Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
1436 Vizualizări

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')
Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
4
oct. 25
3006
2
sept. 25
1915
4
sept. 25
7036
0
aug. 25
919
4
mai 25
3794