diff options
| author | Jaydeep Barot <jar@tinyerp.com> | 2014-04-21 11:04:56 +0530 |
|---|---|---|
| committer | Jaydeep Barot <jar@tinyerp.com> | 2014-04-21 11:04:56 +0530 |
| commit | fcc4d29240eb817cedb9c84ceceffd2e2a3d8c4f (patch) | |
| tree | 732ac7ea7b7b4dfc582f294bfabda48394a4784d | |
| parent | 0c38696de397a69f9552237eee70a67394a05ad5 (diff) | |
[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
| -rw-r--r-- | addons/account/res_config.py | 5 | ||||
| -rw-r--r-- | addons/account/res_config_view.xml | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/addons/account/res_config.py b/addons/account/res_config.py index 8980a31927e..b9bceb3d2ff 100644 --- a/addons/account/res_config.py +++ b/addons/account/res_config.py @@ -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") diff --git a/addons/account/res_config_view.xml b/addons/account/res_config_view.xml index 8a5b1978ecb..115566e9ab5 100644 --- a/addons/account/res_config_view.xml +++ b/addons/account/res_config_view.xml @@ -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> |
