[Odoo12 filled pit diary] field.selection quotes Use

odoo12 (do not know if other versions of the same problem)

Fields.selection key value in the tuple pair values, the list must be double quotes, not a single quotes.

It can be seen that, if the use single quotes, item of value is generated html "" draft "", contains two double quotes. . .

state = fields.Selection(
[("draft", 'Not Available'),
("available", 'Available'),
("lost", 'Lost')],
'State', default='draft'
)

Guess you like

Origin www.cnblogs.com/waterdroptec/p/11302505.html