I'd like to create a record rule for my app.
Here is my XML:
<record model="ir.rule" id="ir_rule_something">
<field name="name">something</field>
<field name="model_id" ref="model_something"/>
<field name="domain_force">[('agent','in',function_that_return_list_of_ids)]</field>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_unlink" eval="False"/>
<field name="perm_create" eval="False"/>
</record>
I would like the function_that_return_list_of_ids to return a list of id. Where do I put the method and how do I call it?
The easiest way will be for you to override
_eval_contextor_eval_context_for_combinationsinir.ruleitself.In this example,
function_of_idsis not a method but a simple function.