default['value']['writeoff_amount'] = self._compute_writeoff_amount(cr, uid, default['value']['line_dr_ids'], default['value']['line_cr_ids'], price)
return default
- def onchange_payment_rate_currency(self, cr, uid, ids, currency_id, payment_rate_currency_id, date, amount, company_id, context=None):
+ def onchange_payment_rate_currency(self, cr, uid, ids, currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context=None):
if context is None:
context = {}
res = {'value': {}}
if currency_id and currency_id == payment_rate_currency_id:
ctx = context.copy()
ctx.update({'date': date})
- payment_rate = self.pool.get('res.currency').browse(cr, uid, currency_id, context=ctx).rate
- res['value'].update({'payment_rate': payment_rate})
vals = self.onchange_rate(cr, uid, ids, payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context=ctx)
for key in vals.keys():
res[key].update(vals[key])
<separator string="Other Information" colspan="4"/>
<field name="currency_id" colspan="4"/>
<field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" groups='base.group_extended' colspan="3"/>
- <field name="payment_rate_currency_id" groups='base.group_extended' colspan="1" nolabel="1"/>
- <field name="paid_amount_in_company_currency" groups='base.group_extended' colspan="4" on_change="onchange_payment_rate_currency(currency_id, payment_rate_currency_id, date, amount, company_id, context)"/>
+ <field name="payment_rate_currency_id" groups='base.group_extended' colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)"/>
+ <field name="paid_amount_in_company_currency" groups='base.group_extended' colspan="4"/>
<field name="number" colspan="4"/>
</group>
</page>
<field name="exchange_acc_id"
domain="[('type','=','other')]" colspan="4"/>
<field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" groups='base.group_extended' colspan="3"/>
- <field name="payment_rate_currency_id" groups='base.group_extended' colspan="1" nolabel="1"/>
- <field name="paid_amount_in_company_currency" groups='base.group_extended' colspan="4" on_change="onchange_payment_rate_currency(currency_id, payment_rate_currency_id, date, amount, company_id, context)"/>
+ <field name="payment_rate_currency_id" groups='base.group_extended' colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)"/>
+ <field name="paid_amount_in_company_currency" groups='base.group_extended' colspan="4"/>
</group>
<group col="2" colspan="1">
<separator string="Payment Options" colspan="2"/>
<field name="exchange_acc_id"
domain="[('type','=','other')]" colspan="4"/>
<field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" groups='base.group_extended' colspan="3"/>
- <field name="payment_rate_currency_id" groups='base.group_extended' colspan="1" nolabel="1"/>
- <field name="paid_amount_in_company_currency" groups='base.group_extended' colspan="4" on_change="onchange_payment_rate_currency(currency_id, payment_rate_currency_id, date, amount, company_id, context)"/>
+ <field name="payment_rate_currency_id" groups='base.group_extended' colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)"/>
+ <field name="paid_amount_in_company_currency" groups='base.group_extended' colspan="4"/>
</group>
<group col="2" colspan="1">
<separator string="Payment Options" colspan="2"/>