3

I have in my code via xmlrpc a function to validate the picking but it asks me to place the batch number of the product. How can I validate that lot?

pick_assign = models.execute_kw(db, uid, password, 'stock.picking', 'force_assign',[pick_id[0]])

pick_transfer_create = models.execute_kw(db, uid, password, 'stock.immediate.transfer', 'create',[{'pick_id': pick_id[0]}])

pick_done = models.execute_kw(db, uid, password, 'stock.immediate.transfer', 'process', [pick_transfer_create],{})

this is the error in the output:

Fault: <Fault 2: 'You need to provide a Lot/Serial Number for product xxxxxxxxx (WH/PICK/06113)'>

1 Answers1

0

Replying to old thread, but in case someone else is looking for solution for the same problem.

You have stock.move (Picking order lines) objects related to your stock.picking. If product in a stock.move is tracked by serial number each stock.move should have as many stock.move.line objects related to it as it has quantity. You write serial numbers to stock.move.line.

Your stock.picking is related to stock.picking.type. Scenario of writing serials depends on stock.picking.type parameter use_create_lots.

If use_create_lots == True you can simply write your serial number to field lot_name field and Odoo creates stock_production_lot -objects (serial number object) for you.

If user_create_lots == False Odoo excepts that stock_production_lotobjects already exists in system and refuses create new serial numbers. In that case you have to search stock.production.lotobjects and link them to stock_move_line object by writing it's id to stock.move.line.lot_id -field.

ex4
  • 2,289
  • 1
  • 14
  • 21