Basic field types

We now have a Stage model and we will expand it to add some additional fields. We should edit the todo_stage/models/todo_task_stage_model.py file and add extra field definitions to make it look like this:

class Stage(models.Model): 
    _name = 'todo.task.stage' 
    _description = 'To-do Stage' 
    _order = 'sequence,name' 
    # String fields: 
    name = fields.Char('Name') 
    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 = fields.Float('% Complete', (3, 2)) 
    # Date fields: 
    date_effective = fields.Date('Effective Date') 
    date_created = fields.Datetime( 'Create ...

Get Odoo 11 Development Essentials - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.