19 lines
762 B
Python
19 lines
762 B
Python
from odoo import api, fields, models
|
|
|
|
|
|
class EducationLibrary(models.Model):
|
|
_name = 'education.library'
|
|
_description = 'Education Library Master'
|
|
|
|
name = fields.Char(string='Library Name', required=True)
|
|
code = fields.Char(string='Code', required=True, copy=False)
|
|
campus_id = fields.Many2one('education.campus', string='Campus')
|
|
department_id = fields.Many2one('education.department', string='Department')
|
|
location = fields.Char(string='Location')
|
|
librarian_id = fields.Many2one('res.users', string='Librarian')
|
|
phone = fields.Char(string='Phone')
|
|
email = fields.Char(string='Email')
|
|
active = fields.Boolean(default=True)
|
|
|
|
_code_unique = models.Constraint('unique(code)', 'The Library Code must be unique!')
|