← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 816858] Re: ir.cron can't be inherited properly

 

Hello,

I would also suggest the following simple improvement: a button on every
scheduled task hat will just run the task when it's clicked. There are
plenty of occasions where you want to test scheduled action, having that
button would be a lot more simpler than having to create a dedicated button
every time. Of course, only admin could do that.
What do you think?


On Thu, Jul 28, 2011 at 10:58 AM, Vo Minh Thu (OpenERP) <
816858@xxxxxxxxxxxxxxxxxx> wrote:

> Actually, the self.pool.get() thing is done in the new scheduler so
> anything is possible. For the first problem, you would have to implement
> a new way to compute the next time a job has to be run. This computation
> could be moved to its own method if you need to inherit from it. The
> second problem is easier as you simply need to override the _callback()
> method.
>
> So basically, the solutions is indeed involving a dynamic self.pool.get
> as you suggested to let you inherit some methods, but at a smaller
> granularity than the full _poolJobs method (which you will still be able
> to reimplement if you want).
>
> Anyway as I said, if you end up customizing significantly ir.cron, it is
> pretty easy to not start the normal ir.cron scheduling.
>
> --
> You received this bug notification because you are a member of OpenERP
> CTP, which is subscribed to OpenERP Server.
> https://bugs.launchpad.net/bugs/816858
>
> Title:
>  ir.cron can't be inherited properly
>
> Status in OpenERP Server:
>   Invalid
>
> Bug description:
>  Hi,
>
>  I'm working on ir.cron to extend its possibilities, but it can't be
>  inherited easily. The problem is that when the server starts, the
>  method _poolJobs of ir.cron is called. This method reference itself
>  with this line :
>
>  self.setAlarm(self._poolJobs, next_call, db_name, db_name)
>
>  The problem is that if you inherit ir.cron, the _poolJobs method will
>  not reference the new object, but keep referencing the old one. This
>  means that if you redefine _callback() in your new ir.cron, it will
>  never be called.
>
>  I think that a small fix could be to use setAlarm on
>  self.pool.get('ir.cron')._poolJobs ?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-server/+bug/816858/+subscriptions
>

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/816858

Title:
  ir.cron can't be inherited properly

Status in OpenERP Server:
  Invalid

Bug description:
  Hi,

  I'm working on ir.cron to extend its possibilities, but it can't be
  inherited easily. The problem is that when the server starts, the
  method _poolJobs of ir.cron is called. This method reference itself
  with this line :

  self.setAlarm(self._poolJobs, next_call, db_name, db_name)

  The problem is that if you inherit ir.cron, the _poolJobs method will
  not reference the new object, but keep referencing the old one. This
  means that if you redefine _callback() in your new ir.cron, it will
  never be called.

  I think that a small fix could be to use setAlarm on
  self.pool.get('ir.cron')._poolJobs ?

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/816858/+subscriptions


References