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 | |
| parent | aef7941fa025879bfa47ad626c0de7cb716e2ccc (diff) | |
| parent | 4e1d5fa01a64bc6daa6c7bf7255caa55ccf53c59 (diff) | |
Merge branch 'odoo-backup' of bitbucket.org:altafixco/indoteknik-addons into odoo-backup
| -rw-r--r-- | indoteknik_custom/models/tukar_guling_po.py | 9 | ||||
| -rw-r--r-- | indoteknik_custom/views/tukar_guling_po.xml | 2 |
2 files changed, 10 insertions, 1 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: diff --git a/indoteknik_custom/views/tukar_guling_po.xml b/indoteknik_custom/views/tukar_guling_po.xml index 1c6a86ea..548a209f 100644 --- a/indoteknik_custom/views/tukar_guling_po.xml +++ b/indoteknik_custom/views/tukar_guling_po.xml @@ -21,7 +21,7 @@ <field name="name">pengajuan.tukar.guling.po.tree</field> <field name="model">tukar.guling.po</field> <field name="arch" type="xml"> - <tree create="1" delete="1" default_order="create_date desc"> + <tree create="0" delete="1" default_order="create_date desc"> <field name="name"/> <field name="vendor_id" string="Customer"/> <field name="origin" string="PO Number"/> |
