Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3222 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 25
2147
2
thg 3 24
3141
0
thg 9 22
3915
0
thg 9 22
1911
1
thg 11 22
2308