Hello community, here is the log from the commit of package trytond for openSUSE:Factory checked in at 2020-11-12 22:45:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/trytond (Old) and /work/SRC/openSUSE:Factory/.trytond.new.24930 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "trytond" Thu Nov 12 22:45:46 2020 rev:50 rq:847928 version:5.0.29 Changes: -------- --- /work/SRC/openSUSE:Factory/trytond/trytond.changes 2020-10-21 14:39:08.605631066 +0200 +++ /work/SRC/openSUSE:Factory/.trytond.new.24930/trytond.changes 2020-11-12 22:45:48.938544140 +0100 @@ -1,0 +2,5 @@ +Wed Nov 11 18:11:15 UTC 2020 - Axel Braun <axel.br...@gmx.de> + +- Version 5.0.29 - Bugfix Release + +------------------------------------------------------------------- Old: ---- trytond-5.0.28.tar.gz New: ---- trytond-5.0.29.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ trytond.spec ++++++ --- /var/tmp/diff_new_pack.Ttbt4W/_old 2020-11-12 22:45:49.758544995 +0100 +++ /var/tmp/diff_new_pack.Ttbt4W/_new 2020-11-12 22:45:49.766545004 +0100 @@ -20,7 +20,7 @@ %define majorver 5.0 %define base_name tryton Name: trytond -Version: %{majorver}.28 +Version: %{majorver}.29 Release: 0 Summary: An Enterprise Resource Planning (ERP) system License: GPL-3.0-or-later ++++++ trytond-5.0.28.tar.gz -> trytond-5.0.29.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/.hgtags new/trytond-5.0.29/.hgtags --- old/trytond-5.0.28/.hgtags 2020-10-18 20:28:16.000000000 +0200 +++ new/trytond-5.0.29/.hgtags 2020-11-11 15:52:13.000000000 +0100 @@ -47,3 +47,4 @@ 4bbcff28555d6da5e95020d4f9c837995c715501 5.0.26 b945fb11b072406345e2dc7d50d6ac858e1fc203 5.0.27 98a6cfc5d5c70fad5c3e7b089bc5f233d1786f66 5.0.28 +371b309731c3b9d3ba84622a652fecd27539f9dd 5.0.29 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/CHANGELOG new/trytond-5.0.29/CHANGELOG --- old/trytond-5.0.28/CHANGELOG 2020-10-18 20:28:16.000000000 +0200 +++ new/trytond-5.0.29/CHANGELOG 2020-11-11 15:52:12.000000000 +0100 @@ -1,3 +1,6 @@ +Version 5.0.29 - 2020-11-11 +* Bug fixes (see mercurial logs for details) + Version 5.0.28 - 2020-10-18 * Bug fixes (see mercurial logs for details) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/PKG-INFO new/trytond-5.0.29/PKG-INFO --- old/trytond-5.0.28/PKG-INFO 2020-10-18 20:28:18.000000000 +0200 +++ new/trytond-5.0.29/PKG-INFO 2020-11-11 15:52:15.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: trytond -Version: 5.0.28 +Version: 5.0.29 Summary: Tryton server Home-page: http://www.tryton.org/ Author: Tryton diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/trytond/__init__.py new/trytond-5.0.29/trytond/__init__.py --- old/trytond-5.0.28/trytond/__init__.py 2020-10-03 00:31:01.000000000 +0200 +++ new/trytond-5.0.29/trytond/__init__.py 2020-10-18 20:28:32.000000000 +0200 @@ -5,7 +5,7 @@ import warnings from email import charset -__version__ = "5.0.28" +__version__ = "5.0.29" os.environ['TZ'] = 'UTC' if hasattr(time, 'tzset'): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/trytond/ir/configuration.py new/trytond-5.0.29/trytond/ir/configuration.py --- old/trytond-5.0.28/trytond/ir/configuration.py 2019-08-11 19:34:43.000000000 +0200 +++ new/trytond-5.0.29/trytond/ir/configuration.py 2020-10-24 00:01:13.000000000 +0200 @@ -29,3 +29,19 @@ language = config.get('database', 'language') cls._get_language_cache.set(None, language) return language + + @classmethod + def create(cls, vlist): + records = super().create(vlist) + cls._get_language_cache.clear() + return records + + @classmethod + def write(cls, *args): + super().write(*args) + cls._get_language_cache.clear() + + @classmethod + def delete(cls, records): + super().delete(records) + cls._get_language_cache.clear() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/trytond/model/fields/field.py new/trytond-5.0.29/trytond/model/fields/field.py --- old/trytond-5.0.28/trytond/model/fields/field.py 2019-08-11 19:34:43.000000000 +0200 +++ new/trytond-5.0.29/trytond/model/fields/field.py 2020-10-30 19:56:48.000000000 +0100 @@ -86,7 +86,10 @@ if field.startswith('_parent_'): field = field[8:] # Strip '_parent_' if not hasattr(record, field): - setattr(record, field, None) + default = None + if hasattr(record, '_defaults') and field in record._defaults: + default = record._defaults[field]() + setattr(record, field, default) elif nested: parent = getattr(record, field) if parent: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/trytond/model/tree.py new/trytond-5.0.29/trytond/model/tree.py --- old/trytond-5.0.28/trytond/model/tree.py 2019-08-11 19:34:43.000000000 +0200 +++ new/trytond-5.0.29/trytond/model/tree.py 2020-10-30 19:56:48.000000000 +0100 @@ -30,38 +30,41 @@ @classmethod def search_rec_name(cls, _, clause): + domain = [] if isinstance(clause[2], str): + field = name values = list(reversed(clause[2].split(separator))) + for value in values: + domain.append((field, clause[1], value.strip())) + field = parent + '.' + field + if (( + clause[1].endswith('like') + and not clause[2].replace( + '%%', '__').startswith('%')) + or not clause[1].endswith('like')): + if clause[1].startswith('not') or clause[1] == '!=': + operator = '!=' + domain.insert(0, 'OR') + else: + operator = '=' + top_parent = '.'.join((parent,) * len(values)) + domain.append((top_parent, operator, None)) + if (clause[1].endswith('like') + and clause[2].replace('%%', '__').endswith('%')): + ids = list(map(int, cls.search(domain, order=[]))) + domain = [(parent, 'child_of', ids)] + elif clause[2] is None: + domain.append((name, clause[1], clause[2])) else: - values = [[]] - for value in clause[2]: - if value is None: - values[0].append(value) - continue - for i, v in range(reversed(value.split(separator))): - while len(values) <= i: - values.append([]) - values[i].append(v) - domain = [] - field = name - for value in values: - domain.append((field, clause[1], value.strip())) - field = parent + '.' + field - if ((clause[1].endswith('like') - and not clause[2].replace( - '%%', '__').startswith('%')) - or not clause[1].endswith('like')): - if clause[1].startswith('not') or clause[1] == '!=': + if clause[1].startswith('not'): operator = '!=' - domain.insert(0, 'OR') + domain.append('AND') else: operator = '=' - top_parent = '.'.join((parent,) * len(values)) - domain.append((top_parent, operator, None)) - if (clause[1].endswith('like') - and clause[2].replace('%%', '__').endswith('%')): - ids = list(map(int, cls.search(domain, order=[]))) - domain = [(parent, 'child_of', ids)] + domain.append('OR') + for value in clause[2]: + domain.append(cls.search_rec_name( + name, (clause[0], operator, value))) return domain @classmethod diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/trytond/pyson.py new/trytond-5.0.29/trytond/pyson.py --- old/trytond-5.0.28/trytond/pyson.py 2019-08-11 19:34:43.000000000 +0200 +++ new/trytond-5.0.29/trytond/pyson.py 2020-10-30 19:56:48.000000000 +0100 @@ -610,7 +610,7 @@ @staticmethod def eval(dct, context): - return datetime.datetime.now() + relativedelta( + return datetime.datetime.utcnow() + relativedelta( year=dct['y'], month=dct['M'], day=dct['d'], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/trytond/res/routes.py new/trytond-5.0.29/trytond/res/routes.py --- old/trytond-5.0.28/trytond/res/routes.py 2019-04-16 22:23:29.000000000 +0200 +++ new/trytond-5.0.29/trytond/res/routes.py 2020-10-30 19:56:48.000000000 +0100 @@ -51,7 +51,7 @@ return key elif request.method == 'DELETE': count = LoginAttempt.count(login) - if count > config.get('session', 'max_attempt', default=5): + if count > config.getint('session', 'max_attempt', default=5): LoginAttempt.add(login) abort(429) Transaction().atexit(time.sleep, 2 ** count - 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/trytond/tests/test_tree.py new/trytond-5.0.29/trytond/tests/test_tree.py --- old/trytond-5.0.28/trytond/tests/test_tree.py 2019-08-11 19:34:43.000000000 +0200 +++ new/trytond-5.0.29/trytond/tests/test_tree.py 2020-10-30 19:56:48.000000000 +0100 @@ -70,6 +70,21 @@ self.assertEqual(records, [parent]) @with_transaction() + def test_search_rec_name_equals_none(self): + "Test search_rec_name equals" + pool = Pool() + Tree = pool.get('test.tree') + + parent = Tree(name="parent") + parent.save() + record = Tree(name="record", parent=parent) + record.save() + + records = Tree.search([('rec_name', '=', None)]) + + self.assertEqual(records, []) + + @with_transaction() def test_search_rec_name_non_equals(self): "Test search_rec_name non equals" pool = Pool() @@ -100,6 +115,51 @@ self.assertEqual(records, [record]) @with_transaction() + def test_search_rec_name_non_equals_none(self): + "Test search_rec_name equals" + pool = Pool() + Tree = pool.get('test.tree') + + parent = Tree(name="parent") + parent.save() + record = Tree(name="record", parent=parent) + record.save() + + records = Tree.search([('rec_name', '!=', None)]) + + self.assertEqual(records, [parent, record]) + + @with_transaction() + def test_search_rec_name_in(self): + "Test search_rec_name in" + pool = Pool() + Tree = pool.get('test.tree') + + parent = Tree(name="parent") + parent.save() + record = Tree(name="record", parent=parent) + record.save() + + records = Tree.search([('rec_name', 'in', ['parent / record'])]) + + self.assertEqual(records, [record]) + + @with_transaction() + def test_search_rec_name_in_toplevel(self): + "Test search_rec_name in top-level" + pool = Pool() + Tree = pool.get('test.tree') + + parent = Tree(name="parent") + parent.save() + record = Tree(name="record", parent=parent) + record.save() + + records = Tree.search([('rec_name', 'in', ['parent'])]) + + self.assertEqual(records, [parent]) + + @with_transaction() def test_search_rec_name_like(self): "Test search_rec_name like" pool = Pool() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-5.0.28/trytond.egg-info/PKG-INFO new/trytond-5.0.29/trytond.egg-info/PKG-INFO --- old/trytond-5.0.28/trytond.egg-info/PKG-INFO 2020-10-18 20:28:17.000000000 +0200 +++ new/trytond-5.0.29/trytond.egg-info/PKG-INFO 2020-11-11 15:52:14.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: trytond -Version: 5.0.28 +Version: 5.0.29 Summary: Tryton server Home-page: http://www.tryton.org/ Author: Tryton _______________________________________________ openSUSE Commits mailing list -- commit@lists.opensuse.org To unsubscribe, email commit-le...@lists.opensuse.org List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/commit@lists.opensuse.org