Inherit mail.activity on res.partner form

493 views Asked by At

I cannot find the view which contain Activities on res.partner form view enter image description here

I tried to inherit mail.mail_activity_type_view_form but it is not

<record id="mail_activity_view_inherit" model="ir.ui.view">
    <field name="name">mail.activity.type.view.form.inherit</field>
    <field name="model">mail.activity.type</field>
    <field name="inherit_id" ref="mail.mail_activity_type_view_form" />
</record>
2

There are 2 answers

0
Adam Strauss On

Let me try to help, you're trying to _inherit mail.activity view which is not possible by using xml, because it will not inherit from xml it is written in qweb, so for that you have to extend it like.

<t t-extend="idOfMailAvtivityQweb">
    <t t-jquery='i[title="Mark as Todo"]' t-operation="before">
        //Here in thread i will add something before title "Mark as Todo"
    </t>
</t>
0
jzeta On

The XML-ID is:

mail.res_partner_view_form_inherit_mail

So, mail addon, res_partner_view_form_inherit_mail view.

The view is this one:

<record id="res_partner_view_form_inherit_mail" model="ir.ui.view">
    <field name="name">res.partner.view.form.inherit.mail</field>
    <field name="model">res.partner</field>
    <field name="inherit_id" ref="base.view_partner_form"/>
    <field name="arch" type="xml">
        <xpath expr="//field[@name='email']" position="replace">
            <field name="is_blacklisted" invisible="1"/>
            <label for="email" class="oe_inline"/>
            <div class="o_row o_row_readonly">
                <i class="fa fa-ban" style="color: red;" role="img" title="This email is blacklisted for mass mailing" aria-label="Blacklisted" attrs="{'invisible': [('is_blacklisted', '=', False)]}" groups="base.group_user"></i>
                <field name="email" widget="email" context="{'gravatar_image': True}" attrs="{'required': [('user_ids','!=', [])]}" />
            </div>
        </xpath>
        <xpath expr="//sheet" position="after">
            <div class="oe_chatter">
                <field name="message_follower_ids" widget="mail_followers"/>
                <field name="activity_ids" widget="mail_activity"/>
                <field name="message_ids" widget="mail_thread"/>
            </div>
        </xpath>
    </field>
</record>