工序增加唯一编码,是否重复,排序;用xml代码生成CNC加工的标准工序;
产品增加模型类型对象和加工的面,包括胚料增加的尺寸
This commit is contained in:
@@ -2,5 +2,6 @@ from . import sale_order
|
||||
from . import product_template
|
||||
from . import http
|
||||
from . import models
|
||||
from . import process
|
||||
|
||||
|
||||
|
||||
11
sf_bpm_api/models/process.py
Normal file
11
sf_bpm_api/models/process.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from odoo import fields, models, api
|
||||
|
||||
|
||||
class ResMrpRoutingWorkcenter(models.Model):
|
||||
_inherit = 'mrp.routing.workcenter'
|
||||
|
||||
code = fields.Char('唯一编码')
|
||||
is_repeat = fields.Boolean('重复',default=False)
|
||||
sort = fields.Integer('排序')
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ class ResProductTemplate(models.Model):
|
||||
model_precision = fields.Float('精度要求', digits=(16, 3))
|
||||
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('加工面板')
|
||||
# 胚料的长,宽,高
|
||||
embryo_long = fields.Float('长[mm]', digits=(16, 3))
|
||||
embryo_width = fields.Float('宽[mm]', digits=(16, 3))
|
||||
@@ -20,6 +22,7 @@ class ResProductTemplate(models.Model):
|
||||
embryo_materials_id = fields.Many2one('mrs.production.materials', string='材料')
|
||||
embryo_materials_type_id = fields.Many2one('mrs.materials.model', string='型号')
|
||||
|
||||
|
||||
# 业务平台分配工厂后在智能工厂先创建销售订单再创建该产品
|
||||
def product_create(self, product_id, item, order_id, order_number, i):
|
||||
copy_product_id = product_id.with_user(self.env.ref("base.user_admin")).copy()
|
||||
@@ -84,3 +87,15 @@ class ResMrpBom(models.Model):
|
||||
'product_uom_id': 1
|
||||
}
|
||||
return self.env['mrp.bom.line'].create(vals)
|
||||
|
||||
|
||||
class ModelType(models.Model):
|
||||
_name = 'sf.model.type'
|
||||
_description = '模型类型'
|
||||
|
||||
name = fields.Char('名称')
|
||||
code = fields.Char('编码')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user