Skip to content
Snippets Groups Projects
Commit 52a3b611 authored by Jorge Pinna Puissant's avatar Jorge Pinna Puissant
Browse files

[FIX] account: error when trying to match payments


Before this commit, when clicking into the 'Payment Matching' button
from a payment, sometimes an error is raised. This occurs because the
active_id is the one of the payment, and not the one of the journal, and
when performing the research with the id of the payment in the table of
the journals, sometimes the id is out of scope.

Now, we check before performing the research that the model of which the
id belongs is the journal.

opw-2166551

closes odoo/odoo#43563

Signed-off-by: default avatarJorge Pinna Puissant (jpp) <jpp@odoo.com>
parent 92737f21
No related branches found
No related tags found
No related merge requests found
......@@ -113,12 +113,14 @@ var StatementAction = AbstractAction.extend({
var def = this.model.load(this.params.context).then(this._super.bind(this));
return def.then(function () {
if (!self.model.context || !self.model.context.active_id) {
self.model.context = {'active_id': self.params.context.active_id};
self.model.context = {'active_id': self.params.context.active_id,
'active_model': self.params.context.active_model};
}
if (self.params.context.journal_id) {
self.model.context.active_id = self.params.context.journal_id;
self.model.context.active_model = 'account.journal';
}
if (self.model.context.active_id) {
if (self.model.context.active_id && self.model.context.active_model === 'account.journal') {
var promise = self._rpc({
model: 'account.journal',
method: 'read',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment