Problem Statement
Currently, inspect_model filters out system-wide chatter and activity fields by checking if the field name starts with hardcoded prefixes:
if (f.name.startsWith('message_') || f.name.startsWith('activity_')) {
continue;
}
This approach is arbitrary, brittle, and inelegant. It is a 'band-aid' fix that does not scale to other standard Odoo mixins (such as utm.mixin, rating.mixin, website.seo.metadata, or custom business mixins) which inject their own sets of system fields into the model.
Proposed Elegant Solution
Instead of hardcoding field name prefixes, inspect_model should dynamically detect whether fields are inherited from standard Odoo mixins / abstract classes and isolate them into a dedicated metadata bucket (e.g., chatter or mixins).
Implementation Concept:
- Query Lineage: Query the parent models of the current target (for example, reading
inherits or analyzing the model's defined inheritance array).
- Detect Mixin Origins: Match fields whose origin modules or parent definitions stem from abstract system mixins like
mail.thread, mail.activity.mixin, utm.mixin, etc.
- Clean Categorization: Dynamically filter these fields out of
base and extended and group them into their own collapsible mixins block, keeping the core field lists focused strictly on the model's true business data.
Problem Statement
Currently,
inspect_modelfilters out system-wide chatter and activity fields by checking if the field name starts with hardcoded prefixes:This approach is arbitrary, brittle, and inelegant. It is a 'band-aid' fix that does not scale to other standard Odoo mixins (such as
utm.mixin,rating.mixin,website.seo.metadata, or custom business mixins) which inject their own sets of system fields into the model.Proposed Elegant Solution
Instead of hardcoding field name prefixes,
inspect_modelshould dynamically detect whether fields are inherited from standard Odoo mixins / abstract classes and isolate them into a dedicated metadata bucket (e.g.,chatterormixins).Implementation Concept:
inheritsor analyzing the model's defined inheritance array).mail.thread,mail.activity.mixin,utm.mixin, etc.baseandextendedand group them into their own collapsiblemixinsblock, keeping the core field lists focused strictly on the model's true business data.