修改产品名称生成规则

This commit is contained in:
胡尧
2025-06-16 09:20:32 +08:00
parent f53e34aeb4
commit 347019d7ee
2 changed files with 8 additions and 5 deletions

View File

@@ -12,10 +12,10 @@ class ProductTemplate(models.Model):
def generate_embryo_name(self, order_id, item, materials_id, materials_type_id, embryo_redundancy_id, i):
"""生成坯料名称"""
embryo_name = '%s-%s-%s [%s %s-%s * %s * %s]' % ('R',
order_id.name, i, materials_id.name, materials_type_id.name,
embryo_name = '%s-%s[%s * %s * %s]%s' % (materials_id.name, materials_type_id.name,
self.format_float(item['model_long'] + embryo_redundancy_id.long),
self.format_float(item['model_width'] + embryo_redundancy_id.width),
self.format_float(item['model_height'] + embryo_redundancy_id.height))
self.format_float(item['model_height'] + embryo_redundancy_id.height),
item['model_id'])
return embryo_name