Files
odoo_source/addons/spreadsheet/static/tests/utils/mock_server.js
T
Lucas Lefèvre a20032cc1c [MOV] spreadsheet: move module to community
The spreadsheet module is moved to the community version
for the upcoming spreadsheet dashboards

This module is the core engine of spreadsheets in Odoo.
It contains `o-spreadsheet` library (o_spreadsheet.js) and all basic
integrations with odoo such as accounting formulas, lists, pivot, filters, etc.

This module alone does not have any action or menu to open a spreadsheet.
Those actions come with `documents_spreadsheet` module or the upcoming
`spreadsheet_dashboard` module.

Task 2799682

Part-of: odoo/odoo#97606
2022-09-10 02:54:51 +02:00

32 lines
942 B
JavaScript

/** @odoo-module */
import { registry } from "@web/core/registry";
registry
.category("mock_server")
.add("res.currency/get_currencies_for_spreadsheet", function (route, args) {
const currencyNames = args.args[0];
const result = [];
for (let currencyName of currencyNames) {
const curr = this.models["res.currency"].records.find(
(curr) => curr.name === currencyName
);
result.push({
code: curr.name,
symbol: curr.symbol,
decimalPlaces: curr.decimal_places || 2,
position: curr.position || "after",
});
}
return result;
})
.add("res.currency/get_company_currency_for_spreadsheet", function (route, args) {
return {
code: "EUR",
symbol: "€",
position: "after",
decimalPlaces: 2,
};
});