Skip to Content
Menú
This question has been flagged
4 Respostes
227 Vistes

I'm trying to update product variant related data via import. However it seems that I cannot make any data updates via import. Even if I try to import just one line of data with ID and some simple data field (for example standard price), I always get "Unclassified error:  Information : <class 'IndexError'>: tuple index out of range at row 2". I have checked that the ID of the product I'm trying to update is in product.product database, as I have just prior exported it from the system.

If I just try to create a new product by importing a product name and standard price this does work.

Any thoughts how I could solve this? Any help is greatly appreciated.

Avatar
Descartar
Best Answer

Hi,

The error you’re seeing happens because standard_price is a product template field, not a variant field, and Odoo doesn’t handle updates well when you try to import it through product.product (variants). That’s why creating new products works, but updating existing ones with just the internal database ID fails and throws the “tuple index out of range” error. The correct way is to export products from Products (product.template), include the “ID” or “External ID” along with the fields you want to update (like standard_price), and then re-import that file. If you really need to update variant-specific fields, you should work with Product Variants (product.product) but identify them using either External IDs or a combination of template and attribute values rather than relying on the raw database ID. This way, Odoo knows exactly which record to update and won’t throw errors.


Hope it helps.

Avatar
Descartar
Autor Best Answer

I have tested with as simple dataset as follows:

id default_code standard_price
__export__.product_product_24721_e5cd5770 ALL-000089 7,80

I have made an export and tried to import the same data, but I encounter the same error every time.

Avatar
Descartar
Best Answer

Hello Mikko,



  It sounds like you're encountering a common issue related to data import in Odoo. This error typically occurs due to a mismatch in the expected format or a misalignment in the data columns. Here's how you can address this:

  1. Double-check the CSV or Excel file format. Ensure that the headers in your import file match exactly with the field names in Odoo for product variants (product.product model).

  2. Verify the ID column. The ID should be the external ID if you're updating existing records. If the external ID is not known, use the database ID but ensure it's correctly mapped.

  3. For the 'tuple index out of range' error, it might help to include an additional column in your import file that uniquely identifies each product variant, such as the default_code (Internal Reference) or the barcode field, alongside the ID.

  4. Test with a minimal dataset. Try importing a single row of data (excluding the header) to isolate the issue. If this succeeds, gradually increase the dataset to identify the problematic entry.

  5. Use Odoo's import compatibility tools. Before importing, Odoo offers a test import feature. Use this to validate your data against common errors.


For personalized assistance:
https://www.pragtech.co.in/contact-us-mql.html

Avatar
Descartar
Best Answer

Can you please provide the details or sample sheet here?

Avatar
Descartar

Hello all,

I forgot the following in the manifest:

‘depends’: [ ‘account_followup’]

and in my module:

followup_reminder_type = fields.Selection(
selection_add=[],
default=‘manual’
)

Now it works properly. When I create a new contact, manual is selected by default.

Thanks for the help :)

I've done the same thing and it is working properly in Odoo.

Related Posts Respostes Vistes Activitat
2
de maig 25
1778
4
de maig 25
5707
1
d’ag. 24
2810
1
de febr. 24
3462
2
de gen. 24
3346