Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/工单添加工艺设计id字段
This commit is contained in:
@@ -1087,6 +1087,33 @@ class ResMrpWorkOrder(models.Model):
|
||||
workorder.state = 'ready'
|
||||
elif workorder.state != 'waiting':
|
||||
workorder.state = 'waiting'
|
||||
# =========== 特殊工艺工单处理 ===================
|
||||
# if workorder.routing_type == '表面工艺' and workorder.is_subcontrac:
|
||||
# purchase_order = self.env['purchase.order'].search(
|
||||
# [('origin', 'ilike', workorder.production_id.name)])
|
||||
# if purchase_order.picking_ids.filtered(lambda p: p.state in ['waiting', 'confirmed', 'assigned']):
|
||||
# workorder.state = 'waiting'
|
||||
# continue
|
||||
if workorder.routing_type == '表面工艺':
|
||||
if workorder.is_subcontract is False:
|
||||
workorder.state = 'ready'
|
||||
else:
|
||||
production_programming = self.env['mrp.production'].search(
|
||||
[('origin', '=', self.production_id.origin)], order='name asc')
|
||||
production_no_remanufacture = production_programming.filtered(
|
||||
lambda a: a.is_remanufacture is False)
|
||||
production_list = [production.name for production in production_programming]
|
||||
purchase_orders = self.env['purchase.order'].search(
|
||||
[('origin', 'ilike', ','.join(production_list))])
|
||||
for line in purchase_orders.order_line:
|
||||
if (
|
||||
line.product_id.server_product_process_parameters_id == workorder.surface_technics_parameters_id
|
||||
and line.product_qty == len(production_no_remanufacture)):
|
||||
if purchase_orders.state == 'purchase':
|
||||
workorder.state = 'ready'
|
||||
else:
|
||||
workorder.state = 'waiting'
|
||||
|
||||
# re_work = self.env['mrp.workorder'].search([('production_id', '=', workorder.production_id.id),
|
||||
# ('processing_panel', '=', workorder.processing_panel),
|
||||
# ('is_rework', '=', True), ('state', 'in', ['done', 'rework'])])
|
||||
@@ -1142,25 +1169,6 @@ class ResMrpWorkOrder(models.Model):
|
||||
# workorder.state = 'ready'
|
||||
# # if (re_work or cnc_workorder) and workorder.production_id.is_rework is False:
|
||||
# # workorder.state = 'ready'
|
||||
# if workorder.routing_type == '表面工艺' and workorder.state not in ['done', 'progress']:
|
||||
# if unclamp_workorder:
|
||||
# if workorder.is_subcontract is False:
|
||||
# workorder.state = 'ready'
|
||||
# else:
|
||||
# production_programming = self.env['mrp.production'].search(
|
||||
# [('origin', '=', self.production_id.origin)], order='name asc')
|
||||
# production_no_remanufacture = production_programming.filtered(
|
||||
# lambda a: a.is_remanufacture is False)
|
||||
# production_list = [production.name for production in production_programming]
|
||||
# purchase_orders = self.env['purchase.order'].search(
|
||||
# [('origin', 'ilike', ','.join(production_list))])
|
||||
# for line in purchase_orders.order_line:
|
||||
# if line.product_id.server_product_process_parameters_id == workorder.surface_technics_parameters_id and line.product_qty == len(
|
||||
# production_no_remanufacture):
|
||||
# if purchase_orders.state == 'purchase':
|
||||
# workorder.state = 'ready'
|
||||
# else:
|
||||
# workorder.state = 'waiting'
|
||||
# elif workorder.production_id.state == 'scrap':
|
||||
# if workorder.routing_type == '解除装夹' and unclamp_workorder.test_results == '报废':
|
||||
# workorder.state = 'waiting'
|
||||
|
||||
Reference in New Issue
Block a user