summaryrefslogtreecommitdiff
path: root/fixco_custom/models
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-03-07 21:00:57 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-03-07 21:00:57 +0700
commitf186a419a0223cbdb02cdc3309d8e280dfead486 (patch)
tree1e6a0e1d2d0df75b1023fed729a026440ee73e32 /fixco_custom/models
parent521cc20f38fe4571f51345fbd7b5134c292f6fe0 (diff)
<Miqdad> fix last commitHEADmain
Diffstat (limited to 'fixco_custom/models')
-rw-r--r--fixco_custom/models/account_move.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/fixco_custom/models/account_move.py b/fixco_custom/models/account_move.py
index 7cf030d..7f46537 100644
--- a/fixco_custom/models/account_move.py
+++ b/fixco_custom/models/account_move.py
@@ -152,14 +152,16 @@ class AccountMove(models.Model):
if not self.env.context.get('active_model') == 'stock.picking':
if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 11]:
raise UserError("Hanya Finance yang bisa ubah Draft")
+
+ if self.state == 'posted' and self.payment_state == 'paid':
+ raise UserError('Invoice Sudah Lunas, untuk edit invoice hapus pembayaran terlebih dahulu')
+
res = super(AccountMove, self).button_draft()
return res
def button_cancel(self):
if self.env.user.id not in [24, 13, 10, 2, 9, 15, 8, 11]:
raise UserError('Hanya Accounting yang bisa Cancel')
- if self.state == 'posted' and self.payment_state == 'paid':
- raise UserError('Invoice Sudah Lunas, Jika Ingin Cancel Hubungi Finance/Accounting untuk cancel pembayaran')
res = super(AccountMove, self).button_cancel()
return res