Skip to content

Commit

Permalink
Merge PR #3090 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by rvalyi
  • Loading branch information
OCA-git-bot committed May 24, 2024
2 parents 32c9d22 + 28e7b87 commit 3e64fe1
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()

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

def _document_correction(self, justificative):
result = super()._document_correction(justificative)
msg = "Carta de correção: {}".format(justificative)
self.message_post(body=msg)
return result
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()
return result

0 comments on commit 3e64fe1

Please sign in to comment.