mirror of
https://github.com/bringout/oca-ocb-report.git
synced 2026-04-22 08:02:02 +02:00
Initial commit: Report packages
This commit is contained in:
commit
bc5e1e9efa
604 changed files with 474102 additions and 0 deletions
|
|
@ -0,0 +1,50 @@
|
|||
/** @odoo-module */
|
||||
import { _lt } from "@web/core/l10n/translation";
|
||||
|
||||
import spreadsheet from "@spreadsheet/o_spreadsheet/o_spreadsheet_extended";
|
||||
|
||||
import PivotCorePlugin from "./plugins/pivot_core_plugin";
|
||||
import PivotUIPlugin from "./plugins/pivot_ui_plugin";
|
||||
|
||||
import { SEE_RECORDS_PIVOT, SEE_RECORDS_PIVOT_VISIBLE } from "./pivot_actions";
|
||||
|
||||
const { coreTypes, invalidateEvaluationCommands } = spreadsheet;
|
||||
const { cellMenuRegistry } = spreadsheet.registries;
|
||||
|
||||
const { inverseCommandRegistry } = spreadsheet.registries;
|
||||
|
||||
function identity(cmd) {
|
||||
return [cmd];
|
||||
}
|
||||
|
||||
coreTypes.add("INSERT_PIVOT");
|
||||
coreTypes.add("RENAME_ODOO_PIVOT");
|
||||
coreTypes.add("REMOVE_PIVOT");
|
||||
coreTypes.add("RE_INSERT_PIVOT");
|
||||
coreTypes.add("UPDATE_ODOO_PIVOT_DOMAIN");
|
||||
|
||||
invalidateEvaluationCommands.add("UPDATE_ODOO_PIVOT_DOMAIN");
|
||||
invalidateEvaluationCommands.add("REMOVE_PIVOT");
|
||||
invalidateEvaluationCommands.add("INSERT_PIVOT");
|
||||
|
||||
cellMenuRegistry.add("pivot_see_records", {
|
||||
name: _lt("See records"),
|
||||
sequence: 175,
|
||||
action: async (env) => {
|
||||
const cell = env.model.getters.getActiveCell();
|
||||
await SEE_RECORDS_PIVOT(cell, env);
|
||||
},
|
||||
isVisible: (env) => {
|
||||
const cell = env.model.getters.getActiveCell();
|
||||
return SEE_RECORDS_PIVOT_VISIBLE(cell, env);
|
||||
},
|
||||
});
|
||||
|
||||
inverseCommandRegistry
|
||||
.add("INSERT_PIVOT", identity)
|
||||
.add("RENAME_ODOO_PIVOT", identity)
|
||||
.add("REMOVE_PIVOT", identity)
|
||||
.add("UPDATE_ODOO_PIVOT_DOMAIN", identity)
|
||||
.add("RE_INSERT_PIVOT", identity);
|
||||
|
||||
export { PivotCorePlugin, PivotUIPlugin };
|
||||
Loading…
Add table
Add a link
Reference in a new issue