Hide fields in a form in edit-mode as it is possible for view-mode

Bug #1156898 reported by Daniel Hammerschmidt
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Wishlist
Unassigned
OpenERP Community Backports (Web)
Opinion
Wishlist
Unassigned

Bug Description

It is possible to hide fields in a form while viewing (e.g. the partner's field 'is_company'). It would be fine if it is possible to hide fields that easy while editing (e.g. a computed one2many-list).

This simply requires an extension to the selector-list of the cass-rule for oe_edit_only (see attaachment).

Related branches

Revision history for this message
Daniel Hammerschmidt (redneck) wrote :
Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Daniel,

I have checked your Issue, But It's ambiguous to us. So Would you please elaborate more. and It's batter for us If you provide step for reproduce.

Thank you and waiting for your reply!

Changed in openerp-web:
status: New → Incomplete
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

I'd favour this. In fact a customer requested this exact feature for a view that contains a large number of unwritable function fields. In write mode, this view looks like a large grey slab dotted with a small number of writeable fields. We want to be able to hide the unwriteable fields in write modus.

Therefore, setting to confirmed.

Changed in openerp-web:
status: Incomplete → Confirmed
Revision history for this message
Daniel Hammerschmidt (redneck) wrote :

Hello,

the following is a snippet from the form view architecture for res.partner (base.view_partner_form):

                    <div class="oe_title">
                        <div class="oe_edit_only">
                            <label for="name"/> (
                            <field name="is_company" on_change="onchange_type(is_company)" class="oe_inline"/> <label for="is_company" string="Is a Company?"/>)
                        </div>
                      ...
                    </div>

The label for the name field and the field is only visible while editing the record.

I added a functional field of type one2many to the res.partner model which is read-only, but there is a "real" field which the computation is based on and therefore it is editable. So, I want to hide the computed field while editing and the "real" field while viewing the record as in the following snippet.

          <div class="oe_view_only oex_kanban_table oex_as_fields">
            <field name="all_commchannel_ids" nolabel="1" mode="kanban" context="{'active_partner_id': active_id}">
              ...
            </field>
          </div>
          <div class="oe_edit_only">
            <label string="Communication" class="oe_horizontal_separator"/>
            <field name="commchannel_ids" nolabel="1" mode="tree"
              context="{'default_partner_id': active_id, 'active_test': False}">
              ...
            </field>
          </div>

To get this running I added ".openerp .oe_form_editable .oe_view_only" to the selector list or the css-rule for ".oe_edit_only".

Revision history for this message
Paramjit Singh Sahota(OpenERP) (psa-openerp) wrote :

Hello Daniel Hammerschmidt,

I have checked your scenario, but this is not a bug but its your suggestion for improvement.
It's good Implementation as per the usability point of view. So We can consider this is as your suggestion and considering it as a "Wishlist".

Thanks for the reporting!

Changed in openerp-web:
status: Confirmed → New
status: New → Confirmed
importance: Undecided → Wishlist
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

I've tested the attached patch in v7.0 and it works for me. I pushed a branch and MP for OCB.

Changed in ocb-web:
assignee: nobody → Lionel Sausin - Numérigraphe (lionel-sausin)
importance: Undecided → Wishlist
status: New → Fix Committed
Changed in ocb-web:
status: Fix Committed → Won't Fix
assignee: Lionel Sausin - Numérigraphe (lionel-sausin) → nobody
Changed in openerp-web:
assignee: OpenERP R&D Web Team (openerp-dev-web) → Lionel Sausin - Numérigraphe (lionel-sausin)
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

This won't fit the OCB strategy, so I moved the 7.0 branch to openobject-addons for the sake of clarity: it merges into the official 7.0 as well as OCB.
 I'm going to propose a merge directly into the trunk.

Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

Looks like this is fixed in the trunk already: please check out revid:<email address hidden>
The style is named "or_read_only", not "or_view_only" as we proposed.

Changed in openerp-web:
assignee: Lionel Sausin - Numérigraphe (lionel-sausin) → nobody
status: Confirmed → Fix Released
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

I meant to write: "oe_read_only"

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

@Lionel good to hear. Thanks for your work!

Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

Since this is in trunk now, maybe we can allow a backport.

Changed in ocb-web:
status: Won't Fix → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.