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

In QWEB we access fields using o, i want to know which model's record set is 'o' currently set to. Is there any way to know this?

I want to do something like this

if o.model_name==account.invoice

do

something

else

some other thing.

Please let me know if i can do soemthing like this or not?

Also someone tell me what exactly is o and what does it contain?

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

hello

you can print or know model name using <span t-esc="o._name"/>.

for eg. <t t-if="o._name == 'account.invoice'">  # for check the model name
 

The 'o' is defined variable by odoo, and it is recordset which is you select the record while print the report.


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

+1, exactly what i was looking for! Thanks :)

Câu trả lời hay nhất

for get the model of the qweb report follow bellow steps,

- activate the developer mode

- open the setting app and follow bellow path 

Technical -> Reporting

- under the reporting section find your report and open it.

- then you can found the related Model there.


 

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

Mitul's answer is what i was looking for. Thanks for the help though!

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 19
3588
7
thg 4 23
28402
1
thg 1 24
1871
1
thg 6 23
4321
1
thg 4 22
9487