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

Naming files, models, fields, context parameters, etc... #52

Open
astirpe opened this issue Jun 8, 2023 · 0 comments
Open

Naming files, models, fields, context parameters, etc... #52

astirpe opened this issue Jun 8, 2023 · 0 comments

Comments

@astirpe
Copy link

astirpe commented Jun 8, 2023

File naming
File nextcloud_base.py contains a definition of an AbstractModel, so the file could be named abstract_nextcloud_base.py for better readability.
Same discourse for file nextcloud_caldav.py: it could be named abstract_nextcloud_caldav.py.

Model naming
Models like nc.calendar, nc.sync.log, nc.sync.user should be renamed to nextcloud.calendar, nextcloud.sync.log, nextcloud.sync.user , so that the corresponding name of tables in database will be more explicit. It's also the same naming as it was made for abstract models: nextcloud.base and nextcloud.caldav, so the naming will be more consistent.

Definition of model calendar.event.nchash should be placed in a separate file. Also this model should be renamed consistently to the other models, for example renamed to: nextcloud.calendar.event.nchash.

Field naming
Some models are inherited from standard Odoo: calendar.event, calendar.recurrence, res.config.settings, res.partner, res.users. In those models, the naming of fields should be not conflicting with any other module that could potentially adopt the same name. Proposal is to rename the following:

  • calendar.event: all fields name prefix from nc_* to nextcloud_*
  • calendar.recurrence: field nc_exdate to nextcloud_exdate
  • res.config.settings: field enable_calendar_sync to nextcloud_enable_calendar_sync and log_capacity to nextcloud_log_capacity
  • res.partner: field nc_sync to nextcloud_sync
  • res.users: field nc_calendar_ids to nextcloud_calendar_ids

Context parameters naming
When passing parameters in context, the name of the parameter should be not conflicting with any other module that could potentially use the same name for context parameters. So for example:

  • with_context(sync=True) should become with_context(nextcloud_sync=True)
  • self._context.get("sync", False) should become self._context.get("nextcloud_sync", False)
  • and so on...
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

No branches or pull requests

1 participant