diff --git a/product/ERP5/mixin/amount_generator.py b/product/ERP5/mixin/amount_generator.py
index b342d7be57358698f7f2c41d34c191b5b4e26a85..fe113164cbd28105587024d3681770d03ab716e1 100644
--- a/product/ERP5/mixin/amount_generator.py
+++ b/product/ERP5/mixin/amount_generator.py
@@ -290,7 +290,7 @@ class AmountGeneratorMixin:
         if not quantity:
           continue
         # Backward compatibility
-        if getattr(aq_base(self), 'create_line', None) == 0:
+        if getattr(self.aq_base, 'create_line', None) == 0:
           property_dict['resource'] = None
         # Create an Amount object
         amount = newTempAmount(portal,