Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化
# Conflicts: # sf_manufacturing/models/mrp_production.py
This commit is contained in:
@@ -433,7 +433,6 @@ class MrpProduction(models.Model):
|
||||
# 工艺确认
|
||||
def technology_confirm(self):
|
||||
process_parameters = []
|
||||
account_moves = []
|
||||
purchase_orders = []
|
||||
parameters_not = []
|
||||
# 获取原有的工单对应的工序
|
||||
@@ -464,6 +463,7 @@ class MrpProduction(models.Model):
|
||||
|
||||
if account_moves:
|
||||
raise UserError(_("请联系工厂生产经理对该(%s)账单进行取消", ", ".join(account_moves)))
|
||||
|
||||
if purchase_orders:
|
||||
raise UserError(_("请联系工厂生产经理对该(%s)采购订单进行取消", ", ".join(purchase_orders)))
|
||||
if parameters_not:
|
||||
@@ -1543,23 +1543,27 @@ class MrpProduction(models.Model):
|
||||
picking_type_id = self._get_default_picking_type_id(vals.get('company_id', self.env.company.id))
|
||||
vals['picking_type_id'] = picking_type_id
|
||||
vals['name'] = self.env['stock.picking.type'].browse(picking_type_id).sequence_id.next_by_id()
|
||||
if not is_first:
|
||||
product_id = self.env['product.product'].browse(vals['product_id'])
|
||||
is_self_process = product_id.materials_type_id and product_id.materials_type_id.gain_way and product_id.materials_type_id.gain_way != '自加工'
|
||||
if not is_first and is_self_process:
|
||||
is_first = True
|
||||
group_id = self.env["procurement.group"].create({'name': vals.get('name')}).id
|
||||
if not vals.get('procurement_group_id'):
|
||||
product_id = self.env['product.product'].browse(vals['product_id'])
|
||||
if product_id.product_tmpl_id.single_manufacturing:
|
||||
if product_id.categ_id.name == '成品':
|
||||
|
||||
if product_id.categ_id.name == '成品' and is_self_process:
|
||||
|
||||
vals['procurement_group_id'] = group_id
|
||||
continue
|
||||
if product_id.id not in product_group_id.keys():
|
||||
procurement_group_vals = self._prepare_procurement_group_vals(vals)
|
||||
group_id = self.env["procurement.group"].create(procurement_group_vals).id
|
||||
vals['procurement_group_id'] = group_id
|
||||
product_group_id[product_id.id] = group_id
|
||||
procurement_group_id = self.env["procurement.group"].create(procurement_group_vals).id
|
||||
vals['procurement_group_id'] = procurement_group_id
|
||||
product_group_id[product_id.id] = procurement_group_id
|
||||
else:
|
||||
vals['procurement_group_id'] = product_group_id[product_id.id]
|
||||
vals['procurement_group_id'] = group_id
|
||||
else:
|
||||
vals['procurement_group_id'] = group_id
|
||||
return super(MrpProduction, self).create(vals_list)
|
||||
|
||||
@api.depends('procurement_group_id.stock_move_ids.created_purchase_line_id.order_id',
|
||||
@@ -1729,7 +1733,12 @@ class sf_detection_result(models.Model):
|
||||
processing_panel = fields.Char('加工面')
|
||||
routing_type = fields.Selection([
|
||||
('装夹预调', '装夹预调'),
|
||||
('CNC加工', 'CNC加工')], string="工序类型")
|
||||
('CNC加工', 'CNC加工'),
|
||||
('解除装夹', '解除装夹'),
|
||||
('切割', '切割'),
|
||||
('表面工艺', '表面工艺'),
|
||||
('线切割', '线切割'),
|
||||
('人工线下加工', '人工线下加工')], string="工序类型")
|
||||
|
||||
rework_reason = fields.Selection(
|
||||
[("programming", "编程"), ("cutter", "刀具"), ("clamping", "装夹"),
|
||||
|
||||
Reference in New Issue
Block a user