Skip to Content
Menu
This question has been flagged
4 Replies
8037 Views

I'm trying to import some contacts in odoo but i have some fields in my xls file that don't correspond to any of the predefined fields.

For example i have a field in my current database that is called 'FDURCC' and i'd like to be able to create a custom field in odoo with that name. That way i can map it correctly.

i'm using the latest version of odoo.

Avatar
Discard
Author Best Answer

Thanks for the help. I actually found an addon called crm_custom_fields that let's you do exactly what i wanted. It's a bit buggy but it works.

Avatar
Discard
Best Answer

Hi Kevin, where can I find this addon that you found? I'm facing the same problem. Found a few custom-field type addons, but not sure if they are the correct ones, do you have a link?

Avatar
Discard
Best Answer

you might want to create a custom module. read the docs\ https://www.odoo.com/documentation/8.0/howtos/backend.html 

You can request a customization from an odoo expert or try your own.

The rough idea is like this 

create a python file

from odoo import models, fields
class NewModel(models.Model):
    _inherit = 'res.partner'
    fdurcc = fields.Char(string="FDURCC")


And create the xml file

<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data>
<record id="res_partner_fdurcc" model="ir.ui.view">
<field
name="name">fdurcc</field>
<field
name="model">res.partner</field>
<field
name="inherit_id" ref="base.view_partner_form"/>
<field
name="arch" type="xml">

            <xpath expr="//field[@name='category_id']" position="after">
                    <field name='fdurcc' />

            </field>

        </record>

    </data>

</odoo>


build your module and install it. There you go....         




Avatar
Discard
Best Answer

You can only import fields, which are already available in Odoo. If you miss fields, you have to customize Odoo first and add these fields. This can be done by creating a module as described by Kevin, or by using other means, see https://www.odoo.com/forum/help-1/question/crm-133521. Creating custom fields and importing data are different topics which are not related.    

Avatar
Discard