diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 8a2e0214..9bc9d3cf 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -657,7 +657,13 @@ class MrpProduction(models.Model): 'user': cnc.env.user.name, 'programme_way': programme_way, 'model_file': '' if not cnc.product_id.model_file else base64.b64encode( - cnc.product_id.model_file).decode('utf-8') + cnc.product_id.model_file).decode('utf-8'), + 'part_name': cnc.product_id.part_name, + 'part_number': cnc.product_id.part_number, + 'machining_drawings': base64.b64encode(cnc.product_id.machining_drawings).decode( + 'utf-8') if cnc.product_id.machining_drawings else '', + 'machining_drawings_name': cnc.product_id.machining_drawings_name, + 'machining_drawings_mimetype': cnc.product_id.machining_drawings_mimetype, } # 打印出除了 model_file 之外的所有键值对 for key, value in res.items(): diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 4b927596..307fbbc2 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -778,6 +778,8 @@ class ResProductMo(models.Model): quality_standard = fields.Binary('质检标准', readonly=True) part_name = fields.Char(string='零件名称', readonly=True) part_number = fields.Char(string='零件图号', readonly=True) + machining_drawings_name = fields.Char(string='零件图号名称', readonly=True) + machining_drawings_mimetype = fields.Char(string='零件图号类型', readonly=True) @api.constrains('tool_length') def _check_tool_length_size(self): if self.tool_length > 1000000: @@ -892,6 +894,8 @@ class ResProductMo(models.Model): item['machining_drawings']), 'quality_standard': '' if not item['quality_standard'] else base64.b64decode(item['quality_standard']), 'part_name': item.get('part_name') or '', + 'machining_drawings_name': item.get('machining_drawings_name') or '', + 'machining_drawings_mimetype': item.get('machining_drawings_mimetype') or '', } tax_id = self.env['account.tax'].sudo().search( [('type_tax_use', '=', 'sale'), ('amount', '=', item.get('tax')), ('price_include', '=', 'True')])