I know that I can add trigger fields to limit when an automated action / automation rule runs (it will only run if there is a change to one of the trigger fields as defined in WHEN UPDATING) but is there a way I can know WHICH field(s) has/have been updated?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- ลูกค้าสัมพันธ์
- e-Commerce
- ระบบบัญชี
- สินค้าคงคลัง
- PoS
- Project
- MRP
คำถามนี้ถูกตั้งค่าสถานะ
UPDATED FOR ODOO 18.0:
Automation Rules with the On save trigger can run multiple times, depending on the model, because updates to one field might trigger updates to other fields.
One easy way to understand how this all works is to create a simple Automation Rule that runs on every update (does not have any trigger fields defined in When updating) and posts a message to the chatter with the old and new values.
Use code like this:
for record in records: if env.context.get('old_values'): old_vals = env.context['old_values'].get(record.id, {}) new_vals = {field: record[field] for field in old_vals.keys()} record.message_post(body="OLD: %s - NEW: %s" % (old_vals, new_vals))
With ALL MODULES loaded, when we create a new Sales Order, choose a Customer (no other fields are given values) and SAVE we will see:
You can see that the Automation Rule runs twelve times as all updates are made to the record.
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อRelated Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
---|---|---|---|---|
|
1
ก.พ. 25
|
746 | ||
How do I connect my Shopee shop to Odoo?
แก้ไขแล้ว
|
|
1
ก.พ. 25
|
661 | |
|
1
มี.ค. 25
|
533 | ||
|
2
ก.พ. 25
|
15055 | ||
|
1
ก.พ. 25
|
16339 |