diff options
| author | Anh Thao Pham (pta) <pta@odoo.com> | 2020-12-09 10:47:12 +0000 |
|---|---|---|
| committer | Anh Thao Pham (pta) <pta@odoo.com> | 2020-12-11 17:29:32 +0000 |
| commit | 3fc7e9918f6e31f44d601669713e7c6866a2a7e0 (patch) | |
| tree | 193ac48270d5f385eea7359995eca22a02049806 | |
| parent | 0f9411d10753aa96103ce77702dbdc0516e9969a (diff) | |
[FIX] stock: fix update quantity action on Product Variant
- Install stock
- Create a Storable Product
- Add an Attribute with Variant Creation Mode set to Instantly (i.e. Color)
- On Product form, click on Variant smart button and open a Product Variant
- Click on "Update Quantity"
The Create button to edit Quantity on Hand is not present.
This comes from the Variant smart button (id: product_variant_action) that adds
'create': False in the context to prevent creation of Variant.
But when navigating to Update Quantity page, it is still in the context and hides
the Create button.
opw-2412380
closes odoo/odoo#63264
X-original-commit: 3d671ef824fec9dc8ee7d3666b6e528a3c794226
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
| -rw-r--r-- | addons/stock/models/product.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index dea79417884..a331968cbc0 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -493,7 +493,7 @@ class Product(models.Model): return action def action_update_quantity_on_hand(self): - return self.product_tmpl_id.with_context(default_product_id=self.id).action_update_quantity_on_hand() + return self.product_tmpl_id.with_context(default_product_id=self.id, create=True).action_update_quantity_on_hand() def action_product_forecast_report(self): self.ensure_one() |
