Kunal Chavda (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-client-web/trunk-bug-726393-kch into 
lp:openobject-client-web.

Requested reviews:
  OpenERP SA's Web Client R&D (openerp-dev-web)
Related bugs:
  #726393 cannot defold parent field in the export box
  https://bugs.launchpad.net/bugs/726393

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/trunk-bug-726393-kch/+merge/52026

Hello,

1. When we export data(from customer) that time we have view_id in params so it 
goes to fields_view_get method for taking fields and bacuase of changes in 
server query(in orm.py revision is 3358) we face problem like can not see child 
of parent in export wizard. And when we change selection of `Export all Data` 
and then select `Import Compatible Export` in export wizard that time it will 
passing through screen.py where view_id becomes false. So that time we can see 
the child of parents.
So I found there is no need to pass view_id to fields_view_get method.

2. some improve code for showing child from save list. currently if we have 
list for export and it has field like Account Recievable/Database ID or Account 
Recievable/ID it shows the null. So for that i have changes in get_data method.
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/trunk-bug-726393-kch/+merge/52026
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client-web/trunk-bug-726393-kch.
=== modified file 'addons/openerp/controllers/impex.py'
--- addons/openerp/controllers/impex.py	2011-02-21 14:45:50 +0000
+++ addons/openerp/controllers/impex.py	2011-03-03 10:06:22 +0000
@@ -92,7 +92,7 @@
     data = fp.read()
     return data
 
-def _fields_get_all(model, views, context=None):
+def _fields_get_all(model, context=None):
 
     context = context or {}
 
@@ -118,8 +118,8 @@
 
     proxy = rpc.RPCProxy(model)
 
-    tree_view = proxy.fields_view_get(views.get('tree', False), 'tree', context)
-    form_view = proxy.fields_view_get(views.get('form', False), 'form', context)
+    tree_view = proxy.fields_view_get(False, 'tree', context)
+    form_view = proxy.fields_view_get(False, 'form', context)
 
     fields = {}
     fields.update(get_view_fields(tree_view))
@@ -138,12 +138,6 @@
         params, data = TinyDict.split(kw)
         ctx = dict((params.context or {}), **rpc.get_session().context)
 
-        views = {}
-        if params.view_mode and params.view_ids:
-            for i, view in enumerate(params.view_mode):
-                views[view] = params.view_ids[i]
-
-
         exports = rpc.RPCProxy('ir.exports')
 
         headers = [{'string' : 'Name', 'name' : 'name', 'type' : 'char'}]
@@ -153,7 +147,6 @@
                                  url=tools.url('/openerp/impex/get_fields'),
                                  field_parent='relation',
                                  context=ctx,
-                                 views=views,
                                  import_compat=int(import_compat))
 
         tree.show_headers = False
@@ -216,7 +209,7 @@
         except:
             views = {}
 
-        fields = _fields_get_all(model, views, ctx)
+        fields = _fields_get_all(model, ctx)
         m2ofields = cherrypy.session.get('fld')
         if m2ofields:
             for i in m2ofields:
@@ -358,7 +351,7 @@
             fields.update(f2)
 
         def rec(fields):
-            _fields = {'id': 'ID' , '.id': 'Database ID' }
+            _fields = {}
 
             def model_populate(fields, prefix_node='', prefix=None, prefix_value='', level=2):
                 fields_order = fields.keys()
@@ -372,7 +365,9 @@
                     _fields[prefix_node+field] = st_name
                     if fields[field].get('relation', False) and level>0:
                         fields2 = rpc.RPCProxy(fields[field]['relation']).fields_get(False)
+                        fields2.update({'id': {'type': 'char', 'string': 'ID'}, '.id': {'type': 'char', 'string': 'Database ID'}})
                         model_populate(fields2, prefix_node+field+'/', None, st_name+'/', level-1)
+            fields.update({'id': {'string': 'ID'}, '.id': {'string': 'Database ID'}})
             model_populate(fields)
 
             return _fields
@@ -422,18 +417,12 @@
 
         ctx = dict((params.context or {}), **rpc.get_session().context)
 
-        views = {}
-        if params.view_mode and params.view_ids:
-            for i, view in enumerate(params.view_mode):
-                views[view] = params.view_ids[i]
-
         headers = [{'string' : 'Name', 'name' : 'name', 'type' : 'char'}]
         tree = treegrid.TreeGrid('import_fields',
                                     model=params.model,
                                     headers=headers,
                                     url=tools.url('/openerp/impex/get_fields'),
                                     field_parent='relation',
-                                    views=views,
                                     context=ctx,
                                     is_importing=1)
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to