Hi,
I'm tring to update sale order line once Unit Price field changed but constraints does not run.
here my code
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
@api.constrains('price_unit')
def _check_price_unit(self):
for line in self:
product = line.product_id
standard_price = product.standard_price
if line.price_unit < 250
line.price_unit = min_price
Can you help me about this?