From a3760a7d9d4090358e1f9c61a6f12d588385a563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?WEB=E8=AE=B8=E4=BD=95=E5=93=B2=5Cxuhez?= Date: Tue, 11 Jul 2023 16:00:21 +0800 Subject: [PATCH] =?UTF-8?q?0711=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_warehouse/__manifest__.py | 11 +- sf_warehouse/models/model.py | 4 +- sf_warehouse/static/src/colorGuide.js | 20 ++ .../static/src/kanban_color_change.scss | 32 +- sf_warehouse/views/view.xml | 288 +++++++++--------- 5 files changed, 207 insertions(+), 148 deletions(-) create mode 100644 sf_warehouse/static/src/colorGuide.js diff --git a/sf_warehouse/__manifest__.py b/sf_warehouse/__manifest__.py index e5067cb9..c667b307 100644 --- a/sf_warehouse/__manifest__.py +++ b/sf_warehouse/__manifest__.py @@ -10,9 +10,9 @@ """, 'category': 'sf', 'website': 'https://www.sf.jikimo.com', - 'depends': ['stock', ], + 'depends': ['stock','web' ], 'data': [ - #'security/group_security.xml', + # 'security/group_security.xml', # 'security/ir.model.access.csv', 'views/view.xml', ], @@ -22,13 +22,12 @@ 'web.assets_qweb': [ ], - 'web.assets_backend':[ + 'web.assets_backend': [ 'sf_warehouse/static/src/change.scss', - 'sf_warehouse/static/src/kanban_color_change.scss' - + 'sf_warehouse/static/src/kanban_color_change.scss', + 'sf_warehouse/static/src/colorGuide.js' ] - }, 'license': 'LGPL-3', 'installable': True, diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index cdbaded9..a41064bf 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -53,7 +53,7 @@ class SfLocation(models.Model): # product_id = fields.Many2one('product.template', string='产品') product_id = fields.Many2one('product.product', string='产品', compute='_compute_product_id', readonly=True) product_sn_id = fields.Many2one('stock.lot', string='产品序列号') - + time_test = fields.Char(string='time') # 添加SQL约束 _sql_constraints = [ ('name_uniq', 'unique(name)', '位置名称必须唯一!'), @@ -90,7 +90,7 @@ class SfLocation(models.Model): record.location_status = '占用' else: record.product_id = False - record.location_status = '空闲' + # record.location_status = '空闲' @api.depends('location_type') def _compute_hide_what(self): diff --git a/sf_warehouse/static/src/colorGuide.js b/sf_warehouse/static/src/colorGuide.js new file mode 100644 index 00000000..c6cc0f94 --- /dev/null +++ b/sf_warehouse/static/src/colorGuide.js @@ -0,0 +1,20 @@ +odoo.define('sf_warehouse.custom_kanban', function (require) { + "use strict" + var KanbanRenderer = require('web.KanbanRenderer'); + + KanbanRenderer.include({ + _render: function () { + var self = this; + return this._super.apply(this, arguments).then(function () { + + var colorGuide = $('
\ + \ + \ + \ +
'); + self.$('.o_kanban_renderer').prepend(colorGuide); + }); + }, + }); + +}); \ No newline at end of file diff --git a/sf_warehouse/static/src/kanban_color_change.scss b/sf_warehouse/static/src/kanban_color_change.scss index eca158e1..23bb18f4 100644 --- a/sf_warehouse/static/src/kanban_color_change.scss +++ b/sf_warehouse/static/src/kanban_color_change.scss @@ -1,11 +1,37 @@ .oe_kanban_card.kanban_color_1 { - background-color: red !important; + background-color: #73b9a2 !important; + opacity: 0.7; + color: #fff; } .oe_kanban_card.kanban_color_2 { - background-color: blue !important; + background-color: #ac6767 !important; + color: #fff; } .oe_kanban_card.kanban_color_3 { - background-color: green !important; + background-color: #77787b !important; + color: #fff; +} + +.spilit { + margin-right: 10px; +} + +.testss { + width: 200px !important; + height: 100px !important; + background-color: #000 !important; +} + +.oe_kanban_card .o_kanban_record_bottom:nth-child(2) span:nth-child(2) { + display: inline-block; + margin-right: 10px; +} + +.color-guide-item { + display: inline-block; + width: 30px; + height: 30px; + border-radius: 50%; } diff --git a/sf_warehouse/views/view.xml b/sf_warehouse/views/view.xml index c0e7f145..35433ed8 100644 --- a/sf_warehouse/views/view.xml +++ b/sf_warehouse/views/view.xml @@ -1,157 +1,171 @@ - - - stock.location.tree.sf.inherit - stock.location - - - - - - - + + + stock.location.tree.sf.inherit + stock.location + + + + + + + - - stock.location.form.sf.inherit - stock.location - - - - - + + stock.location.form.sf.inherit + stock.location + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + +
+
+
-
+
+
- - - - - - -
-
-
- - - - - - stock.location.search.sf.inherit - stock.location - - - - - - - - - example.kanban - stock.location - - - - -
+ stock.location.search.sf.inherit + stock.location + + + + + + + + + + example.kanban + stock.location + + +
+ + +
- -
-
- + +
+
+ +
+
+ +
+ +
+
+ + | + +
-
- -
- -
-
- - | - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - + + + - - 货位状态 - ir.actions.act_window - stock.location - kanban,form - + + 货位状态 + ir.actions.act_window + stock.location + kanban,form + - - - - - - - - - - - + + + + + + + + + + + - + - +