~jfb-tempo-consulting/unifield-web/py3

« back to all changes in this revision

Viewing changes to addons/openerp/controllers/impex.py

  • Committer: jf
  • Date: 2022-08-18 14:58:45 UTC
  • mfrom: (5008.1.33 unifield-web)
  • Revision ID: jfb@tempo-consulting.fr-20220818145845-6nqjgp5oxcr0tlx2
[MERGE] uf26.0rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
198
198
        else:
199
199
            m2ofields = []
200
200
 
201
 
        fields.update({'id': {'string': 'ID'}, '.id': {'string': 'Database ID'}})
 
201
        fields.update({'id': {'string': 'SDref'}, '.id': {'string': 'ID'}})
202
202
 
203
203
        fields_order = sorted(fields.keys(), key=lambda x: fields[x].get('string', ''), reverse=True)
204
204
        records = []
325
325
            fields.update(f2)
326
326
 
327
327
        def rec(fields):
328
 
            _fields = {'id': 'ID' , '.id': 'Database ID' }
 
328
            _fields = {'id': 'SDref', '.id': 'ID'}
329
329
 
330
330
            def model_populate(fields, prefix_node='', prefix=None, prefix_value='', level=2):
331
331
                fields_order = sorted(fields.keys(), key=lambda x: fields[x].get('string', ''), reverse=True)
468
468
        error = None
469
469
 
470
470
        fields = dict(rpc.RPCProxy(params.model).fields_get(False, rpc.session.context))
471
 
        fields.update({'id': {'string': 'ID'}, '.id': {'string': 'Database ID'}})
 
471
        fields.update({'id': {'string': 'SDref'}, '.id': {'string': 'ID'}})
472
472
 
473
473
        def model_populate(fields, prefix_node='', prefix=None, prefix_value='', level=2):
474
474
            def str_comp(x,y):
491
491
                        model_populate(fields2, prefix_node+field+'/', None, st_name+'/', level-1)
492
492
 
493
493
                    if fields[field].get('relation',False) and level>0:
494
 
                        model_populate({'/id': {'type': 'char', 'string': 'ID'}, '.id': {'type': 'char', 'string': 'Database ID'}},
 
494
                        model_populate({'/id': {'type': 'char', 'string': 'SDref'}, '.id': {'type': 'char', 'string': 'ID'}},
495
495
                                       prefix_node+field, None, st_name+'/', level-1)
496
 
        fields.update({'id':{'string':'ID'},'.id':{'string':_('Database ID')}})
 
496
        fields.update({'id': {'string': 'SDref'}, '.id': {'string': _('ID')}})
497
497
        model_populate(fields)
498
498
 
499
499