diff options
| author | Indoteknik . <it@fixcomart.co.id> | 2025-07-24 13:19:04 +0700 |
|---|---|---|
| committer | Indoteknik . <it@fixcomart.co.id> | 2025-07-24 13:19:04 +0700 |
| commit | 758db1e691ca9193ce5029246c98e3b27be540f6 (patch) | |
| tree | 105ca540453034837a31e247307f0114418b4e3e | |
| parent | 66d86b6f5b35274b66fe57bcee5864c64f564b97 (diff) | |
(andri) add user again for validation & rev Seq No Dokumen
| -rw-r--r-- | indoteknik_custom/models/down_payment.py | 12 | ||||
| -rw-r--r-- | indoteknik_custom/views/ir_sequence.xml | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/indoteknik_custom/models/down_payment.py b/indoteknik_custom/models/down_payment.py index 8f449566..0263937b 100644 --- a/indoteknik_custom/models/down_payment.py +++ b/indoteknik_custom/models/down_payment.py @@ -238,7 +238,8 @@ class DownPayment(models.Model): ) elif rec.status == 'pengajuan2': - if self.env.user.id != 23: # ID user AP + ap_user_ids = [23, 9468] # List user ID yang boleh approve sebagai Finance AP + if self.env.user.id not in ap_user_ids: raise UserError("Hanya AP yang berhak menyetujui tahap ini.") rec.name_approval_ap = self.env.user.name rec.date_approved_ap = now @@ -308,7 +309,8 @@ class DownPayment(models.Model): def action_ap_only(self): - # if self.env.user.id != 23: + # ap_user_ids = [23, 9468] # List user ID yang boleh approve sebagai Finance AP + # if self.env.user.id not in ap_user_ids: # raise UserError('Hanya User AP yang dapat menggunakan ini.') return { 'name': 'Create CAB AP Only', @@ -542,6 +544,9 @@ class RealizationDownPayment(models.Model): self.message_post(body=f"Status realisasi diperbarui menjadi <b>{dict(self._fields['done_status'].selection).get(self.done_status)}</b> oleh {self.env.user.name}.") def action_cab(self): + # ap_user_ids = [23, 9468] # List user ID yang boleh approve sebagai Finance AP + # if self.env.user.id not in ap_user_ids: + # raise UserError('Hanya User AP yang dapat menggunakan ini.') self.ensure_one() if not self.pum_id or not self.pum_id.move_id: @@ -658,7 +663,8 @@ class RealizationDownPayment(models.Model): ) elif rec.status == 'pengajuan2': - if self.env.user.id != 23: # ID user AP + ap_user_ids = [23, 9468] # List user ID yang boleh approve sebagai Finance AP + if self.env.user.id not in ap_user_ids: raise UserError("Hanya AP yang berhak menyetujui tahap ini.") rec.name_approval_ap = self.env.user.name rec.date_approved_ap = now diff --git a/indoteknik_custom/views/ir_sequence.xml b/indoteknik_custom/views/ir_sequence.xml index 453a73e8..8c054fed 100644 --- a/indoteknik_custom/views/ir_sequence.xml +++ b/indoteknik_custom/views/ir_sequence.xml @@ -204,7 +204,7 @@ <record id="sequence_down_payment" model="ir.sequence"> <field name="name">Down Payment Sequence</field> <field name="code">down.payment</field> - <field name="prefix">PUM/%(year)s/</field> + <field name="prefix">PUM/%(year)s/%(month)s/</field> <field name="padding">5</field> <field name="number_next">1</field> <field name="number_increment">1</field> @@ -219,5 +219,6 @@ <field name="number_next">1</field> <field name="number_increment">1</field> <field name="active">True</field> + </record> </data> </odoo>
\ No newline at end of file |
