from odoo import models, fields


class EncoachCourseSection(models.Model):
    _name = 'encoach.course.section'
    _description = 'Course Section'
    _order = 'sequence'

    name = fields.Char(size=200, required=True)
    course_id = fields.Many2one('op.course', required=True, ondelete='cascade')
    skill = fields.Selection([
        ('listening', 'Listening'),
        ('reading', 'Reading'),
        ('writing', 'Writing'),
        ('speaking', 'Speaking'),
        ('grammar', 'Grammar'),
        ('vocabulary', 'Vocabulary'),
        ('overall', 'Overall'),
    ])
    sequence = fields.Integer(default=10)
    module_ids = fields.One2many('encoach.course.module', 'section_id', string='Modules')
