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: Products v 17.0
  4. Sales Conditions FAQ

Import Step: Products

by Futural https://github.com/tawasta/server-tools
Odoo
v 17.0 Third Party
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 Discuss (mail)
Community Apps Dependencies Show
Import Core
Lines of code 646
Technical Name import_step_products
LicenseAGPL-3
Websitehttps://github.com/tawasta/server-tools
You bought this module and need support? Click here!

Import Step: Products

Adds a Products import step for the import_core framework.

This module registers:

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

The step integrates with the generic dispatcher provided by import_core.

Features

The product import step supports:

  • Creating products
  • Reusing existing products via search fields
  • Shared import state integration
  • Automatic product variant handling
  • Sequential import chaining
  • Product reuse in later import steps

The module depends on:

  • import_core
  • product

Import step registration

The module registers the following import step:

<record id="generic_import_step_product" model="generic.import.step">
    <field name="name">Products</field>
    <field name="code">product</field>
    <field name="sequence">30</field>
    <field name="required_models">product.template</field>
</record>

This means:

  • The dispatcher executes runner:

    generic.import.runner.product

  • The step is only available when model:

    • product.template

    is installed.

Configuration

  1. Install modules:

    • import_core
    • product
    • import_step_products
  2. Open:

    Imports -> Templates

  3. Create or edit a template

  4. Add import step:

    • Products
  5. Configure field mappings for model:

    • product.template
  6. Optionally mark fields as:

    • Is search field

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

Usage

Basic product import

Map CSV/XLSX columns to product.template fields.

Example mappings:

  • Product Name -> product.template.name
  • Internal Reference -> product.template.default_code
  • Sales Price -> product.template.list_price

Import behavior:

  • Existing products are reused when search fields match
  • New products are created when no match exists

Example CSV

Product Name,Internal Reference,Sales Price
Test Product,SKU-001,99.90

Search field behavior

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

Example:

  • default_code marked as search field

The runner performs:

self.env["product.template"].search([
    ("default_code", "=", value)
], limit=1)

If a matching product is found:

  • Existing record is reused
  • Duplicate creation is avoided

Shared import state

The runner stores records into shared state:

state["product_template"]
state["product"]

The product template is stored using:

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

The product variant is automatically resolved using:

product_template.product_variant_id

and stored into state:

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

Automatic model-based state keys are also generated by generic.import.runner.base.

Example:

state["product_template"]
state["product_product"]

Using products in later steps

Later import steps may reuse imported products through state links.

Typical use cases:

  • Sale order lines
  • Subscription lines
  • Event registrations
  • Custom business flows

Example state link configuration:

source_state_key = product
target_model     = sale.order.line
target_field     = product_id

Technical implementation

The runner inherits:

_inherit = "generic.import.runner.base"

Available helper methods include:

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

Import flow

Simplified processing order:

  1. Read mapped product values
  2. Search/create product.template
  3. Store template into shared state
  4. Resolve product_variant_id
  5. Store variant into shared state
  6. Continue to next import step

Single variant behavior

The module currently assumes standard single-variant product usage.

The state key:

  • state["product"]

always points to:

product_template.product_variant_id

This simplifies integration with later import steps expecting product.product records.

Dependencies

Python dependencies:

  • None

Odoo dependencies:

  • import_core
  • product

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