[FIX] stock: qty on hand display 0 qty product

Related to b08e3d114a

Since the related commit, when a product has no available quantity, the
button "Update Quantity" and the stat button "Qty. On Hand" doesn't work
properly: the view doesn't find the default product(s) and doesn't adapt
the fields according to the product (for instance: serial/lot number).
To fix that, we need to take also all active product variants of the
template, even they have no available quantity.

task-2217907
This commit is contained in:
svs-odoo
2020-03-19 08:01:30 +00:00
parent bbd4391c15
commit 51d43c0cd4
+1 -1
View File
@@ -706,7 +706,7 @@ class ProductTemplate(models.Model):
# Be aware that the exact same function exists in product.product
def action_open_quants(self):
return self.with_context(active_test=False).product_variant_ids.filtered(lambda p: p.qty_available != 0).action_open_quants()
return self.with_context(active_test=False).product_variant_ids.filtered(lambda p: p.active or p.qty_available != 0).action_open_quants()
def action_update_quantity_on_hand(self):
advanced_option_groups = [