Merge branch 'develop' into feature/commercially_launched
This commit is contained in:
@@ -62,7 +62,8 @@ class QualityCheckWizard(models.TransientModel):
|
||||
|
||||
def do_pass(self):
|
||||
if self.test_type == 'picture' and not self.picture:
|
||||
raise UserError('You must provide a picture before validating')
|
||||
raise UserError('请先上传照片')
|
||||
# raise UserError('You must provide a picture before validating')
|
||||
self.current_check_id.do_pass()
|
||||
return self.action_generate_next_window()
|
||||
|
||||
|
||||
@@ -1577,7 +1577,7 @@ class MrpProduction(models.Model):
|
||||
vals['picking_type_id'] = picking_type_id
|
||||
vals['name'] = self.env['stock.picking.type'].browse(picking_type_id).sequence_id.next_by_id()
|
||||
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 != '自加工'
|
||||
is_self_process = product_id.materials_type_id.gain_way if product_id.materials_type_id else None
|
||||
is_customer_provided = product_id.is_customer_provided
|
||||
key = f"{is_self_process}_{is_customer_provided}"
|
||||
if not is_custemer_group_id.get(key):
|
||||
|
||||
@@ -1199,11 +1199,7 @@ class ResMrpWorkOrder(models.Model):
|
||||
'cmm_ids': production.workorder_ids.filtered(lambda t: t.routing_type == 'CNC加工').cmm_ids,
|
||||
}]
|
||||
return workorders_values_str
|
||||
|
||||
@api.depends('production_availability', 'blocked_by_workorder_ids', 'blocked_by_workorder_ids.state',
|
||||
'production_id.tool_state', 'production_id.schedule_state', 'sequence',
|
||||
'production_id.programming_state')
|
||||
def _compute_state(self):
|
||||
def _process_compute_state(self):
|
||||
for workorder in self:
|
||||
# 如果工单的工序没有进行排序则跳出循环
|
||||
if workorder.production_id.workorder_ids.filtered(lambda wk: wk.sequence == 0):
|
||||
@@ -1290,7 +1286,20 @@ class ResMrpWorkOrder(models.Model):
|
||||
mo.get_move_line(workorder.production_id, workorder))
|
||||
else:
|
||||
workorder.state = 'waiting'
|
||||
|
||||
@api.depends('production_availability', 'blocked_by_workorder_ids', 'blocked_by_workorder_ids.state',
|
||||
'production_id.tool_state', 'production_id.schedule_state', 'sequence',
|
||||
'production_id.programming_state')
|
||||
def _compute_state(self):
|
||||
self._process_compute_state()
|
||||
for workorder in self:
|
||||
if workorder.state == 'waiting' or workorder.state == 'pending':
|
||||
for check_id in workorder.check_ids:
|
||||
if not check_id.is_inspect:
|
||||
check_id.quality_state = 'waiting'
|
||||
if workorder.state == 'ready':
|
||||
for check_id in workorder.check_ids:
|
||||
if not check_id.is_inspect:
|
||||
check_id.quality_state = 'none'
|
||||
# 重写工单开始按钮方法
|
||||
def button_start(self):
|
||||
# 判断工单状态是否为等待组件
|
||||
|
||||
@@ -1032,6 +1032,8 @@ class ReStockMove(models.Model):
|
||||
productions = self.env['mrp.production'].search(
|
||||
[('origin', '=', production.origin), ('product_id', '=', production.product_id.id)])
|
||||
res['origin'] = ','.join(productions.mapped('name'))
|
||||
if self.picking_type_id.name == '客供料入库':
|
||||
self.picking_id.sudo().write({'origin': res['origin'] if res.get('origin') else self[0].picking_id.origin})
|
||||
return res
|
||||
|
||||
def _get_new_picking_values(self):
|
||||
|
||||
@@ -140,7 +140,7 @@ class ReworkWizard(models.TransientModel):
|
||||
and item.process_parameters_id == work.surface_technics_parameters_id) or
|
||||
(item.route_id.name == work.name and item.panel
|
||||
and item.panel == work.processing_panel) or
|
||||
(item.route_id == work.routing_workcenter_id
|
||||
(item.route_id == work.routing_work_center_id
|
||||
and not work.processing_panel
|
||||
and not work.surface_technics_parameters_id))
|
||||
if route:
|
||||
|
||||
Reference in New Issue
Block a user