diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2026-01-08 04:39:33 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2026-01-08 04:39:33 +0000 |
| commit | f5e9a57a021902317297eba2441a00b8968ba38c (patch) | |
| tree | 1cc9916cab45f7afb00971fcb4c3dfde7e03dc14 /fixco_custom/models/account_move.py | |
| parent | 6659dcfa24fb1a1923f47be4e0b697489dd0a3bf (diff) | |
| parent | 5c332365e81cda9a7bdb233a31880c3bec1d1e0e (diff) | |
Merged main into print_picking_list
Diffstat (limited to 'fixco_custom/models/account_move.py')
| -rw-r--r-- | fixco_custom/models/account_move.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/fixco_custom/models/account_move.py b/fixco_custom/models/account_move.py index 58c94f7..e40e65f 100644 --- a/fixco_custom/models/account_move.py +++ b/fixco_custom/models/account_move.py @@ -48,6 +48,33 @@ class AccountMove(models.Model): help="Flag otomatis kalau invoice sudah paid dan picking terkait di-return." ) + def queue_job_cancel_bill(self): + QueueJob = self.env['queue.job'] + for move in self: + exists = QueueJob.search([ + ('res_id', '=', move.id), + ('method_name', 'in', ['button_draft', 'button_cancel']) + ], limit=1) + + if exists: + continue + + QueueJob.create([ + { + 'name': f'Reset To Draft {move.name}', + 'model_name': 'account.move', + 'method_name': 'button_draft', + 'res_id': move.id, + }, + { + 'name': f'Cancel Bills {move.name}', + 'model_name': 'account.move', + 'method_name': 'button_cancel', + 'res_id': move.id, + } + ]) + + def _compute_need_refund(self): for move in self: flag = False |
