Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get The value from the Formula cell #2492

Open
saifkazi opened this issue May 19, 2023 · 1 comment
Open

Get The value from the Formula cell #2492

saifkazi opened this issue May 19, 2023 · 1 comment

Comments

@saifkazi
Copy link

saifkazi commented May 19, 2023

Hey

I can get the cell Content using this code which returns me the formula cell

model.getters.getCell("Sheet1",1,12)

but I was hoping . If some how I could manage to get the value that is computed using dependent cell so I could fill it up in my db

UPDATE:

I see there is evaluated object in model.getters.getCell("Sheet1",1,12) but it showing me this

{value: "Loading...", type: "text"}

any help is much appreciated

@rrahir
Copy link
Collaborator

rrahir commented Jan 27, 2024

Hi,

The string you are refering to is displayed for formulas depending on asynchronous data, you have to let some time for the server to return the data and let at least one evaluation take place before trying to fetch its evaluated value.
Correct me if I'm wrong but I suppose that you met this error while trying to extract values from a formula inside Odoo?

if so, you could rely on waitForDataLoaded(model) https://github.com/odoo/odoo/blob/17.0/addons/spreadsheet/static/src/helpers/model.js#L29 an asynchronous function that will resolve once every datasource (pivot/list/odoo graph) have received the server data and their related formulas have been evaluated.

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants