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

[13.0][ADD] server_action_merge #625

Closed
wants to merge 1 commit into from

Conversation

hbrunn
Copy link
Member

@hbrunn hbrunn commented Mar 30, 2023

This module allows users to merge records of arbitrary models.

Configuration

To configure this module, you need to:

  • Go to Settings/Technical/Server actions
  • Create a server action of type Merge (field Action To Do)
  • Click Create Contextual Action to make the action accessible for users

Usage

To use this module, you need to:

  • Go to a list view of a model for which you have created a merge server action
  • Mark at least two records and start your merge action
  • Select the record to merge into
  • Click Merge

Technically, this is a UI for https://github.com/OCA/openupgradelib/blob/master/openupgradelib/openupgrade_merge_records.py#L916

@hbrunn hbrunn added this to the 13.0 milestone Mar 30, 2023
[("orm", "ORM"), ("sql", "SQL")], default="orm", string="Merge method"
)
merge_handling = fields.Selection(
[("delete", "Delete"), ("deactivate", "Deactivate"), ("none", "Do nothing")],
Copy link
Contributor

Choose a reason for hiding this comment

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

what will happen if the "none" option is selected?

Copy link
Member Author

Choose a reason for hiding this comment

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

well, nothing ;-)

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense ?

we could :

  • remove that option
  • remove the default (default=False)
  • by view, set merge_handling required, if state==merge
  • by constrains, forbid state==merge and merge_handling==False

Copy link
Member Author

Choose a reason for hiding this comment

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

I just added a help text for this. I think 'delete' is a good default, that's how I'd expect a merge operation to work in general. But there might be cases where you'd like to keep the merged records, and if there's no 'active' field, doing nothing is the only option, right?

@hbrunn hbrunn force-pushed the 13.0-server_action_merge branch 3 times, most recently from d6844f1 to 8caebd8 Compare March 30, 2023 16:51
Copy link

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 24, 2023
@github-actions github-actions bot closed this Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants