Files
Odoo-Modules/fusion-plating/fusion_plating_cgp/models/fp_cgp_access_log.py
gsinghpal be611876ad changes
2026-04-12 09:09:50 -04:00

64 lines
1.8 KiB
Python

# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
# Part of the Fusion Plating product family.
from odoo import fields, models
class FpCgpAccessLog(models.Model):
"""Physical access log for CGP-controlled areas.
Every entry and exit from a controlled area must be logged so a
timeline can be reconstructed in the event of an incident. In a
typical shop the entries are created automatically by an access
control system; this model is the lightweight hand-entry fallback.
"""
_name = 'fusion.plating.cgp.access.log'
_description = 'Fusion Plating — CGP Access Log Entry'
_order = 'access_datetime desc, id desc'
employee_id = fields.Many2one(
'hr.employee',
string='Employee',
)
access_datetime = fields.Datetime(
string='Date / Time',
required=True,
default=lambda self: fields.Datetime.now(),
)
access_point = fields.Char(
string='Access Point',
required=True,
help='Door, gate, or zone name.',
)
entry_exit = fields.Selection(
[
('entry', 'Entry'),
('exit', 'Exit'),
],
string='Direction',
default='entry',
required=True,
)
access_type = fields.Selection(
[
('employee', 'Employee'),
('visitor_escorted', 'Visitor (Escorted)'),
('visitor_unescorted', 'Visitor (Unescorted)'),
],
string='Access Type',
default='employee',
required=True,
)
related_visitor_id = fields.Many2one(
'fusion.plating.cgp.visitor',
string='Related Visitor',
)
company_id = fields.Many2one(
'res.company',
string='Company',
default=lambda self: self.env.company,
)
notes = fields.Char(string='Notes')