Community mailing list archives

community@mail.odoo.com

Re: Using scheduler in V8

by
Vũ Quốc Hoàng
- 09/03/2014 02:20:44
Hello.
Did you import api?


On Wed, Sep 3, 2014 at 11:58 AM, Kwesi Smith <nanakwesi@gmail.com> wrote:

Hello,

In V8, you can rewrite 2 as:

def weekly_timesheet_notification_schedule (self):


    try:
        TODO
    except Exception:
        logging.exception("ERROR!", exc_info=1)
        pass

The cron job does not execute this and complains of missing args.
However using "def weekly_timesheet_nofitication_scheduler(self, cr, uid, context=None)" works. Does that mean the new V8 api for function specification is not yet supported?

Thanks for your help.

Kwesi.

On Sep 3, 2014 3:55 AM, "Hoang Vu Quoc" <quochoang@trobz.com> wrote:
>
> Hello,
> Sorry if I have mistake.
> I wrote some schedulers for V8. Could you describe more specific?
> Normally, there is not much difference between V7 and V8.
> What you should do is:
> 1. Creat a record for scheduler by xml file
> <record model="ir.cron" id="weekly_timesheet_nofitication">
>             <field name="name">Weekly Timesheet Notification </field>
>             <field name="interval_number">1</field>
>             <field name="interval_type">weeks</field>
>             <field name="numbercall">-1</field>
>             <field name="doall" eval="False"/>
>             <field name="model" eval="'hr.analytic.timesheet'"/>
>             <field name="function" eval="'weekly_timesheet_nofitication_scheduler'"/>
>             <field name="args" eval="'()'" />
>         </record>
> 2. In object: hr.analytic.timesheet, create a method: weekly_timesheet_nofitication_scheduler
> def weekly_timesheet_nofitication_scheduler(self, cr, uid, context=None)
>        
>         try:
>           TODO
>         except Exception:
>             logging.exception("ERROR!", exc_info=1)
>             pass
> Then upgrade the modules and you are able to run scheduler.
>
>
> On Wed, Sep 3, 2014 at 4:52 AM, Kwesi Smith <nanakwesi@gmail.com> wrote:
>>
>> Hello All,
>>
>> Does anyone have experience implementing a scheduler functions using the new V8 api? I'm currently using V8 rc1. I checked all the default scheduler functions and they all use the V7 format. When I tried the V8 function signature, it failed complaining of  sufficient args.
>>
>> _______________________________________________
>> Mailing-List: https://www.odoo.com/groups/community-59
>> Post to: mailto:community@mail.odoo.com
>> Unsubscribe: https://www.odoo.com/groups?unsubscribe
>
>
>
>
> --
> Hoang Vu Quoc
> Technical Consultant
> Mobile: +84-(0)1679011991
> Office: +84 (0)862-737-605
> Email: quochoang@trobz.com
> Skype: hoangvq.uit
>
> trobz - Open Source Solutions for the Enterprise
> Address: 4th floor, 47/2/57 Bui Dinh Tuy st. , Binh Thanh dist., HCMC
> (access map here)
> Website: http://www.trobz.com/
>
> _______________________________________________
> Mailing-List: https://www.odoo.com/groups/community-59
> Post to: mailto:community@mail.odoo.com
> Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
Hoang Vu Quoc
Technical Consultant
Mobile: +84-(0)1679011991
Office: +84 (0)862-737-605
Email: quochoang@trobz.com
Skype: hoangvq.uit

trobz - Open Source Solutions for the Enterprise
Address: 4th floor, 47/2/57 Bui Dinh Tuy st. , Binh Thanh dist., HCMC
(access map here)
Website: http://www.trobz.com/