diff --git a/sf_manufacturing/models/tool_other_features.py b/sf_manufacturing/models/tool_other_features.py index 7e8f04b7..ddad9da8 100644 --- a/sf_manufacturing/models/tool_other_features.py +++ b/sf_manufacturing/models/tool_other_features.py @@ -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 diff --git a/sf_plan/models/custom_plan.py b/sf_plan/models/custom_plan.py index 623e5e21..c30afe93 100644 --- a/sf_plan/models/custom_plan.py +++ b/sf_plan/models/custom_plan.py @@ -21,7 +21,7 @@ class sf_production_plan(models.Model): date_planned_finished = fields.Datetime(string='计划结束时间') state = fields.Selection([ ('draft', '未排程'), ('done', '已排程')], string='状态', copy=False, index=True, readonly=True, - store=True, tracking=True) + store=True) product_id = fields.Many2one('product.product', '关联产品') origin = fields.Char(string='来源')