Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
6976 Vistas

Hello,


I am using Odoo v13 enterprise and my inventory configuration is - FIFO, Automated.

I am importing sales orders and delivery orders from a different system into Odoo.

When importing SO and DO i am setting date same as in other system also accounting entries are generated with same date as of DO but valuation entry(stock valuation layer) is generated with the current datetime when creating record as stock.valuation.layer is using create_date as date.

I tried to pass context from delivery order and verified it in create and write but it didn't worked. Can we change this date somehow to match actual delivery date instead current datetime. 


Thanks,

Avatar
Descartar
Mejor respuesta

Hello Ray,

most of the times in big warehouses it takes days to perform the end of year inventory

therefore the inventory will not be posted in Odoo until Jan 3 or 4 but there is nos possibility (as far as I know) in Odoo to post the inventory on Jan 3 with a date of Dec 31.

@Ray

This is a lack of a basic and needded functionnality

regards

Maurice

Avatar
Descartar
Mejor respuesta

In previews Odoo versions the Stock valuation report was reading the value data from accounting entries, which is the most appropriate way of doing it, so we don't have differences between Stock value and Accounting entries.

Since v13 there seems to be a change in this behavior, so now we are getting the data from the Stock Valuation Layer, which is inconsistent with the accounting entry. So even if you can post a Stock adjustment at a different date, this date is not taken into consideration in the stock Valuation. This is a real issue and as far as I can tell this hasn't been done properly even on Odoo v15 ( where there are several more changes in the way we do stock adjustments ).

It is true that changing just one date in one table is not the solution and can lead to data issues, so this is really not advisable.

So I guess the only way to do it properly is via an additional module, which would either change the behavior of the Stock Adjustment or change the way the Stock valuation report works. None of these options is really easy.

Avatar
Descartar
Mejor respuesta

 I solved it with a query to the base:
parameters= []
parameters.append(parameters_date) # date to date
parameters.append(id_stock_valuation_layer) # object id

self.env.cr.execute("UPDATE public.stock_valuation_layer SET create_date=%s WHERE id=%s ",(parameters))

the date must be type datetime!!



Avatar
Descartar

We don't recommend this. There is relationship between several different models that is maintained when moving inventory. Stock Moves, Product Moves, Stock Quants, Journal Entries AND the Stock Valuation Layer are all used together and changing the dates of ONE will lead to data inconsistency and potentially unpredictable behavior from Odoo (specifically how the Inventory Report, Inventory Valuation and Balance Sheet will report the value of Inventory over different periods of time). It is non trivial to manage back dated inventory with the Odoo schema.

Publicaciones relacionadas Respuestas Vistas Actividad
0
ene 23
2705
0
ene 21
1784
1
jun 25
3616
1
sept 24
3855
1
nov 22
2191