Odoo ir.actions.server
xml 配置
xml
<record model="ir.actions.server" id="library_book_test">
<field name="name">Actions_Server_Test</field>
<field name="model_id" ref="model_library_library"/>
<field name="binding_model_id" ref="model_library_library" />
<field name="state">code</field>
<field name="code">
if records:
action = records.test()
</field>
</record>
python 函数
python
@api.multi
def test(self):
for rec in self:
print(rec)