Hi
I want to replace an on_change function onchange_price to onchange_amt in an xml file. So what i did I wrote another xml file and replace from
<field name="line_dr_ids" on_change="onchange_price(line_dr_ids, tax_id, partner_id)"
default_get="{'journal_id':journal_id,'partner_id':partner_id,'type':type}"
colspan="4" nolabel="1" height="180">
<tree string="Payment Lines" editable="bottom">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','=','payable'), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
/>
<!-- check can be used for any payment - should account type be expense ? -/ -->
<field name="account_id" widget="selection" domain="[('type','=','payable')]"/>
<field name="name"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="amount_original" readonly="1"/>
<field name="amount_unreconciled" sum="Open Balance" readonly="1"/>
<field name="amount" sum="Payment"/>
</tree>
</field>
To this
<field name ="line_dr_ids" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" default_get="{'journal_id':journal_id,'partner_id':partner_id,'type':type}" colspan="4" nolabel="1" height="180" position="replace">
<field name="line_dr_ids" on_change="onchange_amt(line_dr_ids, tax_id, partner_id)" default_get="{'journal_id':journal_id,'partner_id':partner_id,'type':type}" colspan="4" nolabel="1" height="180"/>
</field>
But it is not working. same code if i replace in the original one it works fine. Any guess where I am wrong.
Kind regards
Jennifer