[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) <vfe@odoo.com>
This commit is contained in:
Swapnesh Shah
2021-06-30 19:06:16 +00:00
committed by GitHub
parent 25d4311199
commit fec5eea74a
+1 -1
View File
@@ -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