Commit 0fd21302 authored by Florian Duguet's avatar Florian Duguet Committed by Romain Bignon

[amazon] fix download_document

remove download_document_pdf since document are already in pdf
return documents list ordered from more recent to older one
parent 9a061ea3
......@@ -181,11 +181,12 @@ class AmazonBrowser(LoginBrowser, StatesMixin):
def iter_documents(self, subscription):
documents = []
for y in range( - 2, + 1):
year =
old_year = year - 2
while year >= old_year:
request_id =['x-amz-rid']
for doc in, currency=self.CURRENCY, request_id=request_id):
return documents
yield doc
year -= 1
......@@ -24,7 +24,6 @@ from weboob.capabilities.bill import DocumentTypes, CapDocument, Subscription, D
from weboob.capabilities.base import find_object, NotAvailable
from import Module, BackendConfig
from import ValueBackendPassword, Value
from import html_to_pdf
from .browser import AmazonBrowser
from .en.browser import AmazonEnBrowser
......@@ -94,11 +93,3 @@ class AmazonModule(Module, CapDocument):
def download_document_pdf(self, document):
if not isinstance(document, Document):
document = self.get_document(document)
if document.url is NotAvailable:
return html_to_pdf(self.browser, url=self.browser.BASEURL + document.url)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment