Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3166 Weergaven

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

Avatar
Annuleer
Auteur Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
mei 25
2098
2
mrt. 24
3108
0
sep. 22
3806
0
sep. 22
1882
1
nov. 22
2224