I 나는 다음 코드와 재고 이동 만들 수 -
res = {}
Move = self.env['stock.move']
for transfer in self:
moves = self.env['stock.move']
for products in transfer.requisition_items:
move = Move.create({
'name': transfer.employee_id.name,
'product_id': products.product_id.id,
'restrict_lot_id': False,
'product_uom_qty': products.delivery_quantity,
'product_uom': 1, #TODO: Change the test value 1 to produc_uom
'partner_id': 1, #TODO: Change the test value 1 to partner_id
'location_id': products.source_location.id,
'location_dest_id': products.destination_location.id,
})
moves |= move
moves.action_done()
products.write({'move_id': move.id, 'state': 'done'})
res[transfer.id] = move.id
return res
도움하세요? –
코드를 통해 재고를 이전 하시겠습니까? do_transfer는 내가 생각하기에 작동 할 것이다. 코드로 –
예. 한 위치에서 다른 위치로 제품을 전송하고 싶습니다. 나는 do_transfer를 사용하려하지만 그것을 달성하지 못하고있다. 감사합니다. –