Wald Sin
Wald Sin

Reputation: 208

Odoo: how to change title on wizard form view?

enter image description here Odoo generates form with default "Odoo" title. I want to write my own title, how to do that?

here is also .xml fo this form:

<record model="ir.ui.view" id="email_compose_message_wizard_form">
            <field name="name">mail.compose.message.form</field>
            <field name="model">mail.compose.message</field>
            <field name="groups_id" eval="[Command.link(ref('base.group_user'))]"/>
            <field name="arch" type="xml">
                <form string="Compose Email">
                    <div style="display_none">
                        <group>
                            <!-- truly invisible fields for control and options -->
                            <field name="composition_mode" invisible="1"/>
                            <field name="model" invisible="1"/>
                            <field name="res_id" invisible="1"/>
                            <field name="is_log" invisible="1"/>
                            <field name="parent_id" invisible="1"/>
                            ...

and .py model:

class MailComposer(models.TransientModel):
    _name = 'mail.compose.message'
    _inherit = 'mail.composer.mixin'
    _description = 'Email composition wizard'
    _log_access = True
    _batch_size = 500

Upvotes: 0

Views: 827

Answers (1)

Kenly
Kenly

Reputation: 26738

When the action name is set, Odoo will use it as a title for the dialog

if (action.target === "new") {
    cleanDomFromBootstrap();
    const actionDialogProps = {
        // TODO add size
        ActionComponent: ControllerComponent,
        actionProps: controller.props,
    };
    if (action.name) {
        actionDialogProps.title = action.name;
    }

Odoo will try to use the action name first then the default title (Odoo)

Upvotes: 2

Related Questions