Skip to Content
Menu
This question has been flagged
1 Atsakyti
4798 Rodiniai

Actually, if the serial number to transfer does not exist into the origin, odoo makes the transfer and puts -1 in the origin location for this serial number stock.

Portretas
Atmesti
Best Answer

Manuel, a serial number never "exist" in a location.  What would happen if you create a transfer is that a stock.move is created for that particular product for that particular quantity (and uom) with that particular stock.production.lot (or Serial Number).  So, when you create a stock.move with a particular stock.production.lot, the total quantity of that particular product and stock.production.lot will be calculated as "reduced" by the quantity (and uom) in the origin location and "increased" in the destination location.  In actuality, there is no reducing or increasing of number being performed.

It is possible to ensure that the total quantity of a product and stock.production.lot combination never goes beyond 0 in a stock.location.  You need to develop a _constraint for that. There are a lot of _constraints example in account/account_move_line.py

Portretas
Atmesti