Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
246 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

Can you please provide the details or sample sheet here?

Avatar
Zrušit

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 Odpovědi Zobrazení Aktivita
2
kvě 25
1807
4
kvě 25
5729
1
srp 24
2818
1
úno 24
3465
2
led 24
3357