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

Finance technical architecture

Comprehensive technical architecture, data models, entity relationships, transaction state machines, security access groups, and automated crons.

This document provides the definitive technical and architectural reference for SmartERP 19 Financial Operations.

SmartERP Accounting Technical Architecture & System Settings

Entity Relationship Schema & Core Models#

SmartERP Financial Operations integrates core general ledger models with localized Ethiopian compliance modules:

+----------------------------------------------------------------------------------------------------+
|                               SMARTERP FINANCE ENTITY RELATIONSHIP MAP                             |
+----------------------------------------------------------------------------------------------------+
|                                                                                                    |
|    +-----------------------------+                  +------------------------------+               |
|    |        account.move         |1               * |      account.move.line       |               |
|    |-----------------------------|----------------->|------------------------------|               |
|    | id                          |                  | id                           |               |
|    | name (Sequential Number)    |                  | move_id (FK account.move)    |               |
|    | move_type (invoice/entry)   |                  | account_id (FK acc.account)  |               |
|    | date (Gregorian ISO)        |                  | debit (Monetary)             |               |
|    | state (draft/posted/cancel) |                  | credit (Monetary)            |               |
|    | approval_state              |                  | partner_id (FK res.partner)  |               |
|    | payment_delivery_type       |                  | currency_id                  |               |
|    | cpv_sequence_number         |                  | amount_currency              |               |
|    | wht_applicable              |                  +------------------------------+               |
|    | wht_tax_id                  |                                 |                               |
|    +-----------------------------+                                 |                               |
|                   | 1                                              v *                             |
|                   |                                 +------------------------------+               |
|                   |                                 |       account.account        |               |
|                   |                                 |------------------------------|               |
|                   |                                 | id                           |               |
|                   |                                 | code (e.g. 111200, 211000)   |               |
|                   v 0..1                            | name                         |               |
|    +-----------------------------+                  | account_type                 |               |
|    |       account.payment       |                  +------------------------------+               |
|    |-----------------------------|                                                                 |
|    | id                          |                  +------------------------------+               |
|    | payment_type (in/out)       |                  |       petty.cash.fund        |               |
|    | amount                      |                  |------------------------------|               |
|    | payment_delivery_type       |                  | id                           |               |
|    | cpv_state                   |                  | name                         |               |
|    | wht_tax_id                  |                  | custodian_id (FK res.users)  |               |
|    | wht_amount                  |                  | float_amount                 |               |
|    | wht_taxable_base            |                  | current_balance              |               |
|    +-----------------------------+                  | state (draft/active/closed)  |               |
|                                                     +------------------------------+               |
|                                                                    | 1                             |
|                                                                    |                               |
|                                                                    v *                             |
|                                                     +------------------------------+               |
|                                                     |      petty.cash.voucher      |               |
|                                                     |------------------------------|               |
|                                                     | id                           |               |
|                                                     | name (PCV-YYYY-XXXXX)        |               |
|                                                     | fund_id                      |               |
|                                                     | paid_to_id (FK res.partner)  |               |
|                                                     | amount                       |               |
|                                                     | prepared_by_id               |               |
|                                                     | checked_by_id                |               |
|                                                     | approved_by_id               |               |
|                                                     | state (draft/check/app/paid) |               |
|                                                     | move_id (FK account.move)    |               |
|                                                     +------------------------------+               |
+----------------------------------------------------------------------------------------------------+

Model Data Dictionary#

Model IdentifierDatabase TablePrimary Keys & Foreign KeysDescription & Business Rules
account.moveaccount_movePK id, FK company_id, FK partner_id, FK journal_idHeader for all financial documents (vendor bills, invoices, vouchers).
account.move.lineaccount_move_linePK id, FK move_id, FK account_id, FK partner_idDouble-entry debit and credit lines. Sum(Debit) = Sum(Credit).
account.paymentaccount_paymentPK id, FK journal_id, FK partner_id, FK wht_tax_idPayment execution records generating BPV, CRV, and CPV vouchers.
account.payment.registerTransient ModelIn-memory wizardHooks into write-off lines to dynamically inject withholding tax debits/credits.
wht.declaration.export.wizardTransient ModelIn-memory wizardGenerates official pixel-accurate ERCA Excel declarations.
petty.cash.fundpetty_cash_fundPK id, FK custodian_id, FK journal_id, FK company_idImprest fund master managing float capital and custodian liability.
petty.cash.voucherpetty_cash_voucherPK id, FK fund_id, FK paid_to_id, FK move_idPetty cash disbursement slips enforcing maker-checker segregation.
smart.et.calendarPython EngineStandalone algorithmAstronomical JDN engine converting Ethiopian and Gregorian dates.
peachtree.bank.statementpeachtree_bank_statementPK id, FK account_id, FK company_idPeachtree/Sage style statement reconciliation matching GL cash lines.
accounting.dashboardaccounting_dashboardSingleton PK idSingleton engine computing ~95 financial intelligence KPIs across 9 groups.

