In Sale Quotation Line, there is a field Quantity (product_uom_qty). I want to customize something in its onchange event, but it does not seem to be triggering it when I change its value.
This is what I tried:
class sale_order_line_inherit(models.Model):
_inherit = 'sale.order.line'
@api.onchange('product_uom', 'product_uom_qty')
def product_uom_change(self):
print(res)
print(self.price_unit)
res = super(sale_order_line_inherit, self).product_uom_change()
print(res)
print(self.price_unit)
Nothing gets printed at all. I already included 'sale' in manifest as well. What did I do wrong?
Few points to consider,
sale
moduleI don't have any issue in your code. This is alternative of your code.
@api.onchange('product_uom', 'product_uom_qty')
def product_uom_change(self):
print(self.price_unit)
super().product_uom_change()
print(self.price_unit)