You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
/** @odoo-module */
|
|
import {
|
|
useService
|
|
} from "@web/core/utils/hooks";
|
|
|
|
const {
|
|
Component,
|
|
onWillStart
|
|
} = owl;
|
|
|
|
export class AccountDashboard extends Component {
|
|
setup() {
|
|
this.orm = useService("orm");
|
|
this.action = useService("action");
|
|
|
|
onWillStart(async () => {
|
|
this.invoiceData = await this.orm.call(
|
|
"account.move",
|
|
"retrieve_out_invoice_dashboard",
|
|
);
|
|
});
|
|
}
|
|
/**
|
|
* This method clears the current search query and activates
|
|
* the filters found in `filter_name` attibute from button pressed
|
|
*/
|
|
setSearchContext(ev) {
|
|
let filter_name = ev.currentTarget.getAttribute("filter_name");
|
|
let filters = filter_name.split(',');
|
|
let searchItems = this.env.searchModel.getSearchItems((item) => filters.includes(item.name));
|
|
this.env.searchModel.query = [];
|
|
for (const item of searchItems) {
|
|
this.env.searchModel.toggleSearchItem(item.id);
|
|
}
|
|
}
|
|
}
|
|
AccountDashboard.template = 'account.AccountDashboard'
|
|
|