diff --git a/trytond/ir/rule.py b/trytond/ir/rule.py index 9ec69a8e92..5bd3278305 100644 --- a/trytond/ir/rule.py +++ b/trytond/ir/rule.py @@ -9,6 +9,7 @@ from ..tools import safe_eval from ..transaction import Transaction from ..cache import Cache from ..pool import Pool +from ..backend import TableHandler __all__ = [ 'RuleGroup', 'Rule', @@ -112,6 +113,16 @@ class Rule(ModelSQL, ModelView): 'invalid_domain': 'Invalid domain', }) + @classmethod + def __register__(cls, module_name): + super(Rule, cls).__register__(module_name) + table = TableHandler(Transaction().cursor, cls, module_name) + + # Migration from 2.6: replace field, operator and operand by domain + table.not_null_action('field', action='remove') + table.not_null_action('operator', action='remove') + table.not_null_action('operand', action='remove') + @classmethod def check_domain(cls, rules): ctx = cls._get_context()