Skip to content

Fixed Asset Documentation

Overview

The Fixed Asset module (account.fixed.asset) manages capital assets and their depreciation over time. This module tracks asset purchases, calculates depreciation using straight-line or declining balance methods, maintains book values, and handles asset lifecycle events including registration, depreciation, disposal, and sale.


Model Information

Model Name: account.fixed.asset Display Name: Fixed Asset Name Field: name Key Fields: number (unique asset number) Default Sort Order: number desc

Features

  • ✅ Auto-generated asset numbers
  • ✅ Multi-company support
  • ✅ Two depreciation methods (straight-line, declining balance)
  • ✅ Book value calculation
  • ✅ State workflow (pending/registered/disposed/sold)
  • ✅ Tracking category support
  • ✅ Invoice linkage
  • ✅ Document attachments
  • ✅ Stock lot integration
  • ✅ Salvage value support

Key Fields Reference

Core Asset Fields

Field Type Required Description
name Char Asset item name
number Char Unique asset number (auto-generated)
date_purchase Date Purchase date
price_purchase Decimal(6) Original purchase price
type_id Many2One Asset type/category
fixed_asset_account_id Many2One Fixed asset GL account
state Selection Asset status

Depreciation Fields

Field Type Description
dep_rate Decimal(6) Annual depreciation rate (%)
dep_method Selection Straight Line or Declining Balance
accum_dep_account_id Many2One Accumulated depreciation account
dep_exp_account_id Many2One Depreciation expense account
salvage_value Decimal Residual value after full depreciation

Computed Fields

Field Type Description
book_val Decimal Current book value (purchase - accumulated dep)
last_dep Date Date of last depreciation

Asset States

State Description Typical Use
pending Initial entry Asset recorded but not yet in service
registered Active asset In service, eligible for depreciation
disposed Disposed Asset discarded/scrapped
sold Sold Asset sold to third party

State Flow

pending → registered → disposed
                    → sold
                    ← to_pending (reversal)
Field Type Description
track_id Many2One Tracking category (Track-1)
invoice_id Many2One Purchase invoice
lot_id Many2One Stock lot reference
company_id Many2One Company (multi-company)
asset_owner Char Asset owner name
periods One2Many Depreciation period records
comments One2Many Comments and notes
documents One2Many Document attachments

API Methods

1. Create Fixed Asset

Method: create(vals, context)

Creates asset with auto-generated number.

Example:

asset_id = get_model("account.fixed.asset").create({
    "name": "Dell Laptop XPS 15",
    "date_purchase": "2025-01-15",
    "price_purchase": 50000.00,
    "type_id": computer_type_id,
    "fixed_asset_account_id": asset_account_id,
    "dep_rate": 20.0,  # 20% per year
    "dep_method": "line",
    "accum_dep_account_id": accum_dep_account_id,
    "dep_exp_account_id": dep_exp_account_id,
    "track_id": it_dept_id
})


2. Register Asset

Method: do_register(ids, context)

Activates asset for depreciation.

Behavior: 1. Validates state is "pending" 2. Changes state to "registered" 3. Asset becomes eligible for depreciation

Example:

get_model("account.fixed.asset").do_register([asset_id])
# Asset now active and can be deprecated


3. Return to Pending

Method: to_pending(ids, context)

Reverts asset to pending state.

Example:

get_model("account.fixed.asset").to_pending([asset_id])
# Asset returns to pending, stops depreciation


4. Calculate Book Value

Method: _get_book_val(ids, context) (computed field)

Calculates current book value and last depreciation date.

Formula:

Book Value = Purchase Price - Sum(Depreciation Periods)

For disposed/sold assets: Book value = 0

Context Parameters: - date: Calculate book value as of specific date

Returns:

{
    asset_id: {
        "book_val": 40000.00,
        "last_dep": "2025-12-31"
    }
}


5. Get Daily Depreciation Rate

Method: get_daily_rate(ids, date_from, context)

Calculates daily depreciation rate based on method.

Straight-Line Method:

year_rate = (purchase_price - salvage_value) * dep_rate / 100
day_rate = year_rate / days_in_year

Declining Balance Method:

# Rate decreases each year based on remaining book value
year_rate = current_book_value * dep_rate / 100
day_rate = year_rate / days_in_year

Example:

asset = get_model("account.fixed.asset").browse([asset_id])[0]
daily_rate = asset.get_daily_rate("2025-01-15")
print(f"Daily depreciation: ${daily_rate:.2f}")


6. Depreciate Asset

Method: depreciate(ids, date_to, context)

Calculates and records depreciation up to specified date.

Behavior: 1. Validates asset is "registered" 2. Calculates depreciation from last_dep (or purchase date) to date_to 3. Creates monthly depreciation periods 4. Generates journal entries 5. Updates book value

Journal Entry Created:

Dr  Depreciation Expense     X,XXX
    Cr  Accumulated Depreciation     X,XXX

Example:

# Depreciate to end of month
get_model("account.fixed.asset").depreciate(
    [asset_id],
    "2025-01-31"
)

Batch Depreciation:

# Depreciate all registered assets
asset_ids = get_model("account.fixed.asset").search([
    ["state", "=", "registered"]
])
get_model("account.fixed.asset").depreciate(
    asset_ids,
    "2025-01-31"
)


7. Copy Asset

Method: copy(ids, context)

Duplicates asset as new pending asset.

Example:

result = get_model("account.fixed.asset").copy([asset_id])
# Returns navigation to new asset form


8. On Change Type

Method: onchange_type(context)

Auto-fills depreciation settings from asset type.

Behavior: When asset type is selected, automatically populates: - Fixed asset account - Depreciation rate - Depreciation method - Accumulated depreciation account - Depreciation expense account


Common Use Cases

Use Case 1: Purchase and Register Asset

# 1. Create asset
asset_id = get_model("account.fixed.asset").create({
    "name": "Toyota Camry 2025",
    "date_purchase": "2025-01-15",
    "price_purchase": 800000.00,
    "type_id": vehicle_type_id,
    "dep_rate": 20.0,
    "dep_method": "line",
    "track_id": sales_dept_id,
    "invoice_id": purchase_invoice_id
})

# 2. Register for depreciation
get_model("account.fixed.asset").do_register([asset_id])

print("✓ Asset registered and ready for depreciation")

Use Case 2: Monthly Depreciation Run

from datetime import date
from dateutil.relativedelta import relativedelta

# Get last day of current month
today = date.today()
last_day = (today + relativedelta(day=31)).strftime("%Y-%m-%d")

# Find all registered assets
asset_ids = get_model("account.fixed.asset").search([
    ["state", "=", "registered"]
])

# Run depreciation
get_model("account.fixed.asset").depreciate(asset_ids, last_day)

print(f"✓ Depreciated {len(asset_ids)} assets to {last_day}")

Use Case 3: Asset Register Report

# Generate asset register with book values
assets = get_model("account.fixed.asset").search_browse([
    ["state", "in", ["registered", "disposed", "sold"]]
], order="type_id,number")

print("ASSET REGISTER")
print("=" * 100)
print(f"{'Number':15} {'Name':30} {'Type':20} {'Purchase':>12} {'Book Val':>12} {'Status':10}")
print("-" * 100)

total_purchase = 0
total_book_val = 0

for asset in assets:
    type_name = asset.type_id.name if asset.type_id else "N/A"
    total_purchase += asset.price_purchase or 0
    total_book_val += asset.book_val or 0

    print(f"{asset.number:15} {asset.name[:30]:30} {type_name[:20]:20} "
          f"${asset.price_purchase or 0:>11,.2f} ${asset.book_val or 0:>11,.2f} "
          f"{asset.state:10}")

print("=" * 100)
print(f"Totals: {' ' * 65} ${total_purchase:>11,.2f} ${total_book_val:>11,.2f}")

Use Case 4: Straight-Line Depreciation

# Asset with 5-year life (20% per year)
asset_id = get_model("account.fixed.asset").create({
    "name": "Office Furniture Set",
    "date_purchase": "2025-01-01",
    "price_purchase": 100000.00,
    "dep_rate": 20.0,  # 20% annual
    "dep_method": "line",  # Straight-line
    "salvage_value": 10000.00,  # Residual value
    "type_id": furniture_type_id
})

get_model("account.fixed.asset").do_register([asset_id])

# Annual depreciation = (100,000 - 10,000) * 20% = 18,000
# After 5 years: Book value = 10,000 (salvage value)

Use Case 5: Declining Balance Depreciation

# Asset with accelerated depreciation
asset_id = get_model("account.fixed.asset").create({
    "name": "Manufacturing Equipment",
    "date_purchase": "2025-01-01",
    "price_purchase": 500000.00,
    "dep_rate": 30.0,  # 30% annual
    "dep_method": "decline",  # Declining balance
    "type_id": machinery_type_id
})

get_model("account.fixed.asset").do_register([asset_id])

# Year 1: 500,000 * 30% = 150,000 → Book value: 350,000
# Year 2: 350,000 * 30% = 105,000 → Book value: 245,000
# Year 3: 245,000 * 30% =  73,500 → Book value: 171,500
# Depreciation decreases each year

Use Case 6: Asset with Tracking

