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

Let's say I create 2 integers in Studio:


x_studio_1


x_studio_2


How do I add them up together?


x_studio_total = x_studio_1 + x_studio_2

Does something like this work?

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

Yes, it's quite simple to do with Computed Fields:

Select the field x_studio_total and then click on “More”

(Screenshot for illustration only, your field name is different)

  1. Stored
    • This should be set to FALSE in most cases.
    • If it is set to TRUE, the value of the computed field will only be changed if the value of one of the dependent fields changes, but it does mean that you can use the field in filters, grouping, domain, etc.
  2. Dependencies
    • Fields used in the calculation  - in your example: x_studio_1, x_studio_2  
  3. Compute (Python code)
for record in self: 
record['x_studio_total'] = record.x_studio_1 + record.x_studio_2

Then save your changes.

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

Hi,

Define the x_studio_total as a compute field .

See:  https://www.youtube.com/watch?v=uKlafP54WsM


Thanks

Ảnh đại diện
Huỷ bỏ