From 5c62e0871eab268f485e1cec98c61a95a192cd72 Mon Sep 17 00:00:00 2001 From: "Paolo Gatti (pgi)" Date: Mon, 25 Sep 2023 12:21:02 +0200 Subject: [PATCH] [FIX] l10n_it_edi: Reset to draft / Request cancel fix In the odoo/odoo#122194 PR I incorrectly used the `need_cancel_request` flag instead of the `show_reset_to_draft_button` one. Italian EDI doesn't allow any sort of cancellation (in case of error you have to a full refund credit note). closes odoo/odoo#136436 Signed-off-by: Josse Colpaert --- addons/l10n_it_edi/models/account_move.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/l10n_it_edi/models/account_move.py b/addons/l10n_it_edi/models/account_move.py index 0a2b2667fb6..d1f7df5507a 100644 --- a/addons/l10n_it_edi/models/account_move.py +++ b/addons/l10n_it_edi/models/account_move.py @@ -138,17 +138,16 @@ class AccountMove(models.Model): ids_intersection = set(invoice_lines_tags.ids) & set(vj_lines_tags.ids) move.l10n_it_edi_is_self_invoice = bool(ids_intersection) - @api.depends('l10n_it_edi_transaction') - def _compute_need_cancel_request(self): - super()._compute_need_cancel_request() - # ------------------------------------------------------------------------- # Overrides # ------------------------------------------------------------------------- - def _need_cancel_request(self): + @api.depends('l10n_it_edi_transaction') + def _compute_show_reset_to_draft_button(self): # EXTENDS 'account' - return super()._need_cancel_request() or self.l10n_it_edi_transaction + super()._compute_show_reset_to_draft_button() + for move in self: + move.show_reset_to_draft_button = not move.l10n_it_edi_transaction and move.show_reset_to_draft_button def _get_edi_decoder(self, file_data, new=False): # EXTENDS 'account'