Skip to content

[FIX] util/domains: add version check for model_name#461

Open
apan-odoo wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-add_version_check-apan
Open

[FIX] util/domains: add version check for model_name#461
apan-odoo wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-add_version_check-apan

Conversation

@apan-odoo

Copy link
Copy Markdown
Contributor

The field model_name has become store=f in v18.1 and its column is removed from upgrade too.

Traceback:

  File "/tmp/tmpd0m7olzw/migrations/util/fields.py", line 259, in remove_field
    adapt_domains(
  File "/tmp/tmpd0m7olzw/migrations/util/domains.py", line 479, in adapt_domains
    cr.execute(query, [target_model, match_old, dot_old])
  File "/home/odoo/src/odoo/19.0/odoo/sql_db.py", line 440, in execute
    self._obj.execute(query, params)
psycopg2.errors.UndefinedColumn: column "model_name" does not exist
LINE 2:                 SELECT id, (SELECT model_name FROM ir_act_se...
                                           ^

The field [`model_name`] has become `store=f` in `v18.1`
and its column is [removed] from upgrade too.

Traceback:
```py
  File "/tmp/tmpd0m7olzw/migrations/util/fields.py", line 259, in remove_field
    adapt_domains(
  File "/tmp/tmpd0m7olzw/migrations/util/domains.py", line 479, in adapt_domains
    cr.execute(query, [target_model, match_old, dot_old])
  File "/home/odoo/src/odoo/19.0/odoo/sql_db.py", line 440, in execute
    self._obj.execute(query, params)
psycopg2.errors.UndefinedColumn: column "model_name" does not exist
LINE 2:                 SELECT id, (SELECT model_name FROM ir_act_se...
                                           ^
```

[`model_name`]: https://github.com/odoo/odoo/blob/68f258e99f42693131a5309b3606c3b95f93d824/odoo/addons/base/models/ir_actions.py#L638
[removed]: https://github.com/odoo/upgrade/blob/master/migrations/base/saas~18.1.1.3/pre-migrate.py#L6
@robodoo

robodoo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@sagu-odoo

Copy link
Copy Markdown
Contributor

i think this is the same case as this was for #366 not sure.

@apan-odoo

apan-odoo commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

i think this is the same case as this was for #366 not sure.

Maybe when action_server_id (M2o) became action_server_ids (O2m) the column was not dropped in upgrade. That's the reason the column still exists? For the dbs which have atleast moved to v17 before that patch

Edit: Additionally there are much failing dbs in past onto this.

@aj-fuentes

Copy link
Copy Markdown
Contributor

You should investigate why the column is there on the first place. Be in the lookout for new requests failing on this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants