[FIX] purchase: fix context not being passed on rpc call

On the purchase dashboard(s) the context would never be passed on the
rpc calls that load the upper panel, which caused the result to always
be as seen from the default company.

Closes odoo/odoo#74882

Task ID: 2610547

Related: odoo/enterprise#20145
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
William Braeckman
2021-08-09 15:52:32 +00:00
parent 9b01803649
commit d08b16a49e
@@ -20,6 +20,7 @@ var KanbanRenderer = require('web.KanbanRenderer');
var KanbanView = require('web.KanbanView');
var SampleServer = require('web.SampleServer');
var view_registry = require('web.view_registry');
const session = require('web.session');
var QWeb = core.qweb;
@@ -113,6 +114,7 @@ var PurchaseListDashboardModel = ListModel.extend({
var dashboard_def = this._rpc({
model: 'purchase.order',
method: 'retrieve_dashboard',
context: session.user_context,
});
return Promise.all([super_def, dashboard_def]).then(function(results) {
var id = results[0];
@@ -229,6 +231,7 @@ var PurchaseKanbanDashboardModel = KanbanModel.extend({
var dashboard_def = this._rpc({
model: 'purchase.order',
method: 'retrieve_dashboard',
context: session.user_context,
});
return Promise.all([super_def, dashboard_def]).then(function(results) {
var id = results[0];