Permalink
Browse files

[FIX] account: domain on reconciliation model

When loading the Reconciliation Widget, all reconciliation models are
retrieved. This is not correct: only the one matching the company and
the journal should be retrieved.

Fixes #28270
opw-1904475

closes #28474
  • Loading branch information...
nim-odoo committed Nov 7, 2018
1 parent 7a117b1 commit e5c8071484c883bf78478a39ef2120bcd8f2442d
Showing with 13 additions and 0 deletions.
  1. +13 −0 addons/account/static/src/js/reconciliation/reconciliation_model.js
@@ -392,9 +392,17 @@ var StatementModel = BasicModel.extend({
};
});
});
var domainReconcile = [];
if (context && context.company_ids) {
domainReconcile.push(['company_id', 'in', context.company_ids]);
}
if (context && context.active_model === 'account.journal' && context.active_ids) {
domainReconcile.push(['journal_id', 'in', [false].concat(context.active_ids)]);
}
var def_reconcileModel = this._rpc({
model: 'account.reconcile.model',
method: 'search_read',
domain: domainReconcile,
})
.then(function (reconcileModels) {
self.reconcileModels = reconcileModels;
@@ -1171,9 +1179,14 @@ var ManualModel = StatementModel.extend({
self.accounts = _.object(self.account_ids, _.pluck(accounts, 'code'));
});
var domainReconcile = [];
if (context && context.company_ids) {
domainReconcile.push(['company_id', 'in', context.company_ids]);
}
var def_reconcileModel = this._rpc({
model: 'account.reconcile.model',
method: 'search_read',
domain: domainReconcile,
})
.then(function (reconcileModels) {
self.reconcileModels = reconcileModels;

0 comments on commit e5c8071

Please sign in to comment.