Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package trytond for openSUSE:Factory checked in at 2022-06-12 17:41:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/trytond (Old) and /work/SRC/openSUSE:Factory/.trytond.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "trytond" Sun Jun 12 17:41:21 2022 rev:70 rq:982119 version:6.0.19 Changes: -------- --- /work/SRC/openSUSE:Factory/trytond/trytond.changes 2022-05-02 16:26:34.716905528 +0200 +++ /work/SRC/openSUSE:Factory/.trytond.new.1548/trytond.changes 2022-06-12 17:43:12.798491080 +0200 @@ -1,0 +2,5 @@ +Sat Jun 4 08:10:22 UTC 2022 - Axel Braun <axel.br...@gmx.de> + +- Version 6.0.19 - Bugfix Release + +------------------------------------------------------------------- Old: ---- trytond-6.0.18.tar.gz trytond-6.0.18.tar.gz.asc New: ---- trytond-6.0.19.tar.gz trytond-6.0.19.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ trytond.spec ++++++ --- /var/tmp/diff_new_pack.EKtt01/_old 2022-06-12 17:43:13.286491779 +0200 +++ /var/tmp/diff_new_pack.EKtt01/_new 2022-06-12 17:43:13.286491779 +0200 @@ -20,7 +20,7 @@ %define majorver 6.0 %define base_name tryton Name: trytond -Version: %{majorver}.18 +Version: %{majorver}.19 Release: 0 Summary: An Enterprise Resource Planning (ERP) system License: GPL-3.0-or-later ++++++ trytond-6.0.18.tar.gz -> trytond-6.0.19.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/.hgtags new/trytond-6.0.19/.hgtags --- old/trytond-6.0.18/.hgtags 2022-04-23 17:08:19.000000000 +0200 +++ new/trytond-6.0.19/.hgtags 2022-06-03 19:03:20.000000000 +0200 @@ -42,3 +42,4 @@ c4cf78bb401aec7d52a007eb7bda958658edaf95 6.0.16 246ad7a2addde11a7b3e828ace36cf5fb1bc6696 6.0.17 ca63f7f2eef1998de82eae76636c00211f0e3a80 6.0.18 +2973349bc8ca02dc5aba4fbf6a2e4ba270af9780 6.0.19 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/CHANGELOG new/trytond-6.0.19/CHANGELOG --- old/trytond-6.0.18/CHANGELOG 2022-04-23 17:08:19.000000000 +0200 +++ new/trytond-6.0.19/CHANGELOG 2022-06-03 19:03:19.000000000 +0200 @@ -1,3 +1,6 @@ +Version 6.0.19 - 2022-06-03 +* Bug fixes (see mercurial logs for details) + Version 6.0.18 - 2022-04-23 * Bug fixes (see mercurial logs for details) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/PKG-INFO new/trytond-6.0.19/PKG-INFO --- old/trytond-6.0.18/PKG-INFO 2022-04-23 17:08:22.776352400 +0200 +++ new/trytond-6.0.19/PKG-INFO 2022-06-03 19:03:24.455414800 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: trytond -Version: 6.0.18 +Version: 6.0.19 Summary: Tryton server Home-page: http://www.tryton.org/ Download-URL: http://downloads.tryton.org/6.0/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/__init__.py new/trytond-6.0.19/trytond/__init__.py --- old/trytond-6.0.18/trytond/__init__.py 2022-04-15 21:18:42.000000000 +0200 +++ new/trytond-6.0.19/trytond/__init__.py 2022-04-23 17:08:39.000000000 +0200 @@ -7,7 +7,7 @@ from lxml import etree, objectify -__version__ = "6.0.18" +__version__ = "6.0.19" os.environ['TZ'] = 'UTC' if hasattr(time, 'tzset'): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/ir/avatar.py new/trytond-6.0.19/trytond/ir/avatar.py --- old/trytond-6.0.18/trytond/ir/avatar.py 2022-04-14 23:25:02.000000000 +0200 +++ new/trytond-6.0.19/trytond/ir/avatar.py 2022-06-02 13:36:58.000000000 +0200 @@ -70,6 +70,16 @@ super().write(*args) cls.clear_cache(avatars) + @classmethod + def copy(cls, avatars, default=None): + if default is None: + default = {} + else: + default = default.copy() + default.setdefault('uuid', None) + default.setdefault('cache', None) + return super().copy(avatars, default=default) + @property def url(self): if self.image_id or self.image: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/model/avatar.py new/trytond-6.0.19/trytond/model/avatar.py --- old/trytond-6.0.18/trytond/model/avatar.py 2022-04-14 23:25:02.000000000 +0200 +++ new/trytond-6.0.19/trytond/model/avatar.py 2022-06-02 13:36:58.000000000 +0200 @@ -67,6 +67,15 @@ record.avatar = avatar cls.save(records) + @classmethod + def copy(cls, avatars, default=None): + if default is None: + default = {} + else: + default = default.copy() + default.setdefault('avatars', []) + return super().copy(avatars, default=default) + if default: @classmethod diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/model/fields/many2many.py new/trytond-6.0.19/trytond/model/fields/many2many.py --- old/trytond-6.0.18/trytond/model/fields/many2many.py 2022-04-14 23:25:02.000000000 +0200 +++ new/trytond-6.0.19/trytond/model/fields/many2many.py 2022-05-07 08:36:19.000000000 +0200 @@ -437,7 +437,7 @@ relation_domain.append( (self.origin, 'like', Model.__name__ + ',%')) else: - relation_domain = [self.target, operator, value] + relation_domain = [self.target, 'where', value] rule_domain = Rule.domain_get(Relation.__name__, mode='read') if rule_domain: relation_domain = [relation_domain, rule_domain] @@ -454,7 +454,9 @@ query_table = convert_from(None, relation_tables) query = query_table.select(origin, where=expression) expression = table.id.in_(query) - if operator.startswith('!') or operator.startswith('not '): + if operator == 'not where': + expression = ~expression + elif operator.startswith('!') or operator.startswith('not '): expression |= ~table.id.in_(relation.select(origin)) return expression diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/model/fields/reference.py new/trytond-6.0.19/trytond/model/fields/reference.py --- old/trytond-6.0.18/trytond/model/fields/reference.py 2022-04-14 23:25:02.000000000 +0200 +++ new/trytond-6.0.19/trytond/model/fields/reference.py 2022-06-02 13:36:58.000000000 +0200 @@ -114,7 +114,7 @@ continue try: ref_id = int(ref_id) - except Exception: + except ValueError: continue if ref_id < 0: continue diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/model/modelsql.py new/trytond-6.0.19/trytond/model/modelsql.py --- old/trytond-6.0.18/trytond/model/modelsql.py 2022-04-14 23:25:02.000000000 +0200 +++ new/trytond-6.0.19/trytond/model/modelsql.py 2022-06-02 13:36:58.000000000 +0200 @@ -743,7 +743,10 @@ if not callable(cls.table_query): rule_domain = Rule.domain_get( cls.__name__, mode=f.lstrip('_')) - if rule_domain: + # No need to compute rule domain if it is the same as the + # read rule domain because it is already applied as where + # clause. + if rule_domain and rule_domain != domain: rule_tables = {None: (table, None)} rule_tables, rule_expression = cls.search_domain( rule_domain, active_test=False, tables=rule_tables) @@ -878,9 +881,13 @@ add = target_ids.extend elif field._type == 'reference': def add(value): - id_ = int(value.split(',', 1)[1]) - if id_ >= 0: - target_ids.append(id_) + try: + id_ = int(value.split(',', 1)[1]) + except ValueError: + pass + else: + if id_ >= 0: + target_ids.append(id_) else: add = target_ids.append for row in rows: @@ -902,7 +909,10 @@ for row in rows: value = row[name] if isinstance(value, str): - value = int(value.split(',', 1)[1]) + try: + value = int(value.split(',', 1)[1]) + except ValueError: + value = None if value is not None and value >= 0: row[key] = targets[value] else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/protocols/wrappers.py new/trytond-6.0.19/trytond/protocols/wrappers.py --- old/trytond-6.0.18/trytond/protocols/wrappers.py 2022-04-14 23:25:02.000000000 +0200 +++ new/trytond-6.0.19/trytond/protocols/wrappers.py 2022-06-02 13:36:58.000000000 +0200 @@ -195,7 +195,9 @@ continue logger.error('%s', request, exc_info=True) raise - except Exception: + except Exception as e: + if isinstance(e, HTTPException): + raise logger.error('%s', request, exc_info=True) raise # Need to commit to unlock SQLite database diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/res/user.py new/trytond-6.0.19/trytond/res/user.py --- old/trytond-6.0.18/trytond/res/user.py 2022-04-14 23:25:02.000000000 +0200 +++ new/trytond-6.0.19/trytond/res/user.py 2022-05-07 08:36:19.000000000 +0200 @@ -389,7 +389,7 @@ all_users += users args.extend((users, cls._convert_vals(values))) - if 'password' in values: + if values.keys() & {'active', 'password'}: session_to_clear += users users_to_clear += [u.login for u in users] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/tests/test_field_many2many.py new/trytond-6.0.19/trytond/tests/test_field_many2many.py --- old/trytond-6.0.18/trytond/tests/test_field_many2many.py 2022-04-14 23:25:02.000000000 +0200 +++ new/trytond-6.0.19/trytond/tests/test_field_many2many.py 2022-05-07 08:36:19.000000000 +0200 @@ -244,6 +244,21 @@ self.assertListEqual(many2manys, []) @with_transaction() + def test_search_not_where_others(self): + "Test search many2many not where with others" + Many2Many = self.Many2Many() + many2many, = Many2Many.create([{ + 'targets': [('create', [ + {'name': "Target"}, {'name': "Foo"}])], + }]) + + many2manys = Many2Many.search([ + ('targets', 'not where', [('name', '=', "Target")]), + ]) + + self.assertListEqual(many2manys, []) + + @with_transaction() def test_write_write(self): "Test write many2many write" Many2Many = self.Many2Many() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/tests/test_field_one2many.py new/trytond-6.0.19/trytond/tests/test_field_one2many.py --- old/trytond-6.0.18/trytond/tests/test_field_one2many.py 2022-04-14 23:25:02.000000000 +0200 +++ new/trytond-6.0.19/trytond/tests/test_field_one2many.py 2022-05-07 08:36:19.000000000 +0200 @@ -306,6 +306,21 @@ self.assertListEqual(one2manys, []) @with_transaction() + def test_search_not_where_others(self): + "Test search one2many not where with others" + One2Many = self.One2Many() + one2many, = One2Many.create([{ + 'targets': [('create', [ + {'name': "Target"}, {'name': "Foo"}])], + }]) + + one2manys = One2Many.search([ + ('targets', 'not where', [('name', '=', "Target")]), + ]) + + self.assertListEqual(one2manys, []) + + @with_transaction() def test_write_write(self): "Test write one2many write" One2Many = self.One2Many() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond/tests/test_modelsql.py new/trytond-6.0.19/trytond/tests/test_modelsql.py --- old/trytond-6.0.18/trytond/tests/test_modelsql.py 2022-04-14 23:25:02.000000000 +0200 +++ new/trytond-6.0.19/trytond/tests/test_modelsql.py 2022-06-02 13:36:58.000000000 +0200 @@ -116,6 +116,38 @@ }]) @with_transaction() + def test_read_related_invalid_reference(self): + "Test read with related invalid Reference" + pool = Pool() + Model = pool.get('test.modelsql.read') + + record, = Model.create( + [{'reference': 'test.modelsql.read.target,None'}]) + values = Model.read([record.id], ['reference.name']) + + self.assertEqual(values, [{ + 'id': record.id, + 'reference.': None, + }]) + + @with_transaction() + def test_read_related_deleted_reference(self): + "Test read with related deleted Reference" + pool = Pool() + Model = pool.get('test.modelsql.read') + Target = pool.get('test.modelsql.read.target') + + target, = Target.create([{'name': "Target"}]) + record, = Model.create([{'reference': str(target)}]) + Target.delete([target]) + values = Model.read([record.id], ['reference.name']) + + self.assertEqual(values, [{ + 'id': record.id, + 'reference.': None, + }]) + + @with_transaction() def test_read_related_reference_empty(self): "Test read with empty related Reference" pool = Pool() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.18/trytond.egg-info/PKG-INFO new/trytond-6.0.19/trytond.egg-info/PKG-INFO --- old/trytond-6.0.18/trytond.egg-info/PKG-INFO 2022-04-23 17:08:21.000000000 +0200 +++ new/trytond-6.0.19/trytond.egg-info/PKG-INFO 2022-06-03 19:03:22.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: trytond -Version: 6.0.18 +Version: 6.0.19 Summary: Tryton server Home-page: http://www.tryton.org/ Download-URL: http://downloads.tryton.org/6.0/