mirror of
https://github.com/NaN-tic/trytond-product_purchase_homologation.git
synced 2023-12-14 02:33:10 +01:00
Check if we have the product in the line and if the line is type 'line'.
Task #048267
This commit is contained in:
parent
c270208a38
commit
edf5a01ef4
|
@ -23,9 +23,11 @@ class Purchase(metaclass=PoolMeta):
|
|||
'product_purchase_homologation.cannot_end_purchase',
|
||||
purchase=purchase.id,
|
||||
line=line.rec_name))
|
||||
if (line.product.purchase_homologation_required and
|
||||
if (line.product and
|
||||
line.product.purchase_homologation_required and
|
||||
line.product_supplier and
|
||||
line.product_supplier.active == False):
|
||||
line.product_supplier.active == False and
|
||||
line.type == 'line'):
|
||||
raise UserError(gettext(
|
||||
'product_purchase_homologation.product_purchase_deactivate',
|
||||
purchase=purchase.id,
|
||||
|
|
Loading…
Reference in a new issue