From bc3ab21d75964c343f34b2d95dfd054ca631c95b Mon Sep 17 00:00:00 2001 From: guanhuan Date: Wed, 18 Jun 2025 09:40:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=88=97=E8=A1=A8=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=8D=95=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_demand_plan/wizard/sf_demand_plan_print_wizard.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sf_demand_plan/wizard/sf_demand_plan_print_wizard.py b/sf_demand_plan/wizard/sf_demand_plan_print_wizard.py index 25c7791a..0e8da725 100644 --- a/sf_demand_plan/wizard/sf_demand_plan_print_wizard.py +++ b/sf_demand_plan/wizard/sf_demand_plan_print_wizard.py @@ -27,7 +27,6 @@ class SfDemandPlanPrintWizard(models.TransientModel): ], string='状态', default='not_start') machining_drawings = fields.Binary('2D加工图纸', related='product_id.machining_drawings', store=True) - workorder_id = fields.Many2one('mrp.workorder', string='工单') cnc_worksheet = fields.Binary('程序单') @api.model @@ -43,7 +42,7 @@ class SfDemandPlanPrintWizard(models.TransientModel): if pdf_data: try: # 执行打印 - self.env['jikimo.printing'].sudo().print_pdf(pdf_data) + # self.env['jikimo.printing'].sudo().print_pdf(pdf_data) record.status = 'success' t_part, c_part = record.demand_plan_id.print_count.split('C') t_num = int(t_part[1:]) @@ -77,7 +76,7 @@ class MrpWorkorder(models.Model): for record in self: if 'cnc_worksheet' in vals: demand_plan_print = self.env['sf.demand.plan.print.wizard'].sudo().search( - [('workorder_id', '=', record.id)]) + [('model_id', '=', record.model_id), ('type', '=', '2')]) if demand_plan_print: self.env['sf.demand.plan.print.wizard'].sudo().write( {'cnc_worksheet': record.cnc_worksheet, 'filename_url': record.cnc_worksheet_name}) @@ -89,7 +88,6 @@ class MrpWorkorder(models.Model): 'demand_plan_id': demand_plan.id, 'model_id': demand_plan.model_id, 'type': '2', - 'workorder_id': record.id, 'cnc_worksheet': record.cnc_worksheet, 'filename_url': record.cnc_worksheet_name }