-
-
Notifications
You must be signed in to change notification settings - Fork 987
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
[9.0] [ADD] sale_order_variant_mgmt #343
[9.0] [ADD] sale_order_variant_mgmt #343
Conversation
=============================================== Handle easily multiple variants on Sales Orders =============================================== This module allows to add/modify of all the variants of a product in a direct screen without the need of handling them one by one Configuration ============= * Configure your user to have any permission from "Sales" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Sales > Sales > Quotations * Create a new quotation or edit an existing one. * Press "Add variants" button located in the upper right corner of the "Order Lines" tab. * A new screen will appear allowing you to select the products that have variants. * Once you select the product, a 2D matrix will appear with the first attribute values as columns and the second one as rows. * If there are already order lines for the product variants, the current quantity will be pre-filled in the matrix. * Change the quantities for the variant you want and click on "Transfer to order" * Order lines for the variants will be created/removed to comply with the input you have done. As extra feature for saving steps, there's also a button on each existing line that corresponds to a variant that opens the dialog directly with the product selected.
b0eb1af
to
82ec3fd
Compare
@hbrunn, this is the module where the 2D matrix widget is used. |
cc @Tecnativa |
120f99f
to
6ec67f9
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 in Runbot 👍
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.
On clicking the matrix button available in SO line, it produces a JS related error
Odoo Client Error
Uncaught TypeError: Cannot read property 'constructor' of undefined
http://3155469-343-6ec67f.runbot2.odoo-community.org/web/content/509-c58131e/web.assets_backend.js:3057
Traceback:
TypeError: Cannot read property 'constructor' of undefined
at wrap_context (http://3155469-343-6ec67f.runbot2.odoo-community.org/web/content/509-c58131e/web.assets_backend.js:3057:7)
at http://3155469-343-6ec67f.runbot2.odoo-community.org/web/content/509-c58131e/web.assets_backend.js:3061:127
at iterator (http://3155469-343-6ec67f.runbot2.odoo-community.org/web/content/506-0b1c7ad/web.assets_common.js:14:183)
at Function. (http://3155469-343-6ec67f.runbot2.odoo-community.org/web/content/506-0b1c7ad/web.assets_common.js:17:8)
at _.(anonymous function) as reduce
at eval_contexts (http://3155469-343-6ec67f.runbot2.odoo-community.org/web/content/509-c58131e/web.assets_backend.js:3059:136)
at http://3155469-343-6ec67f.runbot2.odoo-community.org/web/content/509-c58131e/web.assets_backend.js:3061:253
at iterator (http://3155469-343-6ec67f.runbot2.odoo-community.org/web/content/506-0b1c7ad/web.assets_common.js:14:183)
at Function. (http://3155469-343-6ec67f.runbot2.odoo-community.org/web/content/506-0b1c7ad/web.assets_common.js:17:8)
at _.(anonymous function) as reduce
at eval_contexts (http://3155469-343-6ec67f.runbot2.odoo-community.org/web/content/509-c58131e/web.assets_backend.js:3059:136)
@atchuthan, that's due to the related odoo bugs. Please see the README and the first comment in this PR. |
@pedrobaeza sorry, I missed the README and thanks for pointing out. |
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.
Looks very useful!
# This field is for avoiding conflicts with sale_stock module, that | ||
# adds product_tmpl_id, and its possible modifications. This field name | ||
# for sure won't conflict | ||
product_tmpl_id_sale_order_variant_mgmt = fields.Many2one( |
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.
Can you explain? The sale order line's product_tmpl_id is a related field on the line's product's template id, just like this one. Logic wise, it seems safe to assume the field is not customized further. What is the problem then with using this existing field?
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.
It's a long history: this field is used in product configurator modules that have a common abstract model using product_tmpl_id field as a regular field. sale_stock_screws up this, so I need to fix it through the glue module https://github.com/odoomrp/odoomrp-wip/tree/8.0/sale_stock_product_variants. I don't want to need another glue module, and as this is only a wildcard field, it doesn't matter the name.
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.
Thanks for the clarification!
WIP until OCA/web#427 is merged.There are 2 pendings PRs from Odoo to make this completely worked. See known issues section.
Handle easily multiple variants on Sales Orders
This module allows to add/modify of all the variants of a product in a direct
screen without the need of handling them one by one
Configuration
Usage
"Order Lines" tab.
variants.
attribute values as columns and the second one as rows.
quantity will be pre-filled in the matrix.
order"
input you have done.
As extra feature for saving steps, there's also a button on each existing line
that corresponds to a variant that opens the dialog directly with the product
selected.
Known issues / Roadmap
The inline button for modifying quantities for an existing line won't
work correctly until these 2 PRs are merged in Odoo:
The corresponding OCB versions are in: