[FIX] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/8bd0fb2b4 [REL] 17.0.3 https://github.com/odoo/o-spreadsheet/commit/fe3ba2a88 [FIX] text_helper: strikethrough wrong positioning https://github.com/odoo/o-spreadsheet/commit/742581e80 [IMP] demo: add demo data for data validation https://github.com/odoo/o-spreadsheet/commit/0323dd37a [FIX] FiltersPlugin: removing row with data filter header Task: 3546012 https://github.com/odoo/o-spreadsheet/commit/fc2a17482 [FIX] FilterEvaluationPlugin: insert/remove rows on data filter header Task: 3546012 https://github.com/odoo/o-spreadsheet/commit/3c3bbe9a2 [MOV] tests: fix typo in test file name of context menu https://github.com/odoo/o-spreadsheet/commit/c53528f7c [FIX] F&R: Fix css rule https://github.com/odoo/o-spreadsheet/commit/b6fa9634f [FIX] Menus: Show Insert col/row menu when full sheet selected Task: 3450188 https://github.com/odoo/o-spreadsheet/commit/80bd3b30f [REV] Charts: Do not rely on history for the chartRuntimes Task: 3578417 https://github.com/odoo/o-spreadsheet/commit/3d6f4f954 [IMP] evaluation: improve perfs of `getCorrespondingFormulaCell` Task: 3584306 https://github.com/odoo/o-spreadsheet/commit/17ba12211 [FIX] cell: update cell tokens and dependencies Task: 3584306 https://github.com/odoo/o-spreadsheet/commit/c0cb4cf86 [FIX] find_and_replace: take array formula result into account Task: 3413999 [IMP] spreadsheet: remove useless tokenize calls The pivot/list helpers were tokenizing the cell's content when trying to find list/pivot formulas. But we can skip the tokenize call as we already have the tokens in the cell's compiledFormula. closes odoo/odoo#142323 Task: 3584306 Related: odoo/enterprise#50888 Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com> Co-authored-by: Adrien Minne <adrm@odoo.com>
This commit is contained in:
co-authored by
Adrien Minne
parent
22eb8e7b6a
commit
037e5b823b
@@ -20,7 +20,7 @@ cellMenuRegistry.add("move_lines_see_records", {
|
||||
const position = env.model.getters.getActivePosition();
|
||||
const sheetId = position.sheetId;
|
||||
const cell = env.model.getters.getCell(position);
|
||||
const { args } = getFirstAccountFunction(cell.content);
|
||||
const { args } = getFirstAccountFunction(cell.compiledFormula.tokens);
|
||||
let [codes, date_range, offset, companyId, includeUnposted] = args
|
||||
.map(astToFormula)
|
||||
.map((arg) => env.model.getters.evaluateFormula(sheetId, arg));
|
||||
@@ -46,7 +46,7 @@ cellMenuRegistry.add("move_lines_see_records", {
|
||||
!evaluatedCell.error &&
|
||||
evaluatedCell.value !== "" &&
|
||||
cell &&
|
||||
getNumberOfAccountFormulas(cell.content) === 1
|
||||
getNumberOfAccountFormulas(cell.compiledFormula.tokens) === 1
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,22 +1,25 @@
|
||||
/** @odoo-module **/
|
||||
import { getOdooFunctions } from "@spreadsheet/helpers/odoo_functions_helpers";
|
||||
|
||||
/** @typedef {import("@spreadsheet/helpers/odoo_functions_helpers").OdooFunctionDescription} OdooFunctionDescription*/
|
||||
/**
|
||||
* @typedef {import("@spreadsheet/helpers/odoo_functions_helpers").Token} Token
|
||||
* @typedef {import("@spreadsheet/helpers/odoo_functions_helpers").OdooFunctionDescription} OdooFunctionDescription
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {string} formula
|
||||
* @param {Token[]} tokens
|
||||
* @returns {number}
|
||||
*/
|
||||
export function getNumberOfAccountFormulas(formula) {
|
||||
return getOdooFunctions(formula, ["ODOO.BALANCE", "ODOO.CREDIT", "ODOO.DEBIT"]).length;
|
||||
export function getNumberOfAccountFormulas(tokens) {
|
||||
return getOdooFunctions(tokens, ["ODOO.BALANCE", "ODOO.CREDIT", "ODOO.DEBIT"]).length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first Account function description of the given formula.
|
||||
*
|
||||
* @param {string} formula
|
||||
* @param {Token[]} tokens
|
||||
* @returns {OdooFunctionDescription | undefined}
|
||||
*/
|
||||
export function getFirstAccountFunction(formula) {
|
||||
return getOdooFunctions(formula, ["ODOO.BALANCE", "ODOO.CREDIT", "ODOO.DEBIT"])[0];
|
||||
export function getFirstAccountFunction(tokens) {
|
||||
return getOdooFunctions(tokens, ["ODOO.BALANCE", "ODOO.CREDIT", "ODOO.DEBIT"])[0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user