Accept Merge Request #2016: (feature/tool_standard_library_process -> develop)
Merge Request: sf-制造-表面工艺-菜单名称修改 Created By: @廖丹龙 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @廖丹龙 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2016
This commit is contained in:
@@ -1067,7 +1067,8 @@ class ResProductMo(models.Model):
|
||||
raise UserError('产品名称【%s】已存在' % item.name)
|
||||
if item.categ_type == '表面工艺':
|
||||
if len(self.search([('server_product_process_parameters_id', '=',
|
||||
item.server_product_process_parameters_id.id)])) > 1:
|
||||
item.server_product_process_parameters_id.id),('server_product_process_parameters_id', '!=',
|
||||
False)])) > 1:
|
||||
raise UserError('表面工艺参数为【%s】的产品已存在' % item.server_product_process_parameters_id.name)
|
||||
if "create_product_product" not in self._context:
|
||||
templates._create_variant_ids()
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -19,7 +19,7 @@ class ProductCreationWizard(models.TransientModel):
|
||||
service_categ = self.env.ref('sf_manufacturing.product_category_outsource_other_process').sudo()
|
||||
default_values = {
|
||||
'detailed_type': 'service',
|
||||
'name': f"{self.process_parameter_id.process_id.name}{self.process_parameter_id.name}",
|
||||
'name': f"{self.process_parameter_id.routing_id.name}_{self.process_parameter_id.name}",
|
||||
'invoice_policy': 'delivery',
|
||||
'categ_id': service_categ.id,
|
||||
'description': f"基于{self.process_parameter_id.name}创建的服务产品",
|
||||
|
||||
Reference in New Issue
Block a user