[FIX] account,*: fix inconsistent invoice line onchange methods (typos)
lp bug: https://launchpad.net/bugs/932972 fixed bzr revid: odo@openerp.com-20120216185048-w6qyxk75cw8nhzym
This commit is contained in:
parent
91be5ced94
commit
995a2069ec
|
@ -1488,14 +1488,14 @@ class account_invoice_line(osv.osv):
|
|||
#
|
||||
# Set the tax field according to the account and the fiscal position
|
||||
#
|
||||
def onchange_account_id(self, cr, uid, ids, product_id, partner_id, fposition_id, account_id):
|
||||
def onchange_account_id(self, cr, uid, ids, product_id, partner_id, inv_type, fposition_id, account_id):
|
||||
if not account_id:
|
||||
return {}
|
||||
taxes = self.pool.get('account.account').browse(cr, uid, account_id).tax_ids
|
||||
fpos = fposition_id and self.pool.get('account.fiscal.position').browse(cr, uid, fposition_id) or False
|
||||
tax_ids = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, taxes)
|
||||
|
||||
product_change_result = self.product_id_change(cr, uid, ids, product_id, False,
|
||||
product_change_result = self.product_id_change(cr, uid, ids, product_id, False, type=inv_type,
|
||||
partner_id=partner_id, fposition_id=fposition_id)
|
||||
unique_tax_ids = set(tax_ids)
|
||||
if product_change_result and 'value' in product_change_result and 'invoice_line_tax_id' in product_change_result['value']:
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
<field name="uos_id" on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.address_invoice_id, parent.currency_id, context, parent.company_id)" nolabel="1"/>
|
||||
</group>
|
||||
<field name="price_unit"/>
|
||||
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id" on_change="onchange_account_id(product_id, parent.partner_id, parent.fiscal_position,account_id)"/>
|
||||
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id" on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)"/>
|
||||
<field name="discount" groups="base.group_extended"/>
|
||||
<field domain="[('type','<>','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
|
||||
|
@ -171,7 +171,7 @@
|
|||
<field colspan="4" context="{'address_invoice_id': address_invoice_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line" nolabel="1">
|
||||
<tree string="Invoice lines">
|
||||
<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.currency_id, context, parent.company_id)"/>
|
||||
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id" on_change="onchange_account_id(product_id,parent.partner_id,parent.fiscal_position,account_id)"/>
|
||||
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id" on_change="onchange_account_id(product_id,parent.partner_id,parent.type,parent.fiscal_position,account_id)"/>
|
||||
<field name="invoice_line_tax_id" view_mode="2" context="{'type':parent.type}" domain="[('parent_id','=',False)]"/>
|
||||
<field domain="[('type','<>','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="quantity"/>
|
||||
|
|
Loading…
Reference in New Issue