Skip to main content

Multi-Branch Setup

Panville's six Shell stations are configured as child companies under a single Panville parent in Odoo 18's native multi-branch tree. This is the right architecture for Panville because the legal entity (single SEC registration) operates all six stations and shares bank accounts across them.

Architecture

Panville (parent — single SEC registration)
├── TPLE-Rosario
├── Baguio-Abanao
├── Baguio-Baguilian
├── Baguio-Marcos Highway
├── Balili-La Trinidad
└── Pangasinan-San Fabian

Set via res_company.parent_id. Branches inherit currency_id from the parent (Odoo 18 delegates this field — it's read-only on branches).

What's shared at parent level

  • Currency: PHP, set on Panville (auto-inherited by branches)
  • Chart of accounts: l10n_ph loaded once on Panville; Odoo 18 cascades the chart to each child branch automatically when try_loading('ph') is called
  • Bank accounts: Configure on Panville; branches reference parent's banks
  • Single SEC registration / TIN: Held on Panville only

What's per-branch

  • Journals: Each branch gets its own sales, cash, and bank journals after chart load. See Journals
  • Sale Order sequences: Each branch has its own ir.sequence with a station-code prefix. See Sequences
  • Account.move sequences: Per-journal automatically (journal code becomes the move prefix)
  • Account.tax: Each branch has its own 12% CVGo (Incl.) tax. See Taxes
  • Account.tax.group (VAT 12%): Created per-branch when the chart cascades
  • CVGo MOP accounts: Each branch configures its own MOP accounts (Cash, Shell Fleet Card, etc.) — see MOP Accounts
  • CVGo POS data: Uploaded under a specific branch via the company switcher; tagged with company_id

How the company tree is seeded

shell18/data/res_company_panville.xml updates base.main_company to be Panville and creates the 6 children. The post-install hook (shell18/__init__.py:_create_cvgo_tax) then:

  1. Calls account.chart.template.try_loading('ph', company=panville) — this cascades to all children automatically
  2. Iterates panville.child_ids and creates the 12% CVGo (Incl.) tax on each branch using that branch's own VAT 12% tax group

Branch codes

BranchCodeSO Prefix
TPLE-RosarioROSSO/ROS/2026/00001
Baguio-AbanaoABASO/ABA/2026/00001
Baguio-BaguilianBGLSO/BGL/2026/00001
Baguio-Marcos HighwayMARSO/MAR/2026/00001
Balili-La TrinidadLTRSO/LTR/2026/00001
Pangasinan-San FabianSFSO/SF/2026/00001

Journals

When l10n_ph cascades to each branch, Odoo creates the standard set:

<Branch>: Customer Invoices, Vendor Bills, Bank, Cash, Miscellaneous

Each journal's company_id is the branch. The CVGo MOP account references these journals via sale_journal_id and payment_journal_id (both check_company=True, so Odoo enforces consistency at the DB level).

Switching between branches

Use Odoo's company switcher (top-right) to set the active branch. Records you create (CVGo data, MOP accounts, etc.) default to the active branch's company_id. The admin user has company_ids for all six branches (seeded in res_company_panville.xml).

Record-level isolation

shell18/security/shell18_record_rules.xml adds company_id IN company_ids rules to all CVGo models so users only see data for their allowed branches:

  • cvgo.pos.data
  • cvgo.pos.transaction
  • cvgo.pos.transaction.item
  • cvgo.mode.of.payment
  • cvgo.mop.account
  • cvgo.pos.period
  • cvgo.site.period
  • cvgo.closing.hose.period.data
  • cvgo.pos.data.log

Reports across branches

The standard Odoo financial reports respect the active company — switch in the company switcher (or multi-select) to consolidate across all six. For custom reports, scope queries with:

domain += [('company_id', 'in', self.env.companies.ids)]

Why not multi-company

Panville is a single legal entity. Modeling each station as its own res.company (separate from the parent) would mean:

  • Six separate sets of books to consolidate
  • Six separate banks to reconcile
  • Manual intercompany journals for shared expenses
  • BIR reporting fragmented across six entities

The parent/child branch model gives per-station cost-center reporting inside one set of consolidated books — exactly what's needed for a single SEC registration.