Steps to reproduce:
- create an empty spreadsheet
- type in a cell '=ODOO.BALANCE("qsdfqsf", "02/2024")'
=> #ERROR
There's no account that match the given code.
The account.move.line domain ends up having a clause
`('account_id', 'in', [])`
The ORM detects the domain won't match anything and
early returns an empty list []
Our code expects a query object and not a list => boom
opw-3872445
closesodoo/odoo#163444
X-original-commit: 95de1332196fde7bfa5d178c6c0b7995cd892acb
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Steps to reproduce:
- in A1, type '02/2024'
- in A2, type '=ODOO.BALANCE("100", A1)'
=> the result you get come from account lines
for the day 2024/02/1 instead of the full
february month.
The value of A1 is detected as a number (first of february 2024)
When that number is given as the argument of ODOO.BALANCE,
the number falls back as being interpreted as a single day,
instead of a month period.
opw-3872445
closesodoo/odoo#163156
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
This commit actually refactors the code of the accounting functions
to use `computeValueAndFormat` instead of `compute` which doesn't
receive the arguments format.
The goal is to make the actual fix in the next commit easier
to review/understant with minimal noise.
opw-3872445
Part-of: odoo/odoo#163156
Steps to reproduce:
- in A1, type '02/2024'
- in A2, type '=ODOO.BALANCE("100", A1)'
- right click on A2
- click the menu item "See record"
=> you end up with wrong records in the list view
The value of A1 is detected as a number (first of february 2024)
When that number is given as the argument of ODOO.BALANCE,
the number falls back as being interpreted as a single day,
instead of a month period.
opw-3872445
Part-of: odoo/odoo#163156
Improve the wording of the argument descriptions for the functions
`ODOO.ACCOUNT.GROUP`, `ODOO.FISCALYEAR.START`, and
`ODOO.FISCALYEAR.END`.
closesodoo/odoo#154668
Task: 3680374
X-original-commit: bd5ddaca16f6ced709d3aa3af72829b1d443d4bb
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com>
For a first iteration, Russian translations were done using DeepL using
1 large .pot file of all the standard modules to translate (e.g. no
localizations, no test modules, etc). Unfortunately for some reason
doing a msgmerge with the existing ru.po files didn't seem to work, so
old "Translators" metadata at top of files were lost (maybe they will be
re-added during next Transifex sync?)
Part-of: odoo/odoo#152285
The `see records` action that drill downs to the specific AccountMoveLines
that match the formula domain would break if we left some optional
formula arguments empty (specifically concerns the offset and companyId
arguments). This revision ensures that we use their default value when the
arguments are not provided.
closesodoo/odoo#151423
Task: 3621110
X-original-commit: 23bbb0cdebc9028fcc93e006e755c43000428fcb
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
In the 'Accounting Settings' of 'Fisical Year', When the User tries to set
'February' as a month and the 29th as a Day and Save it, It will allow the user
to save but when the User opens the spreadsheet dashboard in the terminal,
same error will be generated.
Steps To Produce:-
1) Install the 'spreadsheet_account' module
2) Go to Settings -> Accounting
3) In the 'Fiscal Periods' of 'Fiscal Year', In 'Last Day' select
'February' month and set 29 as a Day
4) Go to the Accounting module, Customer->Invoices
5) In the 'Favorites', Select 'Insert Link in a Spreadsheet'.
6) Open Spreadsheet, Click on the 'Dashboard' Tab
The Error will be generated in Backend(Terminal)
Applying these changes will resolve this issue.
sentry - 4079962029
closesodoo/odoo#140011
X-original-commit: 1323829d3b5e134300f326f86c887f1cad6119f4
Signed-off-by: Laurent Smet (las) <las@odoo.com>
This commit removes the default exports from the spreadsheet module.
They don't bring anything except confusion when importing a mix of
default and named exports.
closesodoo/odoo#139071
Task: 3559536
Related: odoo/enterprise#49129
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
`=ODOO.BALANCE("100,200", "2022")` works but
`=ODOO.BALANCE("100, 200", "2022")` does not work (notice the extra space).
With this commit, the account codes are trimmed.
closesodoo/odoo#138850
X-original-commit: 7fd3fd60cc7cd207626f49ba1cf40232ced9d4ff
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Issue:
Displaying the data on the dashboard accounting can take up to 1 minute
Analysis:
The spreadsheet_fetch_debit_credit function needs a domain in order to compute the formulas. The domain being set in `_build_spreadsheet_formula_domain` use a like search for account_account.code on account_move_line which is a big table. Thus it does not scale well. There is also a unnecessary complexity on adding an "OR expression" on each one of the account_id code searched for.
Solution:
It can be optimized by searching for the full exhaustive (like in SQL) codes in account.accoun since it has way less records and thus more scalable. And then use an exact condition (=) which is faster than a like search. Also adding more readable while adding the balance_domain and pnl domain only once in the whole query.
Benchmark:
| Before PR | After PR |
|:----------:|:---------:|
| 8s 51 ms | 42 ms code search + 42 ms full query |
Related ticket:
opw-3328144
Version affected:
16.0 and above
closesodoo/odoo#134889
X-original-commit: a707f8345cec8f404077b184f4b0339932c10892
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
In a previous commit 8bfa76a, _lt() returns _t().
So, in this commit, all usages of _lt() are replaced by _t().
task-3292454
closesodoo/odoo#130179
Related: odoo/enterprise#44906
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models
These records can be read and used in children companies.
This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
country
task-3371677
closesodoo/odoo#125642
Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
`isMatched` is always true, so it have little/no purpose and we can
remove this attribute.
closesodoo/odoo#127279
Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com>
This commit adds an "Odoo" functions category in the top bar menu
"Insert > Function".
It allows to easily discover existing functions.
closesodoo/odoo#127372
Signed-off-by: Alexis Lacroix (laa) <laa@odoo.com>
All figures coming from the accounting dashboard should be, by default, excluding the unposted entries since this is the default filter when opening the reports.
opw - 3268676
closesodoo/odoo#120424
X-original-commit: fd20e65fbfeadcc477ea7179900741dd6e98cf16
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Co-authored-by: LucasLefevre <lul@odoo.com>
Install `l10n_au_keypay` on a fresh database, run the tests:
two tests in `spreadsheet_account` fail.
They wrongly assumed the last fiscal day of the main company is always 31th December.
This is not true with the module mentioned above installed since
https://github.com/odoo/odoo/commit/65dacfc17bec5feba1216354c71ca542c1b762b2
(look at `chart_template.py`)
Runbot build errors: 19796, 19797
closesodoo/odoo#117419
X-original-commit: a8d28ef16318df7d42c93265580a8e5dbc75cb1d
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Using o-spreadsheet features and functions is done using
the same import module as if it was installed from npm.
Additionaly, by adding the library as dev dependency in package.json[1], IDEs can
now leverage Typescript types for autocomplete and type checking.
The "alpha" release tag is always the lastest master version.
[1] enable web tooling `addons/web/tooling/enable.sh` ;)
closesodoo/odoo#115972
Related: odoo/enterprise#38471
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
This issue is caught by a sentry. When the user clicks on 'See Records' from the
spreadsheet user gets key-error 'codes'! When clicking on 'See Records' it tries
to get the domain and the domain takes 'codes'
in this function:- spreadsheet_move_line_action()
In this PR(https://github.com/odoo/odoo/pull/113359) they changed the key from
'code' to 'codes'.
sentry - 3961028578
closesodoo/odoo#114161
X-original-commit: 83a8d5437da5da3d5ff5e6395952214e8d08e8f4
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
This simplifies the use of subqueries by avoiding some costly default
order on the model or the idiotic order='id'. Method _flush_search()
has been adapted accordingly.
Part-of: odoo/odoo#112126
Let's say there is one account with code 431 and another with code 4310,
`ODOO.BALANCE("431,4310", 2022)` counts 4310 twice.
The reason is queries are done one code at a time, one by one.
The account 4310 is counted first when using 431 as a prefix (431%) and once
more with 4310 (4310%).
Now, the query uses all codes all at once.
The original idea was to cache queries as much as we could. If you later add the
formula `ODOO.BALANCE("431", 2022)`, the result would have been cached
because queries were done code by code.
Given the issue it brings, we thing this opmitisation is not worth it and is
therefore removed. It also makes the code client-side simpler.
opw-3144473
closesodoo/odoo#113418
X-original-commit: 07bd67f3a389bde4f33e08d97967dbb70ad5a19f
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>