콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
11749 화면

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?

아바타
취소
베스트 답변

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.


아바타
취소
작성자

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

베스트 답변

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.


 

아바타
취소
작성자

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

관련 게시물 답글 화면 활동
1
4월 19
3871
7
4월 23
28908
1
1월 24
2106
1
6월 23
4752
1
4월 22
9882