优化sf获取cnc程序和ftp

This commit is contained in:
jinling.yang
2023-01-09 19:54:02 +08:00
parent c023a13e3a
commit b7723f82d0
24 changed files with 473 additions and 224 deletions

View File

@@ -1,5 +1,11 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
from odoo import api, fields, models,_
class ResProducTemplate_Production(models.Model):
_inherit = 'product.template'
model_file = fields.Binary('模型文件')
class MrpProduction(models.Model):
@@ -9,8 +15,7 @@ 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')
model_file = fields.Binary('模型文件', related='product_id.model_file')
@api.depends('request_ids')
def _compute_maintenance_count(self):
@@ -131,9 +136,6 @@ 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,