-
-
Notifications
You must be signed in to change notification settings - Fork 720
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
[ADD] product_uom_merge #1809
[ADD] product_uom_merge #1809
Conversation
c217748
to
eb79e99
Compare
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.
Tested with done stock moves. Works good. Thanks!
eb79e99
to
9e5e3b6
Compare
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.
Approved as green now and functional tests done
base_uom_merge/__manifest__.py
Outdated
"name": "Base Product UOMs Merge", | ||
"summary": "Merge duplicate product UOMs", | ||
"version": "15.0.1.0.0", | ||
"license": "LGPL-3", |
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.
"license": "LGPL-3", | |
"license": "AGPL-3", |
based on https://github.com/OCA/openupgradelib/blob/master/openupgradelib/openupgrade_merge_records.py
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.
Updated, Thanks
9e5e3b6
to
d137d5e
Compare
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.
Some small comments
Functional review: it works properly
@@ -0,0 +1 @@ | |||
We can merge duplicates products into single product |
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.
We can merge duplicates products into single product | |
We can merge duplicates UOMs into single UOM. |
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.
Updated, Thanks
base_uom_merge/readme/USAGE.rst
Outdated
@@ -0,0 +1,3 @@ | |||
Select uoms from same cateogry then click on Merge UOMs in Action menu. |
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.
Select uoms from same cateogry then click on Merge UOMs in Action menu. | |
Select uoms from same category then click on Merge UOMs in Action menu. |
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.
Updated, Thanks
base_uom_merge/__manifest__.py
Outdated
"license": "AGPL-3", | ||
"website": "https://github.com/OCA/stock-logistics-warehouse", | ||
"author": "ForgeFlow, Odoo Community Association (OCA)", | ||
"category": "Warehouse Management", |
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.
I would change the category field, as this module is not exclusively for Warehouse Management. It can be used from the Sales application without requiring the use of a warehouse, as it no depends to "stock"
Maybe change to category "Product".
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.
Update category as per dependent module Product's category.
Thanks for suggestion
d137d5e
to
9cb0948
Compare
base_uom_merge/README.rst
Outdated
@@ -0,0 +1,3 @@ | |||
=================== | |||
Base Products 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.
Maybe change to Base Product UOMs 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.
Updated, Thanks
|
||
|
||
class TestMergeUOM(TransactionCase): | ||
def setUp(self): |
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.
Change to setUpClass according to the migration rules to v15
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.
Updated, Thanks
9cb0948
to
52463c5
Compare
52463c5
to
aeb539a
Compare
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.
LGTM!
This PR has the |
@JasminSForgeFlow My 10k€ question: is this should be here or in product-attribute repository as it does not depends on stock ? |
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.
you should either forbid merging UoMs with different factors too, or add code that converts the quantity of quants. Otherwise you'll get wrong stock levels, as quants always refer to the product's standard UoM. Maybe a big red warning also suffices for cases where stock is wrong anyways and the merging is the first step to get it right?
Imagine you have product A with UoM km and product B with UoM m. If you now go and merge km into m, your stock levels of product A will be off by factor 1000.
I'm working on a generic merge addon where my customer has been bitten by a very similar issue when merging products, there also quants suddenly refer to a different UoM and are potentially off by the factor difference of the merged products' UoMs.
My fix is to convert quantities before merging: https://github.com/OCA/server-ux/pull/625/files#diff-b166ff54d6536b547b2dbad5be3664f2b7926c93fda8cbb3ddf38e312037aa78R23
@rousseldenis that would then also answer the 10k question, if you want to implement the conversion here, you'd need a dependency on stock.
@hbrunn I haven't look at the implementation yet 😅 but indeed this needs to be more coercive. In fact, your module depends on stock but could be split (supplierinfo in product / quant in stock ones). |
@JasminSForgeFlow I had to implement UoM support for the PR above anyways, so it might be just a little more work to simply lift this to v15 (I expect you just have to change the version number and some field names), then you get all the checks and conversions I talked about for free. And the possibility to merge countries, states and whatever else users tend to duplicate by misspelling things in many2one fields with inline create activated. @rousseldenis let's discuss stuff related to my PR there such as not to hijack the discussion here :-) |
Closing PR |
Module for merge duplicate uoms
cc @ForgeFlow