增加js_class类对看板视图进行布局修改

This commit is contained in:
mgw
2023-07-11 15:43:03 +08:00
parent b72c3ce08a
commit 94ffec20db
5 changed files with 60 additions and 5 deletions

View File

@@ -0,0 +1,21 @@
/** @odoo-module */
import { KanbanController } from "@web/views/kanban/kanban_controller";
import { kanbanView } from "@web/views/kanban/kanban_view";
import { registry } from "@web/core/registry";
// the controller usually contains the Layout and the renderer.
class CustomKanbanController extends KanbanController {
// Your logic here, override or insert new methods...
// if you override setup(), don't forget to call super.setup()
}
CustomKanbanController.template = "sf_warehouse.CustomKanbanView";
export const customKanbanView = {
...kanbanView, // contains the default Renderer/Controller/Model
Controller: CustomKanbanController,
};
// Register it to the views registry
registry.category("views").add("custom_kanban", customKanbanView);

View File

@@ -1,11 +1,25 @@
.oe_kanban_card.kanban_color_1 {
background-color: red !important;
background-color: #73b9a2 !important;
}
.oe_kanban_card.kanban_color_2 {
background-color: blue !important;
background-color: #ac6767 !important;
}
.oe_kanban_card.kanban_color_3 {
background-color: green !important;
background-color: #77787b !important;
}
.color-guide {
border: 1px solid #ccc;
background-color: #f9f9f9;
padding: 10px;
}
.color-guide-item {
display: inline-block;
width: 20px;
height: 20px;
margin-right: 10px;
border-radius: 50%;
}