Odoo onchange not working correctly
问题 I'm inherit purchase.order.line and try change value in field. For product_qty I can change value but for price_unit I can't change value. My custom .py file: class PurchaseOrderLine(models.Model): _inherit = 'purchase.order.line' @api.onchange('product_id') def my_fucn(self): for rec in self: rec.product_qty = 10 #WORKING rec.price_unit = 1 #NOT WORKING Maybe is problem because in original purcahase.py odoo file also have @api.onchange('product_id'). Any solution? 回答1: You can't predict