优化sf获取cnc程序和ftp
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user