Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda

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

Avatar
Buang
Penulis Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Mei 25
2067
2
Mar 24
3093
0
Sep 22
3747
0
Sep 22
1840
1
Nov 22
2185