Ir al contenido
Menú
Se marcó esta pregunta
4 Respuestas
4625 Vistas

So im trying to make a field on the stock move that can determine whether stock is moving in or out. easy enough for inventory, but for manufacturing its a little harder.

How does odoo decide whether to add or subtract from stock quantity?

that way i can create a compute field based around that.


Cheers,

Avatar
Descartar
Autor Mejor respuesta

Yes. It’s only to display on a report pivot. So I’ll test it out. I should be able to create a field in the stock move line shouldn’t I? 

would this work for manufacturing orders too? And inventory adjustments? 

Avatar
Descartar
Mejor respuesta

Hi,

The quantity calculation depends on source locations and destination locations type. There are different location types you can see that by going to Inventory -->Configurations --> locations. It includes Internal location, vendor Location, Customer location, etc. Based on the location type we are checking whether the quantity should be subtracted or added.
You can get an idea by checking the computation details of Quantity on Hand of a product

Avatar
Descartar
Autor

Hi. I thought it had something to do with that.

For receipt, delivery and internal, I can work it out (internal is a little confusing because I can’t see the subtraction of stock in the product moves.).

But for manufacturing orders (Consumables our, finished goods in) and inventory adjustments (up or down)

Hi,  if you want to set a field on the stock move in order to see whether it is In Or out you can check this criterion and add it in your code. But it didn't affect the quantity updation.For just knowing whether it is In Or Out.Modify the code

Stock Move Indest_location.usage in ('internal', 'transit') AND

source_location.usage not in ('internal', 'transit')Stock Move Out

source_location.usage in ('internal', 'transit')

AND  dest_location.usage not in ('internal', 'transit')) 

Autor

Yes. It’s only to display on a report pivot. So I’ll test it out. I should be able to create a field in the stock move line shouldn’t I?

would this work for manufacturing orders too? And inventory adjustments?

Publicaciones relacionadas Respuestas Vistas Actividad
2
ago 25
7096
3
jun 25
3133
2
feb 25
1588
0
nov 24
1371
1
oct 24
1580