İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
1458 Görünümler

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
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
Üretici En İyi Yanıt

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

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
4
Eki 25
3092
2
Eyl 25
1948
4
Eyl 25
7112
0
Ağu 25
944
4
May 25
3866