From 1f0f7ae0c7805d0f7bbc0d127daaf8d036a3eaaf Mon Sep 17 00:00:00 2001 From: yuxianghui <1608204036@qq.com> Date: Wed, 13 Sep 2023 15:21:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=A7=E5=93=81-=E6=95=B4?= =?UTF-8?q?=E4=BD=93=E5=BC=8F=E5=88=80=E5=85=B7-=E5=88=83=E9=83=A8?= =?UTF-8?q?=E7=9B=B4=E5=BE=84=E5=AD=97=E6=AE=B5=E6=95=B0=E6=8D=AE=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/tool_other_features.py | 10 +++++----- sf_plan/models/custom_plan.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) 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='来源')