diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-20 15:57:31 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2026-01-20 15:57:31 +0700 |
| commit | c48a2248a874277b7795d86c6247f51430c0b810 (patch) | |
| tree | dfa9540bbc72bcbdbc54844e97c1a47788cbeefb /fixco_custom/models/account_move_reversal.py | |
| parent | d2268706824167cd23dd3ea9e22acc241bc35122 (diff) | |
push
Diffstat (limited to 'fixco_custom/models/account_move_reversal.py')
| -rw-r--r-- | fixco_custom/models/account_move_reversal.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fixco_custom/models/account_move_reversal.py b/fixco_custom/models/account_move_reversal.py index 745346a..c3cc5cf 100644 --- a/fixco_custom/models/account_move_reversal.py +++ b/fixco_custom/models/account_move_reversal.py @@ -46,8 +46,8 @@ class AccountMoveReversal(models.TransientModel): moves_vals_list.append(move.copy_data({'date': self.date if self.date_mode == 'custom' else move.date})[0]) new_moves = self.env['account.move'].create(moves_vals_list) - - new_moves.action_post() + if new_moves.state != 'posted': + new_moves.action_post() moves_to_redirect |= new_moves move_line = self.env['account.move.line'].search([('move_id', '=', new_moves.id), ('account_id', '=', 347), ('journal_id', '=', 17)], limit=1) if move_line and move_line.move_id.reversed_entry_id: |
