When a vendor bill is created by l10n_fr_einvoicing_import and the supplier could not be matched, the bill has no partner_id. The automatic "in hand" event is still created, and generating its CDAR fails in fr.einvoicing.event._prepare_xml_data():
partner_siren = invoice.commercial_partner_id._get_siren(raise_if_none=True)
commercial_partner_id is an empty recordset, so _get_siren() raises Expected singleton: res.partner(). The outgoing flow goes to state error with that message in odoo_error_details, and there is nothing in it to tell the user what to do.
The two checks just below, on invoice_date and on the bill reference, both raise a UserError that says exactly what is missing and why the value was expected to be there. A missing partner seems to belong to the same family, and is arguably the most likely of the three: a supplier whose record has neither SIRET nor VAT number is not matched, and business.document.import._match_partner() returns nothing without raising, so the bill is created partner-less without any hard failure.
We had six outgoing flows in that state on our own ERP before completing the supplier records, all with the same message.
Would a UserError along the same lines as the two others be acceptable? Something like: the vendor bill has no partner, it was imported from the accredited platform, so the supplier could not be identified from the file and has to be set manually before the acknowledgement can be sent. Happy to send a PR.
Version: l10n_fr_einvoicing 18.0.1.2.0, at 6f61127.
When a vendor bill is created by
l10n_fr_einvoicing_importand the supplier could not be matched, the bill has nopartner_id. The automatic "in hand" event is still created, and generating its CDAR fails infr.einvoicing.event._prepare_xml_data():commercial_partner_idis an empty recordset, so_get_siren()raisesExpected singleton: res.partner(). The outgoing flow goes to stateerrorwith that message inodoo_error_details, and there is nothing in it to tell the user what to do.The two checks just below, on
invoice_dateand on the bill reference, both raise aUserErrorthat says exactly what is missing and why the value was expected to be there. A missing partner seems to belong to the same family, and is arguably the most likely of the three: a supplier whose record has neither SIRET nor VAT number is not matched, andbusiness.document.import._match_partner()returns nothing without raising, so the bill is created partner-less without any hard failure.We had six outgoing flows in that state on our own ERP before completing the supplier records, all with the same message.
Would a
UserErroralong the same lines as the two others be acceptable? Something like: the vendor bill has no partner, it was imported from the accredited platform, so the supplier could not be identified from the file and has to be set manually before the acknowledgement can be sent. Happy to send a PR.Version:
l10n_fr_einvoicing18.0.1.2.0, at 6f61127.