解决产品-整体式刀具-刃部直径字段数据同步问题。

This commit is contained in:
yuxianghui
2023-09-13 15:21:51 +08:00
parent f9e41f262c
commit 1f0f7ae0c7
2 changed files with 6 additions and 6 deletions

View File

@@ -84,11 +84,11 @@ class FeedPerTooth(models.Model):
cutting_speed = fields.Char('径向切宽 ae(mm)')
machining_method = fields.Selection([('直铣', '直铣'), ('坡铣', '坡铣')], string='加工方式')
materials_type_id = fields.Many2one('sf.materials.model', string='材料型号')
blade_diameter = fields.Float('刃部直径D1(mm)', readonly=True, compute='_compute_product_template_id')
blade_diameter = fields.Float('刃部直径D1(mm)', readonly=True, related='product_template_id.cutting_tool_blade_diameter')
feed_per_tooth = fields.Char('每齿走刀量 (mm/z)')
unit = fields.Char('单位', default='fz')
@api.depends('product_template_id')
def _compute_product_template_id(self):
if self.product_template_id is not None:
self.blade_diameter = self.product_template_id.cutting_tool_blade_diameter
# @api.depends('product_template_id')
# def _compute_product_template_id(self):
# if self.product_template_id is not None:
# self.blade_diameter = self.product_template_id.cutting_tool_blade_diameter