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
[FIX][web] Stop recursively adding contexts. #13635
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some lines below this patch, there is this: if (action.context) { c.add(action.context); } action.context = c; Since the `action` variable was coming by reference, this means that each time you press a button, it added its context to itself, making that after pressing too many times the same button, recursiveness turned the system slow. Also, a bigger side effect of this is that if you had a one2many tree view with a button on it that had a context like `{'default_other': some_field}`, the context was not being updated when you clicked on a different row. With this patch, further modifications on the action are made on a copy, so no recursion happens and the original action is kept intact.
This was referenced Sep 29, 2016
You can exercise the problem in this PR: OCA/sale-workflow#343 |
pedrobaeza
approved these changes
Sep 29, 2016
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.
Working now with the patch
pedrobaeza
added a commit
to Tecnativa/purchase-workflow
that referenced
this pull request
Oct 15, 2016
================================================== Handle easily multiple variants on Purchase Orders ================================================== This module allows to add/modify 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 "Purchases" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Purchases > Purchase > Requests for Quotation * 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. 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: * odoo/odoo#13558 * odoo/odoo#13635 The problems are already fixed in OCB.
pedrobaeza
added a commit
to Tecnativa/purchase-workflow
that referenced
this pull request
Oct 15, 2016
================================================== Handle easily multiple variants on Purchase Orders ================================================== This module allows to add/modify 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 "Purchases" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Purchases > Purchase > Requests for Quotation * 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. 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: * odoo/odoo#13558 * odoo/odoo#13635 The problems are already fixed in OCB.
pedrobaeza
added a commit
to OCA/purchase-workflow
that referenced
this pull request
Nov 24, 2016
================================================== Handle easily multiple variants on Purchase Orders ================================================== This module allows to add/modify 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 "Purchases" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Purchases > Purchase > Requests for Quotation * 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. 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: * odoo/odoo#13558 * odoo/odoo#13635 The problems are already fixed in OCB.
Any maybe check this one also, @ged-odoo? |
pedrobaeza
added a commit
to Tecnativa/product-variant
that referenced
this pull request
Jan 7, 2017
================================================= Handle easily multiple variants on Stock Pickings ================================================= 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. It also adds a convenient way of handling the transfer of the products in a 2D matrix with all the values of the first attribute in columns, and the rest of the combinations in rows. Configuration ============= * Configure your user to have any permission from "Inventory" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Inventory > Dashboard. * Create a new picking from one of the existing picking types. * Press "Add variants" button located in the upper right corner of the "Initial Demand" 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 (if any) 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 picking" * Move 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. You are also able to manage variants on 1 dimension in the transfer: * Go to the "Operations" page. * Press on "Manage Variants Transfer" button in the upper right corner of the tab. * Change the quantities to transfer. * Click on "Transfer to picking" button. 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: * odoo/odoo#13557 * odoo/odoo#13635 The patches are already integrated on OCB. * Make this work with product with more than 1 attribute.
pedrobaeza
added a commit
to Tecnativa/product-variant
that referenced
this pull request
Jan 8, 2017
================================================= Handle easily multiple variants on Stock Pickings ================================================= 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. It also adds a convenient way of handling the transfer of the products in a 2D matrix with all the values of the first attribute in columns, and the rest of the combinations in rows. Configuration ============= * Configure your user to have any permission from "Inventory" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Inventory > Dashboard. * Create a new picking from one of the existing picking types. * Press "Add variants" button located in the upper right corner of the "Initial Demand" 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 (if any) 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 picking" * Move 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. You are also able to manage variants on 1 dimension in the transfer: * Go to the "Operations" page. * Press on "Manage Variants Transfer" button in the upper right corner of the tab. * Change the quantities to transfer. * Click on "Transfer to picking" button. 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: * odoo/odoo#13557 * odoo/odoo#13635 The patches are already integrated on OCB. * Make this work with product with more than 1 attribute.
pedrobaeza
added a commit
to Tecnativa/product-variant
that referenced
this pull request
Jan 8, 2017
================================================= Handle easily multiple variants on Stock Pickings ================================================= 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. It also adds a convenient way of handling the transfer of the products in a 2D matrix with all the values of the first attribute in columns, and the rest of the combinations in rows. Configuration ============= * Configure your user to have any permission from "Inventory" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Inventory > Dashboard. * Create a new picking from one of the existing picking types. * Press "Add variants" button located in the upper right corner of the "Initial Demand" 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 (if any) 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 picking" * Move 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. You are also able to manage variants on 1 dimension in the transfer: * Go to the "Operations" page. * Press on "Manage Variants Transfer" button in the upper right corner of the tab. * Change the quantities to transfer. * Click on "Transfer to picking" button. 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: * odoo/odoo#13557 * odoo/odoo#13635 The patches are already integrated on OCB. * Make this work with product with more than 1 attribute.
pedrobaeza
added a commit
to Tecnativa/product-variant
that referenced
this pull request
Jan 8, 2017
================================================= Handle easily multiple variants on Stock Pickings ================================================= 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. It also adds a convenient way of handling the transfer of the products in a 2D matrix with all the values of the first attribute in columns, and the rest of the combinations in rows. Configuration ============= * Configure your user to have any permission from "Inventory" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Inventory > Dashboard. * Create a new picking from one of the existing picking types. * Press "Add variants" button located in the upper right corner of the "Initial Demand" 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 (if any) 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 picking" * Move 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. You are also able to manage variants on 1 dimension in the transfer: * Go to the "Operations" page. * Press on "Manage Variants Transfer" button in the upper right corner of the tab. * Change the quantities to transfer. * Click on "Transfer to picking" button. 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: * odoo/odoo#13557 * odoo/odoo#13635 The patches are already integrated on OCB. * Make this work with product with more than 1 attribute.
pedrobaeza
added a commit
to OCA/product-variant
that referenced
this pull request
Mar 23, 2017
================================================= Handle easily multiple variants on Stock Pickings ================================================= 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. It also adds a convenient way of handling the transfer of the products in a 2D matrix with all the values of the first attribute in columns, and the rest of the combinations in rows. Configuration ============= * Configure your user to have any permission from "Inventory" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Inventory > Dashboard. * Create a new picking from one of the existing picking types. * Press "Add variants" button located in the upper right corner of the "Initial Demand" 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 (if any) 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 picking" * Move 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. You are also able to manage variants on 1 dimension in the transfer: * Go to the "Operations" page. * Press on "Manage Variants Transfer" button in the upper right corner of the tab. * Change the quantities to transfer. * Click on "Transfer to picking" button. 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: * odoo/odoo#13557 * odoo/odoo#13635 The patches are already integrated on OCB. * Make this work with product with more than 1 attribute.
@ged-odoo and this one too 👼 |
chienandalu
approved these changes
Apr 26, 2017
pedrobaeza
added a commit
to Tecnativa/product-variant
that referenced
this pull request
Oct 27, 2017
================================================== Handle easily multiple variants on Purchase Orders ================================================== This module allows to add/modify 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 "Purchases" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Purchases > Purchase > Requests for Quotation * 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. 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: * odoo/odoo#13558 * odoo/odoo#13635 The problems are already fixed in OCB.
pedrobaeza
added a commit
to Tecnativa/product-variant
that referenced
this pull request
Oct 27, 2017
================================================= Handle easily multiple variants on Stock Pickings ================================================= 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. It also adds a convenient way of handling the transfer of the products in a 2D matrix with all the values of the first attribute in columns, and the rest of the combinations in rows. Configuration ============= * Configure your user to have any permission from "Inventory" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Inventory > Dashboard. * Create a new picking from one of the existing picking types. * Press "Add variants" button located in the upper right corner of the "Initial Demand" 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 (if any) 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 picking" * Move 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. You are also able to manage variants on 1 dimension in the transfer: * Go to the "Operations" page. * Press on "Manage Variants Transfer" button in the upper right corner of the tab. * Change the quantities to transfer. * Click on "Transfer to picking" button. 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: * odoo/odoo#13557 * odoo/odoo#13635 The patches are already integrated on OCB. * Make this work with product with more than 1 attribute.
Closing as this won't be merged on this version as it's EOL. |
javierjcf
pushed a commit
to Comunitea/product-variant
that referenced
this pull request
Oct 11, 2018
================================================== Handle easily multiple variants on Purchase Orders ================================================== This module allows to add/modify 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 "Purchases" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Purchases > Purchase > Requests for Quotation * 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. 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: * odoo/odoo#13558 * odoo/odoo#13635 The problems are already fixed in OCB.
grindtildeath
pushed a commit
to grindtildeath/product-variant
that referenced
this pull request
Jul 29, 2019
================================================== Handle easily multiple variants on Purchase Orders ================================================== This module allows to add/modify 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 "Purchases" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Purchases > Purchase > Requests for Quotation * 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. 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: * odoo/odoo#13558 * odoo/odoo#13635 The problems are already fixed in OCB.
sonhd91
pushed a commit
to sonhd91/product-variant
that referenced
this pull request
Dec 28, 2021
================================================== Handle easily multiple variants on Purchase Orders ================================================== This module allows to add/modify 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 "Purchases" group. * Create a product with 2 attributes and several values. Usage ===== * Go to Purchases > Purchase > Requests for Quotation * 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. 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: * odoo/odoo#13558 * odoo/odoo#13635 The problems are already fixed in OCB.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Current behavior before PR:
Some lines below this patch, there is this:
Since the
action
variable was coming by reference, this means that each time you press a button, it added its context to itself, making that after pressing too many times the same button, recursiveness turned the system slow.Also, a bigger side effect of this is that if you had a one2many tree view with a button on it that had a context like
{'default_other': some_field}
, the context was not being updated when you clicked on a different row.Desired behavior after PR is merged:
With this patch, further modifications on the action are made on a copy, so no recursion happens and the original action is kept intact.
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
@Tecnativa