Skip to Content
Menú
This question has been flagged

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

Avatar
Descartar
Autor 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
Descartar
Related Posts Respostes Vistes Activitat
0
de maig 25
2033
2
de març 24
3062
0
de set. 22
3670
0
de set. 22
1817
1
de nov. 22
2152