[ADD] point_of_sale : onchange_qty method added on pos order line

bzr revid: vir@tinyerp.com-20100816061915-1qtk53cfsmvjw2fw
This commit is contained in:
UCO (Open ERP)
2010-08-16 11:49:15 +05:30
committed by Vir (Open ERP)
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -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),
+1 -1
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"/>
<field name="qty" on_change="onchange_qty(price_subtotal_incl, 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"/>