[FIX] contract: proper condition for auto price

This commit is contained in:
Raphaël Valyi
2024-12-11 19:53:37 +00:00
parent a1725dff9c
commit 19c162bc5f

View File

@@ -193,7 +193,11 @@ class ContractAbstractContractLine(models.AbstractModel):
from the pricelist otherwise.
"""
for line in self:
if line.automatic_price and line.product_id:
if (
line.automatic_price
and line.product_id
and (line.contract_id.pricelist_id or line.contract_id.partner_id)
):
pricelist = (
line.contract_id.pricelist_id
or line.contract_id.partner_id.with_company(