[FIX] sale: groupBy and edit record in kanban catalog
Before this commit, in the kanban catalog view, when you make a groupBy or update a record (click on the star), a crash is displayed. Why does this happen? The RPC for "sale_order_lines_info" is called during loadData of all dataPoint types. Solution: The RPC for "sale_order_lines_info" should only be called for DynamicRecordList. closes odoo/odoo#133907 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
@@ -17,12 +17,14 @@ export class ProductCatalogKanbanModel extends RelationalModel {
|
||||
|
||||
async _loadData(params) {
|
||||
const result = await super._loadData(...arguments);
|
||||
const saleOrderLinesInfo = await this.rpc("/sales/catalog/sale_order_lines_info", {
|
||||
order_id: params.context.order_id,
|
||||
product_ids: result.records.map((rec) => rec.id),
|
||||
});
|
||||
for (const record of result.records) {
|
||||
record.productCatalogData = saleOrderLinesInfo[record.id];
|
||||
if (!params.isMonoRecord && !params.groupBy.length) {
|
||||
const saleOrderLinesInfo = await this.rpc("/sales/catalog/sale_order_lines_info", {
|
||||
order_id: params.context.order_id,
|
||||
product_ids: result.records.map((rec) => rec.id),
|
||||
});
|
||||
for (const record of result.records) {
|
||||
record.productCatalogData = saleOrderLinesInfo[record.id];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user