← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 597149] Re: Some fields are not exportable

 

** Changed in: openobject-client-web
       Status: New => Fix Released

** Changed in: openobject-client-web
    Milestone: None => 5.0.15

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

Status in OpenObject Web Client: Fix Released

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'.