From 4e0430d06d780283dda7d2060427c028477bdfb0 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Tue, 2 May 2017 11:36:47 +0200 Subject: [PATCH] [IMP] account: make currency_exchange_journal_id field visible in settings --- addons/account/models/res_config.py | 8 +++++++- addons/account/views/res_config_view.xml | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/account/models/res_config.py b/addons/account/models/res_config.py index 49675a7af46..5f8f83826ef 100644 --- a/addons/account/models/res_config.py +++ b/addons/account/models/res_config.py @@ -14,6 +14,12 @@ class AccountConfigSettings(models.TransientModel): default=lambda self: self.env.user.company_id) currency_id = fields.Many2one('res.currency', related="company_id.currency_id", required=True, string='Currency', help="Main currency of the company.") + currency_exchange_journal_id = fields.Many2one( + 'account.journal', + related='company_id.currency_exchange_journal_id', + string="Exchange Gain or Loss Journal", + domain=[('type', '=', 'general')], + help='The accounting journal where automatic exchange differences will be registered') has_chart_of_accounts = fields.Boolean(compute='_compute_has_chart_of_accounts', string='Company has a chart of accounts') chart_template_id = fields.Many2one('account.chart.template', string='Template', domain="[('visible','=', True)]") @@ -126,4 +132,4 @@ class AccountConfigSettings(models.TransientModel): if ('company_id' in values and 'currency_id' in values): if self.env['res.company'].browse(values.get('company_id')).currency_id.id == values.get('currency_id'): values.pop('currency_id') - return super(AccountConfigSettings, self).create(values) \ No newline at end of file + return super(AccountConfigSettings, self).create(values) diff --git a/addons/account/views/res_config_view.xml b/addons/account/views/res_config_view.xml index 42412b64315..c3626626056 100644 --- a/addons/account/views/res_config_view.xml +++ b/addons/account/views/res_config_view.xml @@ -151,6 +151,10 @@
+
+