diff --git a/sf_base/models/product_template.py b/sf_base/models/product_template.py index 45c46144..99ab1f81 100644 --- a/sf_base/models/product_template.py +++ b/sf_base/models/product_template.py @@ -14,7 +14,14 @@ class ResProductTemplate(models.Model): model_materials_id = fields.Many2one('mrs.production.materials', string='模型材料') model_materials_type_id = fields.Many2one('mrs.materials.model', string='模型材料型号') model_type_id = fields.Many2one('sf.model.type', string='模型类型') - processing_panel = fields.Char('模型加工面板') + model_processing_panel = fields.Char('模型加工面板') + model_surface_process_id = fields.Many2one('mrs.production.process', string='表面工艺') + model_process_parameters_id = fields.Many2one('mrs.processing.technology', string='工艺参数') + # price = fields.Float('单价', digits=(16, 3)) + # number = fields.Integer('数量', default=1) + # total_amount = fields.Float('金额', digits=(16, 3), compute='_compute_total_amount') + # model_number = + # 胚料的长,宽,高 embryo_long = fields.Float('胚料长[mm]', digits=(16, 3), onchange='count_embryo_size') embryo_width = fields.Float('胚料宽[mm]', digits=(16, 3), onchange='count_embryo_size') @@ -22,6 +29,7 @@ class ResProductTemplate(models.Model): embryo_materials_id = fields.Many2one('mrs.production.materials', string='胚料材料') embryo_materials_type_id = fields.Many2one('mrs.materials.model', string='胚料材料型号') + volume = fields.Float(compute='_compute_volume', store=True) @api.depends('embryo_long', 'embryo_width', 'embryo_height') @@ -43,6 +51,11 @@ class ResProductTemplate(models.Model): [('materials_no', '=', item['texture_code'])]).id, 'model_materials_type_id': self.env['mrs.materials.model'].search( [('materials_no', '=', item['texture_type_code'])]).id, + 'model_surface_process_id': self.env['mrs.production.process'].search( + [('process_encode', '=', item['surface_process_code'])]).id, + 'model_process_parameters_id': self.env['mrs.processing.technology'].search( + [('process_encode', '=', item['process_parameters_code'])]).id, + '' 'default_code': '%s-%s' % (order_number, i), 'barcode': item['barcode'], 'active': True diff --git a/sf_base/views/product_template_view.xml b/sf_base/views/product_template_view.xml index 3a8c0955..2086fba6 100644 --- a/sf_base/views/product_template_view.xml +++ b/sf_base/views/product_template_view.xml @@ -15,7 +15,7 @@ - +