Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/优化制造功能
This commit is contained in:
@@ -1361,23 +1361,23 @@ class ResMrpWorkOrder(models.Model):
|
||||
return res
|
||||
|
||||
def button_delivery(self):
|
||||
production_ids = []
|
||||
workorder_ids = []
|
||||
# production_ids = []
|
||||
# workorder_ids = []
|
||||
delivery_type = '运送空料架'
|
||||
max_num = 4 # 最大配送数量
|
||||
feeder_station_start_id = False
|
||||
if len(self) > max_num:
|
||||
raise UserError('仅限于拆卸1-4个制造订单,请重新选择')
|
||||
for item in self:
|
||||
if item.state != 'ready':
|
||||
raise UserError('请选择状态为【就绪】的工单进行解除装夹')
|
||||
|
||||
production_ids.append(item.production_id.id)
|
||||
workorder_ids.append(item.id)
|
||||
if not feeder_station_start_id:
|
||||
down_product_agv_scheduling = self.get_down_product_agv_scheduling()
|
||||
if down_product_agv_scheduling:
|
||||
feeder_station_start_id = down_product_agv_scheduling.end_site_id.id
|
||||
# max_num = 4 # 最大配送数量
|
||||
# feeder_station_start_id = False
|
||||
# if len(self) > max_num:
|
||||
# raise UserError('仅限于拆卸1-4个制造订单,请重新选择')
|
||||
# for item in self:
|
||||
# if item.state != 'ready':
|
||||
# raise UserError('请选择状态为【就绪】的工单进行解除装夹')
|
||||
#
|
||||
# production_ids.append(item.production_id.id)
|
||||
# workorder_ids.append(item.id)
|
||||
# if not feeder_station_start_id:
|
||||
# down_product_agv_scheduling = item.get_down_product_agv_scheduling()
|
||||
# if down_product_agv_scheduling:
|
||||
# feeder_station_start_id = down_product_agv_scheduling.end_site_id.id
|
||||
return {
|
||||
'name': _('确认'),
|
||||
'type': 'ir.actions.act_window',
|
||||
@@ -1386,12 +1386,12 @@ class ResMrpWorkOrder(models.Model):
|
||||
'target': 'new',
|
||||
'context': {
|
||||
# 'default_delivery_ids': [(6, 0, delivery_ids)],
|
||||
'default_production_ids': [(6, 0, production_ids)],
|
||||
# 'default_production_ids': [(6, 0, production_ids)],
|
||||
'default_delivery_type': delivery_type,
|
||||
'default_workorder_ids': [(6, 0, workorder_ids)],
|
||||
# 'default_workorder_ids': [(6, 0, workorder_ids)],
|
||||
'default_workcenter_id': self.env.context.get('default_workcenter_id'),
|
||||
'default_confirm_button': '确认解除',
|
||||
'default_feeder_station_start_id': feeder_station_start_id,
|
||||
# 'default_feeder_station_start_id': feeder_station_start_id,
|
||||
}}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user