Accept Merge Request #380: (feature/刀具优化 -> develop)

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

Created By: @禹翔辉
Accepted By: @禹翔辉
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/380?initial=true
This commit is contained in:
禹翔辉
2023-09-13 15:24:20 +08:00
committed by Coding
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

View File

@@ -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='来源')