跳至内容
菜单
此问题已终结
1 回复
1933 查看

Hello,


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

形象
丢弃

Could you share first what you have tried already?

编写者

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.

编写者 最佳答案


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.


形象
丢弃
相关帖文 回复 查看 活动
0
8月 23
2024
1
6月 21
2843
3
9月 23
2156
3
5月 25
1593
1
4月 25
1209