Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package trytond for openSUSE:Factory checked in at 2023-05-23 14:55:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/trytond (Old) and /work/SRC/openSUSE:Factory/.trytond.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "trytond" Tue May 23 14:55:27 2023 rev:82 rq:1088644 version:6.0.32 Changes: -------- --- /work/SRC/openSUSE:Factory/trytond/trytond.changes 2023-04-07 23:29:22.894466697 +0200 +++ /work/SRC/openSUSE:Factory/.trytond.new.1533/trytond.changes 2023-05-23 14:55:48.934934751 +0200 @@ -1,0 +2,5 @@ +Sat May 20 17:02:23 UTC 2023 - Axel Braun <axel.br...@gmx.de> + +- Version 6.0.32 - Bugfix Release + +------------------------------------------------------------------- Old: ---- trytond-6.0.30.tar.gz trytond-6.0.30.tar.gz.asc New: ---- trytond-6.0.32.tar.gz trytond-6.0.32.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ trytond.spec ++++++ --- /var/tmp/diff_new_pack.m7Zvdq/_old 2023-05-23 14:55:49.634938894 +0200 +++ /var/tmp/diff_new_pack.m7Zvdq/_new 2023-05-23 14:55:49.642938941 +0200 @@ -2,7 +2,7 @@ # spec file for package trytond # # Copyright (c) 2023 SUSE LLC -# Copyright (c) 2015-2022 Dr. Axel Braun +# Copyright (c) 2015-2023 Dr. Axel Braun # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ %define majorver 6.0 %define base_name tryton Name: trytond -Version: %{majorver}.30 +Version: %{majorver}.32 Release: 0 Summary: An Enterprise Resource Planning (ERP) system License: GPL-3.0-or-later ++++++ trytond-6.0.30.tar.gz -> trytond-6.0.32.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/CHANGELOG new/trytond-6.0.32/CHANGELOG --- old/trytond-6.0.30/CHANGELOG 2023-04-01 23:53:39.000000000 +0200 +++ new/trytond-6.0.32/CHANGELOG 2023-05-17 22:33:30.000000000 +0200 @@ -1,4 +1,14 @@ +Version 6.0.32 - 2023-05-17 +--------------------------- +* Bug fixes (see mercurial logs for details) + + +Version 6.0.31 - 2023-05-03 +--------------------------- +* Bug fixes (see mercurial logs for details) + + Version 6.0.30 - 2023-04-01 --------------------------- * Bug fixes (see mercurial logs for details) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/COPYRIGHT new/trytond-6.0.32/COPYRIGHT --- old/trytond-6.0.30/COPYRIGHT 2023-04-01 23:53:38.000000000 +0200 +++ new/trytond-6.0.32/COPYRIGHT 2023-05-17 22:33:29.000000000 +0200 @@ -3,7 +3,7 @@ Copyright (C) 2007-2013 Bertrand Chenal. Copyright (C) 2008-2023 B2CK SPRL. Copyright (C) 2011 Openlabs Technologies & Consulting (P) Ltd. -Copyright (C) 2011-2022 Nicolas Ãvrard. +Copyright (C) 2011-2023 Nicolas Ãvrard. Copyright (C) 2020-2021 Maxime Richez Copyright (C) 2020-2021 SALUC SA diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/PKG-INFO new/trytond-6.0.32/PKG-INFO --- old/trytond-6.0.30/PKG-INFO 2023-04-01 23:53:45.082338000 +0200 +++ new/trytond-6.0.32/PKG-INFO 2023-05-17 22:33:33.943609500 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: trytond -Version: 6.0.30 +Version: 6.0.32 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.30/trytond/__init__.py new/trytond-6.0.32/trytond/__init__.py --- old/trytond-6.0.30/trytond/__init__.py 2023-03-03 19:17:27.000000000 +0100 +++ new/trytond-6.0.32/trytond/__init__.py 2023-05-03 18:26:53.000000000 +0200 @@ -7,7 +7,7 @@ from lxml import etree, objectify -__version__ = "6.0.30" +__version__ = "6.0.32" os.environ['TZ'] = 'UTC' if hasattr(time, 'tzset'): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/trytond/backend/postgresql/database.py new/trytond-6.0.32/trytond/backend/postgresql/database.py --- old/trytond-6.0.30/trytond/backend/postgresql/database.py 2022-12-19 13:03:46.000000000 +0100 +++ new/trytond-6.0.32/trytond/backend/postgresql/database.py 2023-04-19 10:50:37.000000000 +0200 @@ -420,12 +420,15 @@ def nextid(self, connection, table): cursor = connection.cursor() - cursor.execute("SELECT NEXTVAL(%s)", (table + '_id_seq',)) + cursor.execute( + "SELECT nextval(format(%s, %s))", ('%I', table + '_id_seq',)) return cursor.fetchone()[0] def setnextid(self, connection, table, value): cursor = connection.cursor() - cursor.execute("SELECT SETVAL(%s, %s)", (table + '_id_seq', value)) + cursor.execute( + "SELECT setval(format(%s, %s), %s)", + ('%I', table + '_id_seq', value)) def currid(self, connection, table): cursor = connection.cursor() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/trytond/backend/postgresql/table.py new/trytond-6.0.32/trytond/backend/postgresql/table.py --- old/trytond-6.0.30/trytond/backend/postgresql/table.py 2022-12-19 13:03:46.000000000 +0100 +++ new/trytond-6.0.32/trytond/backend/postgresql/table.py 2023-04-19 10:52:24.000000000 +0200 @@ -56,9 +56,9 @@ cursor.execute( SQL( "ALTER TABLE {} ADD COLUMN id INTEGER " - "DEFAULT nextval(%s) NOT NULL").format( + "DEFAULT nextval(format(%s, %s)) NOT NULL").format( Identifier(self.table_name)), - (self.sequence_name,)) + ('%I', self.sequence_name)) cursor.execute( SQL('ALTER TABLE {} ADD PRIMARY KEY(id)') .format(Identifier(self.table_name))) @@ -71,27 +71,31 @@ cursor.execute( SQL( "ALTER TABLE {} ADD COLUMN __id INTEGER " - "DEFAULT nextval(%s) NOT NULL").format( + "DEFAULT nextval(format(%s, %s)) NOT NULL").format( Identifier(self.table_name)), - (self.sequence_name,)) + ('%I', self.sequence_name)) cursor.execute( SQL('ALTER TABLE {} ADD PRIMARY KEY(__id)') .format(Identifier(self.table_name))) else: - default = "nextval('%s'::regclass)" % self.sequence_name + default = ( + "nextval((format('%%I'::text, '%s'))::regclass)" + % self.sequence_name) if self.history: if self._columns['__id']['default'] != default: cursor.execute( SQL("ALTER TABLE {} " - "ALTER __id SET DEFAULT nextval(%s::regclass)") + "ALTER __id SET " + "DEFAULT nextval(format(%s, %s))") .format(Identifier(self.table_name)), - (self.sequence_name,)) + ('%I', self.sequence_name)) if self._columns['id']['default'] != default: cursor.execute( SQL("ALTER TABLE {} " - "ALTER id SET DEFAULT nextval(%s::regclass)") + "ALTER id SET " + "DEFAULT nextval(format(%s, %s))") .format(Identifier(self.table_name)), - (self.sequence_name,)) + ('%I', self.sequence_name,)) self._update_definitions() @staticmethod @@ -372,7 +376,7 @@ column=Identifier(column_name), reference=Identifier(reference), action=SQL(on_delete))) - self._update_definitions(constraints=True) + self._update_definitions(constraints=True) def drop_fk(self, column_name, table=None): self.drop_constraint(column_name + '_fkey', table=table) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/trytond/convert.py new/trytond-6.0.32/trytond/convert.py --- old/trytond-6.0.30/trytond/convert.py 2022-12-19 13:03:46.000000000 +0100 +++ new/trytond-6.0.32/trytond/convert.py 2023-04-13 19:21:28.000000000 +0200 @@ -762,7 +762,7 @@ fs_values = old_values.copy() fs_values.update(new_values) - if values != fs_values: + if old_values != values or values != fs_values: self.grouped_model_data.extend(([self.ModelData(mdata_id)], { 'fs_id': fs_id, 'model': model, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/trytond/ir/resource.py new/trytond-6.0.32/trytond/ir/resource.py --- old/trytond-6.0.30/trytond/ir/resource.py 2022-12-19 13:03:46.000000000 +0100 +++ new/trytond-6.0.32/trytond/ir/resource.py 2023-04-13 19:05:05.000000000 +0200 @@ -26,8 +26,10 @@ Model = pool.get('ir.model') ModelAccess = pool.get('ir.model.access') models = Model.get_name_items() - access = ModelAccess.get_access([m for m, _ in models]) - return [(m, n) for m, n in models if access[m]['read']] + if Transaction().context.get('_check_access'): + access = ModelAccess.get_access([m for m, _ in models]) + models = [(m, n) for m, n in models if access[m]['read']] + return models @classmethod def check_access(cls, ids, mode='read'): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/trytond/ir/trigger.py new/trytond-6.0.32/trytond/ir/trigger.py --- old/trytond-6.0.30/trytond/ir/trigger.py 2022-12-19 13:03:46.000000000 +0100 +++ new/trytond-6.0.32/trytond/ir/trigger.py 2023-04-13 18:48:40.000000000 +0200 @@ -72,7 +72,7 @@ @classmethod def __register__(cls, module_name): cursor = Transaction().connection.cursor() - table = cls.__table_handler__(cls, module_name) + table = cls.__table_handler__(module_name) sql_table = cls.__table__() super(Trigger, cls).__register__(module_name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/trytond/model/modelsql.py new/trytond-6.0.32/trytond/model/modelsql.py --- old/trytond-6.0.30/trytond/model/modelsql.py 2023-03-31 15:45:27.000000000 +0200 +++ new/trytond-6.0.32/trytond/model/modelsql.py 2023-05-04 19:36:34.000000000 +0200 @@ -308,20 +308,20 @@ if cls._history: cls._update_history_table() - history_table = cls.__table_history__() + h_table = cls.__table_history__() cursor.execute(*sql_table.select(sql_table.id, limit=1)) if cursor.fetchone(): cursor.execute( - *history_table.select(history_table.id, limit=1)) + *h_table.select(h_table.id, limit=1)) if not cursor.fetchone(): columns = [n for n, f in cls._fields.items() if f.sql_type()] - cursor.execute(*history_table.insert( - [Column(history_table, c) for c in columns], + cursor.execute(*h_table.insert( + [Column(h_table, c) for c in columns], sql_table.select(*(Column(sql_table, c) for c in columns)))) - cursor.execute(*history_table.update( - [history_table.write_date], [None])) + cursor.execute(*h_table.update( + [h_table.write_date], [None])) @classmethod def _update_history_table(cls): @@ -1129,11 +1129,14 @@ Column(foreign_table, field_name), sub_ids) cursor.execute(*foreign_table.select(foreign_table.id, where=foreign_red_sql)) - records = Model.browse([x[0] for x in cursor]) + related_records = Model.browse([x[0] for x in cursor]) else: with transaction.set_context(active_test=False): - records = Model.search([(field_name, 'in', sub_ids)]) - return records + related_records = Model.search( + [(field_name, 'in', sub_ids)]) + if Model == cls: + related_records = list(set(related_records) - set(records)) + return related_records for sub_ids, sub_records in zip( grouped_slice(ids), grouped_slice(records)): @@ -1147,9 +1150,10 @@ if (not hasattr(Model, 'search') or not hasattr(Model, 'write')): continue - records = get_related_records(Model, field_name, sub_ids) - if records: - Model.write(records, { + related_records = get_related_records( + Model, field_name, sub_ids) + if related_records: + Model.write(related_records, { field_name: None, }) @@ -1157,9 +1161,10 @@ if (not hasattr(Model, 'search') or not hasattr(Model, 'delete')): continue - records = get_related_records(Model, field_name, sub_ids) - if records: - Model.delete(records) + related_records = get_related_records( + Model, field_name, sub_ids) + if related_records: + Model.delete(related_records) for Model, field_name in foreign_keys_tocheck: with Transaction().set_context( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/trytond/modules/__init__.py new/trytond-6.0.32/trytond/modules/__init__.py --- old/trytond-6.0.30/trytond/modules/__init__.py 2022-12-19 13:03:46.000000000 +0100 +++ new/trytond-6.0.32/trytond/modules/__init__.py 2023-05-14 00:27:38.000000000 +0200 @@ -271,6 +271,8 @@ ])) module2state[module] = 'activated' + # Clear cache from old data cached before transaction started + Cache.clear_all() # Avoid clearing cache to prevent dead lock on ir.cache table Cache.rollback(transaction) transaction.commit() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/trytond/protocols/wrappers.py new/trytond-6.0.32/trytond/protocols/wrappers.py --- old/trytond-6.0.30/trytond/protocols/wrappers.py 2023-03-03 19:08:02.000000000 +0100 +++ new/trytond-6.0.32/trytond/protocols/wrappers.py 2023-05-04 19:21:13.000000000 +0200 @@ -74,8 +74,10 @@ def authorization(self): authorization = super(Request, self).authorization if authorization is None: - header = self.environ.get('HTTP_AUTHORIZATION') + header = self.headers.get('Authorization') return parse_authorization_header(header) + elif authorization.type == 'session': + return parse_session(authorization.token) return authorization @cached_property @@ -94,9 +96,10 @@ database_name, auth.get('userid'), auth.get('session'), context=context) else: + parameters = getattr(auth, 'parameters', auth) try: user_id = security.login( - database_name, auth.username, auth, cache=False, + database_name, auth.username, parameters, cache=False, context=context) except RateLimitException: abort(HTTPStatus.TOO_MANY_REQUESTS) @@ -115,25 +118,33 @@ def parse_authorization_header(value): if not value: return - if not isinstance(value, bytes): - value = value.encode('latin1') + if isinstance(value, bytes): + value = value.decode('latin1') try: auth_type, auth_info = value.split(None, 1) auth_type = auth_type.lower() except ValueError: return - if auth_type == b'session': - try: - username, userid, session = base64.b64decode(auth_info).split( - b':', 3) - userid = int(userid) - except Exception: - return - return Authorization('session', { - 'username': username.decode("latin1"), - 'userid': userid, - 'session': session.decode("latin1"), - }) + if auth_type == 'session': + return parse_session(auth_info) + else: + authorization = Authorization(auth_type) + authorization.token = auth_info + return authorization + + +def parse_session(token): + try: + username, userid, session = ( + base64.b64decode(token).decode().split(':', 3)) + userid = int(userid) + except Exception: + return + return Authorization('session', { + 'username': username, + 'userid': userid, + 'session': session, + }) def set_max_request_size(size): @@ -220,16 +231,17 @@ pool = Pool() UserApplication = pool.get('res.user.application') - authorization = request.headers['Authorization'] - try: - auth_type, auth_info = authorization.split(None, 1) - auth_type = auth_type.lower() - except ValueError: + authorization = request.authorization + if authorization is None: + header = request.headers.get('Authorization') + authorization = parse_authorization_header(header) + if authorization is None: abort(HTTPStatus.UNAUTHORIZED) - if auth_type != 'bearer': + if authorization.type != 'bearer': abort(HTTPStatus.FORBIDDEN) - application = UserApplication.check(auth_info, name) + token = getattr(authorization, 'token', '') + application = UserApplication.check(token, name) if not application: abort(HTTPStatus.FORBIDDEN) transaction = Transaction() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/trytond/tests/test_routes.py new/trytond-6.0.32/trytond/tests/test_routes.py --- old/trytond-6.0.30/trytond/tests/test_routes.py 2022-12-19 13:03:46.000000000 +0100 +++ new/trytond-6.0.32/trytond/tests/test_routes.py 2023-05-04 19:21:13.000000000 +0200 @@ -35,7 +35,8 @@ @property def auth_headers(self): return { - 'Authorization': b'Basic ' + base64.b64encode(b'admin:password'), + 'Authorization': ( + 'Basic ' + base64.b64encode(b'admin:password').decode()), } def data_url(self, model): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/trytond-6.0.30/trytond.egg-info/PKG-INFO new/trytond-6.0.32/trytond.egg-info/PKG-INFO --- old/trytond-6.0.30/trytond.egg-info/PKG-INFO 2023-04-01 23:53:43.000000000 +0200 +++ new/trytond-6.0.32/trytond.egg-info/PKG-INFO 2023-05-17 22:33:32.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: trytond -Version: 6.0.30 +Version: 6.0.32 Summary: Tryton server Home-page: http://www.tryton.org/ Download-URL: http://downloads.tryton.org/6.0/