Make root required on entry

The root needs to be filled to have the unique constraint working.

issue6321
review32231002
This commit is contained in:
Cédric Krier
2017-04-21 10:19:16 +02:00
parent 8d7f6f0221
commit db4ea4a750
+2 -1
View File
@@ -386,7 +386,8 @@ class AnalyticAccountEntry(ModelView, ModelSQL):
'Analytic Account Entry'
__name__ = 'analytic.account.entry'
origin = fields.Reference('Origin', selection='get_origin', select=True)
root = fields.Many2One('analytic_account.account', 'Root Analytic',
root = fields.Many2One(
'analytic_account.account', "Root Analytic", required=True,
domain=[
If(~Eval('company'),
# No constraint if the origin is not set