diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-08-15 09:09:29 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-08-15 09:09:29 +0700 |
| commit | dc6903b175f600f01918d3d7575545e76eaef3c4 (patch) | |
| tree | c75dceede87c7c21dba6a82c2e17ef7fa5070737 /indoteknik_custom/models | |
| parent | aef7941fa025879bfa47ad626c0de7cb716e2ccc (diff) | |
| parent | 4e1d5fa01a64bc6daa6c7bf7255caa55ccf53c59 (diff) | |
Merge branch 'odoo-backup' of bitbucket.org:altafixco/indoteknik-addons into odoo-backup
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/tukar_guling_po.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/indoteknik_custom/models/tukar_guling_po.py b/indoteknik_custom/models/tukar_guling_po.py index cc1c79c0..94771f37 100644 --- a/indoteknik_custom/models/tukar_guling_po.py +++ b/indoteknik_custom/models/tukar_guling_po.py @@ -435,6 +435,15 @@ class TukarGulingPO(models.Model): if bu_put: raise UserError("❌ Tidak bisa retur BU/INPUT karena BU/PUT sudah Done!") + existing_tukar_guling = self.env['tukar.guling.po'].search([ + ('operations', '=', self.operations.id), + ('id', '!=', self.id), + ('state', '!=', 'cancel'), + ], limit=1) + + if existing_tukar_guling: + raise UserError("BU ini sudah pernah diretur oleh dokumen %s." % existing_tukar_guling.name) + picking = self.operations pick_id = self.operations.picking_type_id.id if pick_id == 75: |
