Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Can't import/export custom fields in v7?

By
Sean Samborski
on 4/7/14, 3:37 PM 1,459 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)
0

Ray Carnes

--Ray Carnes--
15717
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 4/12/14, 6:08 PM

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/7/14, 3:37 PM
Seen: 1459 times
Last updated: 3/16/15, 8:10 AM