From fec5eea74a0877a1006eed99756a8d73acb4d3f7 Mon Sep 17 00:00:00 2001 From: Swapnesh Shah Date: Thu, 3 Jun 2021 19:29:43 +0000 Subject: [PATCH] [FIX] sale: hide update_prices button correctly Steps: - Active Pricelist - Create SO --> add some lines - Change Pricelist and remove lines Issue: - Button to Update prices is still visible Fix: - Button should not be visible as there are no lines closes odoo/odoo#73038 X-original-commit: aab38f9d52f8629eaea1a3725e4909ac5df1b067 Signed-off-by: Victor Feyens (vfe) --- addons/sale/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale_order.py b/addons/sale/models/sale_order.py index f800a16abde..7cc6575e500 100644 --- a/addons/sale/models/sale_order.py +++ b/addons/sale/models/sale_order.py @@ -471,7 +471,7 @@ class SaleOrder(models.Model): } } - @api.onchange('pricelist_id') + @api.onchange('pricelist_id', 'order_line') def _onchange_pricelist_id(self): if self.order_line and self.pricelist_id and self._origin.pricelist_id != self.pricelist_id: self.show_update_pricelist = True