trytond: do not search for deleted records in history table (issue250003)

1 view
Skip to first unread message

nicolas...@b2ck.com

unread,
Feb 21, 2012, 10:23:50 AM2/21/12
to nicolas...@b2ck.com, re...@tryton-rietveld.appspotmail.com, tryto...@googlegroups.com
Reviewers: ,

Please review this at http://codereview.tryton.org/250003/

Affected files:
M trytond/model/modelsql.py


Index: trytond/model/modelsql.py
===================================================================

--- a/trytond/model/modelsql.py
+++ b/trytond/model/modelsql.py
@@ -1197,6 +1197,9 @@
and not query_string:
select_fields += ['COALESCE("' + self._table
+ '".write_date, "' + \
self._table + '".create_date) AS _datetime']
+ qu1 += (' AND "%s".id NOT IN '
+ '(SELECT id from %s__history where create_date IS NULL '
+ ' AND write_date IS NOT NULL)') % (self._table,
self._table)
if not query_string:
select_fields += [
'"' + self._table + '"."' + name + '" AS "' + name
+ '"' \

Reply all
Reply to author
Forward
0 new messages