From 7473453324799ed79c70fc0504c3a92431092b32 Mon Sep 17 00:00:00 2001 From: "uco (Open ERP)" Date: Mon, 16 Aug 2010 11:31:14 +0530 Subject: [PATCH] [IMP] point_of_sale: On change of qty subtotal should be changed. bzr revid: uco@tinyerp.com-20100816060114-b8xfmuu9x0f2fld7 --- addons/point_of_sale/pos.py | 9 +++++++++ addons/point_of_sale/pos_view.xml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 09865f668a9..9a02a95dc7b 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -1154,6 +1154,15 @@ class pos_order_line(osv.osv): return {'value': {'notice':'Minimum Discount','price_ded':price*discount*0.01 or 0.0 }} else : return {'value': {'notice':'No Discount', 'price_ded':price*discount*0.01 or 0.0}} + + def onchange_qty(self, cr, uid, ids, price_subtotal_incl, discount, qty, price, context=None): + price_sub = price_subtotal_incl + if discount: + subtotal = price_sub-(price_subtotal_incl*(discount*0.01)) + else: + subtotal = qty * price + return {'value': {'price_subtotal_incl': subtotal}} + _columns = { 'name': fields.char('Line Description', size=512), 'company_id':fields.many2one('res.company', 'Company', required=True), diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml index 945eba6d2bd..172b1231d97 100644 --- a/addons/point_of_sale/pos_view.xml +++ b/addons/point_of_sale/pos_view.xml @@ -22,7 +22,7 @@ - +