[IMP] account: make currency_exchange_journal_id field visible in settings

This commit is contained in:
qdp-odoo
2017-05-02 11:36:47 +02:00
parent a78389546b
commit 4e0430d06d
2 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -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)
return super(AccountConfigSettings, self).create(values)
+4
View File
@@ -151,6 +151,10 @@
<div class="mt16">
<button name="%(base.action_currency_form)d" icon="fa-arrow-right" type="action" string="Activate Currencies" class="btn-link"/>
</div>
<div class="row mt16">
<label for="currency_exchange_journal_id" class="col-md-3 o_light_label"/>
<field name="currency_exchange_journal_id"/>
</div>
</div>
</div>
</div>