[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:
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user