Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
3242 Visualizações

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

Avatar
Cancelar
Autor Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
0
mai. 25
2154
2
mar. 24
3158
0
set. 22
3945
0
set. 22
1921
1
nov. 22
2317