From 9eece68233eb896ac71b83674a73a70804a30586 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Wed, 9 Mar 2022 16:49:29 +0100 Subject: [PATCH] Use transaction date as origin date when value date is empty issue11292 review366831002 (grafted from 3e51b8608797844e8fc318ceac7ae5440cd0b7fc) --HG-- branch : 6.0 --- statement.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/statement.py b/statement.py index 9cfa52e3bf..f548407204 100644 --- a/statement.py +++ b/statement.py @@ -77,7 +77,10 @@ class ImportStatement(metaclass=PoolMeta): pool = Pool() Origin = pool.get('account.statement.origin') origin = Origin() - origin.date = transaction.valueDate + try: + origin.date = transaction.valueDate + except ValueError: + origin.date = transaction.transactionDate origin.amount = transaction.amount descriptions = [] for item in transaction.optionalItems: