From 7ba15c65aa802cd3e2994f64d1d1df3a95834aac Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sun, 19 Apr 2026 17:38:28 -0400 Subject: [PATCH] feat(fusion_accounting_assets): asset_detail_panel component Made-with: Cursor --- fusion_accounting_assets/__manifest__.py | 4 +- .../asset_detail_panel/asset_detail_panel.js | 36 +++++++++++++++ .../asset_detail_panel/asset_detail_panel.xml | 46 +++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 fusion_accounting_assets/static/src/components/asset_detail_panel/asset_detail_panel.js create mode 100644 fusion_accounting_assets/static/src/components/asset_detail_panel/asset_detail_panel.xml diff --git a/fusion_accounting_assets/__manifest__.py b/fusion_accounting_assets/__manifest__.py index 7bb8235e..7cdd0be8 100644 --- a/fusion_accounting_assets/__manifest__.py +++ b/fusion_accounting_assets/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Fusion Accounting Assets', - 'version': '19.0.1.0.22', + 'version': '19.0.1.0.23', 'category': 'Accounting/Accounting', 'summary': 'AI-augmented asset management with depreciation schedules.', 'description': """ @@ -46,6 +46,8 @@ menu hides; the engine + AI tools remain available for the chat. 'fusion_accounting_assets/static/src/views/asset_dashboard/asset_dashboard_view.js', 'fusion_accounting_assets/static/src/components/asset_card/asset_card.js', 'fusion_accounting_assets/static/src/components/asset_card/asset_card.xml', + 'fusion_accounting_assets/static/src/components/asset_detail_panel/asset_detail_panel.js', + 'fusion_accounting_assets/static/src/components/asset_detail_panel/asset_detail_panel.xml', ], }, 'installable': True, diff --git a/fusion_accounting_assets/static/src/components/asset_detail_panel/asset_detail_panel.js b/fusion_accounting_assets/static/src/components/asset_detail_panel/asset_detail_panel.js new file mode 100644 index 00000000..26be2378 --- /dev/null +++ b/fusion_accounting_assets/static/src/components/asset_detail_panel/asset_detail_panel.js @@ -0,0 +1,36 @@ +/** @odoo-module **/ + +import { Component } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +import { DepreciationBoard } from "../depreciation_board/depreciation_board"; + +export class AssetDetailPanel extends Component { + static template = "fusion_accounting_assets.AssetDetailPanel"; + static props = { + detail: { type: Object }, + formatCurrency: { type: Function }, + }; + static components = { DepreciationBoard }; + + setup() { + this.assets = useService("fusion_assets"); + } + + async onComputeSchedule() { + await this.assets.computeSchedule(this.props.detail.asset.id, false); + } + + async onRecomputeSchedule() { + await this.assets.computeSchedule(this.props.detail.asset.id, true); + } + + async onPostDepreciation() { + await this.assets.postDepreciation(this.props.detail.asset.id); + } + + async onDispose() { + const saleAmount = parseFloat(prompt("Sale amount (0 for scrap)?", "0")); + if (isNaN(saleAmount)) return; + await this.assets.disposeAsset(this.props.detail.asset.id, { saleAmount }); + } +} diff --git a/fusion_accounting_assets/static/src/components/asset_detail_panel/asset_detail_panel.xml b/fusion_accounting_assets/static/src/components/asset_detail_panel/asset_detail_panel.xml new file mode 100644 index 00000000..c3ba9af9 --- /dev/null +++ b/fusion_accounting_assets/static/src/components/asset_detail_panel/asset_detail_panel.xml @@ -0,0 +1,46 @@ + + + + +
+

+
+ [] +
+
+
State:
+
Cost: $
+
Salvage: $
+
Book Value: $
+
Total Depreciated: $
+
Method:
+
Useful Life: years
+
+ +
+ + + + +
+ +

Depreciation Schedule

+ + +
+

Active Anomalies

+
+ : +
+
+
+
+ +