22 lines
904 B
Python
22 lines
904 B
Python
# pyrefly: ignore [missing-import]
|
|
from odoo import api, fields, models
|
|
|
|
class EducationTransportStop(models.Model):
|
|
_name = 'education.transport.stop'
|
|
_description = 'Transport Route Stop'
|
|
_inherit = ['mail.thread', 'mail.activity.mixin']
|
|
|
|
name = fields.Char(string='Stop Name', required=True, tracking=True)
|
|
code = fields.Char(string='Code', required=True, tracking=True)
|
|
address = fields.Text(string='Address')
|
|
latitude = fields.Float(string='Latitude', digits=(10, 7))
|
|
longitude = fields.Float(string='Longitude', digits=(10, 7))
|
|
landmark = fields.Char(string='Landmark')
|
|
|
|
active = fields.Boolean(default=True)
|
|
company_id = fields.Many2one('res.company', string='Company', required=True, default=lambda self: self.env.company)
|
|
|
|
_sql_constraints = [
|
|
('unique_code', 'unique(code, company_id)', 'Stop code must be unique per company!')
|
|
]
|