Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2020 Visualizzazioni

I have a Stock field and I want it to record the quantity available based on the quantities of product receipts and issues registered.


I need the stock field to update automatically


The stock field should be a calculated field, where the calculation is a subtraction between the input quantity field and the output quantity field.


I have tried to do it in several ways but I can't get the expected result.

I am using Odoo Studio free version


I have tried to create the stock (integer) calculated field with the following code:
for record in self:
record['x_studio_stock_disponible'] = record.x_studio_unidades - record.x_studio_enviado

The Stock field is from the Warehouse model and the fields to be subtracted are related fields, one from the Input model and the other from the Output model. The three models are related.


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
lug 23
1927
1
giu 21
2835
3
set 23
2154
3
mag 25
1584
1
apr 25
1183