From eff6ce9f1b41d9631795426f568f9c070b0938ef Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Tue, 14 May 2024 14:09:42 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=85=B3=E9=97=AD=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E3=80=81=E9=87=87=E8=B4=AD=E5=8D=95=E4=B8=AD=E5=85=B3=E8=81=94?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=9A=84=E5=88=9B=E5=BB=BA=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=9B2=E3=80=81=E4=BC=98=E5=8C=96=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E9=AA=8C=E8=AF=81=E6=9D=A1=E4=BB=B6=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/product_template_management_view.xml | 14 +++++++++----- sf_sale/views/purchase_order_view.xml | 3 +++ sf_sale/views/sale_order_view.xml | 2 +- sf_tool_management/wizard/wizard.py | 3 +++ sf_warehouse/models/model.py | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index 94fc6b45..8842f8bf 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -32,6 +32,7 @@ attrs="{'invisible': [('categ_type', '!=', '刀具')],'required': [('categ_type', '=', '刀具')],'readonly': [('id', '!=', False)]}" placeholder="请选择"/> @@ -39,6 +40,7 @@ @@ -436,7 +438,7 @@ - + @@ -453,7 +455,7 @@ - + @@ -464,8 +466,8 @@ - - + @@ -553,14 +555,16 @@ - + diff --git a/sf_sale/views/purchase_order_view.xml b/sf_sale/views/purchase_order_view.xml index b0a4ed98..85f5b1c8 100644 --- a/sf_sale/views/purchase_order_view.xml +++ b/sf_sale/views/purchase_order_view.xml @@ -83,6 +83,9 @@ {'readonly': [('state', 'in', ['purchase'])]} + + {'no_create': True} + {'readonly': [('state', 'in', ['purchase'])]} diff --git a/sf_sale/views/sale_order_view.xml b/sf_sale/views/sale_order_view.xml index 8350c761..5670e2aa 100644 --- a/sf_sale/views/sale_order_view.xml +++ b/sf_sale/views/sale_order_view.xml @@ -119,7 +119,7 @@ string="模型文件" attrs="{'readonly': [('state', 'in', ['draft'])]}"/> - {'no_create': True} + {'no_create': True, 'no_quick_create': True} {'is_sale_order_line': True } diff --git a/sf_tool_management/wizard/wizard.py b/sf_tool_management/wizard/wizard.py index a77c9010..d6981922 100644 --- a/sf_tool_management/wizard/wizard.py +++ b/sf_tool_management/wizard/wizard.py @@ -1,3 +1,5 @@ +import logging + from datetime import timedelta, datetime from odoo import fields, models, api @@ -807,6 +809,7 @@ class ProductProduct(models.Model): """ product_id = self.env['product.product'].search([('name', '=', '功能刀具')]) + logging.info("product_id: %s" % product_id) stock_lot = self.env['stock.lot'].create({ 'name': self.get_stock_lot_name(tool_assembly_order_id), 'product_id': product_id.id, diff --git a/sf_warehouse/models/model.py b/sf_warehouse/models/model.py index 236781ee..1a7ba1e0 100644 --- a/sf_warehouse/models/model.py +++ b/sf_warehouse/models/model.py @@ -880,7 +880,7 @@ class SfStockPicking(models.Model): line.compute_destination_location_id() else: # 对除刀柄之外的刀具物料进行 目标货位必填校验 - if self.location_dest_id.name == '刀具房' and line.product_id.cutting_tool_material_id not in ( + if self.location_dest_id.name == '刀具房' and line.product_id.cutting_tool_material_id.name not in ( '刀柄', False): raise ValidationError('请选择【%s】产品的目标货位!' % line.product_id.name) if line.current_location_id: