Fixed Asset Depreciation Period Documentation¶
Overview¶
The Fixed Asset Depreciation Period module (account.fixed.asset.period) records individual depreciation periods for fixed assets. Each period represents depreciation calculated for a specific time range (typically one month), tracking the depreciation amount and linking to the generated journal entry. This model enables detailed depreciation tracking and audit trails.
Model Information¶
Model Name: account.fixed.asset.period
Display Name: Fixed Asset Period
Name Field: None (no specific display field)
Key Fields: None (auto-increment ID)
Default Sort Order: asset_id, date_to
Features¶
- ✅ Monthly depreciation tracking
- ✅ Date range recording
- ✅ Journal entry linkage
- ✅ Cascade delete with parent asset
- ✅ Automatic creation by depreciation process
Key Fields Reference¶
Core Fields¶
| Field | Type | Required | Description |
|---|---|---|---|
asset_id |
Many2One | ✅ | Parent asset (cascade delete) |
date_from |
Date | ✅ | Period start date |
date_to |
Date | ✅ | Period end date |
amount |
Decimal | ✅ | Depreciation amount for period |
move_id |
Many2One | ❌ | Journal entry for depreciation |
API Methods¶
1. Create Depreciation Period¶
Method: create(vals, context)
Creates depreciation period (typically done automatically by depreciate method).
Example:
# Usually created automatically, but can be manual:
period_id = get_model("account.fixed.asset.period").create({
"asset_id": asset_id,
"date_from": "2025-01-01",
"date_to": "2025-01-31",
"amount": 1500.00
})
Note: Periods are typically created by account.fixed.asset.depreciate() method, not manually.
Common Use Cases¶
Use Case 1: View Asset Depreciation History¶
# Get all depreciation periods for an asset
periods = get_model("account.fixed.asset.period").search_browse([
["asset_id", "=", asset_id]
], order="date_to")
print("DEPRECIATION HISTORY")
print("=" * 70)
print(f"{'Period Start':15} {'Period End':15} {'Amount':>12} {'Move #':10}")
print("-" * 70)
total_dep = 0
for period in periods:
total_dep += period.amount
move_num = period.move_id.number if period.move_id else "N/A"
print(f"{period.date_from:15} {period.date_to:15} "
f"${period.amount:>11,.2f} {move_num:10}")
print("=" * 70)
print(f"Total Accumulated Depreciation: ${total_dep:,.2f}")
Use Case 2: Monthly Depreciation Report¶
# Get all depreciation for a specific month
month_periods = get_model("account.fixed.asset.period").search_browse([
["date_to", ">=", "2025-01-01"],
["date_to", "<=", "2025-01-31"]
], order="asset_id")
print("DEPRECIATION EXPENSE - January 2025")
print("=" * 80)
print(f"{'Asset Number':15} {'Asset Name':30} {'Amount':>12}")
print("-" * 80)
total = 0
for period in month_periods:
asset = period.asset_id
total += period.amount
print(f"{asset.number:15} {asset.name[:30]:30} ${period.amount:>11,.2f}")
print("=" * 80)
print(f"Total Monthly Depreciation: ${total:,.2f}")
Use Case 3: Verify Depreciation Entries¶
# Check periods with journal entries
periods_with_entries = get_model("account.fixed.asset.period").search_browse([
["move_id", "!=", None],
["date_to", ">=", "2025-01-01"]
], order="date_to,asset_id")
print("POSTED DEPRECIATION PERIODS")
print("=" * 90)
print(f"{'Date':12} {'Asset':15} {'Amount':>12} {'Journal Entry':15} {'Status':10}")
print("-" * 90)
for period in periods_with_entries:
asset = period.asset_id
move = period.move_id
status = "Posted" if move.state == "posted" else move.state
print(f"{period.date_to:12} {asset.number:15} ${period.amount:>11,.2f} "
f"{move.number:15} {status:10}")
Use Case 4: Asset Depreciation Summary¶
# Summarize depreciation by asset
from collections import defaultdict
asset_totals = defaultdict(lambda: {"periods": 0, "total": 0})
periods = get_model("account.fixed.asset.period").search_browse([
["date_to", ">=", "2025-01-01"],
["date_to", "<=", "2025-12-31"]
])
for period in periods:
asset_id = period.asset_id.id
asset_totals[asset_id]["periods"] += 1
asset_totals[asset_id]["total"] += period.amount
asset_totals[asset_id]["asset"] = period.asset_id
print("ANNUAL DEPRECIATION SUMMARY - 2025")
print("=" * 80)
print(f"{'Asset Number':15} {'Asset Name':30} {'Periods':>8} {'Total':>12}")
print("-" * 80)
for asset_data in sorted(asset_totals.values(),
key=lambda x: x["asset"].number):
asset = asset_data["asset"]
print(f"{asset.number:15} {asset.name[:30]:30} "
f"{asset_data['periods']:>8} ${asset_data['total']:>11,.2f}")
Use Case 5: Identify Unposted Depreciation¶
# Find periods without journal entries
unposted = get_model("account.fixed.asset.period").search_browse([
["move_id", "=", None]
], order="date_to,asset_id")
if unposted:
print("WARNING: Unposted Depreciation Periods")
print("=" * 70)
for period in unposted:
asset = period.asset_id
print(f"Asset: {asset.number} - {asset.name}")
print(f" Period: {period.date_from} to {period.date_to}")
print(f" Amount: ${period.amount:,.2f}")
print()
else:
print("✓ All depreciation periods have journal entries")
Use Case 6: Delete Depreciation Periods¶
# Delete periods for re-calculation
# WARNING: Only delete if journal entries are voided first
asset = get_model("account.fixed.asset").browse([asset_id])[0]
# Find periods to delete
period_ids = get_model("account.fixed.asset.period").search([
["asset_id", "=", asset_id],
["date_to", ">=", "2025-01-01"]
])
# Void journal entries first
for period in get_model("account.fixed.asset.period").browse(period_ids):
if period.move_id:
get_model("account.move").void([period.move_id.id])
# Delete periods
get_model("account.fixed.asset.period").delete(period_ids)
# Re-run depreciation
get_model("account.fixed.asset").depreciate([asset_id], "2025-12-31")
print("✓ Periods recalculated")
Use Case 7: Depreciation Audit Trail¶
# Complete audit trail for an asset
asset = get_model("account.fixed.asset").browse([asset_id])[0]
print(f"DEPRECIATION AUDIT TRAIL")
print(f"Asset: {asset.number} - {asset.name}")
print(f"Purchase Date: {asset.date_purchase}")
print(f"Purchase Price: ${asset.price_purchase:,.2f}")
print(f"Method: {asset.dep_method} @ {asset.dep_rate}%")
print()
periods = get_model("account.fixed.asset.period").search_browse([
["asset_id", "=", asset_id]
], order="date_to")
print("=" * 100)
print(f"{'Period End':12} {'Days':>5} {'Amount':>12} {'Accum Dep':>12} "
f"{'Book Value':>12} {'Journal Entry':15}")
print("-" * 100)
accum_dep = 0
for period in periods:
accum_dep += period.amount
book_val = asset.price_purchase - accum_dep
# Calculate days
from datetime import datetime
d_from = datetime.strptime(period.date_from, "%Y-%m-%d")
d_to = datetime.strptime(period.date_to, "%Y-%m-%d")
days = (d_to - d_from).days + 1
move_num = period.move_id.number if period.move_id else "Not posted"
print(f"{period.date_to:12} {days:>5} ${period.amount:>11,.2f} "
f"${accum_dep:>11,.2f} ${book_val:>11,.2f} {move_num:15}")
print("=" * 100)
print(f"Current Book Value: ${asset.book_val:,.2f}")
Best Practices¶
1. Don't Create Periods Manually¶
# Good: Use depreciate method
get_model("account.fixed.asset").depreciate([asset_id], "2025-01-31")
# Automatically creates periods with proper calculations
# Avoid: Manual period creation
# Manual periods bypass depreciation logic and may be incorrect
2. Verify Journal Entry Linkage¶
# Check all periods have journal entries
periods_without_moves = get_model("account.fixed.asset.period").search([
["move_id", "=", None]
])
if periods_without_moves:
print("Warning: Some periods missing journal entries")
3. Delete Periods Only After Voiding Moves¶
# Correct deletion sequence:
# 1. Void journal entry
# 2. Delete period
period = get_model("account.fixed.asset.period").browse([period_id])[0]
if period.move_id:
get_model("account.move").void([period.move_id.id])
get_model("account.fixed.asset.period").delete([period_id])
4. Use Periods for Reporting¶
# Periods are authoritative source for:
# - Depreciation expense by month
# - Accumulated depreciation
# - Asset book value calculation
Period Lifecycle¶
1. Creation¶
2. Posting¶
3. Voiding (if needed)¶
Related Models¶
| Model | Relationship | Description |
|---|---|---|
account.fixed.asset |
Many2One | Parent asset |
account.move |
Many2One | Depreciation journal entry |
Version History¶
Last Updated: 2025-12-16 Model Version: account_fixed_asset_period.py Framework: Netforce
Additional Resources¶
- Fixed Asset Documentation:
account.fixed.asset - Journal Entry Documentation:
account.move - Depreciation Wizard Documentation:
account.fixed.asset.depreciation
This documentation is generated for developer onboarding and reference purposes.