mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[FIX]rma_analytic/models/procurement.py constraint in procurement.
This commit is contained in:
committed by
Aaron ForgeFlow
parent
ba9d3175ef
commit
8d94970e28
@@ -12,8 +12,8 @@ class ProcurementOrder(models.Model):
|
||||
@api.constrains('account_analytic_id')
|
||||
def check_analytic(self):
|
||||
for order in self:
|
||||
if (order.account_analytic_id !=
|
||||
order.rma_line_id.analytic_account_id):
|
||||
if order.rma_line_id and (order.account_analytic_id !=
|
||||
order.rma_line_id.analytic_account_id):
|
||||
raise exceptions.ValidationError(
|
||||
_("The analytic account in the procurement it's not the "
|
||||
"same as in the rma line"))
|
||||
|
||||
Reference in New Issue
Block a user