[17.0][IMP+FIX] base_import_pdf_by_template_account: Suitable value of sort_weight in _unwrap_edi_attachments() method if applicable#1181
Open
victoralmau wants to merge 4 commits intoOCA:17.0from
Conversation
4d0eb4e to
aae2a51
Compare
aae2a51 to
0b59513
Compare
Member
Author
|
Please @pedrobaeza and @sergio-teruel can you review it? |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
…ght in _unwrap_edi_attachments() method if applicable Example of use case: - Create a pdf template linked to invoices. - Define an email alias to automatically create the invoices and process the attachments - Send an email to the alias with 2 attachments: example.xml and example.pdf Before: The _unwrap_edi_attachments() method indirectly applied a lower sort_weight value (10) to the example.xml file than to the example.pdf file (20), which meant that the https://github.com/odoo/odoo/blob/399da69818d22860a808f5416829863f002ad38a/addons/account/models/account_move.py#L3202 condition was met for the example.pdf file and the pdf was not processed correctly (https://github.com/odoo/odoo/blob/399da69818d22860a808f5416829863f002ad38a/addons/account/models/account_move.py#L3215). After: The _unwrap_edi_attachments() method modifies the value of sort_weight in .pdf files if there is +1 file and if there is any pdf import template that applies to the corresponding record. Future: In v19 (master for now) the process has been improved using the account.document.import.mixin and https://github.com/odoo/odoo/blob/cf4e5b95c34357e5129adf9c78429f7c1a4ea33e/addons/account/models/account_document_import_mixin.py#L318 template. TT56274
…ontext value to avoid error when processing the record TT56274
…d process It is very important to have a log of the exception to better understand what is happening (a badly formatted value or a field that does not exist in the view by the user who is executing it). TT56274
0b59513 to
ef8bd2a
Compare
…df releases changes
Member
Author
|
Ping @pedrobaeza and @sergio-teruel |
pedrobaeza
reviewed
Feb 2, 2026
pedrobaeza
approved these changes
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Suitable value of
sort_weightin_unwrap_edi_attachments()method if applicableExample of use case:
Before:
The
_unwrap_edi_attachments()method indirectly applied a lower sort_weight value (10) to the example.xml file than to the example.pdf file (20), which meant that the https://github.com/odoo/odoo/blob/399da69818d22860a808f5416829863f002ad38a/addons/account/models/account_move.py#L3202 condition was met for the example.pdf file and the pdf was not processed correctly (https://github.com/odoo/odoo/blob/399da69818d22860a808f5416829863f002ad38a/addons/account/models/account_move.py#L3215).After:
The
_unwrap_edi_attachments()method modifies the value of sort_weight in .pdf files if there is +1 file and if there is any pdf import template that applies to the corresponding record.Future:
In v19 (master for now) the process has been improved using the
account.document.import.mixinand https://github.com/odoo/odoo/blob/cf4e5b95c34357e5129adf9c78429f7c1a4ea33e/addons/account/models/account_document_import_mixin.py#L318 template.@Tecnativa TT56274