CVGo VAT-Inclusive Tax
Panville is on Philippine VAT (l10n_ph) — 12% VAT on most sales. CVGo prices are already VAT-inclusive, so shell18 uses a special tax that extracts VAT from the inclusive price rather than adding it on top.
The tax
Each branch has its own copy of:
| Field | Value |
|---|---|
| Name | 12% CVGo (Incl.) |
| Amount | 12.0 |
| Amount Type | percent |
| Type Tax Use | sale |
| Price Include Override | tax_included |
| Tax Group | VAT 12% (each branch's own copy) |
How the per-branch tax is created
The post-install hook in shell18/__init__.py runs at -i shell18:
- Loads the
l10n_phchart on Panville. Odoo 18 cascades the chart to all child branches automatically (account.chart.template._loadwalkschild_ids) - After cascade, each branch has its own
VAT 12%tax group - The hook iterates
panville.child_idsand creates the12% CVGo (Incl.)tax on each, referencing that branch's group
This ensures _check_company consistency: a SO created on a branch references a tax owned by the same branch.
How posting picks the right tax
In cvgo_pos_data_posting.py, the tax search is scoped by the data's branch:
taxes_obj = self.env['account.tax'].search([
('type_tax_use', '=', 'sale'),
('company_id', '=', self.company_id.id),
])
Then _find_tax(taxes_obj, tax_code, tax_rate) matches by:
- Amount (12.0 or 0.0 from CVGo
tax_rate) - Prefer
price_include_override == 'tax_included'— this picks the CVGo tax over any plain "12% VAT" the chart might add - Fallback to any matching tax if no inclusive variant exists
Reading totals
Because the tax is inclusive:
- CVGo
sale_total= pump price the customer paid (VAT-inclusive) - Odoo
amount_total= same number - Odoo
amount_untaxed=sale_total / 1.12 - Odoo
amount_tax=sale_total - amount_untaxed
The reconciliation tab compares these directly — see Reconciliation.
Verifying
-- Confirm each branch has the CVGo tax
SELECT t.name, t.amount, t.price_include_override, c.name AS branch
FROM account_tax t
JOIN res_company c ON t.company_id = c.id
WHERE t.name = '12% CVGo (Incl.)'
ORDER BY c.name;
Expect exactly six rows (one per branch). Panville (parent) may or may not have one depending on whether you transact on the parent — shell18 only creates the tax on branches.
What if the hook didn't run?
The post-install hook only runs on -i shell18. If you upgraded with -u and the tax is missing:
- Confirm
l10n_phchart is loaded on Panville (Settings > Accounting > Configuration > Chart Template) - Re-run install on a fresh DB, or create the missing taxes manually per branch via Settings > Accounting > Taxes