坯料尺寸显示修改

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,11 +196,14 @@ class SfProductionDemandPlan(models.Model):
else:
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):
for line in self:
if line.product_id:
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)}"
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)}"
else:
line.embryo_long = None

View File

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