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

I am modifying some report and I want to know where do the values come from?

for example,

[[ formatLang(o.amount_total, digits=get_digits(dp='Account') ) ]] [[ o.pricelist_id.currency_id. symbol ]]

Where does the amount_total come from?

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

Check corresponding .py file. Usually, the data is defined in __init__ method.
 

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

I guess that you.are editing sale_order.rml file, where o. stands for object, for which current report is being processed and amount_total for the field which is defined in current model - to see, which field is called how, enable developer mode and see from there by hovering on each of fields label.

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

Adding on Mariusz' answer: the o actually comes from a for loop, something like repeatIn(objects, 'o') in RML definition. The information is passed to the RML file during rendering as objects variable.