Files
odoo_source/addons/pad_project/views/project_views.xml
T
Rémy Baranx (bar) 11cd84317d [IMP] pad_project: collaborative pads in portal
When the 'collaborative pads' option is activated for a project,
and the visibility is set to 'portal users', it is possible to define
the access level to pads to edit task descriptions.

- If set to 'internal users', the behavior stays the same.
- If set to 'portal users', a portal user has access to a pad to edit
  task descriptions on the portal.

When configured for portal users access, by default, the task description
is displayed with an 'edit' button on top of it.

On 'edit' button click, the page is re-rendered with an additional
url parmater 'edit=1' to switch to edit mode.

In edit mode, the task description is shown in a collaborative pad,
with a 'Save' button on top of it.

On 'save' button click, the page is re-rendered with the 'edit' url
parameter, to switch in classic mode (read-only).

TaskID: 2204379

[IMP] project: collaborative pads in portal

In order to be (easily) able to add buttons to the right of the description
title, the description title is put inside a d-flex div.

closes odoo/odoo#46591

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-19 14:33:02 +00:00

46 lines
2.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_task_form2_inherit_pad_project" model="ir.ui.view">
<field name="name">project.task.form.inherit</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='description']" position="attributes">
<attribute name="attrs">{'invisible': [('use_pad', '=', True)], 'readonly': [('use_pad', '=', True)]}</attribute>
</xpath>
<field name="description" position="after">
<field name="use_pad" invisible="1"/>
<field name="description_pad" widget="pad" attrs="{'invisible': [('use_pad', '=', False)], 'readonly': [('use_pad', '=', False)]}"/>
</field>
</field>
</record>
<record id="project_project_view_form" model="ir.ui.view">
<field name="name">project.project.view.form</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='rating_settings']" position="after">
<div class="col-lg-6 o_setting_box" id="pad_settings">
<div class="o_setting_left_pane">
<field name="use_pads"/>
</div>
<div class="o_setting_right_pane">
<label for="use_pads" string="Collaborative Pads"/>
<div class="text-muted">
Use collaborative rich text pads on tasks
</div>
<div class="content-group" attrs="{'invisible': ['|', ('use_pads', '=', False), ('privacy_visibility', '!=', 'portal')]}">
<div class="mt16 row">
<label for="pad_availability" string="Available to:" class="col-3 col-lg-3 o_light_label"/>
<field name="pad_availability" widget="radio"/>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>