From d379179d93abe923908d773621d0c7bd1b2b0a7e Mon Sep 17 00:00:00 2001 From: Thibault Douge Date: Wed, 7 Apr 2021 11:44:53 +0200 Subject: [PATCH] [trainline] change the condition to get invoices - ignore duplicate because sometimes we have duplicate when ouigo is the seller --- modules/trainline/pages.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/trainline/pages.py b/modules/trainline/pages.py index 633bf61d24..a3879baf04 100644 --- a/modules/trainline/pages.py +++ b/modules/trainline/pages.py @@ -41,12 +41,14 @@ class DocumentsPage(LoggedPage, JsonPage): @method class iter_documents(DictElement): item_xpath = 'pastBookings/results' + # when the seller is ouigo we have duplicate data + ignore_duplicate = True class item(ItemElement): klass = Bill def condition(self): - return 'Paid' in Dict('order/payment/paymentState')(self) + return 'COMPLETE' in Dict('order/state')(self) obj_id = Format('%s_%s', Env('subid'), CleanText(Dict('order/id'))) obj_number = CleanText(Dict('order/friendlyOrderId')) -- GitLab