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:
- Müşteri İlişkileri Yönetimi
- e-Commerce
- Muhasebe
- Envanter
- PoS
- Project
- MRP
Bu soru işaretlendi
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Olİlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
---|---|---|---|---|
|
1
Eki 22
|
2775 | ||
|
2
Oca 25
|
3103 | ||
|
1
Haz 25
|
1540 | ||
|
3
Tem 25
|
3211 | ||
|
1
May 25
|
1362 |