boolean fields validation issues

Bug #879412 reported by Olivier Dony (Odoo)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Web Team

Bug Description

There are currently 2 issues that I can see with the openerp.web.Form.FieldBoolean widget used in Form views:

1) It does not respect the current (read: legacy gtkanonical) semantics of the "required" attribute for boolean fields in OpenERP. Basically the "required" attribute should have no effect for boolean fields, just as it goes on the model level: NULLs are automatically turned to False, which is considered a valid value. This contrasts a bit with the behavior for Char fields, but matches the behavior of Integer/Float fields (NULL -> 0).
We need to correct that in order to make the UI consistent with the way the model level behaves.
(On the framework side I think we will also add warnings when a Boolean, Integer or Float fields is declared required)

2) Due to a peculiarity in the implementation of FieldBoolean, if you render a boolean field invalid, you will never be able to make it valid again, and thus you can never correct it nor save the form. This would normally not matter, because a FieldBoolean should never be invalid, except that it is currently possible, because of 1).

Thanks!

PS: Not to mention that making a checkbox input widget invalid in CSS has no visible effect (at least on webkit browsers), as there is no border or background color that can be seen.

Tags: rc1

Related branches

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

I probably should have reported these 2 issues separately, but issue 2 largely becomes irrelevant once issue 1 is solved, so it somehow makes sense. I'll amend myself by making 2 separate merge proposals for the 2 parts of the bug.

Please be careful not to mark the bug Fix Released until at least issue 1) is solved!

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

See the 2 related merge proposals for a patch for each part of this bug.
A review/confirmation by fme would be appreciated :-)

Thanks

Changed in openerp-web:
status: Confirmed → Fix Committed
Changed in openerp-web:
status: Fix Committed → Fix Released
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.