]> git.ipfire.org Git - thirdparty/python-drafthorse.git/commitdiff
Fix bugs in generation
authorRaphael Michel <mail@raphaelmichel.de>
Thu, 25 Oct 2018 21:49:12 +0000 (23:49 +0200)
committerRaphael Michel <mail@raphaelmichel.de>
Thu, 25 Oct 2018 21:49:12 +0000 (23:49 +0200)
drafthorse/models/fields.py
drafthorse/models/trade.py

index 1065b3bd3d301ca7c326b7fa8f5d68cce4167843..d558370fea15003f0d5723ba346c529ccb94b3e8 100644 (file)
@@ -136,7 +136,7 @@ class QuantityField(Field):
 
         if not isinstance(value, (tuple, list)):
             raise TypeError("Please pass a 2-tuple of including amount and unit code.")
-        instance._data[self.name].value = value[0]
+        instance._data[self.name].amount = value[0]
         instance._data[self.name].unit_code = value[1]
 
     def initialize(self):
@@ -156,7 +156,7 @@ class CurrencyField(Field):
 
         if not isinstance(value, (tuple, list)):
             raise TypeError("Please pass a 2-tuple of including amount and currency.")
-        instance._data[self.name].value = value[0]
+        instance._data[self.name].amount = value[0]
         instance._data[self.name].currency = value[1]
 
     def initialize(self):
index 5a420daf14ebc29561a1af21b159b27ffc272b73..892d58bced7a94c8ffa269c5a5131735fe183099 100644 (file)
@@ -68,8 +68,8 @@ class TradeSettlement(Element):
                                   _d="Schalter für Zu-/Abschlag")
     service_charge = MultiField(LogisticsServiceCharge, required=False, profile=COMFORT)
     terms = MultiField(PaymentTerms, required=False, profile=COMFORT)
-    money_summation = Field(MonetarySummation, required=True, profile=BASIC,
-                            _d="Detailinformation zu Belegsummen")
+    monetary_summation = Field(MonetarySummation, required=True, profile=BASIC,
+                               _d="Detailinformation zu Belegsummen")
     accounting_account = Field(ReceivableAccountingAccount, required=False, profile=EXTENDED,
                                _d="Detailinformationen zur Buchungsreferenz")