From 7d1d3fe1e6be91746e5cc969315a7bb95161bd3f Mon Sep 17 00:00:00 2001
From: Nicolas Martinelli <nim@odoo.com>
Date: Wed, 6 Nov 2019 10:17:09 +0000
Subject: [PATCH] [FIX] account: correct account domain

- Create a child company B in parent company A
- Go to company A
- Create an invoice, create a payment (less than the invoice)
- Open the payment matching widget
- Associate the invoice and the payment, add a line for the open balance

It is possible to choose accounts from company B.

This is due to an incorrect forward-port of commit fb48e49779f71394a1d.
It was valid in v11 but needed to be changed in v12.

Fixes #39533
opw-2116411

closes odoo/odoo#39847

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
---
 .../static/src/js/reconciliation/reconciliation_renderer.js    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js
index df546200d6c9..53f28e0c6204 100644
--- a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js
+++ b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js
@@ -534,7 +534,7 @@ var LineRenderer = Widget.extend(FieldManagerMixin, {
             relation: 'account.account',
             type: 'many2one',
             name: 'account_id',
-            domain: [['company_id', '=', state.st_line.company_id]],
+            domain: [['company_id', '=', state.st_line.company_id], ['deprecated', '=', false]],
         }, {
             relation: 'account.journal',
             type: 'many2one',
@@ -568,7 +568,6 @@ var LineRenderer = Widget.extend(FieldManagerMixin, {
         }], {
             account_id: {
                 string: _t("Account"),
-                domain: [['deprecated', '=', false]],
             },
             label: {string: _t("Label")},
             amount: {string: _t("Account")},
-- 
GitLab