-
-
Notifications
You must be signed in to change notification settings - Fork 715
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
[11.0][NEW] product_secondary_unit: New module for set a second units for a product #377
Conversation
618be34
to
5d93f84
Compare
5d93f84
to
25e9719
Compare
We talk about |
Is this not a duplicate of product packaging uom module? Because it does exactly the same and is more flexible as it takes advantages of product packaging (you have as many units as you want). See stock logistics warehouse repo. |
I share the same feeling as @rousseldenis |
@sergio-teruel @rousseldenis , Sorry to ask questions on a PR, however i'd like to know, Is there a particular use-case this module was designed for? I have an industry-specific requirement for a company that manufactures aluminium cans (eg. for Coca Cola, John West Tuna, etc.). This Industry will always quote a unit price for cans as a per 1000 Units (ie. 1000 x Unit), but Sale and Purchase UoM will remain Unit (ie. x1). In this case I need to define a secondary UoM on product. Is this module or product packaging uom module designed for this sort of use-case? I have tried this PR in the runbot, but am not sure of how to use it. Is it to allow for defining a UoM in more than one UoM Category (eg. Sale and Purchase in Unit, and Secondary UoM in Weight)? |
There are several modules that work together. packaging_uom, sale_packaging and purchase_packaging. Packaging uom 'simply' add an uom on product packagings. The other one let you use them in sale and purchases flows. Let's say you store your coca with 1L bottles, the unit will be (1X Unit x 1L). But you have also the packaging that say 6x Unit x 1L which is the pack you use in purchases. Or a pallet of them and so on |
Thanks for the explanation, that makes sense. |
@sergio-teruel Have you seen remarks ? |
@sergio-teruel I agree with @rousseldenis. You are not taking a good way. Packaging modules are more powerful and not limited to 2 units of measure. Please take a look. |
5f8d93a
to
79276b5
Compare
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_product_secondary_unit_user,access_product_second_unit_user,model_product_secondary_unit,base.group_user,1,0,0,0 | ||
access_product_secondary_unit_user_stock,access_product_second_unit_user_stock,model_product_secondary_unit,stock.group_stock_user,1,1,1,0 | ||
access_product_secondary_unit_manager,access_product_second_unit_manager,model_product_secondary_unit,stock.group_stock_manager,1,1,1,1 |
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 depend on stock
or remove these permission lines.
I'm getting this error while trying to install the addon:
Exception: Module loading product_secondary_unit failed: file product_secondary_unit/security/ir.model.access.csv could not be processed:
No matching record found for external id 'stock.group_stock_user' in field 'Group'
No matching record found for external id 'stock.group_stock_manager' in field 'Group'
cc @Tecnativa Before reviewing, would you enter discussion about module utility and redundancy? |
79276b5
to
d625cea
Compare
Excuse me everybody... Hi, my first idea was use the packaging conversion modules but my collegue @pedrobaeza said to me that the core packaging module will be enterprise, so I decided use a new data model (product.secondary.unit). |
@sergio-teruel What @pedrobaeza certainly talked about is the 'product.ul' model removal. Which is completely different. This was the package where you put products inside (box, pallet, ...) for delivery. And reintroduced through @alexis-via PR OCA/stock-logistics-tracking#18 The model 'product.packaging' is still on v11 and master. This is the one used by 'packaging_uom'. Moreover, Odoo still uses it in master since commit odoo/odoo@da00534 Do you need more information about those ? |
@sergio-teruel For the unit categories conversion, the sale packaging and purchase packaging does what you need: Did it on runbot ! |
Sorry, but not, with packaging modules you can not sell in a secondary unit writing directly the second unit. |
Ok, but that's more a 'conversion factor helper' than a secondary unit. I understand your needs. There is a PR for barcodes management in packagings (that's used in real life) here OCA/stock-logistics-barcode#153 that can help to call the good one. Indeed that implies creating as many packagings as multiple units you have, but the process uses the standard uom model and can be called at any place. That's the advantage. Why not improving the existing one to fullfill your requirements (adding the shortcuts you have created or ...) ? |
Hi @rousseldenis , Let's introduce concept "Caliber / Size" which doesn't' have and relation with Packages.
Make the same example case with 3 legs. Kg are weight but the box is the same.
Furthermore, with this PR we know stock in the main unit (kg) plus the approximate number of legs (kg/caliber). What happens with Stock in packages. What do you think? Thanks |
@rafaelbn I will come with explanations and video but I've succeeded on runbot selling 10 pieces of 5kg. Delivering 60kg. On sale order, the delivered quantity is correct (12 x 5kg). The stock is managed by kg and the quantity is decreased by 60 x. Quants are ok.
You introduce a new model, so using existing one is better |
Hi @rousseldenis ,
Using existing one is better if we don't mix apples with oranges. The main thing here is requirement + this requirements are not for a single customer but a sector. We Tecnativa like to make thinkg simpe as possible and reuse always, we maintain version by version all modules. After two years working in Odoo using what Odoo and OCA have this is the time to improve what is missing. Please take in care that we haven''t (as @sergio-teruel said) just developed without testing the modules you said. There is a consider big amount hours of analysis before taking this decision and 2 years working in this sector. You proposal is used by us in other customers, of course we know to use conversion between units in the same category but it not the solution of this case. Absolutely in this case not. Our customer will introduce one sale.order line per second (usually nobody think on UX), just opening the pop-up and closing it plus finding fields will be 5 seconds. Note: and Odoo packaging modules are (sorry IMHO) awful! If we use Packages for conversion unit of different categories the we cannot use packaging for in the case real packaging (in the case).
Thanks you for your example! and time! ❤️ but what you did it's not correct for us and doesn't fit customer requirement because:
Think that the main unit is kg. always and everywhere AND a second unit of measure must be show in everywhere always, SO, Picking, Stock, Invoice, Accounting. The solution of course is not the simple functionality of creating unit for ALL the products with a ratio... 😄 (that should be easy!). Unit like 0.6-0.8, 1.5, 1.2-1.4, and hundred more.. Your proposal is from where we come. We work with Odoo packaging and some customs from v8, 3 years ago.. #377 (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.
I don't have too much time now to dig into.
I proposed a table at Louvain Sprint for logistics topics.
I think we could make converging efforts to develop a solution as strong as possible and fill in functional and UX gaps. Did you plan to work on such topics ?
I agree about the code sprint table.. |
Of course, this one is depending on product only ! But one rules them all 😄 |
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.
If you want to avoid product packaging complexity management with different uoms, take this one.
Code review and tested.
Please don't merge until @sergio-teruel notice us thanks @yajo #377 (review) is solved |
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
…y unit for a product (OCA#377)
cc @Tecnativa