Skip to Content
Menu
This question has been flagged
1 Atsakyti
3245 Rodiniai

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

Portretas
Atmesti
Autorius 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
Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
geg. 25
2157
2
kov. 24
3159
0
rugs. 22
3946
0
rugs. 22
1922
1
lapkr. 22
2319