[FIX] Account_tax_include : onchange of product on invoice line price type issue
authorACH,JVO <>
Wed, 26 Aug 2009 12:36:48 +0000 (18:06 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Wed, 26 Aug 2009 12:36:48 +0000 (18:06 +0530)
lp bug: https://launchpad.net/bugs/416767 fixed

bzr revid: jvo@tinyerp.com-20090826123648-w1tc3c8j2ssgglvs

addons/account_tax_include/invoice_tax_incl.py
addons/account_tax_include/invoice_tax_incl.xml

index e42800d..afe2138 100644 (file)
@@ -140,11 +140,11 @@ class account_invoice_line(osv.osv):
         else:
             return super(account_invoice_line, self).product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context)
 
-    def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, price_type='tax_excluded', context=None):
+    def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, context=None):
         # note: will call product_id_change_unit_price_inv with context...
         if context is None:
             context = {}
-        context.update({'price_type': price_type})
+        context.update({'price_type': context.get('price_type','tax_excluded')})
         return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, context=context)
 account_invoice_line()
 
index 2da7895..946aa06 100644 (file)
@@ -58,7 +58,7 @@
             <field name="inherit_id" ref="account.invoice_supplier_form"/>
             <field name="arch" type="xml">
                 <field name="product_id" position="replace">
-                    <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.price_type)"/>
+                    <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id,{'price_type':parent.price_type})"/>
                 </field>
             </field>
         </record>