From 79006e062a3696eddf1d97bc124c06263c8dadef Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Fri, 18 Apr 2025 15:44:13 +0800 Subject: [PATCH] =?UTF-8?q?1.=E9=99=90=E5=88=B6=E5=B7=A5=E5=BA=8F-?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=85=8D=E7=BD=AE=20=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E9=80=89=E4=B8=AD=E4=B8=80=E4=B8=AA=202.?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=A7=E5=93=81=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=BF=87=E6=BB=A4=203.=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=A1=86=E5=8F=AF=E4=BB=A5=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=88=B0=E4=BA=A7=E5=93=81=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/sf_production_common.py | 6 ++++++ sf_manufacturing/views/mrp_routing_workcenter_view.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/sf_production_common.py b/sf_manufacturing/models/sf_production_common.py index 708199bb..6285c133 100644 --- a/sf_manufacturing/models/sf_production_common.py +++ b/sf_manufacturing/models/sf_production_common.py @@ -21,6 +21,12 @@ class SfProductionProcessParameter(models.Model): for record in self: if len(record.outsourced_service_products) > 1: raise ValidationError("工艺参数不能与多个产品关联") + + @api.onchange('outsourced_service_products') + def _onchange_validate_partner_limit(self): + for record in self: + if len(record.outsourced_service_products) > 1: + raise ValidationError("工艺参数不能与多个产品关联") @api.depends('outsourced_service_products') def _compute_is_product_button(self): for record in self: diff --git a/sf_manufacturing/views/mrp_routing_workcenter_view.xml b/sf_manufacturing/views/mrp_routing_workcenter_view.xml index d1eb0618..3c3bb27a 100644 --- a/sf_manufacturing/views/mrp_routing_workcenter_view.xml +++ b/sf_manufacturing/views/mrp_routing_workcenter_view.xml @@ -30,7 +30,7 @@ - +