坯料尺寸显示修改

This commit is contained in:
guanhuan
2025-06-24 11:39:47 +08:00
parent 0d76d1a7d3
commit 7d1f7b11eb
2 changed files with 6 additions and 3 deletions

View File

@@ -196,10 +196,13 @@ class SfProductionDemandPlan(models.Model):
else: else:
line.model_long = None line.model_long = None
@api.depends('product_id.model_long', 'product_id.model_width', 'product_id.model_height') @api.depends('product_id.model_long', 'product_id.model_width', 'product_id.model_height', 'product_id.blank_type')
def _compute_embryo_long(self): def _compute_embryo_long(self):
for line in self: for line in self:
if line.product_id: if line.product_id:
if line.product_id.blank_type == '圆料':
line.embryo_long = f"Ø{round(line.product_id.model_width, 3)}*{round(line.product_id.model_long, 3)}"
else:
line.embryo_long = f"{round(line.product_id.model_long, 3)}*{round(line.product_id.model_width, 3)}*{round(line.product_id.model_height, 3)}" line.embryo_long = f"{round(line.product_id.model_long, 3)}*{round(line.product_id.model_width, 3)}*{round(line.product_id.model_height, 3)}"
else: else:
line.embryo_long = None line.embryo_long = None

View File

@@ -28,7 +28,7 @@
<field name="qty_delivered"/> <field name="qty_delivered"/>
<field name="qty_to_deliver"/> <field name="qty_to_deliver"/>
<field name="model_long"/> <field name="model_long"/>
<field name="blank_type"/> <field name="blank_type" optional="hide"/>
<field name="embryo_long"/> <field name="embryo_long"/>
<field name="materials_id"/> <field name="materials_id"/>
<field name="model_machining_precision"/> <field name="model_machining_precision"/>