E-Invoice Type Documentation¶
Overview¶
The E-Invoice Type model (account.einvoice.type) provides a lookup table for LHDN MyInvois document type codes. It stores the standardized type codes used to classify e-invoice documents (Invoice, Credit Note, Debit Note, etc.).
Model Information¶
Model Name: account.einvoice.type
Display Name: e-Invoice Type
Name Field: code
Key Fields: None (no unique constraint defined)
Features¶
- ❌ Audit logging enabled (
_audit_log) - ❌ Multi-company support (
company_id) - ❌ Full-text content search (
_content_search) - ✅ Translatable description
Key Fields Reference¶
All Fields¶
| Field | Type | Required | Description |
|---|---|---|---|
code |
Char | ✅ | Type code (searchable, indexed) |
description |
Text | ❌ | Type description (translatable) |
Standard LHDN Type Codes¶
| Code | Description |
|---|---|
01 |
Normal Invoice |
02 |
Credit Note |
03 |
Debit Note |
04 |
Refund Note |
11 |
Self-Billed Invoice |
12 |
Self-Billed Credit Note |
13 |
Self-Billed Debit Note |
14 |
Self-Billed Refund Note |
Common Use Cases¶
Use Case 1: Get Type Description¶
# Find type by code
type_code = "02"
types = get_model("account.einvoice.type").search_browse([
["code", "=", type_code]
])
if types:
print(f"Code {type_code}: {types[0].description}")
# Output: Code 02: Credit Note
Use Case 2: Populate Type Dropdown¶
# Get all types for selection
all_types = get_model("account.einvoice.type").search_browse([])
options = [(t.code, t.description) for t in all_types]
Version History¶
Last Updated: December 2024 Model Version: account_einvoice_type.py Framework: Netforce
This documentation is generated for developer onboarding and reference purposes.