Merge PR #2373 into 15.0

Signed-off-by pedrobaeza
pull/2374/head
OCA-git-bot 2022-07-15 13:37:34 +00:00
commit 560e951127
1 changed files with 21 additions and 0 deletions

View File

@ -265,6 +265,27 @@ class BaseExceptionModel(models.AbstractModel):
else: else:
rec.exceptions_summary = False rec.exceptions_summary = False
def _popup_exceptions(self):
"""This method is used to show the popup action view.
Used in several dependent modules."""
record = self._get_popup_action()
action = record.sudo().read()[0]
action = {
field: value
for field, value in action.items()
if field in record._get_readable_fields()
}
action.update(
{
"context": {
"active_id": self.ids[0],
"active_ids": self.ids,
"active_model": self._name,
}
}
)
return action
@api.model @api.model
def _get_popup_action(self): def _get_popup_action(self):
return self.env.ref("base_exception.action_exception_rule_confirm") return self.env.ref("base_exception.action_exception_rule_confirm")