From b10a3df6cc9159dc44fe220f3404cc4854265240 Mon Sep 17 00:00:00 2001 From: Nicolas Mac Rouillon Date: Tue, 29 Sep 2015 12:47:48 -0300 Subject: [PATCH] ADD onchange in waybill expense for product_id --- logistic/waybill_expense.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/logistic/waybill_expense.py b/logistic/waybill_expense.py index d2f574f..0010f53 100644 --- a/logistic/waybill_expense.py +++ b/logistic/waybill_expense.py @@ -56,6 +56,11 @@ def _amount_line(self): date = fields.Date( related='waybill_id.date', string='Date', store=True) + @api.one + @api.onchange('product_id') + def on_change_product(self): + self.price_unit = self.product_id.lst_price + def action_invoice_create(self, cr, uid, ids, grouped=False, date_invoice=False, context=None): invoice_ids = [] partner_currency = {}