I am trying to prevent duplicating records and believe it's possible using scheduled actions in the automation section in the technical area, could anyone please advise?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
It might work better to leverage the Data Cleanup App.
You can identify WHY people are duplicating records.
- accident?
- misunderstanding?
- lack of tracking?
You can then address the issues. If you block people from duplicating, it might frustrate them when they legitimately need to duplicate things in order to do their jobs.
Legitimate reasons for duplicating records:
- to save time when needing to create some thing very similar to something that already exists (like a Customer ordering the same things they did last time)
- to maintain a history of prior records (a customer requires several adjustments to their quotations before deciding on a final order)
- to minimize errors (a payroll journal entry is the same each month apart from the amounts)
- to correct errors (it might be faster and more accurate to duplicate a record and archive the original)
- to address mistakes (if an inventory transfer is accidentally cancelled, Users can duplicate it and continue working)
https://www.odoo.com/documentation/17.0/applications/productivity/data_cleaning.html
Thanks Vishnu, unfortunately most of the duplicates are in products.
products = env['product.product'].search([])
seen = set()
duplicates = []
for product in products:
identifier = (product.name, product.default_code, product.barcode)
if identifier in seen:
duplicates.append(product.id)
else:
seen.add(identifier)
if duplicates:
env['product.product'].browse(duplicates).unlink()
example to remove duplicates of contacts you can Insert the following Pythoncode
partners = env['res.partner'].search([])
seen = set()
duplicates = []
for partner in partners:
identifier = (partner.name, partner.email) # Adjust this to your duplication criteria
if identifier in seen:
duplicates.append(partner.id)
else:
seen.add(identifier)
if duplicates:
env['res.partner'].browse(duplicates).unlink()
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 4 22
|
2386 | ||
Save records in database
Đã xử lý
|
|
2
thg 3 15
|
11995 | |
|
0
thg 11 22
|
2337 | ||
|
0
thg 12 20
|
5352 | ||
|
2
thg 8 19
|
8467 |
Thanks for your replies.