看板视图筛选实现功能的条件已具备(看板已抠,字段存在),待优化

This commit is contained in:
mgw
2023-08-07 08:58:50 +08:00
parent cb011a9bd7
commit de32f5db78
4 changed files with 223 additions and 21 deletions

View File

@@ -15,8 +15,32 @@ class CustomKanbanController extends KanbanController {
this.workOrders = await this.getAllWorkOrders();
console.log('lines', this.workOrders);
}
buttonClick(ev) {
const button = ev.currentTarget;
const id = button.getAttribute('data-id');
console.log('true_id', id);
const context = {production_line_show: 'shengchanxian1'}
this.env.services.rpc('/web/dataset/call_kw', {
model: 'mrp.workcenter',
method: 'search_read',
args: [[], ['id']],
kwargs: {}
}).then((records) => {
const ids = records.map(record => record.id);
const context = {production_line_show: id};
this.env.services.rpc('/web/dataset/call_kw', {
model: 'mrp.workcenter',
method: 'write',
args: [ids, context],
kwargs: {}
}).then((response) => {
console.log('response', response);
});
});
}
async getAllWorkOrders() {
const response = await this.env.services.rpc('/web/dataset/call_kw',{
model: 'sf.production.line',
@@ -24,7 +48,14 @@ class CustomKanbanController extends KanbanController {
args: [],
kwargs: {},
});
// const response1 = await this.env.services.rpc('/web/dataset/call_kw',{
// model: 'mrp.workcenter',
// method: 'search_read',
// args: [],
// kwargs: {},
// });
console.log('response', response);
// console.log('response1', response1);
// 你可以在这里处理响应,例如将其存储在控制器的状态中
return response;
}