Files
gzth/yuthon_property_approval/data/property_bills_payable_cron.xml
T

28 lines
1.7 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- 定时任务:每天早上10点,存在待付账单时给「出纳(财务部)」发企业微信消息提醒
(发送逻辑见 models/property_bills_list.py: cron_send_payable_reminder) -->
<record id="cron_property_bills_payable_reminder" model="ir.cron">
<field name="name">定时任务:每天10点应付账单待付提醒</field>
<!-- 挂到应付账单模型上 -->
<field name="model_id" ref="model_property_bills_list"/>
<field name="state">code</field>
<!-- 执行入口:应付账单模型上的 cron_send_payable_reminder 方法 -->
<field name="code">model.cron_send_payable_reminder()</field>
<field eval="True" name="active"/>
<!-- 以超级管理员身份执行,避免权限不足 -->
<field name="user_id" ref="base.user_root"/>
<!-- 每 1 天执行一次 -->
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<!-- 下次执行时间:每天 10:00(北京时间)= 02:00 UTC;
若当天已过10点则顺延到明天,避免刚装好就立刻触发一次 -->
<field name="nextcall" eval="((DateTime.now() + timedelta(hours=8)) if (DateTime.now() + timedelta(hours=8)).hour &lt; 10 else (DateTime.now() + timedelta(hours=8) + relativedelta(days=1))).strftime('%Y-%m-%d 02:00:00')"/>
<!-- 不限执行次数,永久循环 -->
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
</record>
</data>
</odoo>