Merge lp://staging/~openerp-dev/openobject-client-web/6.0-opw-584450-msh into lp://staging/openobject-client-web

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp://staging/~openerp-dev/openobject-client-web/6.0-opw-584450-msh
Merge into: lp://staging/openobject-client-web
Diff against target: 265 lines (+118/-9)
7 files modified
addons/openerp/static/javascript/form.js (+69/-1)
addons/openerp/static/javascript/wizard.js (+1/-1)
addons/openerp/utils/utils.py (+1/-1)
addons/openerp/validators.py (+28/-1)
addons/openerp/widgets/form/_form.py (+9/-5)
addons/openerp/widgets/form/templates/float.mako (+1/-0)
openobject/widgets/_base.py (+9/-0)
To merge this branch: bzr merge lp://staging/~openerp-dev/openobject-client-web/6.0-opw-584450-msh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+145315@code.staging.launchpad.net

Description of the change

Hello,

Adds the feature of digits support in float field, currently in 6.0, id you have given digits=(16,2) then it does not restrict to enter value upto 16 in float field, it allows more than 16 digits, which should not happen, currently web-client only have validation for rounding precision using formencode, but here this fix will add oue own validation for digits length and rounding precision.

For demo:- add digits=(16,2) in any object's float field or use existing one, and enter digits 18, web-client will allow while submit the form, which should not happen, it should give "Invalid float literal" warning and ask client to enter proper data in float field, so for that changed the validators, mako and form.js(For submit form in formview).

Here in list editable view, submit form not going to call all the validation of editable list view done at py, so changed the validators.py for that so when to_python is called when send data to server, it will validate float data according attrs(digits).

Also checked in wizard, if wizard have float field then validation should also work in that.

Tested on on_change call when wrong data filled in float field, tested with one2many.

Please share your views on this and provide test cases, if you have any other, so that I can check this branch on that test cases also.

Thanks.

To post a comment you must log in.

Unmerged revisions

4901. By Mohammed Shekha<email address hidden>

[ADD]Adds the feature of digits support in float field, currently in 6.0, id you have given digits=(16,2) then it does not restrict to enter value upto 16 in float field, it allows more than 16 digits, which should not happen, currently web-client only have validation for rounding precision using formencode, but here this fix will add oue own validation for digits length and rounding precision.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.