Selaa lähdekoodia

Pass child to availability_policy instead of parent because it has all the data

master
Lars van de Kerkhof 6 vuotta sitten
vanhempi
commit
2e80068166
2 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 3
    0
      docs/source/releases/v2.1.rst
  2. 1
    1
      src/oscar/apps/partner/strategy.py

+ 3
- 0
docs/source/releases/v2.1.rst Näytä tiedosto

@@ -42,6 +42,9 @@ Minor changes
42 42
   an order (instead of raising an exception), for consistency with how
43 43
   the basket flows handle inactive vouchers.
44 44
 
45
+- Fixed the logic of ``StockRequired.parent_availability_policy`` to use
46
+  child products to determine availability of children, rather than the parent.
47
+
45 48
 
46 49
 Dependency changes
47 50
 ~~~~~~~~~~~~~~~~~~

+ 1
- 1
src/oscar/apps/partner/strategy.py Näytä tiedosto

@@ -220,7 +220,7 @@ class StockRequired(object):
220 220
     def parent_availability_policy(self, product, children_stock):
221 221
         # A parent product is available if one of its children is
222 222
         for child, stockrecord in children_stock:
223
-            policy = self.availability_policy(product, stockrecord)
223
+            policy = self.availability_policy(child, stockrecord)
224 224
             if policy.is_available_to_buy:
225 225
                 return Available()
226 226
         return Unavailable()

Loading…
Peruuta
Tallenna