From 0d136d0b6c1fd6760c371ecaa5ac29d905decf02 Mon Sep 17 00:00:00 2001 From: sergiocorato Date: Fri, 24 Sep 2021 16:33:00 +0200 Subject: [PATCH] [FIX][12.0] add ability to remove current selection dichiarazione di intento in invoice --- .../wizard/manually_declarations.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/l10n_it_dichiarazione_intento/wizard/manually_declarations.py b/l10n_it_dichiarazione_intento/wizard/manually_declarations.py index c8021a78e4a3..52b1dad2cedb 100644 --- a/l10n_it_dichiarazione_intento/wizard/manually_declarations.py +++ b/l10n_it_dichiarazione_intento/wizard/manually_declarations.py @@ -36,7 +36,8 @@ def confirm(self): if not invoice_id: return res invoice = self.env['account.invoice'].browse(invoice_id) - for declaration in self.declaration_ids: - invoice.dichiarazione_intento_ids = [ - (4, declaration.id)] + if self.declaration_ids: + invoice.dichiarazione_intento_ids = [(6, 0, self.declaration_ids.ids)] + else: + invoice.dichiarazione_intento_ids = False return True