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

Hi everyone,

i have a model my_model.

one the fields in my_model is a boolean 'my_boolean'

Several records of my_model are displayed in a tree view and some of them have my_boolean set to True


I need to hide those records.

first, I've tried to create a record rule as following


<record id="my_rule_id" model="ir.rule">
    <field name="name">My rule name</field>
    <field name="perm_read" eval="0"/>
    <field name="domain_force">[('my_boolean', '=', True)]</field>
    <field name="model_id" ref="module.model_my_model"/>
</record>


but it didn't work well, my record is hidden but it also prevent creation for some reason

Maybe I can create a context in the tree view to hide those records?


thank you for your help


アバター
破棄
最善の回答

Hi,

Will adding the domain to the corresponding menu action will resolve your case ? In the action linked with the menu, add this domain, ie, to show only records with boolean ticked.

Sample domain:

field name="domain">[('my_boolean','=',True)]field


For More: https://www.youtube.com/watch?v=oLzVr8JYzf0

Thanks

アバター
破棄
著作者

Hi,

It worked,

by customing ir.actions.act_window

Thank you very much

関連投稿 返信 ビュー 活動
1
7月 23
4598
2
3月 23
14780
1
5月 22
3190
1
3月 15
4837
2
8月 25
2129