@@ -175,25 +175,24 @@ def _generate_zm_download_lines(self):
175175 vat = zml .vat .replace (" " , "" ).replace ("-" , "" )
176176 if vat not in res :
177177 res [vat ] = {
178- "1_country" : vat [:2 ],
179- "2_vat" : vat [2 :],
180- "3_amount_products" : zml .amount_products ,
181- "4_amount_services" : zml .amount_services ,
178+ "1_vat" : vat ,
179+ "2_amount_products" : zml .amount_products ,
180+ "3_amount_services" : zml .amount_services ,
182181 }
183182 else :
184- res [vat ]["3_amount_products " ] += zml .amount_products
185- res [vat ]["4_amount_services " ] += zml .amount_services
183+ res [vat ]["2_amount_products " ] += zml .amount_products
184+ res [vat ]["3_amount_services " ] += zml .amount_services
186185 lines = [
187186 ["Laenderkennzeichen" , "USt-IdNr." , "Betrag(Euro)" , "Art der Leistung" ]
188187 ]
189188 for vat in res :
190189 v = res [vat ]
191- amount_products = self ._round_zm_amount (v ["3_amount_products " ])
190+ amount_products = self ._round_zm_amount (v ["2_amount_products " ])
192191 if amount_products :
193- lines .append ([v ["1_country" ], v [ "2_vat " ], amount_products , "L" ])
194- amount_services = self ._round_zm_amount (v ["4_amount_services " ])
192+ lines .append ([v ["1_vat " ], amount_products , "L" ])
193+ amount_services = self ._round_zm_amount (v ["3_amount_services " ])
195194 if amount_services :
196- lines .append ([v ["1_country" ], v [ "2_vat " ], amount_services , "S" ])
195+ lines .append ([v ["1_vat " ], amount_services , "S" ])
197196 return lines
198197
199198 def zm_download (self ):
@@ -204,7 +203,7 @@ def zm_download(self):
204203 "," .join (str (i ) for i in line )
205204 for line in self ._generate_zm_download_lines ()
206205 )
207- zm_download_base64 = base64 .b64encode (zm_download .encode ("iso-8859-15" ))
206+ zm_download_base64 = base64 .b64encode (zm_download .encode ())
208207 attachment_id = self .env ["ir.attachment" ].create (
209208 {
210209 "name" : "{}.csv" .format (self .name ),
0 commit comments