Skip to content

Commit

Permalink
[FIX] l10n_br_account: account move on fiscal wiz
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemotter committed May 24, 2024
1 parent 32c9d22 commit 28e7b87
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 65 deletions.
18 changes: 18 additions & 0 deletions l10n_br_account/models/fiscal_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,21 @@ def message_post(self, **kwargs):
"""
for doc in self:
doc.move_ids.message_post(**kwargs)

def cancel_move_ids(self):
for record in self:
if record.move_ids:
self.move_ids.button_cancel()

Check warning on line 157 in l10n_br_account/models/fiscal_document.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account/models/fiscal_document.py#L157

Added line #L157 was not covered by tests

def _document_cancel(self, justificative):
result = super()._document_cancel(justificative)
msg = "Cancelamento: {}".format(justificative)
self.cancel_move_ids()
self.message_post(body=msg)
return result

Check warning on line 164 in l10n_br_account/models/fiscal_document.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account/models/fiscal_document.py#L161-L164

Added lines #L161 - L164 were not covered by tests

def _document_correction(self, justificative):
result = super()._document_correction(justificative)
msg = "Carta de correção: {}".format(justificative)
self.message_post(body=msg)
return result

Check warning on line 170 in l10n_br_account/models/fiscal_document.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account/models/fiscal_document.py#L167-L170

Added lines #L167 - L170 were not covered by tests
4 changes: 0 additions & 4 deletions l10n_br_account/wizards/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from . import base_wizard_mixin

from . import account_move_reversal
from . import wizard_document_cancel
from . import wizard_document_correction
from . import wizard_document_invalidate
26 changes: 0 additions & 26 deletions l10n_br_account/wizards/base_wizard_mixin.py

This file was deleted.

17 changes: 0 additions & 17 deletions l10n_br_account/wizards/wizard_document_cancel.py

This file was deleted.

16 changes: 0 additions & 16 deletions l10n_br_account/wizards/wizard_document_correction.py

This file was deleted.

3 changes: 1 addition & 2 deletions l10n_br_account/wizards/wizard_document_invalidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ class InvalidateNumberWizard(models.TransientModel):

def do_invalidate(self):
result = super().do_invalidate()
if self.move_id:
self.move_id.button_cancel()
self.document_id.cancel_move_ids()

Check warning on line 12 in l10n_br_account/wizards/wizard_document_invalidate.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account/wizards/wizard_document_invalidate.py#L12

Added line #L12 was not covered by tests
return result

0 comments on commit 28e7b87

Please sign in to comment.