[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 odoo/odoo#28474
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user