# Conflicts:
#	sf_dlm/data/product_data.xml
#	sf_dlm/models/product_template.py
#	sf_manufacturing/models/mrp_workorder.py
#	sf_mrs_connect/controllers/controllers.py
This commit is contained in:
gqh
2022-12-12 14:52:48 +08:00
15 changed files with 273 additions and 73 deletions

View File

@@ -40,24 +40,24 @@ class ResMrpRoutingWorkcenter(models.Model):
return self.env.cr.dictfetchall()[0].get('workcenter_id')
class ModelTypeRoutingSort(models.Model):
_name = 'sf.model.type.routing.sort'
_description = '工序排序'
sequence = fields.Integer('Sequence')
route_workcenter_id = fields.Many2one('mrp.routing.workcenter')
is_repeat = fields.Boolean('重复', related='route_workcenter_id.is_repeat')
routing_type = fields.Selection([
('获取CNC加工程序', '获取CNC加工程序'),
('装夹', '装夹'),
('前置三元定位检测', '前置三元定位检测'),
('CNC加工', 'CNC加工'),
('后置三元质量检测', '后置三元质量检测'),
('解除装夹', '解除装夹'),
], string="工序类型", related='route_workcenter_id.routing_type')
workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
model_type_id = fields.Many2one('sf.model.type')
_sql_constraints = [
('route_model_type_uniq', 'unique (route_workcenter_id,model_type_id)', '工序不能重复!')
]
# class ModelTypeRoutingSort(models.Model):
# _name = 'sf.model.type.routing.sort'
# _description = '工序排序'
#
# sequence = fields.Integer('Sequence')
# route_workcenter_id = fields.Many2one('mrp.routing.workcenter')
# is_repeat = fields.Boolean('重复', related='route_workcenter_id.is_repeat')
# routing_type = fields.Selection([
# ('获取CNC加工程序', '获取CNC加工程序'),
# ('装夹', '装夹'),
# ('前置三元定位检测', '前置三元定位检测'),
# ('CNC加工', 'CNC加工'),
# ('后置三元质量检测', '后置三元质量检测'),
# ('解除装夹', '解除装夹'),
# ], string="工序类型", related='route_workcenter_id.routing_type')
# workcenter_ids = fields.Many2many('mrp.workcenter', required=False, related='route_workcenter_id.workcenter_ids')
# model_type_id = fields.Many2one('sf.model.type')
#
# _sql_constraints = [
# ('route_model_type_uniq', 'unique (route_workcenter_id,model_type_id)', '工序不能重复!')
# ]

View File

@@ -242,7 +242,7 @@ class ResMrpWorkOrder(models.Model):
'material_type_code': cnc.env['sf.materials.model'].search(
[('id', '=', cnc.product_id.materials_type_id.id)]).materials_no,
'machining_precision': cnc.product_id.model_machining_precision,
'embryo_long': cnc.product_id.bom_ids.bom_line_ids.product_id.long,
'embryo_long': cnc.product_id.bom_ids.bom_line_ids.product_id.length,
'embryo_height': cnc.product_id.bom_ids.bom_line_ids.product_id.height,
'embryo_width': cnc.product_id.bom_ids.bom_line_ids.product_id.width
# 'factory_code': self.env.user.company_id.partner_id.