diff options
| author | JordiMForgeFlow <jordi.masvidal@forgeflow.com> | 2021-05-19 13:08:39 +0000 |
|---|---|---|
| committer | JordiMForgeFlow <jordi.masvidal@forgeflow.com> | 2021-05-19 15:59:06 +0000 |
| commit | 387c7abd2b4e82ba6078b867cc36b2b865302f7b (patch) | |
| tree | 09e58b0a79dc03b57c04950b6015f0e90ff7f340 /odoo/sql_db.py | |
| parent | cfd2a39bece6a6fba379897183a767900c06d746 (diff) | |
[FIX] mrp: fix recursion error when updating quants for kit variant
When updating the quantities available for a product, an inventory move
is generated without setting the product_tmpl_id, as this field is related
to the product_id of the move. However, when creating the move, Odoo will
consider it a default missing value and will try to fill it in the method
default_get.
When navigating to the product variants of a template from the template form,
a default_product_tmpl_id is set in the context pointing to the template. This
context is propagated to the update quantity action to create/update quants for
the variant.
The problem when dealing with kits is that the products available to update
their quantities are the components of the kit. When navigating to a variant
and updating the quantities of a component of the kit variant, the default product
template in the context will be the kit template.
This is causing that, when generating the inventory move, the move is created with
product_id of the component, and product_tmpl_id of the kit template.
This issue creates a critical data inconsistency as the component's template is set
to the kit's template, which apart from making no sense generates a recursion error.
To fix this, when triggering the action to create/update quants for a kit product, it
must be ensured that no default product template is being set.
closes odoo/odoo#71055
X-original-commit: bdeea73dc1efb6ff7d02cc2f58347a69762bcc3c
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Diffstat (limited to 'odoo/sql_db.py')
0 files changed, 0 insertions, 0 deletions
