Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
4730 มุมมอง

I created, through the GUI, a server action and a scheduled action

In this way, I can get the system to send some messages when a deadline is coming close


But I have to remember to create such actions every time I create a database


Can I create any actions through xml files, as with common data ?

How ?

Is any example available ?

Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Please refer to this blog:


Server action


Hope it helps

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thank you Walid


what about automated actions ?

I tried with a ir.cron action but it appears among the schedule actions, not the automated ones

อวตาร
ละทิ้ง
ผู้เขียน

ah it's base_automation ?

คำตอบที่ดีที่สุด

You can create server action through XML as below:

Actions — Odoo 14.0 documentation

<record id="act_hr_employee_holiday_request" model="ir.actions.server">
<field name="name">Time off Analysis</field>
<field name="model_id" ref="hr_holidays.model_hr_leave_report"/>
<field name="binding_model_id" ref="hr.model_hr_employee"/>
<field name="state">code</field>
<field name="groups_id" eval="[(4, ref('base.group_user'))]"/>
<field name="code">
action = model.action_time_off_analysis()
</field>
</record>




You can create scheduled action through xml as below:


<record id="autovacuum_job" model="ir.cron">
<field name="name">Base: Auto-vacuum internal data</field>
<field name="model_id" ref="model_ir_autovacuum"/>
<field name="state">code</field>
<field name="code">model._run_vacuum_cleaner()</field>
<field name='interval_number'>1</field>
<field name='interval_type'>days</field>
<field name="numbercall">-1</field>
</record>


How to Create Scheduled Actions in Odoo – Ngasturi Notes


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 22
18364
0
ม.ค. 22
2365
0
ธ.ค. 22
2253
0
ก.ค. 20
3513
2
ธ.ค. 19
7338