This question has been flagged
1 Reply
4582 Views

When creating fields, I can't export or import these fields in v7. I can view the fields in the export popup, but it will never actually export if this field is in the add column.

The fields are created under Settings->Database Structure->Fields and look like this:

Field Name: x_user.id
Field Label: Outside Salesperson

Type: Custom Field
Model: Partner
In Modules: Null

Field Type: many2one
Object Relation: res.users
Relation Field: Null
Selection Options: Null
Domain: []
Serialization Field: Null
On Delete: Set NULL

Required: Null
Readonly: Null
Searchable: Not Searchable
Translatable: Null

When viewing the export popup, this field is displayed and I move it to the Add Column. Now, when I press Export, it just will never export.

EDIT: openero-server.log has the message:

KeyError: u"Field 'x_user' does not exist in object 'browse_record(res.partner, 14367)'"

There's also a traceback error:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 1245, in export_data
    datas += self.__export_row(cr, uid, row, fields_to_export, context)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 1162, in __export_row
    r = r[f[i]]
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 386, in __getitem__
    raise KeyError(error_msg)
Avatar
Discard
Best Answer

I believe the problem is the dot in the name.

Fields:

  • field must be in lowercase, separated by underscores. T
  • try to use commonly used names for fields: name, state, active, partner_id, eso.

Conventions for the field name depends on the field type:

  • many2one: must end by '_id' (eg: partner_id, order_line_id)
  • many2many: must end by '_ids' (eg: category_ids)
  • one2many: must end by '_ids' (eg: line_ids
Avatar
Discard