Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into develop
This commit is contained in:
@@ -477,7 +477,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('LocationChange error:%s' % e)
|
logging.info('LocationChange error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/AGVToProduct', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/AGVToProduct', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def AGVToProduct(self, **kw):
|
def AGVToProduct(self, **kw):
|
||||||
"""
|
"""
|
||||||
@@ -549,7 +549,7 @@ class Manufacturing_Connect(http.Controller):
|
|||||||
logging.info('AGVToProduct error:%s' % e)
|
logging.info('AGVToProduct error:%s' % e)
|
||||||
return json.JSONEncoder().encode(res)
|
return json.JSONEncoder().encode(res)
|
||||||
|
|
||||||
@http.route('/AutoDeviceApi/AGVDownProduct', type='json', auth='sf_token', methods=['GET', 'POST'], csrf=False,
|
@http.route('/AutoDeviceApi/AGVDownProduct', type='json', auth='none', methods=['GET', 'POST'], csrf=False,
|
||||||
cors="*")
|
cors="*")
|
||||||
def AGVDownProduct(self, **kw):
|
def AGVDownProduct(self, **kw):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -779,7 +779,8 @@ class MrpProduction(models.Model):
|
|||||||
routing_workcenter = self.env['mrp.routing.workcenter'].sudo().search(
|
routing_workcenter = self.env['mrp.routing.workcenter'].sudo().search(
|
||||||
[('name', '=', work.routing_type)])
|
[('name', '=', work.routing_type)])
|
||||||
|
|
||||||
work.write({'date_planned_start': date_planned_start, 'date_planned_finished': date_planned_end,'duration_expected':routing_workcenter.time_cycle})
|
work.write({'date_planned_start': date_planned_start, 'date_planned_finished': date_planned_end,
|
||||||
|
'duration_expected': routing_workcenter.time_cycle})
|
||||||
|
|
||||||
# 修改标记已完成方法
|
# 修改标记已完成方法
|
||||||
def button_mark_done1(self):
|
def button_mark_done1(self):
|
||||||
@@ -1078,27 +1079,22 @@ class MrpProduction(models.Model):
|
|||||||
productions.write({'programming_no': self.programming_no, 'is_remanufacture': True})
|
productions.write({'programming_no': self.programming_no, 'is_remanufacture': True})
|
||||||
# productions.procurement_group_id.mrp_production_ids.move_dest_ids.write(
|
# productions.procurement_group_id.mrp_production_ids.move_dest_ids.write(
|
||||||
# {'group_id': self.env['procurement.group'].search([('name', '=', sale_order.name)])})
|
# {'group_id': self.env['procurement.group'].search([('name', '=', sale_order.name)])})
|
||||||
stock_picking = None
|
stock_picking_remanufacture = self.env['stock.picking'].search([('origin', '=', productions.name)])
|
||||||
pc_picking = self.env['stock.picking'].search(
|
for pick in stock_picking_remanufacture:
|
||||||
[('origin', '=', productions.name), ('name', 'ilike', 'WH/PC/')])
|
if pick.name.startswith('WH/PC/') or pick.name.startswith('WH/INT/'):
|
||||||
stock_picking = pc_picking
|
if pick.move_ids:
|
||||||
int_picking = self.env['stock.picking'].search(
|
product_type_id = pick.move_ids[0].product_id.categ_id
|
||||||
[('origin', '=', productions.name), ('name', 'ilike', 'WH/INT/')])
|
if product_type_id.name == '坯料':
|
||||||
stock_picking |= int_picking
|
location_id = self.env['stock.location'].search([('name', '=', '坯料存货区')])
|
||||||
for pick in stock_picking:
|
if not location_id:
|
||||||
if pick.move_ids:
|
logging.info(f'没有搜索到【坯料存货区】: {location_id}')
|
||||||
product_type_id = pick.move_ids[0].product_id.categ_id
|
break
|
||||||
if product_type_id.name == '坯料':
|
if pick.picking_type_id.name == '内部调拨':
|
||||||
location_id = self.env['stock.location'].search([('name', '=', '坯料存货区')])
|
if pick.location_dest_id.product_type != product_type_id:
|
||||||
if not location_id:
|
pick.location_dest_id = location_id.id
|
||||||
logging.info(f'没有搜索到【坯料存货区】: {location_id}')
|
elif pick.picking_type_id.name == '生产发料':
|
||||||
break
|
if pick.location_id.product_type != product_type_id:
|
||||||
if pick.picking_type_id.name == '内部调拨':
|
pick.location_id = location_id.id
|
||||||
if pick.location_dest_id.product_type != product_type_id:
|
|
||||||
pick.location_dest_id = location_id.id
|
|
||||||
elif pick.picking_type_id.name == '生产发料':
|
|
||||||
if pick.location_id.product_type != product_type_id:
|
|
||||||
pick.location_id = location_id.id
|
|
||||||
scarp_process_parameter_workorder = self.env['mrp.workorder'].search(
|
scarp_process_parameter_workorder = self.env['mrp.workorder'].search(
|
||||||
[('surface_technics_parameters_id', '!=', False), ('production_id', '=', self.id),
|
[('surface_technics_parameters_id', '!=', False), ('production_id', '=', self.id),
|
||||||
('is_subcontract', '=', True)])
|
('is_subcontract', '=', True)])
|
||||||
@@ -1111,7 +1107,6 @@ class MrpProduction(models.Model):
|
|||||||
for process_item in scarp_process_parameter_workorder:
|
for process_item in scarp_process_parameter_workorder:
|
||||||
if purchase_item.product_id.categ_type == '表面工艺':
|
if purchase_item.product_id.categ_type == '表面工艺':
|
||||||
if purchase_item.product_id.server_product_process_parameters_id == process_item.surface_technics_parameters_id:
|
if purchase_item.product_id.server_product_process_parameters_id == process_item.surface_technics_parameters_id:
|
||||||
print(purchase_orders.origin.find(productions.name))
|
|
||||||
if purchase_orders.origin.find(productions.name) == -1:
|
if purchase_orders.origin.find(productions.name) == -1:
|
||||||
purchase_orders.origin += ',' + productions.name
|
purchase_orders.origin += ',' + productions.name
|
||||||
if item['is_reprogramming'] is False:
|
if item['is_reprogramming'] is False:
|
||||||
|
|||||||
@@ -1100,7 +1100,7 @@ class ResMrpWorkOrder(models.Model):
|
|||||||
[('barcode', 'ilike', 'VL-SPOC')]).id),
|
[('barcode', 'ilike', 'VL-SPOC')]).id),
|
||||||
('origin', '=', self.production_id.name)])
|
('origin', '=', self.production_id.name)])
|
||||||
if move_out.state != 'done':
|
if move_out.state != 'done':
|
||||||
move_out.write({'state': 'assigned'})
|
move_out.write({'state': 'assigned', 'production_id': False})
|
||||||
self.env['stock.move.line'].create(move_out.get_move_line(self.production_id, self))
|
self.env['stock.move.line'].create(move_out.get_move_line(self.production_id, self))
|
||||||
|
|
||||||
# move_out._action_assign()
|
# move_out._action_assign()
|
||||||
|
|||||||
@@ -574,6 +574,7 @@ class StockPicking(models.Model):
|
|||||||
('origin', '=', self.origin), ('picking_id', '=', self.id)])
|
('origin', '=', self.origin), ('picking_id', '=', self.id)])
|
||||||
if self.location_id == move_in.location_id and self.location_dest_id == move_in.location_dest_id:
|
if self.location_id == move_in.location_id and self.location_dest_id == move_in.location_dest_id:
|
||||||
if move_out.origin == move_in.origin:
|
if move_out.origin == move_in.origin:
|
||||||
|
move_in.write({'production_id': False})
|
||||||
if move_out.picking_id.state != 'done':
|
if move_out.picking_id.state != 'done':
|
||||||
raise UserError(
|
raise UserError(
|
||||||
_('该入库单对应的单号为%s的出库单还未完成,不能进行验证操作!' % move_out.picking_id.name))
|
_('该入库单对应的单号为%s的出库单还未完成,不能进行验证操作!' % move_out.picking_id.name))
|
||||||
@@ -659,6 +660,11 @@ class ReStockMove(models.Model):
|
|||||||
return move_values
|
return move_values
|
||||||
|
|
||||||
def _get_new_picking_values_Res(self, item, sorted_workorders, rescode):
|
def _get_new_picking_values_Res(self, item, sorted_workorders, rescode):
|
||||||
|
picking_type_id = self.mapped('picking_type_id').id
|
||||||
|
if rescode == 'WH/OCOUT/':
|
||||||
|
picking_type_id = self.env.ref('sf_manufacturing.outcontract_picking_out').id
|
||||||
|
elif rescode == 'WH/OCIN/':
|
||||||
|
picking_type_id = self.env.ref('sf_manufacturing.outcontract_picking_in').id
|
||||||
return {
|
return {
|
||||||
'name': self.env['stock.picking']._get_name_Res(rescode),
|
'name': self.env['stock.picking']._get_name_Res(rescode),
|
||||||
'origin': item.name,
|
'origin': item.name,
|
||||||
@@ -667,7 +673,7 @@ class ReStockMove(models.Model):
|
|||||||
'user_id': False,
|
'user_id': False,
|
||||||
'move_type': self.mapped('group_id').move_type or 'direct',
|
'move_type': self.mapped('group_id').move_type or 'direct',
|
||||||
'partner_id': sorted_workorders.supplier_id.id,
|
'partner_id': sorted_workorders.supplier_id.id,
|
||||||
'picking_type_id': self.mapped('picking_type_id').id,
|
'picking_type_id': picking_type_id,
|
||||||
'location_id': self.mapped('location_id').id,
|
'location_id': self.mapped('location_id').id,
|
||||||
'location_dest_id': self.mapped('location_dest_id').id,
|
'location_dest_id': self.mapped('location_dest_id').id,
|
||||||
'state': 'confirmed',
|
'state': 'confirmed',
|
||||||
|
|||||||
Reference in New Issue
Block a user