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)'>
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 yourstock.picking. If product in astock.moveis tracked by serial number eachstock.moveshould have as manystock.move.lineobjects related to it as it has quantity. You write serial numbers tostock.move.line.Your
stock.pickingis related tostock.picking.type. Scenario of writing serials depends onstock.picking.typeparameteruse_create_lots.If
use_create_lots == Trueyou can simply write your serial number to fieldlot_namefield and Odoo createsstock_production_lot-objects (serial number object) for you.If
user_create_lots == FalseOdoo excepts thatstock_production_lotobjects already exists in system and refuses create new serial numbers. In that case you have to searchstock.production.lotobjects and link them tostock_move_lineobject by writing it's id tostock.move.line.lot_id-field.