Transaction Lifecycle State Machine#

1. Vendor Bill Approval State Transitions#

[draft] ---> action_confirm_bill() ---> [confirmed]
                                             |
                                             v
                                     action_check()
                                             |
                                             v
                                        [checked]
                                             |
                                             v
                                     action_approve()  <--- Gated by smarterp.approval.request
                                             |
                                             v
                                        [approved]
                                             |
                                             v
                                      action_post()    <--- Intercepted by _post()
                                             |
                                             v
                                         [posted]

2. Petty Cash Voucher State Transitions#

[draft] ---> action_check() -------------------> [checked]  (Constraint: checked_by != prepared_by)
                                                    |
                                                    v
                                            action_approve()  <--- Gated by 'PCV' approval
                                                    |
                                                    v
                                               [approved]
                                                    |
                                                    v
                                             action_post()   <--- Creates & posts account.move
                                                    |
                                                    v
                                                  [paid]     (Immutable: Cannot be deleted)

Security Architecture and Segregation of Duties (SoD)#

SmartERP enforces strict role-based access control (RBAC) and Segregation of Duties (SoD) across financial operations:

+----------------------------------------------------------------------------------------------------+
|                               FINANCIAL SECURITY ACCESS GROUP HIERARCHY                            |
+----------------------------------------------------------------------------------------------------+
|                                                                                                    |
|   Auditor / Read-Only (`account.group_account_readonly`)                                           |
|   └── Full read access to Trial Balance, General Ledger, Vouchers, and Tax Reports                 |
|                                                                                                    |
|   Billing Clerk & Cashier (`account.group_account_invoice`)                                        |
|   └── Create customer invoices, register payments (CRV), create draft petty cash vouchers (PCPS)   |
|   └── CANNOT validate journal entries, open fiscal periods, or modify tax settings                 |
|                                                                                                    |
|   Senior Accountant (`account.group_account_user`)                                                 |
|   └── Validate vendor bills, reconcile bank statements, execute BPV/CPV, prepare tax returns       |
|   └── CANNOT close fiscal years, override lock dates, or bypass DoA approval gates                 |
|                                                                                                    |
|   Financial Controller / CFO (`account.group_account_manager`)                                     |
|   └── Full administrative authority: open/close fiscal years, set lock dates, configure COA/Taxes  |
|   └── Authorize Tier 3/4 expenditures and approve budget override exceptions                       |
+----------------------------------------------------------------------------------------------------+

Enforced Toxic SoD Pairs#

  1. Cashier vs. Approver: A user with Cashier permissions (group_account_invoice) cannot approve disbursements or petty cash vouchers.
  2. Maker vs. Checker: The user who compiles a petty cash voucher or CPV is strictly blocked by code constraints from checking or approving it (prepared_by != checked_by).
  3. Master Data Creator vs. Disburser: A user who creates or edits vendor bank details cannot approve payments to that vendor.
  4. Bank Reconciler vs. Cash Disburser: The user who executes cash disbursements cannot independently mark bank reconciliation statements as done.

Automated Crons and Scheduled Actions#

SmartERP operates background scheduled actions to guarantee ledger integrity:

Cron Job NameTechnical IntervalModel TriggeredOperational Purpose
Bank Feed SyncHourlyaccount.journal._cron_sync_bank_feedsIngests electronic statement lines from connected bank APIs.
SLA Escalation WatcherEvery 15 Minutessmarterp.approval.request._cron_check_slaEvaluates working-hour timers and escalates overdue approvals.
Fiscal Period Lock ValidatorDaily at Midnightaccount.fiscal.year._cron_enforce_locksEnforces period_lock_date across all active companies.
Holiday Engine SyncAnnuallysmart.et.holiday._cron_generate_annual_holidaysComputes Bahire Hasab and Islamic lunar holidays for the fiscal year.
Tax Filing ReminderMonthly on the 20thwht.declaration.export.wizard._cron_tax_alertNotifies finance team of upcoming MOR declaration filing deadlines.

Developer Extension API and Hooks#

Developers extending SmartERP Financial Operations should adhere to these established extension patterns:

1. Extending the Payment Register with Custom Withholding Lines#

class CustomPaymentRegister(models.TransientModel):
    _inherit = 'account.payment.register'

    def _create_payment_vals_from_wizard(self, batch_result):
        payment_vals = super()._create_payment_vals_from_wizard(batch_result)
        # Custom withholding logic must inject write_off_line_vals:
        # Positive balance = Debit (Asset for Inbound)
        # Negative balance = Credit (Liability for Outbound)
        return payment_vals

2. Safely Gating Document Posting#

class CustomFinancialMove(models.Model):
    _inherit = 'account.move'

    def _post(self, soft=True):
        # Always gate inside _post(), NOT action_post(), to intercept API calls
        for move in self:
            if move.custom_control_condition:
                move._check_custom_financial_compliance()
        return super()._post(soft=soft)
መጨረሻ የተሻሻለው: 2026-10-16