You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[15.0] [16.0] l10n_es_ticketbai: raises "psycopg2.errors.UndefinedFunction: function to_date(date, unknown) does not exist" when upgrading from v14
#3900
Open
rrebollo opened this issue
Jan 14, 2025
· 0 comments
Using openupgrade in a doodba-copier-template project to go from v14.0 to v15.0 raises this error with the following traceback:
2025-01-14 17:14:33,492 1 INFO devel OpenUpgrade: l10n_es_ticketbai: post-migration script called with version 14.0.2.9.3
2025-01-14 17:14:33,492 1 ERROR devel odoo.sql_db: bad query:
UPDATE tbai_invoice_refund_origin
SET expedition_date = TO_DATE("openupgrade_legacy_15_0_expedition_date", 'DD-MM-YYYY')
ERROR: function to_date(date, unknown) does not exist
LINE 3: SET expedition_date = TO_DATE("openupgrade_legacy_15...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
2025-01-14 17:14:33,492 1 ERROR devel OpenUpgrade: Error after 0:00:00.000289 running
UPDATE tbai_invoice_refund_origin
SET expedition_date = TO_DATE("openupgrade_legacy_15_0_expedition_date", 'DD-MM-YYYY')
2025-01-14 17:14:33,492 1 ERROR devel OpenUpgrade: l10n_es_ticketbai: error in migration script /opt/odoo/auto/addons/l10n_es_ticketbai/migrations/15.0.1.4.6/post-migration.py: function to_date(date, unknown) does not exist
LINE 3: SET expedition_date = TO_DATE("openupgrade_legacy_15...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
2025-01-14 17:14:33,492 1 ERROR devel OpenUpgrade: function to_date(date, unknown) does not exist
LINE 3: SET expedition_date = TO_DATE("openupgrade_legacy_15...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/openupgradelib/openupgrade.py", line 2308, in wrapped_function
func(
File "/opt/odoo/auto/addons/l10n_es_ticketbai/migrations/15.0.1.4.6/post-migration.py", line 10, in migrate
openupgrade.logged_query(
File "/usr/local/lib/python3.8/site-packages/openupgradelib/openupgrade.py", line 1718, in logged_query
cr.execute(query, args)
File "<decorator-gen-5>", line 2, in execute
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 90, in check
return f(self, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 311, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedFunction: function to_date(date, unknown) does not exist
LINE 3: SET expedition_date = TO_DATE("openupgrade_legacy_15...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Using openupgrade in a doodba-copier-template project to go from v15.0 to v16.0 raises this error with the following traceback:
ERROR devel odoo.sql_db: bad query:
UPDATE tbai_invoice_refund_origin
SET expedition_date = TO_DATE("openupgrade_legacy_16_0_expedition_date", 'DD-MM-YYYY')
ERROR: function to_date(date, unknown) does not exist
LINE 3: SET expedition_date = TO_DATE("openupgrade_legacy_16...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
2025-01-14 20:29:13,432 1 ERROR devel OpenUpgrade: Error after 0:00:00.000390 running
UPDATE tbai_invoice_refund_origin
SET expedition_date = TO_DATE("openupgrade_legacy_16_0_expedition_date", 'DD-MM-YYYY')
2025-01-14 20:29:13,432 1 ERROR devel OpenUpgrade: l10n_es_ticketbai: error in migration script /opt/odoo/auto/addons/l10n_es_ticketbai/migrations/16.0.1.0.1/post-migration.py: function to_date(date, unknown) does not exist
LINE 3: SET expedition_date = TO_DATE("openupgrade_legacy_16...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
2025-01-14 20:29:13,432 1 ERROR devel OpenUpgrade: function to_date(date, unknown) does not exist
LINE 3: SET expedition_date = TO_DATE("openupgrade_legacy_16...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/openupgradelib/openupgrade.py", line 2308, in wrapped_function
func(
File "/opt/odoo/auto/addons/l10n_es_ticketbai/migrations/16.0.1.0.1/post-migration.py", line 10, in migrate
openupgrade.logged_query(
File "/usr/local/lib/python3.10/site-packages/openupgradelib/openupgrade.py", line 1718, in logged_query
cr.execute(query, args)
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 321, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedFunction: function to_date(date, unknown) does not exist
LINE 3: SET expedition_date = TO_DATE("openupgrade_legacy_16...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
2025-01-14 20:29:13,434 1 WARNING devel odoo.modules.loading: Transient module states were reset
2025-01-14 20:29:13,445 1 ERROR devel odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 87, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 485, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 373, in load_marked_modules
loaded, processed = load_module_graph(
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 237, in load_module_graph
migrations.migrate_module(package, 'post')
File "/opt/odoo/auto/addons/openupgrade_framework/odoo_patch/odoo/modules/migration.py", line 18, in migrate_module
MigrationManager.migrate_module._original_method(self, pkg, stage)
File "/opt/odoo/custom/src/odoo/odoo/modules/migration.py", line 189, in migrate_module
migrate(self.cr, installed_version)
File "/usr/local/lib/python3.10/site-packages/openupgradelib/openupgrade.py", line 2308, in wrapped_function
func(
File "/opt/odoo/auto/addons/l10n_es_ticketbai/migrations/16.0.1.0.1/post-migration.py", line 10, in migrate
openupgrade.logged_query(
File "/usr/local/lib/python3.10/site-packages/openupgradelib/openupgrade.py", line 1718, in logged_query
cr.execute(query, args)
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 321, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedFunction: function to_date(date, unknown) does not exist
LINE 3: SET expedition_date = TO_DATE("openupgrade_legacy_16...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
2025-01-14 20:29:13,445 1 CRITICAL devel odoo.service.server: Failed to initialize database `devel`.
Traceback (most recent call last):
File "/opt/odoo/custom/src/odoo/odoo/service/server.py", line 1311, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "<decorator-gen-16>", line 2, in new
File "/opt/odoo/custom/src/odoo/odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 87, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 485, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 373, in load_marked_modules
loaded, processed = load_module_graph(
File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 237, in load_module_graph
migrations.migrate_module(package, 'post')
File "/opt/odoo/auto/addons/openupgrade_framework/odoo_patch/odoo/modules/migration.py", line 18, in migrate_module
MigrationManager.migrate_module._original_method(self, pkg, stage)
File "/opt/odoo/custom/src/odoo/odoo/modules/migration.py", line 189, in migrate_module
migrate(self.cr, installed_version)
File "/usr/local/lib/python3.10/site-packages/openupgradelib/openupgrade.py", line 2308, in wrapped_function
func(
File "/opt/odoo/auto/addons/l10n_es_ticketbai/migrations/16.0.1.0.1/post-migration.py", line 10, in migrate
openupgrade.logged_query(
File "/usr/local/lib/python3.10/site-packages/openupgradelib/openupgrade.py", line 1718, in logged_query
cr.execute(query, args)
File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 321, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedFunction: function to_date(date, unknown) does not exist
LINE 3: SET expedition_date = TO_DATE("openupgrade_legacy_16...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
2025-01-14 20:29:13,446 1 INFO devel odoo.service.server: Stopping gracefully
To Reproduce
Steps to reproduce the behavior:
Upgrade from v14 to v15 using OpenUpgrade or from v15 to v16
rrebollo
changed the title
[15.0] l10n_es_ticketbai: raises "psycopg2.errors.UndefinedFunction: function to_date(date, unknown) does not exist" when upgrading from v14
[15.0] [16.0] l10n_es_ticketbai: raises "psycopg2.errors.UndefinedFunction: function to_date(date, unknown) does not exist" when upgrading from v14
Jan 14, 2025
Module
l10n_es_ticketbai
Describe the bug
Using openupgrade in a doodba-copier-template project to go from v14.0 to v15.0 raises this error with the following traceback:
Using openupgrade in a doodba-copier-template project to go from v15.0 to v16.0 raises this error with the following traceback:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Addon post-migration scrip pass successfully
Context
doodba-copier-template
openupgrade
postgres v14
The text was updated successfully, but these errors were encountered: