From 354a4d48c033d28f2ce5072f8c79b693ea3a2bed Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 21 Sep 2011 09:33:59 +0200 Subject: [PATCH] [IMP] useability, warning on change of pricelist in the middle of the SO lp bug: https://launchpad.net/bugs/782168 fixed bzr revid: fp@tinyerp.com-20110921073359-t20q6m88ocnm746z --- addons/sale/sale.py | 10 ++++++++++ addons/sale/sale_view.xml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) 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 @@ - +