የSmartERP መመሪያ የAshewa Technology Solutions መድረክ
ይህ ገጽ ገና ወደ አማርኛ አልተተረጎመም። የእንግሊዝኛው ጽሑፍ ቀርቧል።

Timesheets Technical Architecture & Data Model

Technical reference of models, ORM hooks, database constraints, extension points, and unit test suites for smart_enterprise_timesheet.

This technical reference is for software engineers, ERP architects, and technical administrators extending SmartERP's timesheet platform.

Enterprise Timesheet Compliance Technical Architecture

Entity Relationship Model#

 +----------------------------------+          +----------------------------------+
 |    smart.timesheet.period.lock   |          | smart.timesheet.period.lock.     |
 +----------------------------------+          | override                         |
 | id : integer                     |          +----------------------------------+
 | company_id : res.company         | 1      * | id : integer                     |
 | lock_date : date                 +--------->| company_id : res.company         |
 | active : boolean                 |          | user_id : res.users              |
 | note : text                      |          | analytic_line_id : account.ana...|
 +----------------------------------+          | action : selection               |
                                               | note : text                      |
 +----------------------------------+          +----------------------------------+
 |   smart.timesheet.control.rule   |
 +----------------------------------+          +----------------------------------+
 | id : integer                     |          | smart.timesheet.escalation.line  |
 | company_id : res.company         | 1      * +----------------------------------+
 | department_ids : hr.department   +--------->| id : integer                     |
 | deadline_days_after_period : int |          | rule_id : smart.timesheet.con... |
 | grace_period_days : int          |          | sequence : integer               |
 | reminder_enabled : boolean       |          | target_role : selection          |
 | escalation_enabled : boolean     |          | template_id : mail.template      |
 +----------------------------------+          +----------------------------------+

Key Technical Methods & ORM Hooks#

1. Lock Date Enforcement (account.analytic.line)#

def _check_smart_period_lock(self):
    for line in self:
        company = line.company_id or self.env.company
        lock_date = self.env['smart.timesheet.period.lock']._effective_lock_date(company)
        if lock_date and line.date and line.date <= lock_date:
            if not self._smart_has_lock_override():
                raise AccessError(_(
                    "Timesheet period is locked through %s. Adjustments require "
                    "Timesheet Lock Override authorization.", lock_date
                ))
            self._smart_log_override('write', line=line)

2. Unit Testing Baseline#

The module includes exhaustive test suites under addons/smart_enterprise_timesheet/tests/:

  • test_period_lock.py: Validates ORM create/write/unlink blocks on locked dates.
  • test_control_rule.py: Validates deadline computations and reminder thresholds.
  • test_escalation.py: Tests automated tier escalation and recipient resolution.
  • test_grid_config.py: Verifies decimal rounding and calendar conversions.
መጨረሻ የተሻሻለው: 2026-10-16