Browse Source

Merge pull request #855 from acsone/10.0-fix_base_excpetion-lmi

[FIX] base_exception: '_check_exception' is 'api.multi' since it's ca…
pull/857/head
Pedro M. Baeza 7 years ago
committed by GitHub
parent
commit
a6f334a2b3
  1. 4
      base_exception/models/base_exception.py

4
base_exception/models/base_exception.py

@ -108,7 +108,7 @@ class BaseException(models.AbstractModel):
action = self.env.ref('base_exception.action_exception_rule_confirm') action = self.env.ref('base_exception.action_exception_rule_confirm')
return action return action
@api.model
@api.multi
def _check_exception(self): def _check_exception(self):
""" """
This method must be used in a constraint that must be created in the This method must be used in a constraint that must be created in the
@ -138,6 +138,8 @@ class BaseException(models.AbstractModel):
def detect_exceptions(self): def detect_exceptions(self):
"""returns the list of exception_ids for all the considered base.exceptions """returns the list of exception_ids for all the considered base.exceptions
""" """
if not self:
return []
exception_obj = self.env['exception.rule'] exception_obj = self.env['exception.rule']
all_exceptions = exception_obj.sudo().search( all_exceptions = exception_obj.sudo().search(
[('rule_group', '=', self[0].rule_group)]) [('rule_group', '=', self[0].rule_group)])

Loading…
Cancel
Save