[6.1] digits attribute not respected

Bug #994589 reported by Yves Hoyos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Web Team

Bug Description

Hello,

There is a problem with the digit attibute in the new web client.

I was trying to set decimal precision to 4 digits in the hr.expense module.
I adapted the configuration of the decimal_precision module. It works in the database, but it was not visible in the ERP.

To correct this, I try to edit the XML of the view, and add the "digits" attribute.
The objects changed were "hr.expense" and "hr.expense.line".
Exemple: In the view "hr.expense.form", I change <field name="unit_amount"/> to <field name="unit_amount" digits="(14,4)"/>.

Here is the bugs.

The first one is in the page_view and/or list_view (not sure witch one): the attribute isn't well parsed. The result is that only 1 digit was displayed. I try to change the XML to <field name="unit_amount" digits="(4)"/> and I get 4 digits. So there is a problem with the format of the attribute.

The second one is that the attribute is well parsed in the form_view but not saved.
To use the attibute in the form view, the xml must be <field name="unit_amount" digits="(14,4)"/>. Then the function "parse_digits" of addons/web/static/src/js/view_form.js:1534 correctly parse the attribute, but it's not saved in the object. It's useless.
To correct this, the solution is to edit line 1529 and replace it by:
this.digits = this.parse_digits(node.attrs.digits);

So I have a "solution" for all the bugs but I can not use them at the same time !

Could you investigate on this ?

Thanks.

Related branches

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :
Changed in openerp-web:
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
importance: Undecided → Low
status: New → Confirmed
Changed in openerp-web:
status: Confirmed → In Progress
Revision history for this message
Vidhin Mehta (OpenERP) (vme-openerp) wrote :
Changed in openerp-web:
status: In Progress → Fix Committed
Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

Merged in 2591. Please note that specifying the digits attribute like "(4)" is not a valid syntax. It must be a tuple of 2 numbers.

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.