E-Invoice Total Tax by Tax Type Documentation¶
Overview¶
The E-Invoice Total Tax by Tax Type model (account.einvoice.totaltax.taxtype) stores aggregated tax totals grouped by tax type for e-invoices. It provides a summary view of taxes by category.
Model Information¶
Model Name: account.einvoice.totaltax.taxtype
Display Name: E-Invoice Total Tax Tax Type
Key Fields: None (no unique constraint defined)
Features¶
- ❌ Audit logging enabled (
_audit_log) - ❌ Multi-company support (
company_id) - ❌ Full-text content search (
_content_search) - ✅ Cascade delete with invoice
Key Fields Reference¶
All Fields¶
| Field | Type | Required | Description |
|---|---|---|---|
invoice_id |
Many2One | ✅ | Parent invoice (cascade delete) |
total_amount |
Decimal | ❌ | Total tax amount for this type |
einvoice_tax_type_id |
Many2One | ❌ | Tax type reference |
Related Models¶
| Model | Relationship | Description |
|---|---|---|
account.invoice |
Many2One (invoice_id) | Parent invoice |
account.einvoice.taxtype |
Many2One | Tax type |
Common Use Cases¶
Use Case 1: Add Tax Type Total¶
# Add aggregated tax by type
total_id = get_model("account.einvoice.totaltax.taxtype").create({
"invoice_id": invoice_id,
"einvoice_tax_type_id": service_tax_type_id,
"total_amount": 150.00,
})
Use Case 2: Get Tax Totals by Type¶
# Get tax totals grouped by type
totals = get_model("account.einvoice.totaltax.taxtype").search_browse([
["invoice_id", "=", invoice_id]
])
for total in totals:
tax_type = total.einvoice_tax_type_id.description if total.einvoice_tax_type_id else "N/A"
print(f"{tax_type}: {total.total_amount}")
Version History¶
Last Updated: December 2024 Model Version: account_einvoice_totaltax_taxtype.py Framework: Netforce
This documentation is generated for developer onboarding and reference purposes.