Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1520 Lượt xem

Hi,

I am working with Odoo Web Enterprise 17.0+e.

As shown in the image below, I want to add a new field in my list view (Desc) that displays a value calculated as items needed minus stock. If the result is greater than 0, it should be shown as negative (for example, -4).

Is this possible to achieve?


Thanks in advance!



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

You can achieve this by defining new computed field in your model and define your logic inside the compute function.

for example if items_needed and stock is your fields, then


After this, inherit your view in xml and using xpath add new field after the stock

refer this too :


Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

works as expected. thanks!