From 59cb6e5def98aaea47ff47511ee6d963013f1811 Mon Sep 17 00:00:00 2001 From: gqh Date: Thu, 2 Feb 2023 14:59:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A5=E5=8D=95=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E6=96=B0=E5=A2=9E=E7=89=A9=E6=96=99page?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=B7=A5=E5=8D=95=E6=8C=89=E9=92=AE?= =?UTF-8?q?bug=EF=BC=8C=E9=9A=90=E8=97=8F=E6=9D=83=E9=99=90=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_dlm/__manifest__.py | 3 ++- sf_dlm/models/__init__.py | 1 + sf_dlm/models/product_workorder.py | 13 +++++++++ sf_dlm/views/product_workorder.xml | 27 +++++++++++++++++++ .../views/mrp_workcenter_views.xml | 4 +-- sf_manufacturing/views/mrp_workorder_view.xml | 20 ++++++++------ 6 files changed, 57 insertions(+), 11 deletions(-) create mode 100644 sf_dlm/models/product_workorder.py create mode 100644 sf_dlm/views/product_workorder.xml diff --git a/sf_dlm/__manifest__.py b/sf_dlm/__manifest__.py index da6dba4b..098a2cdd 100644 --- a/sf_dlm/__manifest__.py +++ b/sf_dlm/__manifest__.py @@ -13,7 +13,8 @@ 'depends': ['mrp', 'base', 'sf_manufacturing'], 'data': [ 'data/product_data.xml', - 'views/product_template_view.xml' + 'views/product_template_view.xml', + 'views/product_workorder.xml' ], 'demo': [ ], diff --git a/sf_dlm/models/__init__.py b/sf_dlm/models/__init__.py index 7d40ff65..c6b96570 100644 --- a/sf_dlm/models/__init__.py +++ b/sf_dlm/models/__init__.py @@ -1,5 +1,6 @@ from. import product_template from. import product_supplierinfo +from. import product_workorder diff --git a/sf_dlm/models/product_workorder.py b/sf_dlm/models/product_workorder.py new file mode 100644 index 00000000..eafa3175 --- /dev/null +++ b/sf_dlm/models/product_workorder.py @@ -0,0 +1,13 @@ +from odoo import api, fields, models + + + +class ResMrpWorkOrder(models.Model): + _inherit = 'mrp.workorder' + _order = 'sequence' + + product_tmpl_id_length = fields.Float(related='production_id.product_tmpl_id.length', readonly=True, store=True, check_company=True, string="胚料长度(mm)") + product_tmpl_id_width = fields.Float(related='production_id.product_tmpl_id.width', readonly=True, store=True, check_company=True, string="胚料宽度(mm)") + product_tmpl_id_height = fields.Float(related='production_id.product_tmpl_id.height', readonly=True, store=True, check_company=True, string="胚料高度(mm)") + product_tmpl_id_materials_id = fields.Many2one(related='production_id.product_tmpl_id.materials_id', readonly=True, store=True, check_company=True, string="材料") + product_tmpl_id_materials_type_id = fields.Many2one(related='production_id.product_tmpl_id.materials_type_id', readonly=True, store=True, check_company=True, string="型号") diff --git a/sf_dlm/views/product_workorder.xml b/sf_dlm/views/product_workorder.xml new file mode 100644 index 00000000..4c5f2a10 --- /dev/null +++ b/sf_dlm/views/product_workorder.xml @@ -0,0 +1,27 @@ + + + + production.workorder.dlm + mrp.workorder + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sf_manufacturing/views/mrp_workcenter_views.xml b/sf_manufacturing/views/mrp_workcenter_views.xml index 85bf5f6c..0ba4034a 100644 --- a/sf_manufacturing/views/mrp_workcenter_views.xml +++ b/sf_manufacturing/views/mrp_workcenter_views.xml @@ -56,7 +56,7 @@ - 工作中心概述 + 工作中心看板 ir.actions.act_window mrp.workcenter kanban,form @@ -76,7 +76,7 @@ - + @@ -110,17 +110,26 @@ context="{'default_workcenter_id': workcenter_id}" class="btn-danger" attrs="{'invisible': ['|', ('production_state', 'in', ('draft', 'done', 'cancel')), ('working_state', '!=', 'blocked')]}"/> + + + 1 + + + + + + @@ -145,7 +154,6 @@ - @@ -159,12 +167,8 @@ - - - - - - + +
左面: