From 26c979ef1d95f53d047a18f6e56844e207680e65 Mon Sep 17 00:00:00 2001 From: "jinling.yang" Date: Thu, 30 May 2024 16:45:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8A=A5=E4=BB=B7=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=B7=B2=E6=9C=89=E4=BA=A7=E5=93=81=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 3afef01d..3f35ed1a 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -379,6 +379,14 @@ class MrpProduction(models.Model): workorders_values.append( self.env['mrp.workorder'].json_workorder_str('', production, route)) production.workorder_ids = workorders_values + if production_programming.programming_state == '已编程': + sale = self.env['sale.order'].search([('name', '=', production.name)]) + if sale.partner_id.name != '业务平台': + logging.info("production: %s" % production.name) + production.workorder_ids.filtered(lambda t: t.routing_type == 'CNC加工').write({ + 'cnc_ids': production_programming.workorder_ids.filtered( + lambda + t1: t1.routing_type == 'CNC加工').cnc_ids}) for workorder in production.workorder_ids: workorder.duration_expected = workorder._get_duration_expected()