1.限制工序-作业配置 产品只能选中一个

2.添加产品下拉框查询过滤
3.产品选择框可以跳转到产品页面
This commit is contained in:
liaodanlong
2025-04-18 15:44:13 +08:00
parent ff7c4a9ce7
commit 79006e062a
2 changed files with 7 additions and 1 deletions

View File

@@ -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:

View File

@@ -30,7 +30,7 @@
<field name="is_delete_button" invisible="1"/>
<field name="code" attrs="{'readonly': True}"/>
<field name="name"/>
<field name="outsourced_service_products" widget="many2many_tags"/>
<field name="outsourced_service_products" domain="[('detailed_type', '=', 'service'),('process_parameter', '=', False)]"/>
<!-- 按钮列 -->
<button name="action_create_service_product" string="创建服务产品" type="object"
class="btn-primary"