Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged

How to migrate/import hundreds of Gift Cards from another system to Odoo using existing gift cards codes?

Avatar
Opusti
Avtor Best Answer

Since codes for new gift cards are automatically created in a read-only field, the only way to import codes is to 

1) remove the read-only functionality with a customization.

from odoo import models, fields, api

class GiftCard(models.Model):
_inherit = "gift.card"

code = fields.Char(default=lambda x: x._generate_code(), required=True, readonly=False, copy=False)

2) import
Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
0
maj 25
2078
2
mar. 24
3099
0
sep. 22
3766
0
sep. 22
1858
1
nov. 22
2196