fields
forms
Many2one Avatar
Odoo 19 fields — Many2one Avatar (views)
Live preview
Interactive
Source excerpt
web/static/src/views/fields/many2one_avatar/many2one_avatar_field.js
import { Component } from "@odoo/owl";
import { registry } from "@web/core/registry";
import { computeM2OProps, Many2One } from "../many2one/many2one";
import {
buildM2OFieldDescription,
extractM2OFieldProps,
Many2OneField,
} from "../many2one/many2one_field";
export class Many2OneAvatarField extends Component {
static template = "web.Many2OneAvatarField";
static components = { Many2One };
static props = { ...Many2OneField.props };
get m2oProps() {
return computeM2OProps(this.props);
}
}
export const many2OneAvatarField = {
...buildM2OFieldDescription(Many2OneAvatarField),
extractProps(staticInfo, dynamicInfo) {
return {
...extractM2OFieldProps(staticInfo, dynamicInfo),
canOpen:
"no_open" in staticInfo.options
? !staticInfo.options.no_open
: staticInfo.viewType === "form",
};
},
};
registry.category("fields").add("many2one_avatar", many2OneAvatarField);
Registry / API
- Registry name
many2one_avatar- Category
fields- Module
web- Slug
many2one-avatar- Nav group
forms