Server Action
View -> Python -> act_window
ตัวอย่าง
<record id="action_server_demo" model="ir.action">
<field name="name">Test Action Server</field>
<field name="type">ir.actions.server</field>
<field name="state">code</field>
<field name="model_id" ref="my_module.my_model" />
<field name="binding_model_id" ref="my_module.my_model" />
<field name="code">records.my_function()</field>
</record>
def my_function(self):
show_ids = [1,2,3,4,5,6]
return {
'type': 'ir.actions.act_window',
'res_model': 'destination_model',
'views': [[False, 'tree'], [False, 'form']],
'domain': [['id', 'in', show_ids ]],
'target': 'new',
}
Top comments (1)
ช่วยอธิบายเพิ่มเติมด้วยครับ