You have been assigned a bug task for a public bug by DBR (OpenERP)
(dbr-openerp):
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);
}
}
** Affects: openobject-client-web
Importance: Low
Assignee: OpenERP SA's Web Client R&D (openerp-dev-web)
Status: Confirmed
** Affects: openobject-client-web/5.0
Importance: Undecided
Status: Won't Fix
** Affects: openobject-client-web/trunk
Importance: Low
Assignee: OpenERP SA's Web Client R&D (openerp-dev-web)
Status: Confirmed
--
Fields get blued in view mode if attrs is applied.
https://bugs.launchpad.net/bugs/659782
You received this bug notification because you are a member of OpenERP SA's Web
Client R&D, which is a bug assignee.
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-web
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-web
More help : https://help.launchpad.net/ListHelp