diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 9c585801ffa..12c27c197ed 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -322,6 +322,16 @@ class sale_order(osv.osv): self.log(cr, uid, id, message) return True + def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context={}): + print order_lines + if (not pricelist_id) or (not order_lines): + return {} + warning = { + 'title': _('Pricelist Warning!'), + 'message' : _('If you change the pricelist of this order (and eventually the currency), prices of existing order lines will not be updated.') + } + return {'warning': warning} + def onchange_partner_id(self, cr, uid, ids, part): if not part: return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'partner_order_id': False, 'payment_term': False, 'fiscal_position': False}} diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 51c543279ae..a12a4c566f5 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -112,7 +112,7 @@ - +