Daily updates from Odoo
Friday, July 17, 2026
1 change · 17.0
Resolved issues and error corrections
This fix prevents payment document creation from failing when accounting views pass an unrelated document type value. If the incoming type is not valid for Documents, the system now uses the standard default so EDI payment updates can proceed normally.
Original PR description
In certain scenarios, a default_type context can be passed during document creation, and this value may not exist in the type selection field, as it may come from a type in another model. Steps to…
In certain scenarios, a default_type context can be passed during document creation, and this value may not exist in the type selection field, as it may come from a type in another model. Steps to reproduce using MX EDI update payment: - Setup a Mexican company with MX EDI - Install the documents_account module and create a folder for journals where you will place customer payments (ex: journal PAY/) - In accounting views, group journals by type, which will adds default_type = <journal type> when opening entries from this view - From this view, open the Customer Invoices journal, create and post an invoice - Register a payment, and then click on Update Payment button, which will triggers an EDI document creation with default_type="sale" in the context, causing the error 'ValueError: Wrong value for documents.document.type: "sale"' This fix falls back to the default document type if the type in the context is not in the selection, preventing the error and allowing the document to be created correctly. opw-5742850 opw-6182877