# Track asset by department and project
asset_id = get_model("account.fixed.asset").create({
    "name": "Project Server",
    "date_purchase": "2025-01-15",
    "price_purchase": 200000.00,
    "type_id": computer_type_id,
    "dep_rate": 33.33,  # 3-year life
    "dep_method": "line",
    "track_id": it_dept_id,  # Department tracking
    "asset_owner": "IT Department"
})

# Depreciation expense will be tracked to IT department

# Create invoice for asset purchase
invoice_id = get_model("account.invoice").create({
    "type": "in",
    "contact_id": supplier_id,
    "date": "2025-01-15",
    "lines": [
        ("create", {
            "product_id": laptop_product_id,
            "qty": 1,
            "unit_price": 50000.00,
            "account_id": asset_account_id
        })
    ]
})

get_model("account.invoice").post([invoice_id])

# Create linked asset
asset_id = get_model("account.fixed.asset").create({
    "name": "Dell Laptop",
    "date_purchase": "2025-01-15",
    "price_purchase": 50000.00,
    "invoice_id": invoice_id,  # Link to invoice
    "type_id": computer_type_id
})

Best Practices

1. Use Asset Types for Consistency

# Good: Use asset type to auto-fill settings
{
    "type_id": computer_type_id
    # Automatically fills accounts, rates, method
}

# Avoid: Manual entry prone to errors
{
    "dep_rate": 20.0,
    "dep_method": "line",
    "accum_dep_account_id": 123,
    # Risk of inconsistent settings
}

2. Register Assets Promptly

# Register when asset is placed in service
# Don't leave in "pending" indefinitely
get_model("account.fixed.asset").do_register([asset_id])

3. Run Depreciation Consistently

# Best practice: Monthly depreciation at month-end
# Automate with scheduled job

from dateutil.relativedelta import relativedelta

def monthly_depreciation():
    # Last day of previous month
    today = date.today()
    last_month_end = (today.replace(day=1) - timedelta(days=1)).strftime("%Y-%m-%d")

    asset_ids = get_model("account.fixed.asset").search([
        ["state", "=", "registered"]
    ])

    get_model("account.fixed.asset").depreciate(asset_ids, last_month_end)

4. Set Salvage Values When Appropriate

# For assets with residual value
{
    "price_purchase": 100000.00,
    "salvage_value": 10000.00,
    "dep_method": "line"
}
# Depreciates 90,000 over asset life

5. Track Assets by Department

# Use tracking for departmental allocation
{
    "track_id": department_id
}
# Depreciation expense allocated to department

Depreciation Methods Explained

Straight-Line Method

When to Use: - Standard depreciation for most assets - Even expense allocation over asset life - Simple and predictable

Calculation:

Annual Depreciation = (Purchase Price - Salvage Value) × Rate%
Monthly Depreciation = Annual Depreciation ÷ 12

Example: - Purchase: $120,000 - Salvage: $20,000 - Rate: 20% (5-year life) - Annual Dep: ($120,000 - $20,000) × 20% = $20,000 - Monthly Dep: $20,000 ÷ 12 = $1,667


Declining Balance Method

When to Use: - Technology assets (rapid obsolescence) - Vehicles (higher depreciation early) - Tax advantage for accelerated depreciation

Calculation:

Year 1: Book Value × Rate%
Year 2: (Book Value - Year 1 Dep) × Rate%
Year 3: (Book Value - Year 1&2 Dep) × Rate%

Example: - Purchase: $120,000 - Rate: 30% - Year 1: $120,000 × 30% = $36,000 - Year 2: $84,000 × 30% = $25,200 - Year 3: $58,800 × 30% = $17,640


Database Constraints

Unique Constraint

  • number: Asset number must be unique

Delete Restrictions

  • Cannot delete assets with depreciation periods
  • Delete periods first, then asset

Model Relationship Description
account.fixed.asset.type Many2One Asset type/category
account.fixed.asset.period One2Many Depreciation periods
account.account Many2One Asset/depreciation accounts
account.invoice Many2One Purchase invoice
account.track.categ Many2One Tracking category
stock.lot Many2One Stock lot reference
company Many2One Multi-company support

Version History

Last Updated: 2025-12-16 Model Version: account_fixed_asset.py Framework: Netforce


Additional Resources

  • Asset Type Documentation: account.fixed.asset.type
  • Depreciation Period Documentation: account.fixed.asset.period
  • Depreciation Wizard Documentation: account.fixed.asset.depreciation
  • Disposal Wizard Documentation: account.fixed.asset.dispose
  • Sale Wizard Documentation: account.fixed.asset.sell

This documentation is generated for developer onboarding and reference purposes.