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

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

Avatar
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
kvě 25
2050
2
bře 24
3086
0
zář 22
3715
0
zář 22
1826
1
lis 22
2164