Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1419 Lượt xem

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')
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 10 25
2961
2
thg 9 25
1901
4
thg 9 25
7021
0
thg 8 25
912
4
thg 5 25
3764