[IMP] when we unselect allow multi currency, values of Gain Exchange Rate Account and Loss Exchange Rate Account will become false.

bzr revid: jar@tinyerp.com-20140421053456-zc7x5mvy4rk34al8
This commit is contained in:
Jaydeep Barot 2014-04-21 11:04:56 +05:30
parent 0c38696de3
commit fcc4d29240
2 changed files with 6 additions and 1 deletions

View File

@ -259,6 +259,11 @@ class account_config_settings(osv.osv_memory):
def onchange_tax_rate(self, cr, uid, ids, rate, context=None):
return {'value': {'purchase_tax_rate': rate or False}}
def onchange_multi_currency(self, cr, uid, ids, group_multi_currency, context=None):
if not group_multi_currency:
return {'value': {'income_currency_exchange_account_id': False, 'expense_currency_exchange_account_id': False}}
return {}
def onchange_start_date(self, cr, uid, id, start_date):
if start_date:
start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d")

View File

@ -122,7 +122,7 @@
<label for="id" string="Features"/>
<div>
<div name="group_multi_currency">
<field name="group_multi_currency" class="oe_inline"/>
<field name="group_multi_currency" class="oe_inline" on_change="onchange_multi_currency(group_multi_currency)"/>
<label for="group_multi_currency"/>
</div>
<div>