[REF] point_of_sale: onchange_qty method improved.

bzr revid: uco@tinyerp.com-20100816064601-ra0zss7pom07y1rz
This commit is contained in:
uco (Open ERP) 2010-08-16 12:16:01 +05:30
parent 7473453324
commit 59624efb6c
2 changed files with 4 additions and 6 deletions

View File

@ -1155,12 +1155,10 @@ class pos_order_line(osv.osv):
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
def onchange_qty(self, cr, uid, ids, discount, qty, price, context=None):
subtotal = qty * price
if discount:
subtotal = price_sub-(price_subtotal_incl*(discount*0.01))
else:
subtotal = qty * price
subtotal = subtotal - (subtotal * discount / 100)
return {'value': {'price_subtotal_incl': subtotal}}
_columns = {

View File

@ -22,7 +22,7 @@
<field name="lines" colspan="4" nolabel="1">
<tree string="Order lines" editable="bottom">
<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" width="275" />
<field name="qty" on_change="onchange_qty(price_subtotal_incl, discount, qty, price_unit)"/>
<field name="qty" on_change="onchange_qty(discount, qty, price_unit)"/>
<!--<field name="qty" on_change="onchange_qty(qty,price_unit)"/>-->
<!--field name="qty_rfd" groups="base.group_extended"/-->
<field name="price_ded" on_change="onchange_ded(price_ded, price_subtotal_incl,price_unit)" invisible="1"/>