[TRUNK 4305] INVISIBLE AND REQUIRED ATTRS NOT EVALUATED

Bug #704492 reported by Serge
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Low
OpenERP R&D Web Team

Bug Description

SITUATION

a field date and a text field

TEXT fields need to be visible and required only if the date is 16 year old or less

ON NO EDIT MODE

   DATE AGE > 16 YEAR : Field invisible BUT LABEL is visible (NOT OK LABEL NEED TO BE INVISIBLE TOO)
   DATE AGE <= 16 YEAR : Field and label visible (OK)

ON EDIT MODE OPEN WITH DATE AGE <= 16

    Field & Lable visible and required (OK)

    CHANGE DATE AGE TO BE > 16

    Field & Lable visible and required (NOT OK THAT NEED TO BE INVISIBLE AND NOT REQUIRED)

ON EDIT MODE OPEN WITH AGE > 16

    Field invisible, Lable visible, not required (NOT OK LABEL NEED TO BE INVISIBLE TOO)

    CHANGE DATE AGE TO BE <= 16

    Field invisible, Lable visible, not required (NOT OK Field NEED TO BE INVISIBLE AND REQUIRED)

ATM i have no time to debug that, but that will work fine and previous version, can't remember de version number, but i know that worked fine, today we test and that no more worked.

I hope i'm clear in my explication. This is a major bug for me and maybe for many other develloper, it's not normal then ATTRS is not re-evaluate when value change.

Revision history for this message
qdp (OpenERP) (qdp) wrote :

hello,

i checked and i confirm the bug: attrs aren't working well in the web client.
1st bug:
-open the form view of a product.
-there is currently attrs on the weight and volume (make it readonly if product is a service)
-open a service product in edit mode and change its type to stockable
=> the fields stay not editable

2nd bug:
-modify the attrs in order to make it invisible instead of readonly if product is a service
-open a stockable product and change its type to service
=> the field is hidden but the label is still visible

Thanks Serge for the bug report, but next time try not to abuse of capital letters !
Quentin

Changed in openobject-client-web:
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-client-web:
status: Confirmed → Fix Released
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Serge, thanks for reporting, this should be fixed if you update to the latest web client revision.

By the way, please avoid using all capitals sentences in bug reports, as it has a bad impact on readability, and it does not actually put emphasis on anything if everything is in uppercase.

Revision history for this message
Serge (sboivin) wrote :

"By the way, please avoid using all capitals sentences in bug reports, as it has a bad impact on readability, and it does not actually put emphasis on anything if everything is in uppercase."

Ok i will try, the problem is lauchpad dont have anyway to format, no way to change color or style, anyway i will try to avoid capitals ;)

Revision history for this message
Serge (sboivin) wrote :

I updated my web-client code and server code, problem not solve

and not always visible never go invisible and never go required... problem today is more bug than yesterday

Revision history for this message
Serge (sboivin) wrote :

I updated my web-client code and server code, problem not solve

and always visible never go invisible and never go required... problem today is more bug than yesterday

Revision history for this message
Serge (sboivin) wrote :

Sorry that work, i do my test with a module customer to remove the attrs, so i tested without the module and condition to hidden and require work

GOOD JOB :P

Revision history for this message
Serge (sboivin) wrote :

This bug back from last trunk

ATTRS not evaluate after a on_change events

To solve the problem, i added form_hookAttrChange();

in addons/openerp/static/javascript/form.js
in function onChange(caller)

after the line 680 (fld.__lock_onchange = false;)

add this

form_hookAttrChange();

Anyone can confirm it, in my test all time i have a on_change with result modify other fields and some attrs on this fields, attrs no evaluate, my fix solve the problem.

Changed in openobject-client-web:
status: Fix Released → New
Revision history for this message
Serge (sboivin) wrote :

how reproduce the problem

field1 a boolean field
field2 with a attrs invisible when field1 = True
field3 with a on_change events, result change the value of field1

result

field1 change value but field2 dont hide or dont show (depend of the value)

Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Hello Serge,

I have tested the bug scenario and reproduced the problem .
So, I am confirming this bug.

Thanks for reporting

Changed in openobject-client-web:
assignee: nobody → OpenERP SA's Web Client R&D (openerp-dev-web)
importance: Medium → Low
status: New → Confirmed
Changed in openobject-client-web:
status: Confirmed → In Progress
Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello Serge,

Its fixed in trunk web-client. Please update your code and notify us.
Revision info:
4546 <email address hidden>

Thanks.

Changed in openobject-client-web:
status: In Progress → Fix Released
Revision history for this message
Sananaz (Open ERP) (sma-tiny) wrote :

Hello Serge,

For your comment #7 (ATTRS not evaluated after on_change events ), now fixed this problem in trunk web-client.
Please update your code.
Revision-info:
4578 <email address hidden>

Thank you for notifying.

Revision history for this message
Juanjo A (juanjoa) wrote :

Hi, I on latest version, but I have this problem.
When I change a boolean field, with on_change method, on a tree editable view, the attribute of a second field dont change.

On form view, this work ok, but not on editable tree view. The attrs dont change.

Thx
Juanjo A

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.