E-Invoice Total Tax Amount Documentation¶
Overview¶
The E-Invoice Total Tax Amount model (account.einvoice.total.tax.amount) stores detailed tax breakdown information for e-invoices. Each record represents a tax calculation with type, rate, and amount details.
Model Information¶
Model Name: account.einvoice.total.tax.amount
Display Name: E-Invoice Total Tax Amount
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) |
number |
Integer | ❌ | Tax line number |
einvoice_tax_type_id |
Many2One | ❌ | Tax type reference |
number_unit |
Integer | ❌ | Number of units |
rate_unit |
Decimal | ❌ | Rate per unit |
tax_rate |
Decimal | ❌ | Tax rate percentage |
amount |
Decimal | ❌ | Tax amount |
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 Breakdown¶
# Add sales tax breakdown
tax_id = get_model("account.einvoice.total.tax.amount").create({
"invoice_id": invoice_id,
"number": 1,
"einvoice_tax_type_id": sales_tax_type_id,
"tax_rate": 8.0,
"amount": 80.00,
})
Use Case 2: Get Tax Summary¶
# Get tax breakdown for invoice
taxes = get_model("account.einvoice.total.tax.amount").search_browse([
["invoice_id", "=", invoice_id]
])
for tax in taxes:
tax_type = tax.einvoice_tax_type_id.description if tax.einvoice_tax_type_id else "N/A"
print(f"{tax_type}: {tax.tax_rate}% = {tax.amount}")
Version History¶
Last Updated: December 2024 Model Version: account_einvoice_total_tax_amount.py Framework: Netforce
This documentation is generated for developer onboarding and reference purposes.