# bharathi17656/megacream-staging architecture

> Architecture diagram of the GitHub repository bharathi17656/megacream-staging, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bharathi17656/megacream-staging
- Repository: https://github.com/bharathi17656/megacream-staging

## Overview

#### Purpose and Runtime
This repository is a suite of installable Odoo add-ons for HR/attendance/payroll and business-document customization (accounting, sales, purchasing, inventory). Each module is entered through its Odoo manifest and Python package initialization, for example `advance_attendance/__manifest__.py` and `adevx_hr_leave_rule/__init__.py`. Runtime is the Odoo server, using its ORM, model inheritance, XML views/reports, access-control records, wizards, scheduled actions, and mail activities.

#### HR Attendance and Leave Policy
The core HR customization layer extends Odoo attendance, employee, leave, work-schedule, and payslip models. `adevx_hr_leave_rule/models/hr_leave_rule.py` defines leave-rule behavior; related extensions span `adevx_hr_leave_rule/models/hr_leave_inherit.py` and `adevx_hr_leave_rule/models/hr_payslip.py`. UI and policy configuration are exposed through `adevx_hr_leave_rule/views/hr_leave_rule.xml` and `adevx_hr_leave_rule/views/hr_leave_type.xml`.

#### Advanced Attendance Workflow
`advance_attendance` supplies the operational attendance workflow: configurable approvals, auto-allocation, late-entry handling, schedules, and leave automation. Primary control flow is attendance/leave events → approval or allocation rules → approval requests and HR record updates. Key boundaries are configuration (`advance_attendance/models/approval_config.py`, `advance_attendance/models/auto_allocation_config.py`), workflow records (`advance_attendance/models/approval_request.py`), and the user-driven activity wizard (`advance_attendance/wizard/attendance_activity_wizard.py`). Scheduled/background execution is configured in `advance_attendance/data/cron.xml`; notification integration uses `advance_attendance/data/email_templates.xml`.

#### Biometric Ingestion and Attendance Reporting
The biometric connector isolates integration with BioTime terminals/services from Odoo HR attendance records. Service and terminal configuration live in `l4e_biotime_connector/models/biotime_service.py` and `l4e_biotime_connector/models/biotime_terminal.py`; raw or intermediate attendance-line handling is represented by `l4e_biotime_connector/models/hr_attendance_line.py`, feeding attendance extensions in `l4e_biotime_connector/models/hr_attendance.py`. Reporting is a separate boundary: attendance filters/wizards generate daily and monthly outputs through `attendance_status_filter/models/attendance_report_wizard.py`, `attendance_status_filter/models/monthly_attendance_wizard.py`, and XML templates such as `attendance_status_filter/reports/monthly_attendance_template.xml`.

#### Payroll and Employee Compensation Outputs
Payroll behavior is modified by leave/worked-day rules and statutory controls, while reporting is delivered through Odoo reports and a custom controller. Relevant extensions include `adevx_hr_leave_rule/models/hr_payslip_worked_days.py`, `payroll_pf_esi_control/models/hr_payslip.py`, and `employee_salary_report/models/hr_payslip_inherit.py`. Payment reporting has a request/controller boundary at `payroll_payment_report/controllers/payment_report_controller.py`, with wizard-driven parameter collection in `payroll_payment_report/wizard/payment_report_wizard.py` and rendering in `payroll_payment_report/report/payment_report_template.xml`.

#### Commercial Document Extensions
Accounting, sales, purchasing, and stock are extended independently through Odoo model inheritance and views. Invoice customization/reporting centers on `l4e_invoice_report/models/account_move.py` and `l4e_invoice_report/report/invoice_report_template.xml`; posted invoices can be edited via `l4e_posted_invoice_editor/models/account_move.py`. Sales/purchase charges use wizard-mediated flows in `l4e_transportation_charge/models/sale_order.py` and `l4e_transportation_charge/wizard/transportation_charge_wizard.py`, while draft purchase approval extends orders and users in `purchase_draft_approval/models/purchase_order.py` and `purchase_draft_approval/models/res_users.py`.

#### Security and Presentation Boundaries
Odoo access controls are module-local CSV/XML data, separating authorization from model logic; examples include `advance_attendance/security/approval_request_security.xml` and `adevx_hr_leave_rule/security/leave_access_group.xml`. XML views define back-office entry points and workflows, while report templates define printable outputs. The only evident client-side customization is the partner binary-field widget at `l4e_partner_custom_fields/static/src/fields/many2many_binary_confirm.js`.

