This question has been flagged
2 Replies
123 Views

some of our products require annual calibration and our calibration reminders used to work but not anymore.  I think this is because we have migrated from v10 to 13 and now 15.  I am getting an error now and the alerts don't work anymore.

Could someone help me create a new alert that would be based on the expiration date of a serial number of a product?

Thank you.

Avatar
Discard
Best Answer

Your question is very broad; I will try to guide you, but you will have to give more information, or the code you had in your functional version (last version where cron worked for you)


The best answer I can give you to your question is to compare your code with another module's cron.

For example:


a module external to Odoo that has a cron, it can be sendcloud.

It is included in version 17, but in versions 15 and 16 you can still download it from

https://apps.odoo.com/apps/modules/15.0/delivery_sendcloud_official/


Within this shipping module, you will find that the shipping methods are synchronized every 1 hour (in your code you can modify it to once a day)


and you can make a call to the method so that it performs the relevant validations with the python code according to your preferences.


This is the cron file

custom-addons/delivery_sendcloud_official/delivery_sendcloud_official/data/delivery_sendcloud_cron.xml


<record id="ir_cron_delivery_sendcloud_shipping_method" forcecreate="True" model="ir.cron">
    <field name="name">Sendcloud: sync Shipping Methods</field>
    <field name="active" eval="True" />
    <field name="user_id" ref="base.user_root" />
    <field name="interval_number">1</field>
    <field name="interval_type">hours</field>
    <field name="numbercall">-1</field>
    <field name="doall" eval="False" />
    <field name="model_id" ref="model_delivery_carrier" />
    <field name="state">code</field>
    <field name="code">model.sendcloud_sync_shipping_method()</field>
</record>

     

Documentation ir.cron ACTION Odoo 15



Avatar
Discard
Best Answer

You should use cron not automated action to make an alert sir, i'm guessing you have custom addons right?

Avatar
Discard