Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
4800 Представления

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.

Аватар
Отменить
Лучший ответ

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

Аватар
Отменить