产品和制造订单新增模型和occ查看模型模块

This commit is contained in:
jinling.yang
2022-12-30 10:00:17 +08:00
parent 5fcb17d048
commit a3e39d4fac
33 changed files with 1497 additions and 119 deletions

View File

@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models,_
from odoo import api, fields, models, _
class MrpProduction(models.Model):
@@ -10,6 +9,8 @@ class MrpProduction(models.Model):
tray_ids = fields.One2many('sf.tray', 'production_id', string="托盘")
maintenance_count = fields.Integer(compute='_compute_maintenance_count', string="Number of maintenance requests")
request_ids = fields.One2many('maintenance.request', 'production_id')
# model_file = fields.Binary('模型文件', related='product_id.model_file')
# model_information = fields.Char('模型信息', related='product_id.model_information')
@api.depends('request_ids')
def _compute_maintenance_count(self):
@@ -130,6 +131,9 @@ class MrpProduction(models.Model):
'location_src_id': production.location_src_id.id,
'location_dest_id': production.location_dest_id.id,
'bom_id': production.bom_id.id,
'model_file': base64.b64decode(production.product_id.model_file),
'model_information': '%s/%s' % (
production.product_id.model_processing_panel, production.product_id.materials_id.name),
'date_deadline': production.date_deadline,
'date_planned_start': production.date_planned_start,
'date_planned_finished': production.date_planned_finished,