From 48809cd654e10d76240bc9be08d6d20cfb3a2adf Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Fri, 29 Mar 2024 17:37:02 +0800 Subject: [PATCH 01/11] =?UTF-8?q?1=E3=80=81=E5=BA=8F=E5=88=97=E5=8F=B7?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=AF=B9=E8=B1=A1=E6=B7=BB=E5=8A=A0rfid?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E4=B8=94rfid=E4=BB=85=E5=9C=A8=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=B8=BA=E5=88=80=E6=9F=84=E6=97=B6=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E5=BA=8F=E5=88=97=E5=8F=B7=E6=A8=A1=E5=9E=8B=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=A7=84=E6=A0=BC=E5=AD=97=E6=AE=B5=EF=BC=8C=E4=B8=94?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8=E6=A0=B9=E6=8D=AE=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E4=BA=A7=E5=93=81=E7=B1=BB=E5=9E=8B=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=87=BA=E5=85=B6=E5=80=BC=EF=BC=8C=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=B8=BA=E5=A4=B9=E5=85=B7=E6=97=B6=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=85=B6=E8=A7=84=E6=A0=BC=E7=9A=84=E5=80=BC?= =?UTF-8?q?=EF=BC=9B2=E3=80=81=E5=9C=A8=E9=87=87=E8=B4=AD=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E6=B5=81=E7=A8=8B=EF=BC=8C=E5=BD=95=E5=85=A5=E5=BA=8F?= =?UTF-8?q?=E5=88=97=E5=8F=B7=E7=9A=84=E8=BF=87=E7=A8=8B=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BD=95=E5=85=A5rfid=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E5=BD=93=E4=BA=A7=E5=93=81=E6=98=AF=E5=88=80=E6=9F=84?= =?UTF-8?q?=E6=97=B6=E9=9C=80=E5=BD=95=E5=85=A5=E5=88=80=E6=9F=84=E7=9A=84?= =?UTF-8?q?rfid=EF=BC=8C=E5=B9=B6=E5=9C=A8=E9=AA=8C=E8=AF=81=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E5=90=8E=E5=88=80=E6=9F=84=E7=9A=84=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8F=B7=E4=B8=AD=E5=B8=A6=E6=9C=89rfid=E7=A0=81=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/stock.py | 16 ++++++++ .../views/mrp_production_addional_change.xml | 3 +- sf_manufacturing/views/stock_lot_views.xml | 6 +++ sf_warehouse/models/model.py | 27 ++++++++++++- .../views/change_stock_move_views.xml | 40 +++++++++++++------ 5 files changed, 78 insertions(+), 14 deletions(-) diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index f255d28b..b68b0ea0 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -222,6 +222,22 @@ class ProductionLot(models.Model): _name = 'stock.lot' _inherit = ['stock.lot', 'printing.utils'] + rfid = fields.Char('Rfid', readonly=True) + product_material_name = fields.Char('刀具产品物料名称', related='product_id.cutting_tool_material_id.name') + product_specification = fields.Char('规格', compute='_compute_product_specification', store=True) + + @api.depends('product_id') + def _compute_product_specification(self): + for stock in self: + if stock: + if stock.product_id: + if stock.product_id.categ_id.name in '刀具': + stock.product_specification = stock.product_id.specification_id.name + elif stock.product_id.categ_id.name in '夹具': + stock.product_specification = stock.product_id.specification_fixture_id.name + else: + stock.product_specification = stock.product_id.default_code + @api.model def generate_lot_names1(self, display_name, first_lot, count): """Generate `lot_names` from a string.""" diff --git a/sf_manufacturing/views/mrp_production_addional_change.xml b/sf_manufacturing/views/mrp_production_addional_change.xml index 0ae0d95f..6ba78573 100644 --- a/sf_manufacturing/views/mrp_production_addional_change.xml +++ b/sf_manufacturing/views/mrp_production_addional_change.xml @@ -422,7 +422,8 @@
规格: - + +
[] diff --git a/sf_manufacturing/views/stock_lot_views.xml b/sf_manufacturing/views/stock_lot_views.xml index bd04005c..f7ef9c9b 100644 --- a/sf_manufacturing/views/stock_lot_views.xml +++ b/sf_manufacturing/views/stock_lot_views.xml @@ -13,6 +13,12 @@