Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3332 มุมมอง

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

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 25
2261
2
มี.ค. 24
3256
0
ก.ย. 22
4050
0
ก.ย. 22
2009
1
พ.ย. 22
2419