OpenUpgrade icon indicating copy to clipboard operation
OpenUpgrade copied to clipboard

[11→12]: psycopg2.ProgrammingError: can't adapt type 'res.company' [stock]

Open nikiwaibel opened this issue 9 months ago • 2 comments

i got this error: psycopg2.ProgrammingError: can't adapt type 'res.company' during the OpenUpgrade process [11→12].

(i am new to openupgrade)

Module

stock

Describe the bug

2024-04-30 07:51:29,525 4446 ERROR odoo12-from11 odoo.sql_db: bad query: UPDATE "stock_rule" SET "company_id"=%s,"write_uid"=%s,"write_date"=%s WHERE id IN %s
ERROR: can't adapt type 'res.company'
2024-04-30 07:51:29,526 4446 ERROR odoo12-from11 OpenUpgrade: stock: error in migration script stock/migrations/12.0.1.1/post-migration.py: can't adapt type 'res.company'
2024-04-30 07:51:29,526 4446 ERROR odoo12-from11 OpenUpgrade: can't adapt type 'res.company'
Traceback (most recent call last):
  File "/home/odoo/venv-3.6-odoo12/lib64/python3.6/site-packages/openupgradelib/openupgrade.py", line 2285, in wrapped_function
    version,
  File "/home/odoo/odoo11to12/OpenUpgrade-12/addons/stock/migrations/12.0.1.1/post-migration.py", line 181, in migrate
    merge_stock_location_path_stock_rule(env)
  File "/home/odoo/odoo11to12/OpenUpgrade-12/addons/stock/migrations/12.0.1.1/post-migration.py", line 98, in merge_stock_location_path_stock_rule
    row[0],
  File "/home/odoo/venv-3.6-odoo12/lib64/python3.6/site-packages/openupgradelib/openupgrade_merge_records.py", line 1036, in merge_records
    _adjust_merged_values_orm(*args2)
  File "/home/odoo/venv-3.6-odoo12/lib64/python3.6/site-packages/openupgradelib/openupgrade_merge_records.py", line 631, in _adjust_merged_values_orm
    target_record.write(new_vals)
2024-04-30 07:51:29,531 4446 ERROR odoo12-from11 odoo.modules.loading: Error executing post migration script for module stock
`-> product_expiry
`-> stock_picking_batch
: can't adapt type 'res.company'

obviously the error happens in OpenUpgrade-12/addons/stock/migrations/12.0.1.1/post-migration.py:merge_stock_location_path_stock_rule(), but i can't make out where exactly; nor i know, if this is caused by sthg that may have modified res.company in the first place or due to something wrong in my odoo-11 stock or due to an error / missing feature in OpenUpgrade-11 ("stock" is marked as "complete" …).

To Reproduce

Affected versions:

  • source system: odoo-11 (fedora26, python-3.6, postgres-9.6)
  • destination system: odoo-12 (fedora-28, python-3.6, postgres-10.7)

Steps to reproduce the behavior:

  1. i removed as much as i could from odoo-11 (some commercial modules like professional_templates - we want to get rif of them anyway)
  2. installed OCB-12 with OCA-12 modules and some others (website_webkul_addons, odoo_shipping_service_apps, …)
  3. createdb odoo12-from11
  4. psql -d odoo12-from11 -f dump.sql >/dev/null
  5. ./odoo11to12/OpenUpgrade-12/odoo-bin -d odoo12-from11 --without-demo=all --addons-path=odoo11to12/OpenUpgrade-12/addons,odoo11to12/commercialAddons,odoo11to12/OCA-12 -D . --update=all --stop-after-init >OpenUpgrade.log 2>&1

Expected behavior update the database from 11 to 12 without error.

Additional context in case the full log is required, just let me know.

nikiwaibel avatar Apr 30 '24 11:04 nikiwaibel