Commit Graph
14 Commits
Author SHA1 Message Date
Julien Alardot (jual) 68fbdc9640 [REF] *expense*: Technical hr_expense refactor
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

closes odoo/odoo#130244

Related: odoo/upgrade#5016
Related: odoo/enterprise#45149
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-10-20 23:37:36 +00:00
Lucas Lefèvre (lul) 838ee8d18d [FIX] spreadsheet_dashboard_*: set explicit en_US locale
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

closes odoo/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>
2023-10-19 10:45:53 +00:00
Lucas Lefèvre e5d11fa7a5 [FIX] spreadsheet_dashboard_hr_expense: don't mix currencies
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

closes odoo/odoo#119264

X-original-commit: e579ec5b3794d545676accdd23428557b75d05fa
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-04-20 22:09:57 +02:00
Chenyun Yang 0a87304ff0 [REF] spreadsheet: spreadsheet models
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

closes odoo/odoo#116498

Related: odoo/upgrade#4473
Related: odoo/enterprise#38692
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-03-30 15:09:33 +02:00
Lucas Lefèvre 8642a85b4e [REV] spreadsheet_dashboard_hr_expense: restore global filters
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 #104125

closes odoo/odoo#109099

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-04 18:49:46 +01:00
Lucas Lefèvre 14700c9e96 [FIX] spreadsheet_dashboard: unskip expense dashboard test
The test was skipped because the expense dashboard was broken when
the test was merged.
See https://github.com/odoo/odoo/commit/17afe2987e4146b85187b31a34caf7146d5a7cf2

closes odoo/odoo#109033

X-original-commit: 4d4c192e0994ff7849641499b728fe228ae66a4d
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-04 11:35:52 +01:00
niyasraphy 64ac4f80df [FIX] spreadsheet_dashboard_{}: remove non existing field from json files
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.

closes odoo/odoo#109014

X-original-commit: baea94b9e7e5e5d120e11d454194fbfd70dee4ef
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-03 20:15:06 +01:00
Lucas Lefèvre e6990ed2b8 [FIX] spreadsheet_dashboard: remove currency formats
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

closes odoo/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>
2022-12-12 13:18:59 +01:00
Adrien Minne f043908df8 [FIX] spreadsheet_dashboard_*: fix dashboards
Update dashboard with latest version.

closes odoo/odoo#107512

X-original-commit: bd116406002f9d0a196141fe742de36ac6dbaa55
Related: odoo/enterprise#34815
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-12-09 16:41:01 +01:00
Lucas Lefèvre 04892cc17e [FIX] spreadsheet_dashboard_*: adjust some spreadsheet dashboards
This commit fixes/improves spreadsheet dashboards.

closes odoo/odoo#101315

X-original-commit: 7e4cc7cf7be6c196abf0e467630dd5cd86bf15a7
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-09-27 17:11:51 +02:00
Lucas Lefèvre 291d752ad5 [FIX] spreadsheet_dashboard_*: mark translatable cell content
closes odoo/odoo#101120

X-original-commit: 50e2c92fafa8640f9e23e70d2b10b5cf85373998
Related: odoo/enterprise#31780
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-09-26 14:43:21 +02:00
Lucas Lefèvre afec5e4f15 [IMP] spreadsheet_dashboard_*: update dashboards
closes odoo/odoo#100343

Related: odoo/enterprise#31407
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-09-16 14:25:59 +02:00
Lucas Lefèvre 1ca605fe12 [IMP] spreadsheet_dashboard_*: update dashboards
*_account, _event_sale, _hr_expense, _pos_hr, _sale

closes odoo/odoo#100101

Related: odoo/enterprise#31283
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-09-14 16:18:02 +02:00
Lucas LefèvreandNathan Grognet 82f9297af1 [ADD] spreadsheet_dashboard_hr_expense: add expense dashboard
Part-of: odoo/odoo#97606
Co-authored-by: Nathan Grognet <ngr@odoo.com>
2022-09-10 02:54:53 +02:00