File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -26,18 +26,25 @@ class ProductProduct(models.Model):
26
26
27
27
@api .multi
28
28
def _compute_available_quantities_dict (self ):
29
+ stock_dict = self ._compute_quantities_dict (
30
+ self ._context .get ('lot_id' ),
31
+ self ._context .get ('owner_id' ),
32
+ self ._context .get ('package_id' ),
33
+ self ._context .get ('from_date' ),
34
+ self ._context .get ('to_date' ))
29
35
res = {}
30
36
for product in self :
31
37
res [product .id ] = {
32
- 'immediately_usable_qty' : product .virtual_available ,
38
+ 'immediately_usable_qty' : stock_dict [product .id ][
39
+ 'virtual_available' ],
33
40
'potential_qty' : 0.0
34
41
}
35
- return res
42
+ return res , stock_dict
36
43
37
44
@api .multi
38
45
@api .depends ('virtual_available' )
39
46
def _compute_available_quantities (self ):
40
- res = self ._compute_available_quantities_dict ()
47
+ res , _ = self ._compute_available_quantities_dict ()
41
48
for product in self :
42
49
for key , value in res [product .id ].items ():
43
50
if hasattr (product , key ):
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def _compute_available_quantities(self):
31
31
32
32
@api .multi
33
33
def _compute_available_quantities_dict (self ):
34
- variants_dict = self .mapped (
34
+ variants_dict , _ = self .mapped (
35
35
'product_variant_ids' )._compute_available_quantities_dict ()
36
36
res = {}
37
37
for template in self :
You can’t perform that action at this time.
0 commit comments