I'm trying to set nextcall based on time zone in cronjob in 2nd next day
Here's my code:
<record id="ir_cron_check_qty_and_move_from_internal_customer_to_customer" model="ir.cron">
<field name="name">KiotViet: Check Qty And Move Product From Internal Customer To Customer</field>
<field name="model_id" ref="model_kiotviet_cron"/>
<field name="type">ir.actions.server style="color:#e8bf6a;"></field>
<field name="state">code</field>
<field name="code">model.check_qty_and_move_from_internal_customer_to_customer()</field>
<!-- set cron will run after 1 days -->
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<!-- set cron will run at 2am -->
<field name="nextcall"
eval="datetime.now() + (datetime.now(pytz.timezone('Asia/Ho_Chi_Minh')).replace(day=26, hour=2, minute=00, second=00) - datetime.now(pytz.timezone('Asia/Ho_Chi_Minh'))) % timedelta(hours=24)"/>
<field name="numbercall">-1</field>
</record>This code is to change the nextcall to the time zone of "Asia/Ho_Chi_Minh".
But when using it, i can't set the days to it, such as 2nd next day.
I've try to set day, but not working.
Please help, thanks.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
3460
มุมมอง
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
ก.ค. 23
|
3369 | ||
|
1
มิ.ย. 25
|
1871 | ||
|
3
ก.ค. 25
|
3480 | ||
|
1
พ.ค. 25
|
1605 | ||
|
1
พ.ค. 25
|
1850 |