diff --git a/addons/account/models/account_journal_dashboard.py b/addons/account/models/account_journal_dashboard.py index 505442c36dd..edb2e5a01ff 100644 --- a/addons/account/models/account_journal_dashboard.py +++ b/addons/account/models/account_journal_dashboard.py @@ -264,11 +264,11 @@ class account_journal(models.Model): return { 'type': 'ir.actions.client', 'tag': 'bank_statement_reconciliation_view', - 'context': {'statement_ids': bank_stmt.ids}, + 'context': {'statement_ids': bank_stmt.ids, 'company_ids': self.mapped('company_id').ids}, } else: # Open reconciliation view for customers/suppliers - action_context = {'show_mode_selector': False} + action_context = {'show_mode_selector': False, 'company_ids': self.mapped('company_id').ids} if self.type == 'sale': action_context.update({'mode': 'customers'}) elif self.type == 'purchase': diff --git a/addons/account/static/src/js/account_reconciliation_widgets.js b/addons/account/static/src/js/account_reconciliation_widgets.js index dbbb55bddb1..6aacbb24c68 100644 --- a/addons/account/static/src/js/account_reconciliation_widgets.js +++ b/addons/account/static/src/js/account_reconciliation_widgets.js @@ -91,6 +91,10 @@ var abstractReconciliation = Widget.extend(ControlPanelMixin, { // NB : for presets to work correctly, a field id must be the same string as a preset field this.presets = {}; // Description of the fields to initialize in the "create new line" form + var domain_account_id = [['deprecated', '=', false]]; + if (context && context.context && context.context.company_ids) { + domain_account_id.push(['company_id', 'in', context.context.company_ids]); + } this.create_form_fields = { account_id: { id: "account_id", @@ -103,7 +107,7 @@ var abstractReconciliation = Widget.extend(ControlPanelMixin, { relation: "account.account", string: _t("Account"), type: "many2one", - domain: [['deprecated', '=', false]], + domain: domain_account_id, }, }, label: {