Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
1424 Visualizações

I tried to set a default status value to "Draft" when creating a new record, but the status is always blank. If I set the status manually, it worked. Here is the my command. Am I missing something?

class custom_purchase(models.Model):
_name = 'custom.purchase'

name = fields.Char(string="Name")
tanggal = fields.Date(string="Tanggal")
status = fields.Selection([('draft','Draft'),('approve','Approve'),('done','Done')], default='draft')
Avatar
Cancelar
Melhor resposta

Try upgrade restart server and update module, perhaps the default has not been updated yet

Avatar
Cancelar
Autor Melhor resposta

Restarted Odoo service, ran Update App List, ran Apply Upgrade, upgraded the module, and it worked! Thanks!

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
4
out. 25
2961
2
set. 25
1904
4
set. 25
7025
0
ago. 25
912
4
mai. 25
3770