تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1474 أدوات العرض
Hello, I would like to know how I could execute an automatic action from a button in my odoo form


الصورة الرمزية
إهمال
أفضل إجابة

Hi,

Try this code:

def button_run_action(self):

        action_id = self.env.context.get('automatic_action_id')

        if action_id:

            action = self.env['ir.cron'].sudo().search([('id', '=', action_id)

            action.method_direct_trigger()


Hope it helps

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 21
4569
3
مارس 15
9622
0
أغسطس 23
1689
2
فبراير 23
3113
1
ديسمبر 22
4968