跳至內容
選單
此問題已被標幟
1 回覆
3247 瀏覽次數

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
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
5月 25
2159
2
3月 24
3161
0
9月 22
3948
0
9月 22
1925
1
11月 22
2322