Enforce clearing account type only on draft payment
As the receivable, payable type may evolve over time, only draft state should enforce it. Closes #13145
This commit is contained in:
@@ -179,10 +179,12 @@ class Payment(metaclass=PoolMeta):
|
||||
|
||||
@classmethod
|
||||
def _account_type_domain(cls):
|
||||
return If(Eval('kind') == 'receivable',
|
||||
('type.receivable', '=', True),
|
||||
('type.payable', '=', True),
|
||||
)
|
||||
return If(Eval('state') == 'draft',
|
||||
If(Eval('kind') == 'receivable',
|
||||
('type.receivable', '=', True),
|
||||
('type.payable', '=', True),
|
||||
),
|
||||
())
|
||||
|
||||
@fields.depends('party', 'kind', 'date')
|
||||
def on_change_party(self):
|
||||
|
||||
Reference in New Issue
Block a user