18 lines
591 B
Python
18 lines
591 B
Python
from odoo import models, fields
|
|
|
|
class EducationRoom(models.Model):
|
|
_name = 'education.room'
|
|
_description = 'Education Room/Venue'
|
|
_order = 'name'
|
|
|
|
name = fields.Char(string='Name', required=True)
|
|
code = fields.Char(string='Code', required=True, index=True)
|
|
capacity = fields.Integer(string='Capacity', default=30)
|
|
building = fields.Char(string='Building / Location')
|
|
active = fields.Boolean(default=True)
|
|
description = fields.Text(string='Description')
|
|
|
|
_sql_constraints = [
|
|
('code_unique', 'unique(code)', 'Room code must be unique!')
|
|
]
|