Main entry points: [`advance_attendance/models/approval_request.py`](https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/models/approval_request.py) (Approval Requests), [`l4e_biotime_connector/models/hr_attendance.py`](https://github.com/bharathi17656/megacream-staging/blob/main/l4e_biotime_connector/models/hr_attendance.py) (HR Attendance Records), [`adevx_hr_leave_rule/models/hr_payslip_worked_days.py`](https://github.com/bharathi17656/megacream-staging/blob/main/adevx_hr_leave_rule/models/hr_payslip_worked_days.py) (Payroll & Statutory Rules), [`adevx_hr_leave_rule/models/hr_leave_rule.py`](https://github.com/bharathi17656/megacream-staging/blob/main/adevx_hr_leave_rule/models/hr_leave_rule.py) (Leave Policy Rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hr["HR, Attendance &amp; Payroll"]
  node_leave_policy["Leave Policy Rules<br/>HR model extension<br/>[hr_leave_rule.py]"]
  node_leave_policy_ui["Leave Policy UI<br/>XML views<br/>[hr_leave_rule.xml]"]
  node_attendance_config["Attendance Rules Config<br/>workflow configuration<br/>[approval_config.py]"]
  node_attendance_requests["Approval Requests<br/>workflow records"]
  node_attendance_wizard["Attendance Activity Wizard<br/>Odoo wizard"]
  node_attendance_jobs["Attendance Automation<br/>scheduled actions<br/>[cron.xml]"]
  node_biotime_config["BioTime Service &amp; Terminals<br/>integration models<br/>[biotime_service.py]"]
  node_biometric_lines[("Biometric Attendance Lines<br/>staging records")]
  node_hr_attendance[("HR Attendance Records<br/>Odoo model extension<br/>[hr_attendance.py]")]
  node_attendance_reports["Attendance Reports<br/>report wizards"]
  node_payroll_rules["Payroll &amp; Statutory Rules<br/>payslip extensions"]
  node_payment_report["Payroll Payment Report<br/>controller and wizard"]
end

subgraph group_commercial["Commercial Documents"]
  node_invoice_extension["Invoice Extension &amp; Report<br/>account move extension<br/>[account_move.py]"]
  node_posted_invoice_editor["Posted Invoice Editor<br/>account move extension<br/>[account_move.py]"]
  node_transport_charges["Transportation Charges<br/>sales wizard flow"]
  node_purchase_approval["Draft Purchase Approval<br/>purchase extension<br/>[purchase_order.py]"]
end

subgraph group_odoo["Odoo Platform Boundaries"]
  node_odoo_runtime{{"Odoo Server &amp; ORM<br/>runtime"}}
  node_access_controls["Module Access Controls<br/>security data"]
  node_partner_widget["Partner Binary Widget<br/>client widget"]
end

node_odoo_runtime -->|"loads inherited models"| node_leave_policy
node_odoo_runtime -->|"loads add-on"| node_attendance_config
node_odoo_runtime -->|"runs integration models"| node_biotime_config
node_odoo_runtime -->|"computes payslips"| node_payroll_rules
node_odoo_runtime -->|"extends accounting"| node_invoice_extension
node_leave_policy_ui -->|"configures"| node_leave_policy
node_access_controls -.->|"authorizes access"| node_attendance_requests
node_attendance_config -->|"drives approvals and allocation"| node_attendance_requests
node_attendance_wizard -->|"creates activities"| node_attendance_requests
node_attendance_jobs -->|"automates workflow"| node_attendance_requests
node_attendance_requests -->|"updates HR records"| node_hr_attendance
node_biotime_config -->|"ingests terminal data"| node_biometric_lines
node_biometric_lines -->|"feeds attendance"| node_hr_attendance
node_hr_attendance -->|"supplies report data"| node_attendance_reports
node_leave_policy -->|"contributes leave worked days"| node_payroll_rules
node_hr_attendance -->|"contributes worked attendance"| node_payroll_rules
node_payroll_rules -->|"supplies payment data"| node_payment_report
node_invoice_extension -->|"shares account moves"| node_posted_invoice_editor
node_transport_charges -.->|"operates alongside order workflows"| node_purchase_approval
node_odoo_runtime -->|"serves client customization"| node_partner_widget

click node_access_controls "https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/security/approval_request_security.xml"
click node_leave_policy "https://github.com/bharathi17656/megacream-staging/blob/main/adevx_hr_leave_rule/models/hr_leave_rule.py"
click node_leave_policy_ui "https://github.com/bharathi17656/megacream-staging/blob/main/adevx_hr_leave_rule/views/hr_leave_rule.xml"
click node_attendance_config "https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/models/approval_config.py"
click node_attendance_requests "https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/models/approval_request.py"
click node_attendance_wizard "https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/wizard/attendance_activity_wizard.py"
click node_attendance_jobs "https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/data/cron.xml"
click node_biotime_config "https://github.com/bharathi17656/megacream-staging/blob/main/l4e_biotime_connector/models/biotime_service.py"
click node_biometric_lines "https://github.com/bharathi17656/megacream-staging/blob/main/l4e_biotime_connector/models/hr_attendance_line.py"
click node_hr_attendance "https://github.com/bharathi17656/megacream-staging/blob/main/l4e_biotime_connector/models/hr_attendance.py"
click node_attendance_reports "https://github.com/bharathi17656/megacream-staging/blob/main/attendance_status_filter/models/attendance_report_wizard.py"
click node_payroll_rules "https://github.com/bharathi17656/megacream-staging/blob/main/adevx_hr_leave_rule/models/hr_payslip_worked_days.py"
click node_payment_report "https://github.com/bharathi17656/megacream-staging/blob/main/payroll_payment_report/controllers/payment_report_controller.py"
click node_invoice_extension "https://github.com/bharathi17656/megacream-staging/blob/main/l4e_invoice_report/models/account_move.py"
click node_posted_invoice_editor "https://github.com/bharathi17656/megacream-staging/blob/main/l4e_posted_invoice_editor/models/account_move.py"
click node_transport_charges "https://github.com/bharathi17656/megacream-staging/blob/main/l4e_transportation_charge/wizard/transportation_charge_wizard.py"
click node_purchase_approval "https://github.com/bharathi17656/megacream-staging/blob/main/purchase_draft_approval/models/purchase_order.py"
click node_partner_widget "https://github.com/bharathi17656/megacream-staging/blob/main/l4e_partner_custom_fields/static/src/fields/many2many_binary_confirm.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_leave_policy,node_leave_policy_ui,node_attendance_config,node_attendance_requests,node_attendance_wizard,node_attendance_jobs,node_biotime_config,node_biometric_lines,node_hr_attendance,node_attendance_reports,node_payroll_rules,node_payment_report toneBlue
class node_invoice_extension,node_posted_invoice_editor,node_transport_charges,node_purchase_approval toneAmber
class node_odoo_runtime,node_access_controls,node_partner_widget toneMint
```

## Components

### HR, Attendance & Payroll

Attendance, leave, biometric, and payroll add-ons.

- [Leave Policy Rules](https://github.com/bharathi17656/megacream-staging/blob/main/adevx_hr_leave_rule/models/hr_leave_rule.py): HR model extension · Extends leave, employee, schedule, and payslip policy behavior. · `adevx_hr_leave_rule/models/hr_leave_rule.py`
- [Leave Policy UI](https://github.com/bharathi17656/megacream-staging/blob/main/adevx_hr_leave_rule/views/hr_leave_rule.xml): XML views · `adevx_hr_leave_rule/views/hr_leave_rule.xml`
- [Attendance Rules Config](https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/models/approval_config.py): workflow configuration · Defines approval and automatic allocation rules. · `advance_attendance/models/approval_config.py`
- [Approval Requests](https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/models/approval_request.py): workflow records · Tracks attendance approval decisions and HR updates. · `advance_attendance/models/approval_request.py`
- [Attendance Activity Wizard](https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/wizard/attendance_activity_wizard.py): Odoo wizard · User-driven attendance workflow action. · `advance_attendance/wizard/attendance_activity_wizard.py`
- [Attendance Automation](https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/data/cron.xml): scheduled actions · Runs background attendance and leave automation. · `advance_attendance/data/cron.xml`
- [BioTime Service & Terminals](https://github.com/bharathi17656/megacream-staging/blob/main/l4e_biotime_connector/models/biotime_service.py): integration models · Configures biometric services and terminal endpoints. · `l4e_biotime_connector/models/biotime_service.py`
- [Biometric Attendance Lines](https://github.com/bharathi17656/megacream-staging/blob/main/l4e_biotime_connector/models/hr_attendance_line.py): staging records · Captures raw or intermediate biometric attendance data. · `l4e_biotime_connector/models/hr_attendance_line.py`
- [HR Attendance Records](https://github.com/bharathi17656/megacream-staging/blob/main/l4e_biotime_connector/models/hr_attendance.py): Odoo model extension · Applies biometric and workflow changes to Odoo attendance. · `l4e_biotime_connector/models/hr_attendance.py`
- [Attendance Reports](https://github.com/bharathi17656/megacream-staging/blob/main/attendance_status_filter/models/attendance_report_wizard.py): report wizards · Generates daily and monthly attendance outputs. · `attendance_status_filter/models/attendance_report_wizard.py`
- [Payroll & Statutory Rules](https://github.com/bharathi17656/megacream-staging/blob/main/adevx_hr_leave_rule/models/hr_payslip_worked_days.py): payslip extensions · Applies leave worked-day and PF/ESI controls to payslips. · `adevx_hr_leave_rule/models/hr_payslip_worked_days.py`
- [Payroll Payment Report](https://github.com/bharathi17656/megacream-staging/blob/main/payroll_payment_report/controllers/payment_report_controller.py): controller and wizard · Collects parameters and renders payment reporting. · `payroll_payment_report/controllers/payment_report_controller.py`

### Commercial Documents

Accounting, sales, purchase, and stock extensions.

- [Invoice Extension & Report](https://github.com/bharathi17656/megacream-staging/blob/main/l4e_invoice_report/models/account_move.py): account move extension · Customizes invoices and their printable report. · `l4e_invoice_report/models/account_move.py`
- [Posted Invoice Editor](https://github.com/bharathi17656/megacream-staging/blob/main/l4e_posted_invoice_editor/models/account_move.py): account move extension · Allows edits to posted invoices. · `l4e_posted_invoice_editor/models/account_move.py`
- [Transportation Charges](https://github.com/bharathi17656/megacream-staging/blob/main/l4e_transportation_charge/wizard/transportation_charge_wizard.py): sales wizard flow · Applies charge workflow to sales orders. · `l4e_transportation_charge/wizard/transportation_charge_wizard.py`
- [Draft Purchase Approval](https://github.com/bharathi17656/megacream-staging/blob/main/purchase_draft_approval/models/purchase_order.py): purchase extension · Extends purchase orders and users for draft approval. · `purchase_draft_approval/models/purchase_order.py`

### Odoo Platform Boundaries

Shared runtime presentation and authorization mechanisms.

- **Odoo Server & ORM**: runtime · Loads add-ons and provides inherited models, jobs, mail, and reporting.
- [Module Access Controls](https://github.com/bharathi17656/megacream-staging/blob/main/advance_attendance/security/approval_request_security.xml): security data · Module-local groups and record access separate authorization from logic. · `advance_attendance/security/approval_request_security.xml`
- [Partner Binary Widget](https://github.com/bharathi17656/megacream-staging/blob/main/l4e_partner_custom_fields/static/src/fields/many2many_binary_confirm.js): client widget · Custom many-to-many binary confirmation field. · `l4e_partner_custom_fields/static/src/fields/many2many_binary_confirm.js`

## Connections

- Odoo Server & ORM → Leave Policy Rules: loads inherited models
- Odoo Server & ORM → Attendance Rules Config: loads add-on
- Odoo Server & ORM → BioTime Service & Terminals: runs integration models
- Odoo Server & ORM → Payroll & Statutory Rules: computes payslips
- Odoo Server & ORM → Invoice Extension & Report: extends accounting
- Leave Policy UI → Leave Policy Rules: configures
- Module Access Controls → Approval Requests: authorizes access
- Attendance Rules Config → Approval Requests: drives approvals and allocation
- Attendance Activity Wizard → Approval Requests: creates activities
- Attendance Automation → Approval Requests: automates workflow
- Approval Requests → HR Attendance Records: updates HR records
- BioTime Service & Terminals → Biometric Attendance Lines: ingests terminal data
- Biometric Attendance Lines → HR Attendance Records: feeds attendance
- HR Attendance Records → Attendance Reports: supplies report data
- Leave Policy Rules → Payroll & Statutory Rules: contributes leave worked days
- HR Attendance Records → Payroll & Statutory Rules: contributes worked attendance
- Payroll & Statutory Rules → Payroll Payment Report: supplies payment data
- Invoice Extension & Report → Posted Invoice Editor: shares account moves
- Transportation Charges → Draft Purchase Approval: operates alongside order workflows
- Odoo Server & ORM → Partner Binary Widget: serves client customization
