Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Specific Industry Applications
  3. Import Step: Contacts v 17.0
  4. Sales Conditions FAQ

Import Step: Contacts

by Futural https://github.com/tawasta/server-tools
Odoo
v 17.0 Third Party 1
Download for v 17.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies • Contacts (contacts)
• Discuss (mail)
Community Apps Dependencies Show
Import Core
Lines of code 669
Technical Name import_step_contacts
LicenseAGPL-3
Websitehttps://github.com/tawasta/server-tools
You bought this module and need support? Click here!

Import Step: Contacts

Adds a Partners import step for the import_core framework.

This module registers:

  • Import step: partner
  • Runner model: generic.import.runner.partner

The step integrates with the generic dispatcher provided by import_core.

Features

The partner import step supports:

  • Creating new partners
  • Reusing existing partners via search fields
  • Parent/child contact imports
  • Shared import state integration
  • Automatic child contact linking
  • Sequential import chaining

The module depends on:

  • import_core
  • contacts

Import step registration

The module registers the following import step:

<record id="generic_import_step_partner" model="generic.import.step">
    <field name="name">Partners</field>
    <field name="code">partner</field>
    <field name="sequence">10</field>
    <field name="required_models">res.partner</field>
</record>

This means:

  • The dispatcher executes runner:

    generic.import.runner.partner

  • The step is only available when model res.partner exists.

Configuration

  1. Install modules:

    • import_core
    • contacts
    • import_step_contacts
  2. Open:

    Imports -> Templates

  3. Create or edit a template

  4. Add import step:

    • Partners
  5. Configure field mappings for:

    • res.partner
  6. Optionally mark fields as:

    • Is search field

Search fields are used to find existing partners before creating new ones.

Usage

Basic partner import

Map CSV/XLSX columns to res.partner fields.

Example mappings:

  • Name -> res.partner.name
  • Email -> res.partner.email
  • Phone -> res.partner.phone

Import behavior:

  • Existing partners are reused when search fields match
  • New partners are created when no match exists
  • name is required for new partner creation

Example CSV

Name,Email,Phone
Test Partner,test@example.com,123456

Search field behavior

Fields marked as Is search field are used to build search domains.

Example:

  • email marked as search field

The runner performs:

self.env["res.partner"].search([
    ("email", "=", value)
], limit=1)

If a record is found:

  • Existing record is reused
  • Duplicate creation is avoided

Child contacts

Child contacts are supported using CSV/XLSX column:

  • Tyyppi

If value equals:

  • child

(case-insensitive)

then the row is treated as a child contact.

Example CSV

Tyyppi,Name,Email
main,Company A,company@example.com
child,John Doe,john@example.com
child,Jane Doe,jane@example.com

Behavior

When importing child rows:

  • The latest main partner is stored in shared state

  • Child contacts automatically receive:

    parent_id = main_partner.id

  • Child rows skip remaining import steps using:

    state["_skip_rest"] = True

This prevents child contact rows from executing unrelated import logic.

Shared import state

The runner stores records into import state using:

state = self._set_state_record(
    state,
    "partner",
    partner,
)

For main contacts:

state["main_partner"] = partner

This allows later rows and later steps to reuse the partner record.

Error handling

The module provides user-friendly validation errors.

Missing main partner

If a child row appears before a main partner:

Child-kontaktirivi ilman pääkontaktia.

Missing partner name

If a new partner would be created without name:

Partnerilta puuttuu nimi (name).

Errors include:

  • CSV row number
  • Original row data
  • Processed values

Technical implementation

The runner inherits:

_inherit = "generic.import.runner.base"

Available helper methods include:

  • _get_or_create()
  • _clean_vals()
  • _set_state_record()
  • _build_domain()

Partner creation flow

Simplified flow:

  1. Read mapped values
  2. Build search domain
  3. Search existing partner
  4. Create if not found
  5. Store result into shared state
  6. Handle child logic

Dependencies

Python dependencies:

  • None

Odoo dependencies:

  • import_core
  • contacts

Known issues / Roadmap

Credits

Contributors

  • Valtteri Lattu <valtteri.lattu@tawasta.fi>

Maintainer

Oy Tawasta OS Technologies Ltd.

This module is maintained by Oy Tawasta OS Technologies Ltd.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with