优化坯料的制造订单
This commit is contained in:
@@ -14,7 +14,7 @@ class ProductionTechnologyWizard(models.TransientModel):
|
||||
is_technology_confirm = fields.Boolean(default=False)
|
||||
|
||||
def confirm(self):
|
||||
if self.is_technology_confirm is True:
|
||||
if self.is_technology_confirm is True and self.production_id.product_id.categ_id.type == '成品':
|
||||
domain = [('origin', '=', self.origin), ('state', '=', 'technology_to_confirmed')]
|
||||
else:
|
||||
domain = [('id', '=', self.production_id.id)]
|
||||
@@ -56,14 +56,16 @@ class ProductionTechnologyWizard(models.TransientModel):
|
||||
# lambda td: td.is_auto is False and td.process_parameters_id is not False)
|
||||
# # if special:
|
||||
productions._create_workorder(False)
|
||||
productions.get_subcontract_pick_purchase()
|
||||
if self.production_id.product_id.categ_id.type == '成品':
|
||||
productions.get_subcontract_pick_purchase()
|
||||
productions.is_adjust = False
|
||||
for item in productions:
|
||||
workorder = item.workorder_ids.filtered(lambda wo: wo.state not in ('cancel')).sorted(
|
||||
key=lambda a: a.sequence)
|
||||
if workorder[0].state in ['pending']:
|
||||
cnc_workorder = self.search(
|
||||
[('production_id', '=', item.id), ('routing_type', '=', 'CNC加工')],
|
||||
limit=1, order='id asc')
|
||||
if cnc_workorder.cnc_ids:
|
||||
workorder[0].state = 'waiting'
|
||||
if workorder[0].production_id.product_id.categ_id.type == '成品':
|
||||
cnc_workorder = self.search(
|
||||
[('production_id', '=', item.id), ('routing_type', '=', 'CNC加工')],
|
||||
limit=1, order='id asc')
|
||||
if cnc_workorder.cnc_ids:
|
||||
workorder[0].state = 'waiting'
|
||||
|
||||
Reference in New Issue
Block a user