oca-ocb-hr/odoo-bringout-oca-ocb-hr_expense/hr_expense/static/src/components/expense_dashboard.js
2025-08-29 15:20:50 +02:00

28 lines
767 B
JavaScript

/** @odoo-module */
import { useService } from '@web/core/utils/hooks';
import { formatMonetary } from "@web/views/fields/formatters";
const { Component, onWillStart, useState } = owl;
export class ExpenseDashboard extends Component {
setup() {
super.setup();
this.orm = useService('orm');
this.state = useState({
expenses: {}
});
onWillStart(async () => {
const expense_states = await this.orm.call("hr.expense", 'get_expense_dashboard', []);
this.state.expenses = expense_states;
});
}
renderMonetaryField(value, currency_id) {
return formatMonetary(value, { currencyId: currency_id});;
}
}
ExpenseDashboard.template = 'hr_expense.ExpenseDashboard';