This refactoring handles a lot of needed changes that should have almost
no impact on the UX. The aim is to make the code more readable and coherent
Major changes:
- Improve tests and make sure they actually make sense and test the flow
- Split hr.expense and hr.expense.sheet models into two files
- Rename fields according to account naming conventions
- all .*_amount become *_amount_currency and .*_amount_company -> .*_amount
- unit_amount -> price_unit
- all .*_amount or .*number.* for non-monetary -> nb_*
- amount_tax -> tax_amount
- Move hr.expense.sample field to hr_expense_extract
- Replace hr.expense.same_currency field by hr.expense.is_multiple_currency
to be consistent with hr.expense.sheet
- Remove hr.expense.unit_amount_display deprecated field
- Remove OCR-related & deprecated reference field
- Remove hr.expense.sheet.address_id deprecated field
- Simplify security fields (removing sheet_is_editable and merging the behaviour
for fewer confusions)
- Edit product fields to use related fields when possible
Minor changes:
- Coding UTF-8 lines removal
- Cleaning some imports
- Making some formatting more consistent
task-3358176
closesodoo/odoo#130244
Related: odoo/upgrade#5016
Related: odoo/enterprise#45149
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
The en_US default locale in o-spreadsheet is m/d/yyyy but it's mm/dd/yyyy in odoo.
Because of this mismatch, spreadsheets from the source code of odoo (dashboards,
templates) will have a small warning saying the spreadsheet locale and the user
locale mismatch.
That's because existing spreadsheet don't have any locale and the default one is
used.
This commit adds the locale to all o-spreadsheet json files.
Notes:
- we could have completely upgrade the json file format to the latest
o-spreadsheet version (version: 14), but just adding the settings is enough
closesodoo/odoo#139133
X-original-commit: 76f77f0bca6852846079f1fe0de6080554f96ac2
Related: odoo/enterprise#49148
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
In the Dashboard app, expenses KPI amounts are currently expressed in the
currency they were made in, but with the currency symbol of the company
currency. It also means amounts with different currencies are aggregated.
We want the KPI to be expressed in the company currency and not in the
expense currency.
Note that even with this commit, the amounts are still mixing different
currencies if multiple companies are active
Task 3266092
closesodoo/odoo#119264
X-original-commit: e579ec5b3794d545676accdd23428557b75d05fa
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
This commit refactors the current model structure of spreadsheet-related
module. Data fields are integrated into an abstract model
`spreadsheet.mixin` and all sub-models are inherited from it. This way
we can group all decode/encode logics into one place.
task 3222572
closesodoo/odoo#116498
Related: odoo/upgrade#4473
Related: odoo/enterprise#38692
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Partial revert of #109033
The global filters were removed in 16.0 because the pivot "9" does
not exists in this dashboard.
But it exists in master.
See #104125closesodoo/odoo#109099
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
before this commit, on clicking top reinvoiced orders section in the expense dashboard throws traveback saying invalid field analytic_account_id.
as analytic_account_id field is now replaced by analytic_distribution, removing the usage of analytic_account_id from json files.
closesodoo/odoo#109014
X-original-commit: baea94b9e7e5e5d120e11d454194fbfd70dee4ef
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Some of the dashboard files were using currency formats, which are
hardcoded with a given currency.
Because of that, some amounts are displayed with a $ sign, even if
the amount is in €, according to the record's currency.
It should use the automatic currency formatting of LIST functions
to use the record's currency.
This commits removes the hardcoded currency formats.
Note that the automatic format displays the decimal values while
the hardcoded format did not.
This is a functional change.
opw 3071160
opw 3058192
closesodoo/odoo#107557
X-original-commit: 54c99ede032775b9699ae85f3112de427c4b12b5
Related: odoo/enterprise#34834
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Remove most values uselessly specified because giving the same value as
the default one (see _DEFAULT_MANIFEST in odoo/modules/module.py)
auto_install is Falsy by default
author is Odoo SA by default
summary & description are empty strings by default
application is False by default
test, demo, depends and data are empty lists by default
This will reduce noise/inconsistencies between manifests specifications,
simplify analysis of manifests content.
closesodoo/odoo#106686
Related: odoo/enterprise#34462
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
use a python test to walk throuhg jsons instead of tours
Tours:
- you need to add one for each dashboard. It's a PITA and it doesn't scale
- they only check visible formulas since formulas are loaded only if they are in the viewport (I'm not even sure what is "visible" in chrome headless)
- they are slow
- can't check fields defined in global filters, links to odoo menu/views
`./odoo-bin --addons-path=../enterprise,./addons -d odoo-db -u --test-enable`
before: `59,76s user 5,78s system 29% cpu 3:43,15 total`
after: `15,12s user 1,20s system 86% cpu 18,912 total`
The Expenses dashboard was broken by https://github.com/odoo/odoo/pull/98914
But I want to merge this test right now.
Task 2980180
closesodoo/odoo#100757
X-original-commit: 17afe2987e4146b85187b31a34caf7146d5a7cf2
Related: odoo/enterprise#31598
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>