Files
odoo_source/addons/mail/views/res_partner_views.xml
T
Pierre-Yves Dufays 725e7ffae3 [IMP] various: improve custom activity views
The following summary view of the record in the activity views have been
improved:
- project_task: task state added
- project_project: project manager added
- event_event: responsible and the dates (date_begin_located and
date_end_located) added
- account_move: total amount, customer and state added
- sale_order: total amount and the state added
- purchase_order: total amount and the state added
- crm_lead: customer and stage added
- hr_applicant (hr_recruitment): recruiter added
- survey_survey: responsible added
- maintenance.request: added equipment and responsible
- stock.picking: added scheduled_date
- repair.order: responsible, schedule_date and product_id added
- mrp.production: added responsible
- hr_leave (hr_holidays): status is added and default deadline modified see
below

Ensures that "Schedule activity" is in one line by adding a colspan.

hr_leave activity: When a time off approval activity is created as a
consequence of the creation of a hr.leave, the deadline of the activity is set
to the date_from of the hr.leave minus activity type delay_count (default 15)
except if it leads to a date anterior to today. In that case it is set to
today. That way, in the activity view, the time off approval activities are
more or less sorted by related hr.leave date_from and the cell date is an
indication of when the time off is planned.

Technical note: on most activity view, the activity record was not occupying
all the horizontal space. To solve that problem the css has been modified and
the max-width (200) that was imposed on the sub div has been removed. And as
it was impossible to impose a max-width for a flex div (which is the common
case for the activity record), the max width is imposed on each text that might
be too long using the class o_text_block. That class has been modified to
impose a max-width. That's why that class has been added in most view.
Alternativly, we could have modified the activity compiler to add that class
when the attribute full was set (not done because not sure of the consequence).

Task-3300854

Part-of: odoo/odoo#138135
2023-10-19 19:08:12 +00:00

122 lines
6.3 KiB
XML

<?xml version="1.0" ?>
<odoo>
<data>
<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">
<button name="mail_action_blacklist_remove" class="fa fa-ban text-danger"
title="This email is blacklisted for mass mailings. Click to unblacklist."
type="object" context="{'default_email': email}" groups="base.group_user"
invisible="not is_blacklisted"/>
<field name="email" widget="email" context="{'gravatar_image': True}" required="user_ids"/>
</div>
</xpath>
<xpath expr="//sheet" position="after">
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</xpath>
</field>
</record>
<record id="res_partner_view_kanban_inherit_mail" model="ir.ui.view">
<field name="name">res.partner.view.kanban.inherit.mail</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="activity_state"/>
</field>
<xpath expr="//div[hasclass('oe_kanban_bottom_right')]" position="inside">
<field name="activity_ids" widget="kanban_activity"/>
</xpath>
</field>
</record>
<record id="res_partner_view_search_inherit_mail" model="ir.ui.view">
<field name="name">res.partner.view.search.inherit.mail</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<filter name="inactive" position="after">
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
<separator/>
</filter>
</field>
</record>
<record id="res_partner_view_tree_inherit_mail" model="ir.ui.view">
<field name="name">res.partner.view.tree.inherit.mail</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='user_id']" position="after">
<field name="activity_ids" optional="show" widget="list_activity"/>
</xpath>
</field>
</record>
<record id="res_partner_view_activity" model="ir.ui.view">
<field name="name">res.partner.activity</field>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<activity string="Contacts">
<field name="id"/>
<templates>
<div t-name="activity-box">
<img t-att-src="activity_image('res.partner', 'avatar_128', record.id.raw_value)" role="img" t-att-title="record.name.value" t-att-alt="record.name.value"/>
<div class="ms-2">
<field name="name" display="full" class="o_text_block"/>
<field name="parent_id" muted="1" display="full" class="o_text_block"/>
</div>
</div>
</templates>
</activity>
</field>
</record>
<!-- Add mail-defined activity view to standard action on partners to manage activities related to partner model -->
<record id="base.action_partner_form" model="ir.actions.act_window">
<field name="view_mode">kanban,tree,form,activity</field>
</record>
<record id="base.action_partner_customer_form" model="ir.actions.act_window">
<field name="view_mode">kanban,tree,form,activity</field>
</record>
<record id="base.action_partner_supplier_form" model="ir.actions.act_window">
<field name="view_mode">kanban,tree,form,activity</field>
</record>
<!-- Replace the default mass-mailing wizard in base with the composition wizard -->
<record id="action_partner_mass_mail" model="ir.actions.act_window">
<field name="name">Send email</field>
<field name="res_model">mail.compose.message</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context" eval="{
'default_composition_mode': 'mass_mail',
'default_partner_to': '{{ object.id or \'\' }}',
'default_subtype_xmlid': 'mail.mt_comment',
'default_reply_to_force_new': True,
}"/>
<field name="binding_model_id" ref="base.model_res_partner"/>
<field name="binding_view_types">list</field>
</record>
</data>
</odoo>