how to call a server action from a function?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
Hi,
We can use the following code for creating a server action.
<record id="model_test_record_id" model="ir.actions.server">
<field name="name">Record Name</field>
<field name="model_id" ref="module_name.model_model_name"/>
<field name="binding_model_id" ref="module_name.model_model_name"/>
<field name="binding_view_types">form</field>
<field name="state">code</field>
<field name="code">action = records.demo_server_action()</field>
</record>
We can define the server action demo_server_action() on the model.name model
Use the following code to call the server action from a function.
@api.model
def function_name(self):
model_id.demo_server_action()
Regards
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
1
10月 22
|
2777 | ||
|
2
1月 25
|
3121 | ||
|
1
6月 25
|
1580 | ||
|
3
7月 25
|
3230 | ||
|
1
5月 25
|
1380 |