Skip to content

[FIX] util/orm: don't mark inherited field manual for custom - #418

Open
sagu-odoo wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-fix-custom-field-manaul-sagu
Open

[FIX] util/orm: don't mark inherited field manual for custom#418
sagu-odoo wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-fix-custom-field-manaul-sagu

Conversation

@sagu-odoo

@sagu-odoo sagu-odoo commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

During the upgrade process, inherited fields were incorrectly marked as manual, whereas they should retain their original base state.

like Fields created through Studio or ir.model.fields are expected to have state = manual, while inherited fields are set up by the ORM with state = base 1.

Marking inherited fields as manual makes the ORM treat them as independently created fields, which can trigger unnecessary computations, e.g for non-stored fields and
Many2many fields related to ir.attachment.

This change ensures that:

  • inherited fields retain state = base
  • only fields created from ir.model.fields or coming from custom module will have the state manual not the inherited one.
  • field setup remains consistent with the ORM behavior

This prevents inherited fields from being treated as independent fields and avoids unwanted computations during mock crawl without marking as inhertied field.

@robodoo

robodoo commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@sagu-odoo
sagu-odoo force-pushed the master-fix-custom-field-manaul-sagu branch from 0f12608 to bd59ab3 Compare April 22, 2026 10:27
@sagu-odoo
sagu-odoo requested review from a team and Pirols April 22, 2026 11:03
@KangOl

KangOl commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

The MemoryError traceback looks unrelated and more like a side-effect.

@aj-fuentes

Copy link
Copy Markdown
Contributor

Besides what @KangOl mentioned I want to point out that the description in the PR is quite ambiguous. Please clarify what you meant. The query you modified mark all fields that weren't loaded as manual, this is important to avoid other errors. It doesn't make sense to disable this without a clear description of the setup such that we know if it is really safe to do so. Regarding the linked patch. If you need something to "get applied" maybe there are other ways to achieve that. Hence, once more, a detailed setup is important.

@sagu-odoo

sagu-odoo commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

The MemoryError traceback looks unrelated and more like a side-effect.

The issue related to computation being triggered on inherited fields, which caused blocking especially for non-stored fields Many2Many fields linked with ir.attachment.

The intention of the fix is to ensure that inherited fields are not marked as manual fields. Only fields created via the UI or explicitly through ir.model.fields should be considered manual.

There is no issue with stored field computation; the problem specifically occurs with inherited (non-stored) fields.

This has been addressed in the following PR, which resolves the blocking of upgrade requests for almost:

Related fixes to address the traceback but not for 19.0 version

@sagu-odoo

Copy link
Copy Markdown
Contributor Author

this isssue mostly limited to custom module fields only as of now.

@KangOl

KangOl commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

upgradeci retry with always only crm

@sagu-odoo

sagu-odoo commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

for mentioned traceback, I think we can backport something like this fix not exact to 19.0 odoo/odoo#246333 . So, group by feature on ir.attachment will be disable because of this and this.

@sagu-odoo
sagu-odoo force-pushed the master-fix-custom-field-manaul-sagu branch from bd59ab3 to f678dce Compare April 27, 2026 13:22
@sagu-odoo
sagu-odoo force-pushed the master-fix-custom-field-manaul-sagu branch from f678dce to a4bc288 Compare May 6, 2026 11:02
@sagu-odoo

Copy link
Copy Markdown
Contributor Author

Hello @aj-fuentes and @KangOl , can i get your opinion on this ?.

Thanks in advance

@sagu-odoo

Copy link
Copy Markdown
Contributor Author

Hello @aj-fuentes and @KangOl ,Gentle reminder! can i get your opinion on this ?.

Thanks in advance

@sagu-odoo

Copy link
Copy Markdown
Contributor Author

Hllo @aj-fuentes , Gentle reminder!, can i get review on this ?.

Thanks in advance.

@sagu-odoo
sagu-odoo force-pushed the master-fix-custom-field-manaul-sagu branch from a4bc288 to cf89594 Compare July 15, 2026 21:46
@sagu-odoo
sagu-odoo force-pushed the master-fix-custom-field-manaul-sagu branch from cf89594 to bbdc619 Compare August 10, 2026 11:37
Comment thread src/util/orm.py Outdated
@sagu-odoo
sagu-odoo force-pushed the master-fix-custom-field-manaul-sagu branch 3 times, most recently from 404a071 to 4975541 Compare August 17, 2026 07:54
@sagu-odoo
sagu-odoo requested a review from KangOl August 17, 2026 11:45
During the upgrade process, inherited fields were incorrectly
marked as `manual`, whereas they should
retain their original `base` state.

like Fields created through Studio or `ir.model.fields` are
expected to have `state = manual`, while
inherited fields are set up by the ORM with
`state = base` [1].

Marking inherited fields as `manual` makes the ORM treat them
as independently created fields, which can trigger unnecessary
computations, e.g  for non-stored fields and
`Many2many` fields related to `ir.attachment`.

This change ensures that:
* inherited fields retain `state = base`
* only fields created from `ir.model.fields` or coming
  from custom module will have the state  `manual` not the
  inherited one.
* field setup remains consistent with the ORM behavior

This prevents inherited fields from being treated as independent
fields and avoids unwanted computations during mock crawl.

[1]: https://github.com/odoo/odoo/blob/d58f4ed332af35f6de26a93f07adf05368731e20/odoo/orm/model_classes.py#L493-L508
@sagu-odoo
sagu-odoo force-pushed the master-fix-custom-field-manaul-sagu branch from 4975541 to 762aa33 Compare August 24, 2026 11:14
@sagu-odoo

Copy link
Copy Markdown
Contributor Author

Hello @KangOl , could you please have another look ?.

Thanks in advance

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