diff options
Diffstat (limited to 'fixco_custom/models')
| -rw-r--r-- | fixco_custom/models/account_move.py | 6 |
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 |
