FIX self[0] in _rule_group

pull/2366/head
Iván Todorovich 2019-04-09 15:04:13 +00:00 committed by Cesar Andres Sanchez
parent 518eae1e54
commit 4c5860f06b
1 changed files with 2 additions and 3 deletions

View File

@ -194,14 +194,13 @@ class BaseException(models.AbstractModel):
if hasattr(exception_obj, field.name) if hasattr(exception_obj, field.name)
] or [None])[0] ] or [None])[0]
@api.multi
def _rule_domain(self): def _rule_domain(self):
"""Filter exception.rules. """Filter exception.rules.
By default, only the rules with the correct rule group By default, only the rules with the correct rule group
will be used. will be used.
""" """
# TODO fix self[0] : it may not be the same on all ids in self return [('rule_group', 'in', self.mapped('rule_group'))]
return [('rule_group', '=', self[0].rule_group)]
@api.multi @api.multi
def detect_exceptions(self): def detect_exceptions(self):