Files
odoo_source/addons/project/views/project_update_views.xml
T
Bruno Boi f22961ad07 [FIX] web,*: repair root class attr
*: web + adaptations in base, fleet, hr, hr_expense, hr_recruitment,
   loyalty, lunch, mail, mass_mailing, note, project, stock, survey,
   web_tour

**Foreword**
Since d19037e141 the rootnode class attribute for form/list views was
copied two times:
- on the o_view_controller div
- and on the root node of the view renderer.

Examples:

<form class="foo">...</form>

    gives

<div class="o_view_controller o_form_view foo">
    <div class="o_control_panel">...</div>
    <div class="o_content">
        <div class="foo o_form_editable ...">...</div>
    </div>
</div>

and

<list class="foo">...</list>

    gives

<div class="o_view_controller o_list_view foo">
    <div class="o_control_panel">...</div>
    <div class="o_content">
        <div class="o_list_renderer foo ...">...</div>
    </div>
</div>

**Issue**
This could lead to confusion and also unexpected styling issues.
See this PR #119815 to read a message JS Framework team has received.
See also another a fix that had to be made for x2m fields: 980244fa8

**Introduced Changes**
- in the form compiler, the root node attributes are no more copied to
  the root div node of the compiled template the form renderer receives
- the root div node generated by the form compiler now has the
  "o_form_renderer" class, which was removed during the recent form view
  refactoring.
- the list renderer no more adds the root node class attribute to its
  "o_list_renderer" div
- the X2ManyFieldDialog has been adapted too
- since View, X2ManyField & X2ManyFieldDialog both need to compute view
  classnames derivated from the arch root node, an util has been
  introduced to avoid duplicating code
- the whole codebase has been checked and adapted.

Related: odoo/enterprise#40418
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-04-27 16:10:30 +02:00

133 lines
6.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="project_update_view_search" model="ir.ui.view">
<field name="name">project.update.view.search</field>
<field name="model">project.update</field>
<field name="arch" type="xml">
<search string="Search Update">
<field name="name"/>
<field name="project_id" invisible="1"/>
<field name="user_id"/>
<field name="description"/>
<field name="status"/>
<filter string="My Updates" name="my_updates" domain="[('user_id', '=', uid)]"/>
<filter string="Followed Updates" name="followed_updates" domain="[('message_is_follower', '=', True)]"/>
<separator/>
<filter string="On Track" name="on_track" domain="[('status', '=', 'on_track')]"/>
<filter string="At Risk" name="at_risk" domain="[('status', '=', 'at_risk')]"/>
<filter string="Off Track" name="off_track" domain="[('status', '=', 'off_track')]"/>
<filter string="On Hold" name="on_hold" domain="[('status', '=', 'on_hold')]"/>
<separator/>
<filter name="date" string="Date" date="date"/>
</search>
</field>
</record>
<record id="project_update_view_form" model="ir.ui.view">
<field name="name">project.update.view.form</field>
<field name="model">project.update</field>
<field name="arch" type="xml">
<form string="Project Update" js_class="form_description_expander">
<sheet>
<div class="oe_title">
<h1>
<field name="name" class="o_text_overflow" placeholder="e.g. Monthly review"/>
</h1>
</div>
<group>
<group>
<field name="project_id" invisible="1"/>
<field name="color" invisible="1"/>
<field name="status" widget="status_with_color"/>
<field name="progress" widget="progressbar" options="{'editable': true}"/>
</group>
<group>
<field name="user_id" widget="many2one_avatar_user" readonly="1"/>
<field name="date"/>
</group>
</group>
<separator/>
<notebook>
<page string="Description" name="description">
<field name="description" nolabel="1" class="o_project_update_description" options="{'resizable': false}"/>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" options="{'post_refresh':True}" groups="base.group_user"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<record id="project_update_view_kanban" model="ir.ui.view">
<field name="name">project.update.view.kanban</field>
<field name="model">project.update</field>
<field name="arch" type="xml">
<kanban sample="1" js_class="project_update_kanban">
<field name="color"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="{{!selection_mode ? 'oe_kanban_color_' + record.color.raw_value : ''}} oe_kanban_global_click o_pupdate_kanban_card">
<!-- Project Update Kanban View is always ungrouped - see js_class -->
<div class="o_kanban_detail_ungrouped row">
<div class="col-sm-4 col-6 o_pupdate_name">
<b><field name="name_cropped"/></b>
<div>
<field name="user_id" widget="many2one_avatar_user"/>
<t t-esc="record.user_id.value"/>
</div>
</div>
<div class="col-sm-2 text-sm-start col-6 align-end">
<field name="color" invisible="1"/>
<b><field name="status" widget="status_with_color"/></b>
</div>
<div class="col-sm-2 col-6 pb-0">
<b><field name="progress_percentage" widget="percentage"/></b>
<div>Progress</div>
</div>
<div class="col-sm-2 col-6 pb-0">
<b><field name="date"/></b>
<div>Date</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="project_update_view_tree" model="ir.ui.view">
<field name="name">project.update.view.tree</field>
<field name="model">project.update</field>
<field name="arch" type="xml">
<tree sample="1" js_class="project_update_list">
<field name="name"/>
<field name="user_id" widget="many2one_avatar_user" class="fw-bold" optional="show"/>
<field name="date" optional="show"/>
<field name="progress" string="Progress" widget="progressbar" optional="show"/>
<field name="color" invisible="1"/>
<field name="status" widget="status_with_color"/>
</tree>
</field>
</record>
<record id="project_update_all_action" model="ir.actions.act_window">
<field name="name">Project Updates</field>
<field name="res_model">project.update</field>
<field name="view_mode">kanban,tree,form</field>
<field name="domain">[('project_id', '=', active_id)]</field>
<field name="search_view_id" ref="project_update_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No updates found. Let's create one!
</p><p>
Get a snapshot of the status of your project and share its progress with key stakeholders.
</p>
</field>
</record>
</odoo>