From 923ac55625fab8a1400b7bd35e721937c9d9b9c0 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Thu, 12 Apr 2018 14:11:39 +0200 Subject: [PATCH] Add issue7334.diff - read history that created_date is before the requested create_date --- issue7334.diff | 21 +++++++++++++++++++++ series | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 issue7334.diff diff --git a/issue7334.diff b/issue7334.diff new file mode 100644 index 0000000..62d6990 --- /dev/null +++ b/issue7334.diff @@ -0,0 +1,21 @@ +diff -r 6d7a5b7b018a trytond/trytond/model/modelsql.py +--- a/trytond/trytond/model/modelsql.py Thu Apr 12 13:56:38 2018 +0200 ++++ b/trytond/trytond/model/modelsql.py Thu Apr 12 14:02:33 2018 +0200 +@@ -708,7 +708,16 @@ + rowcount = len(cursor.fetchall()) + if rowcount == len({}.fromkeys(sub_ids)): + cls.raise_user_error('access_error', cls.__name__) +- cls.raise_user_error('read_error', cls.__name__) ++ if cls._history: ++ where = red_sql ++ if domain: ++ where &= dom_exp ++ query = from_.select(*columns, where=where, order_by=history_order, limit=history_limit) ++ cursor.execute(*from_.select(*columns, where=where, ++ order_by=history_order, limit=history_limit)) ++ fetchall = list(cursor_dict(cursor)) ++ else: ++ cls.raise_user_error('read_error', cls.__name__) + result.extend(fetchall) + else: + result = [{'id': x} for x in ids] diff --git a/series b/series index 1ce343d..1567575 100644 --- a/series +++ b/series @@ -76,3 +76,5 @@ issue7012.diff # [stock_consignment] Allow to create internal order points to pr issue7129.diff # [account_payment] Slow to list Lines to Pay issue4958.diff # [account_payment] Remove account kind filter on Payable/Receivable lines filestore.diff # [trytond] changeset-06e955c4465e + changeset-a8d3c527a445 + +#issue7334.diff # [trytond] read history that created_date is before the requested create_date