Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
1416 Widoki

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')
Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
4
paź 25
2959
2
wrz 25
1897
4
wrz 25
7018
0
sie 25
910
4
maj 25
3761