Conversation
fields_get resolves field labels by following base_field, which for _inherits delegated fields points to the parent model. This caused delegated fields like "code" (from product.product) to get the parent model's label instead of lighting.product's own label. When two fields from different models shared the same translated label (e.g. "code" and "reference" both resolving to "Referencia" in Spanish), the export crashed with "The field 'Referencia' is duplicated". Use line.field_id.field_description (from ir.model.fields, scoped to the correct model) instead of the label returned by fields_get.
Serialized fields (e.g. json_search_cri, json_search_wattage) store raw JSON values such as lists of ints or strings. The export code did not handle the "serialized" field type, so these raw lists passed the isinstance(datum, (tuple, list)) check and reached _get_meta_num, which expects a list of dicts, causing: AttributeError: 'int' object has no attribute 'keys' Convert serialized field values to their JSON string representation.
…xport When the export template has multiple fields resolving to the same column name (e.g. two fields both labeled "SAP B1 Bindings"), the export would crash with an internal "The field 'X' is duplicated" error. Detect all duplicate column labels upfront and raise a user-friendly ValidationError listing every conflict and guiding the user to set a distinct label on the template field definition, or remove the duplicate.
Rewrite es.po and fr.po removing parent model strings that don't belong to this module and fixing bad translations (technical names used as translations). Add missing ca.po, de.po, it.po and pt.po for all installed languages.
Binary field values are bytes objects that xlsxwriter cannot write to cells. Export the human-readable file size instead, matching how Odoo displays binary fields in tree views.
…port Use xlsxwriter's write_datetime with locale-aware number formats derived from Odoo's res.lang date/time settings instead of writing raw values. Extract field type conversion logic into a dedicated method to improve readability.
… export Datetime values are stored in UTC in the database. Convert them to the user's timezone before writing to Excel so exported times match what users see in the Odoo interface.
…uages Add missing ca, de, it translations and update stale es, fr, pt files from Odoo 11 to current Odoo 16 format. Remove inherited model and field entries that belong to other modules.
c7fafd6 to
419e0c3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 16.0 #84 +/- ##
==========================================
- Coverage 44.03% 43.93% -0.11%
==========================================
Files 283 283
Lines 8007 8044 +37
Branches 1543 1549 +6
==========================================
+ Hits 3526 3534 +8
- Misses 4386 4415 +29
Partials 95 95 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Test plan