← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 879412] [NEW] boolean fields validation issues

 

Public bug reported:

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.

** Affects: openerp-web
     Importance: Medium
     Assignee: OpenERP R&D Web Team (openerp-dev-web)
         Status: Confirmed


** Tags: rc1

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/879412

Title:
  boolean fields validation issues

Status in OpenERP Web:
  Confirmed

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openerp-web/+bug/879412/+subscriptions


Follow ups

References