Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][ADD] pattern_import_export_import_type #125

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

Kev-Roche
Copy link
Contributor

This module add an import type allowing to: create only, update only or both.

@Kev-Roche Kev-Roche force-pushed the 14.0-add-pattern_import_export_import_type branch 7 times, most recently from e7c8f6c to cdb3a14 Compare September 1, 2023 20:29
Comment on lines 12 to 17
def _load_records_write(self, values):
import_type = self._context.get("pattern_import_type", None)
if import_type:
if import_type in ("update_and_creation", "update_only"):
return super()._load_records_write(values)
else:
raise ValidationError(_("Import Type not allowing updating record."))
else:
return super()._load_records_write(values)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def _load_records_write(self, values):
import_type = self._context.get("pattern_import_type", None)
if import_type:
if import_type in ("update_and_creation", "update_only"):
return super()._load_records_write(values)
else:
raise ValidationError(_("Import Type not allowing updating record."))
else:
return super()._load_records_write(values)
def _load_records_write(self, values):
import_type = self._context.get("pattern_import_type")
if import_type and import_type not in ("update_and_creation", "update_only"):
raise ValidationError(_("Import Type not allowing updating record."))
else:
return super()._load_records_write(values)

@Kev-Roche Kev-Roche force-pushed the 14.0-add-pattern_import_export_import_type branch from cdb3a14 to 712241e Compare September 4, 2023 14:43
@Kev-Roche Kev-Roche force-pushed the 14.0-add-pattern_import_export_import_type branch from 712241e to 9a40f91 Compare September 5, 2023 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants