Fields get blued in view mode if attrs is applied.

Bug #659782 reported by Russell Briggs
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Low
OpenERP R&D Web Team
5.0
Won't Fix
Undecided
Unassigned
Trunk
Fix Released
Low
OpenERP R&D Web Team

Bug Description

Thank you for your speedy fix to my last problem! :) Unfortunately I've found another bug with conditional formatting:

We have a number of fields conditionally made required (using attrs). When the form is shown in 'view' mode, these fields are incorrectly highlighted blue.

The problem seems to be in the 'form_setRequired()' function in static/javascript/form_state.js. It does not take into account whether the form is editable or not (_terp_editable).

Please see my below suggested fix (starting from line 319 of form_state.js):

var form_setRequired = function(container, field, required) {

    var editable = getElement('_terp_editable').value;

    if (editable == 'True') {
        if (required) {
            MochiKit.DOM.addElementClass(field, 'requiredfield');
        } else {
            MochiKit.DOM.removeElementClass(field, 'requiredfield');
        }
    }
    MochiKit.DOM.removeElementClass(field, 'errorfield');

    var kind = MochiKit.DOM.getNodeAttribute(field, 'kind');

    if (field.type == 'hidden' && kind == 'many2one') {
        form_setRequired(container, getElement(field.name + '_text'), required);
    }
}

summary: - [5.0] conditionally required fields highlighted in 'view' mode
+ Fields get blued in view mode if attrs is applied.
Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Hello,

Our R&D Teams are focused on the latest OpenERP version, and this issue does not affect it.

Thanks.

Revision history for this message
Jiten (OpenERP) (jiten-openerp) wrote :

Hello Russell Briggs,

It has been fixed in trunk web branch by revision number :4083
<email address hidden>

Thanks for suggested fix.

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.