コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
11375 ビュー

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
3524
7
4月 23
28331
1
1月 24
1821
1
6月 23
4261
1
4月 22
9433