Skip to Content
Menu
This question has been flagged
2743 Views

I want to add a button to the partner view to compose a templated email instead of having to select the one row from the list view and selecting partner mass mailing
 

I have a button added to the form

                    <button class="oe_inline oe_stat_button" type="action"
                        name="%(agent_compose_message)d"
                        icon="fa-text"
                        context="{'search_default_partner_id': active_id, 'default_duration': 1.0}">
                        <field string="Templated Email" name="" widget="statinfo"/>
                    </button>

 

and an action defind

        <record id="agent_compose_message" model="ir.actions.act_window">
            <field name="name">Template Emails</field>
            <field name="src_model">res.partner</field>
            <field name="res_model">mail.compose.message</field>
            <field name="multi">True</field>
            <field name="target">new</field>
            <field name="view_id" ref="mail.email_compose_message_wizard_form"/>
            <field name="context">{
                            'default_composition_mode': 'mass_mail',
                            'default_partner_to': '${object.id or \'\'}',
                            'default_use_template': True,
                        }</field>                                    
        </record>       

When I use the button in get the following error

      Error: Got non-search view after asking for a search view: type form, arch root form

      http://localhost:8069/web/static/src/js/search.js:606

Any ideas?

Thanks

Steve

Avatar
Discard