feat(fusion_accounting_assets): asset_card component
Made-with: Cursor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
'name': 'Fusion Accounting Assets',
|
||||
'version': '19.0.1.0.21',
|
||||
'version': '19.0.1.0.22',
|
||||
'category': 'Accounting/Accounting',
|
||||
'summary': 'AI-augmented asset management with depreciation schedules.',
|
||||
'description': """
|
||||
@@ -44,6 +44,8 @@ menu hides; the engine + AI tools remain available for the chat.
|
||||
'fusion_accounting_assets/static/src/views/asset_dashboard/asset_dashboard.js',
|
||||
'fusion_accounting_assets/static/src/views/asset_dashboard/asset_dashboard.xml',
|
||||
'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',
|
||||
],
|
||||
},
|
||||
'installable': True,
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class AssetCard extends Component {
|
||||
static template = "fusion_accounting_assets.AssetCard";
|
||||
static props = {
|
||||
asset: { type: Object },
|
||||
selected: { type: Boolean, optional: true },
|
||||
onSelect: { type: Function },
|
||||
formatCurrency: { type: Function },
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-name="fusion_accounting_assets.AssetCard">
|
||||
<div class="o_fusion_assets_card"
|
||||
t-att-class="props.selected ? 'selected' : ''"
|
||||
t-on-click="props.onSelect">
|
||||
<div class="o_fusion_assets_card_header">
|
||||
<div class="asset-name">
|
||||
<t t-esc="props.asset.name"/>
|
||||
<span t-if="props.asset.code" class="text-muted ms-2">
|
||||
[<t t-esc="props.asset.code"/>]
|
||||
</span>
|
||||
</div>
|
||||
<div class="asset-state-badge" t-att-data-state="props.asset.state">
|
||||
<t t-esc="props.asset.state"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="asset-numbers">
|
||||
<div>
|
||||
<span class="label">Cost:</span>
|
||||
<span class="value">$<t t-esc="props.formatCurrency(props.asset.cost)"/></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="label">Book Value:</span>
|
||||
<span class="value">$<t t-esc="props.formatCurrency(props.asset.book_value)"/></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="label">Method:</span>
|
||||
<span class="value"><t t-esc="props.asset.method"/></span>
|
||||
</div>
|
||||
<div t-if="props.asset.category_name">
|
||||
<span class="label">Category:</span>
|
||||
<span class="value"><t t-esc="props.asset.category_name"/></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
Reference in New Issue
Block a user