After creating a new model, the next step is to add fields to it. Let's explore the several types of fields available in Odoo.
We now have a
Stage model and will expand it to add some additional fields. We should edit the
todo_ui/todo_model.py file, by removing some unnecessary attributes included before for the purpose of explanation, making it look like this:
class Stage(models.Model): _name = 'todo.task.stage' _order = 'sequence,name' # String fields: name = fields.Char('Name', 40) desc = fields.Text('Description') state = fields.Selection( [('draft','New'), ('open','Started'),('done','Closed')], 'State') docs = fields.Html('Documentation') # Numeric fields: sequence = fields.Integer('Sequence') perc_complete ...