From 1cdcb81de27acc10151c6a9c324043656efa7a06 Mon Sep 17 00:00:00 2001 From: Diego Paradeda Date: Tue, 10 Dec 2024 15:58:37 -0300 Subject: [PATCH] [FIX] l10n_br_nfe: unlink nfesupl before reassigning --- l10n_br_nfe/models/document.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/l10n_br_nfe/models/document.py b/l10n_br_nfe/models/document.py index 8abf6d66a408..977cd5970c7b 100644 --- a/l10n_br_nfe/models/document.py +++ b/l10n_br_nfe/models/document.py @@ -1234,6 +1234,8 @@ def _document_qrcode(self): super()._document_qrcode() for record in self.filtered(lambda d: d.document_type == MODELO_FISCAL_NFCE): + if record.nfe40_infNFeSupl: + record.nfe40_infNFeSupl.unlink() record.nfe40_infNFeSupl = self.env[ "l10n_br_fiscal.document.supplement" ].create(