Some fields are not exportable

Bug #597149 reported by asdferfasdfasp9f7as98df
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Undecided
Navrang Oza

Bug Description

When browsing records on the web client, if you click on the export button, only the fields from the default form/tree will appear in the list of available fields. The GTK Client behaves correctly however.

In my case, I use a wizard to craft a context with specific parameters to compute a total of purchases on a supplier using a function field. That function field is only displayed on the view called at the end state of the wizard. When I want to export my carefully-crafted view, I can't select the total of purchases.

Note that for this bug to appear, the view must not have a form associated.

What happens under the hood (controllers/impex.py):

The function _fields_get_all is always called with the view parameter set to '{}'; no matter what. This leads us to the calling code: ImpEx.get_fields(). It turns out that kw['views'] is eval()ed and breaks whenever the current view has no form associated because the value of the element 'form' is not False but false (probably because of some javascript or json).

Example kw['views']:

    '{"tree": 511, "form": false}'

Proposed fix:

    eval(kw['views'].replace('false', 'False'))

Good fix:

    Track down which part of the client passes 'false'.

Revision history for this message
asdferfasdfasp9f7as98df (benoit.m-deactivatedaccount) wrote :
Revision history for this message
asdferfasdfasp9f7as98df (benoit.m-deactivatedaccount) wrote :

Okay. My fix is not as wrong as I thought. To be more correct it should just use the simplejson module to convert the string instead of doing an eval.

Revision history for this message
asdferfasdfasp9f7as98df (benoit.m-deactivatedaccount) wrote :

Meh. I forgot to import the module. Fixed in this new patch.

Changed in openobject-client-web:
assignee: nobody → noz (Open ERP) (noz-tiny)
Revision history for this message
ksh (Axelor) (ksh-axelor) wrote :

Following revision may solve the problem stated
lp:openobject-client-web/5.0 : 2893
So plz update eTiny-source

Revision history for this message
Navrang Oza (noz-tiny) wrote :

Hello Benoit Myard,

Did you update your branch ?
Its working fine or not ?

Regards.

Navrang Oza (noz-tiny)
Changed in openobject-client-web:
status: New → Fix Released
milestone: none → 5.0.15
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.