Multi-Branch Setup
YGC's multi-branch deployments use Odoo's multi-company feature with parent/child company hierarchy. Each branch is a child company of the holding entity. This page documents the target architecture; see the migration runbooks for the path from current to target state at Baywaters.
Architecture
Parent Company (e.g., Baywaters Corp.)
├── Branch 1 (e.g., Shawarma Shacks (Petron))
├── Branch 2 (e.g., Potato Corner (Caltex))
├── ...
└── Branch N
Set via res_company.parent_id. Users can be assigned to multiple companies; their active company determines which records they see by default.
Journal isolation per branch
Each branch gets its own journal set. Sharing journals across branches causes:
- Sequence collisions when multiple branches post on the same date
- Date/sequence validation errors when drafts persist across months
- Reporting ambiguity (which branch did this entry belong to?)
Journal codes
Odoo 17's account.journal.code is varchar(5) (silently truncates past 5 chars). Use a 2-letter prefix + 3-letter suffix with no separator:
<XX>INV (Customer Invoices)
<XX>BIL (Vendor Bills)
<XX>MSC (Miscellaneous)
<XX>CSH (Cash)
<XX>BNK (Bank — only if branch has dedicated bank account)
Where <XX> is the 2-letter branch code (e.g., PC for Potato Corner Caltex). The parent company keeps INV, BILL, MISC, etc.
Move naming follows automatically
With code = 'PCMSC', posted entries are named PCMSC/2026/04/0001 automatically. No manual sequence configuration needed.
Chart of accounts: shared, not duplicated
YGC uses a single shared CoA across the parent and all branches. Branch-specific differentiation goes through:
- Analytic accounts per branch — preferred for revenue/expense splits
- Sub-accounts for physically branch-specific cash/bank/receivable/payable accounts (e.g.,
1010-PC Cash on Hand – Potato Corner)
Avoid duplicating the entire CoA per branch — it makes consolidated financial statements painful and breaks the OCA reconciliation modules used elsewhere in YGC.
Security: hide parent journals from branch users
Once branch journals exist, restrict branch accounting users so they don't see the parent's journals:
# Verify Odoo's built-in ir.rule on account.journal already filters by company:
SELECT name, model_id, domain_force FROM ir_rule
WHERE model_id IN (SELECT id FROM ir_model WHERE model = 'account.journal');
If journal.company_id = branch_company_id, the built-in multi-company rule handles isolation. No custom rules needed.
User assignments
For each accounting user:
- Allowed Companies = the branches they handle (could be multiple)
- Default Company = their primary branch
Branch managers may have access to all child companies; the parent's accounting team has access to everything.
Reports across branches
YGC reports must filter on company_id. The standard Odoo financial reports respect the active company; consolidated reports across branches use the multi-company filter at the top of the screen.
For custom reports in red17_base_accounting or per-company addons, ensure all queries include:
domain += [('company_id', 'in', self.env.companies.ids)]
When NOT to use this pattern
- Single legal entity with departments — use analytic accounts only, not multi-company
- Branches that share VAT/BIR registration — multi-company with the same VAT may complicate BIR reporting; consult tax advisor
- Very small branch counts (1–2) — overhead may not be worth it; analytic accounts could be enough