From 1c6a7a1e586d4b1d5c8b818bb6fbcc4fabc9e4b6 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 1 Oct 2018 09:12:59 +0000 Subject: [FIX] l10n_be_invoice_bba: Duplicating an existing in_invoice with BBA structured message Steps to reproduce the bug: - Create a partner P with communication type set to BBA - Create an in_invoice I for P with a BBA structured communication - Validate I and try to duplicate it Bug: A UserError was raised "Empty BBA Structured Communication!" opw:1883982 closes odoo/odoo#27331 --- addons/l10n_be_invoice_bba/models/account_invoice.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'addons/l10n_be_invoice_bba') diff --git a/addons/l10n_be_invoice_bba/models/account_invoice.py b/addons/l10n_be_invoice_bba/models/account_invoice.py index 3cf74d36d97..1ec4f3bb63c 100644 --- a/addons/l10n_be_invoice_bba/models/account_invoice.py +++ b/addons/l10n_be_invoice_bba/models/account_invoice.py @@ -181,4 +181,6 @@ class AccountInvoice(models.Model): default['reference_type'] = reference_type if reference_type == 'bba': default['reference'] = self.generate_bbacomm(self.type, reference_type, self.partner_id.id, '')['value']['reference'] + elif self.type in ['in_invoice']: + self.reference_type = 'none' return super(AccountInvoice, self).copy(default) -- cgit v1.2.3