Accept Merge Request #231: (feature/增加js_class类对看板视图布局进行修改 -> develop)
Merge Request: 增加js_class类对看板视图进行布局修改 Created By: @马广威 Accepted By: @马广威 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/231?initial=true
This commit is contained in:
@@ -23,7 +23,11 @@
|
||||
'web.assets_qweb': [
|
||||
],
|
||||
'web.assets_backend':[
|
||||
'sf_warehouse/static/src/kanban_color_change.scss'
|
||||
# 'sf_warehouse/static/src/js/vanilla-masker.min.js',
|
||||
'sf_warehouse/static/src/css/kanban_color_change.scss',
|
||||
'sf_warehouse/static/src/js/custom_kanban_controller.js',
|
||||
'sf_warehouse/static/src/xml/custom_kanban_controller.xml',
|
||||
|
||||
]
|
||||
|
||||
|
||||
|
||||
25
sf_warehouse/static/src/css/kanban_color_change.scss
Normal file
25
sf_warehouse/static/src/css/kanban_color_change.scss
Normal file
@@ -0,0 +1,25 @@
|
||||
.oe_kanban_card.kanban_color_1 {
|
||||
background-color: #73b9a2 !important;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_2 {
|
||||
background-color: #ac6767 !important;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_3 {
|
||||
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%;
|
||||
}
|
||||
21
sf_warehouse/static/src/js/custom_kanban_controller.js
Normal file
21
sf_warehouse/static/src/js/custom_kanban_controller.js
Normal 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);
|
||||
@@ -1,11 +0,0 @@
|
||||
.oe_kanban_card.kanban_color_1 {
|
||||
background-color: red !important;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_2 {
|
||||
background-color: blue !important;
|
||||
}
|
||||
|
||||
.oe_kanban_card.kanban_color_3 {
|
||||
background-color: green !important;
|
||||
}
|
||||
16
sf_warehouse/static/src/xml/custom_kanban_controller.xml
Normal file
16
sf_warehouse/static/src/xml/custom_kanban_controller.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<templates>
|
||||
<t t-name="sf_warehouse.CustomKanbanView" t-inherit="web.KanbanView" owl="1">
|
||||
<!-- <xpath expr="//Layout" position="before"> -->
|
||||
<!-- <div> -->
|
||||
<!-- Hello world ! -->
|
||||
<!-- </div> -->
|
||||
<!-- </xpath> -->
|
||||
<xpath expr="//t[@t-component='props.Renderer']" position="before">
|
||||
<div>
|
||||
Hello world !
|
||||
</div>
|
||||
</xpath>
|
||||
|
||||
</t>
|
||||
</templates>
|
||||
@@ -74,7 +74,7 @@
|
||||
<field name="name">example.kanban</field>
|
||||
<field name="model">stock.location</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_mobile">
|
||||
<kanban class="o_kanban_mobile" js_class="custom_kanban">
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div t-attf-class="oe_kanban_card oe_kanban_global_click
|
||||
|
||||
Reference in New Issue
Block a user