summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/user_pengajuan_tempo_request.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-03-20 13:12:09 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-03-20 13:12:09 +0700
commitb4d157d591ea0c6dcefd1f708081c2e158911a2b (patch)
tree65c15cdff8b945d606e208142d7e24cbba14bba9 /indoteknik_custom/models/user_pengajuan_tempo_request.py
parent8a23309d00183fb66f1e8c57f0087439fdb999ec (diff)
parentc48f3204c84cf7fca8da827178c4971370b324f8 (diff)
Merge branch 'odoo-backup' into CR/renca-banner
Diffstat (limited to 'indoteknik_custom/models/user_pengajuan_tempo_request.py')
-rw-r--r--indoteknik_custom/models/user_pengajuan_tempo_request.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/indoteknik_custom/models/user_pengajuan_tempo_request.py b/indoteknik_custom/models/user_pengajuan_tempo_request.py
index abcb6f2f..caa420e5 100644
--- a/indoteknik_custom/models/user_pengajuan_tempo_request.py
+++ b/indoteknik_custom/models/user_pengajuan_tempo_request.py
@@ -548,20 +548,7 @@ class UserPengajuanTempoRequest(models.Model):
('name', '=', contact_data['name'])
], limit=1)
- if existing_contact:
- # Pastikan tidak ada duplikasi nama dalam perusahaan yang sama
- duplicate_check = self.env['res.partner'].search([
- ('name', '=', contact_data['name']),
- ('id', '!=', existing_contact.id) # Hindari update yang menyebabkan duplikasi global
- ], limit=1)
-
- if not duplicate_check:
- # Perbarui hanya field yang tidak menyebabkan konflik
- update_data = {k: v for k, v in contact_data.items() if k != 'name'}
- existing_contact.write(update_data)
- else:
- raise UserError(f"Skipping update for {contact_data['name']} due to existing duplicate.")
- else:
+ if not existing_contact:
# Pastikan tidak ada partner lain dengan nama yang sama sebelum membuat baru
duplicate_check = self.env['res.partner'].search([
('name', '=', contact_data['name'])