feat(fusion_accounting_reports): anomaly_strip OWL component (Fusion-only)
Made-with: Cursor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
'name': 'Fusion Accounting Reports',
|
||||
'version': '19.0.1.0.28',
|
||||
'version': '19.0.1.0.29',
|
||||
'category': 'Accounting/Accounting',
|
||||
'summary': 'AI-augmented financial reports (P&L, balance sheet, trial balance, GL).',
|
||||
'description': """
|
||||
@@ -54,6 +54,8 @@ menu hides; the engine and AI tools remain available for the chat.
|
||||
'fusion_accounting_reports/static/src/components/period_filter/period_filter.xml',
|
||||
'fusion_accounting_reports/static/src/components/ai_commentary_panel/ai_commentary_panel.js',
|
||||
'fusion_accounting_reports/static/src/components/ai_commentary_panel/ai_commentary_panel.xml',
|
||||
'fusion_accounting_reports/static/src/components/anomaly_strip/anomaly_strip.js',
|
||||
'fusion_accounting_reports/static/src/components/anomaly_strip/anomaly_strip.xml',
|
||||
],
|
||||
},
|
||||
'installable': True,
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class AnomalyStrip extends Component {
|
||||
static template = "fusion_accounting_reports.AnomalyStrip";
|
||||
static props = {
|
||||
anomaly: { type: Object },
|
||||
};
|
||||
|
||||
formatAmount(amount) {
|
||||
if (amount === null || amount === undefined) return "";
|
||||
return new Intl.NumberFormat(undefined, {
|
||||
minimumFractionDigits: 2, maximumFractionDigits: 2,
|
||||
signDisplay: 'always',
|
||||
}).format(amount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-name="fusion_accounting_reports.AnomalyStrip">
|
||||
<div class="o_fusion_anomaly_strip" t-att-data-severity="props.anomaly.severity">
|
||||
<strong><t t-esc="props.anomaly.label"/></strong>
|
||||
<span class="ms-2">
|
||||
<t t-esc="props.anomaly.direction === 'increase' ? '↑' : '↓'"/>
|
||||
<t t-esc="props.anomaly.variance_pct.toFixed(1)"/>%
|
||||
(<t t-esc="formatAmount(props.anomaly.variance_amount)"/>)
|
||||
</span>
|
||||
<span class="ms-3 text-muted">
|
||||
severity: <t t-esc="props.anomaly.severity"/>
|
||||
</span>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
Reference in New Issue
Block a user