-
-
Notifications
You must be signed in to change notification settings - Fork 791
[16.0][ADD] product_merge #1830
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
base: 16.0
Are you sure you want to change the base?
Conversation
eed5099 to
b3efaff
Compare
|
Possible duplicate of https://github.com/OCA/stock-logistics-warehouse/tree/16.0/base_product_merge? |
|
This module emits error logs during the tests. Can you mute the logger when testing the exception? |
StefanRijnhart
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments above.
The goal is not the same. This PR propose to merge 2 product templates into one product with 2 variants. |
|
From what I can see, |
I didn't know that the |
|
Sounds like there is a strong case to try and improve |
50bf43a to
477680a
Compare
| other_templates.ids, | ||
| self.product_tmpl_id.id, | ||
| field_spec=self._get_merge_field_spec(), | ||
| delete=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity. Why to keep the old template?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a merge strategy, we chose to keep the target values. This behavior can be modified through inheritance of _get_merge_field_spec. However, after the merge, the user may need to check one of the merged products to see, for example, the previous price or any other useful data.
That’s why we archive the merged products and leave the cleanup to the user if they wish to do so.
rousseldenis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems great.
| Ensure that at least two products are selected for merging. | ||
| """ | ||
| for wizard in self: | ||
| if len(wizard.product_ids) < 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alert should be great on wizard form in order to warn user before clicking on merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check can't be done before the user completes their input
otherwise, they would receive a warning after adding the first product
IMO, it makes sense to trigger it when they click on the button
0defc7f to
6d06571
Compare
This module allows users to efficiently merge multiple product templates into one. This merge process ensures that attributes and variants from all selected products are consolidated into the primary product template, without creating any new variants. This approach is particularly important for maintaining data integrity and avoiding unnecessary database load. By not creating new variants during the merge, the module helps to prevent heavy updates on existing tables, making it ideal for large-scale databases.
6d06571 to
61e45b8
Compare
|
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. |
|
@sbejaoui Any chance that you could create another PR for V18? |
|
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. |
nihelgabsi-acsone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functional Test + Code review
This module allows users to efficiently merge multiple product templates into one. This merge process ensures that attributes and variants from all selected products are consolidated into the primary product template, without creating any new variants. This approach is particularly important for maintaining data integrity and avoiding unnecessary database load.
By not creating new variants during the merge, the module helps to prevent heavy updates on existing tables, making it ideal for large-scale databases.