Cheque Documentation¶
Overview¶
The Cheque module (account.cheque) tracks physical cheques received from customers or issued to suppliers. This module maintains cheque details, status tracking, and links to related payments, supporting cheque management workflows from receipt/issuance through to clearance.
Model Information¶
Model Name: account.cheque
Display Name: Cheque
Name Field: None (no specific display field)
Key Fields: None (auto-increment ID)
Default Sort Order: date desc, id desc
Features¶
- ✅ Cheque detail tracking
- ✅ Status workflow (draft/waiting/paid)
- ✅ Bank and branch information
- ✅ Payment linkage
- ✅ Cheque image/photo storage
- ✅ Multi-company support
Key Fields Reference¶
Core Cheque Fields¶
| Field | Type | Required | Description |
|---|---|---|---|
number |
Char | ✅ | Cheque number |
date |
Date | ✅ | Cheque date |
amount |
Decimal | ❌ | Cheque amount |
state |
Selection | ✅ | Status (draft/waiting/paid) |
contact_id |
Many2One | ❌ | Customer/supplier |
bank_id |
Many2One | ❌ | Issuing bank |
branch |
Char | ❌ | Bank branch |
company_id |
Many2One | ❌ | Company (auto-filled) |
Document Fields¶
| Field | Type | Description |
|---|---|---|
image |
File | Scanned cheque image/photo |
related_id |
Reference | Related payment |
Cheque States¶
| State | Description | Typical Use |
|---|---|---|
| draft | Initial entry | Cheque recorded but not processed |
| waiting | Awaiting clearance | Cheque deposited, awaiting bank clearance |
| paid | Cleared/Paid | Cheque successfully cleared by bank |
State Flow¶
API Methods¶
1. Create Cheque¶
Method: create(vals, context)
Records a new cheque.
Example:
# Record customer cheque
cheque_id = get_model("account.cheque").create({
"number": "CHQ-001234",
"date": "2025-01-15",
"amount": 5000.00,
"contact_id": customer_id,
"bank_id": customer_bank_id,
"branch": "Downtown Branch",
"state": "draft",
"related_id": f"account.payment,{payment_id}"
})
Common Use Cases¶
Use Case 1: Record Customer Cheque¶
# Customer pays with cheque
# 1. Create payment
payment_id = get_model("account.payment").create({
"type": "in", # Receipt
"contact_id": customer_id,
"date": "2025-01-15",
"account_id": undeposited_funds_id, # Temporary account
"lines": [
("create", {
"invoice_id": invoice_id,
"amount": 5000.00
})
]
})
# 2. Record cheque details
cheque_id = get_model("account.cheque").create({
"number": "123456",
"date": "2025-01-15",
"amount": 5000.00,
"contact_id": customer_id,
"bank_id": customer_bank_id,
"state": "draft",
"related_id": f"account.payment,{payment_id}"
})
print("✓ Cheque recorded")
Use Case 2: Deposit Cheque¶
# Mark cheque as deposited and waiting clearance
get_model("account.cheque").write([cheque_id], {
"state": "waiting"
})
print("✓ Cheque deposited, awaiting clearance")
Use Case 3: Clear Cheque¶
# Cheque cleared by bank
# 1. Update cheque status
get_model("account.cheque").write([cheque_id], {
"state": "paid"
})
# 2. Transfer from undeposited funds to bank
transfer_id = get_model("account.transfer").create({
"date": "2025-01-20",
"account_from_id": undeposited_funds_id,
"account_to_id": bank_account_id,
"amount": 5000.00,
"amount_received": 5000.00,
"ref": f"Cheque {cheque_number} cleared"
})
get_model("account.transfer").post([transfer_id])
print("✓ Cheque cleared and deposited to bank")
Use Case 4: Record Supplier Cheque¶
# Issue cheque to supplier
# 1. Create payment
payment_id = get_model("account.payment").create({
"type": "out", # Payment
"contact_id": supplier_id,
"date": "2025-01-15",
"account_id": bank_account_id,
"lines": [
("create", {
"invoice_id": bill_id,
"amount": 10000.00
})
]
})
# 2. Record issued cheque
cheque_id = get_model("account.cheque").create({
"number": "OUR-CHQ-789",
"date": "2025-01-15",
"amount": 10000.00,
"contact_id": supplier_id,
"bank_id": our_bank_id,
"branch": "Main Office",
"state": "waiting", # Issued, awaiting cashing
"related_id": f"account.payment,{payment_id}"
})
print("✓ Cheque issued to supplier")
Use Case 5: Cheque Register Report¶
# Generate cheque register
cheques = get_model("account.cheque").search_browse([
["date", ">=", "2025-01-01"],
["date", "<=", "2025-01-31"]
], order="date,number")
print("CHEQUE REGISTER - January 2025")
print("=" * 80)
print(f"{'Date':12} {'Number':15} {'Contact':25} {'Amount':>12} {'Status':10}")
print("-" * 80)
for chq in cheques:
contact_name = chq.contact_id.name if chq.contact_id else "N/A"
print(f"{chq.date:12} {chq.number:15} {contact_name[:25]:25} "
f"${chq.amount:>11,.2f} {chq.state:10}")
total = sum(chq.amount or 0 for chq in cheques)
print("=" * 80)
print(f"Total: ${total:,.2f}")
Use Case 6: Attach Cheque Image¶
# Attach scanned cheque image
import base64
# Read cheque image file
with open("cheque_scan.jpg", "rb") as f:
image_data = base64.b64encode(f.read()).decode()
get_model("account.cheque").write([cheque_id], {
"image": image_data
})
print("✓ Cheque image attached")
Best Practices¶
1. Always Record Cheque Numbers¶
# Good: Full cheque details
{
"number": "CHQ-123456",
"date": "2025-01-15",
"bank_id": bank_id,
"branch": "Downtown"
}
# Insufficient: Missing details
{
"number": "123456"
# Missing bank and branch info
}
2. Use Proper State Workflow¶
# Received cheque workflow:
# 1. draft - Record cheque details
# 2. waiting - Deposit and await clearance
# 3. paid - Bank confirms clearance
# Don't skip states
3. Link to Payments¶
Related Models¶
| Model | Relationship | Description |
|---|---|---|
account.payment |
Reference | Related payment |
contact |
Many2One | Customer/supplier |
bank |
Many2One | Issuing bank |
company |
Many2One | Multi-company support |
Version History¶
Last Updated: 2025-12-16 Model Version: account_cheque.py Framework: Netforce
Additional Resources¶
- Payment Documentation:
account.payment - Contact Documentation:
contact - Bank Documentation:
bank
This documentation is generated for developer onboarding and reference purposes.