Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
4597 Lượt xem

This is my new scheduled action: https://pastebin.com/78KnL19w

and this is my function:

class HrPayslip(models.Model):    

    _inherit = "hr.payslip"

    def action_test_function(self):   ... 


if i run the action manually it works correctly, but it never runs by itself, i think i'm missing a small detail but i really can't understand, if someone cuold help me i'd appreciate


thanks in advance

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Cristian Carbone,

Please find code in comment.

I hope it will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Ảnh đại diện
Huỷ bỏ

Please find below code it may help you to resolve this issue,
<?xml version="1.0" encoding="UTF-8"?>

<odoo>
<data noupdate="1">
<record id="auto_rilpre_generation_scheduler" model="ir.cron">
<field name="name">Rilpre Track: Auto Generation</field>
<field name="model_id" ref="model_hr_payslip"/>
<field name="state">code</field>
<field name="code">model.action_test_function()</field>
<field name="user_id" ref="base.user_admin"/>
<field name='interval_number'>2</field>
<field name='interval_type'>minutes</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
</record>
</data>
</odoo>

Tác giả

code works on the community version but not on Sh; thank you for the effort!

Câu trả lời hay nhất

Remove ="function"eval="'action_test_function'"/> from your XML code. Try after that.

Ảnh đại diện
Huỷ bỏ
Tác giả

thanks Pratyush, but i already tried, and still nothing

Câu trả lời hay nhất

Hi,

Can you try add the following line of code too into your scheduled action

<field name="user_id" ref="base.user_root"/>


Regards 

Ảnh đại diện
Huỷ bỏ
Tác giả

hi, thanks for the effort, but it's not working, i really cannot understand what i'm missing

Hi,
Can you mention the code of action_test_function, which you are trying to run using scheduled action.

Tác giả

hi, the function was actually empty, my problem was that any of the scheduled actions on the database started

I was working on odoo.sh and I think it was a problem of multiple branches as I saw looking around in this forum

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 24
1976
0
thg 11 23
1466
1
thg 12 21
14122
6
thg 4 15
14826
2
thg 3 23
2475