[14.0][IMP] add default_value for import and export#114
Open
chafique-delli wants to merge 2 commits into
Open
Conversation
chafique-delli
force-pushed
the
14.0-imp-pattern_import_export_custom_header
branch
2 times, most recently
from
February 7, 2023 11:11
bc4a28c to
f228775
Compare
Contributor
Author
|
ping @sebastienbeau |
chafique-delli
force-pushed
the
14.0-imp-pattern_import_export_custom_header
branch
from
February 7, 2023 16:35
f228775 to
d4326da
Compare
sebastienbeau
requested changes
Feb 17, 2023
| _inherit = "base" | ||
|
|
||
| def _pattern_format2json(self, row): | ||
| pattern_config_ctx = self._context.get("pattern_config") |
Contributor
There was a problem hiding this comment.
config = self._context["pattern_config"]["pattern_file"].pattern_config_id
Comment on lines
+17
to
+23
| for custom_header in pattern_config.custom_header_ids: | ||
| value = "" | ||
| if custom_header.name in row: | ||
| value = row[custom_header.name] | ||
| if not value and custom_header.import_default_value: | ||
| value = custom_header.import_default_value | ||
| new_row[custom_header.initial_header_name] = value |
Contributor
There was a problem hiding this comment.
Suggested change
| for custom_header in pattern_config.custom_header_ids: | |
| value = "" | |
| if custom_header.name in row: | |
| value = row[custom_header.name] | |
| if not value and custom_header.import_default_value: | |
| value = custom_header.import_default_value | |
| new_row[custom_header.initial_header_name] = value | |
| new_row = { | |
| header.initial_header_name: row.get(header.name) or header.import_default_value | |
| for header in custom_header_ids | |
| } | |
| if new_row: | |
| row = new_row |
chafique-delli
force-pushed
the
14.0-imp-pattern_import_export_custom_header
branch
from
February 17, 2023 11:06
d4326da to
ae76975
Compare
chafique-delli
force-pushed
the
14.0-imp-pattern_import_export_custom_header
branch
from
December 22, 2023 13:24
4baccd8 to
515c654
Compare
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.
cc @sebastienbeau