Commit Graph
9 Commits
Author SHA1 Message Date
Kevin Baptiste a7754e77a9 [FIX] fleet: fleet cost report
Steps to reproduce:
- Install Fleet
- Go on report-cost
- Click on a specifi vehicles
-> The cost associated are not correct

Solution:
Correction of the SQL-query which was not correct (id not unique)

closes odoo/odoo#81688

X-original-commit: e06114b3b7e188d8ce293f77d8395592193eb83d
Signed-off-by: yosa-odoo <yosa@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-01-03 12:33:54 +00:00
Yannick Tivisse 24713b76b5 [REV] fleet: Revert multiple fleet mechanism
I don't get why you don't get it...

Partial revert of the taskID: 2415309
Com PR: https://github.com/odoo/odoo/pull/70313
Ent PR: https://github.com/odoo/enterprise/pull/18114
Upg PR: https://github.com/odoo/upgrade/pull/2447

closes odoo/odoo#75475

Related: odoo/enterprise#20406
Related: odoo/upgrade#2765
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-25 12:20:39 +00:00
Adrien Widart b97d360ade [FIX] fleet: always include current month in costs report
When consulting the costs reports, if the beginning of the dates range
has a day greater than the day of today (e.g., start date: 2021/02/25,
today: 2021/07/10 => 25 > 10), the costs of the current month won't be
include in the report.

To reproduce the issue:
(DB without any demo data. Let X be the day of the month for today)
1. Create a vehicle V
2. Add a service S1 for V
    - The category of the service type does not matter
    - Cost: 500
    - Date: today
3. Add a second service S2 for V
    - Same service type
    - Cost: 250
    - Date: Last month with a day > X (so if today is 2021/07/26, date
could be 2021/06/27)
4. Fleet > Reporting > Costs

Error: The report does not include S1

When generating the dates range, the current date is used as the end of
the interval. Since the interval step is '1 month', it will lead to an
issue in the above case:
Suppose today is 2021/07/26, the interval starts on 2021/06/27. Then, if
we add one month to this date, we have 2021/07/27, which is after the
end of the interval (2021/07/26), so the date is ignored. As a result,
current month won't be included in the report.

Note: A similar issue can happen with the contracts

OPW-2477004

closes odoo/odoo#74273

X-original-commit: 7ea6300f951bd426c94d721bb56e6ad85a58bd30
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-26 17:03:06 +00:00
Adrien Widart 5c10ffe284 [FIX] fleet: use services dates in report start date computation
When adding some services to a vehicle that does not have any
immatriculation date, the costs report does not consider these services.

To reproduce the error:
(DB without any demo data)
1. Create a vehicle V
    - Remove the Immatriculation Date
2. Add a service for V
    - The category of the service type does not matter
    - Cost > 0
    - Date: today
3. Fleet > Reporting > Costs

Error: Costs Analysis is empty, the service is not considered

In the SQL view, the date used as start point is the oldest
immatriculation date. Therefore, if the vehicle doesn't have this date,
the report lines won't be generated.

OPW-2477004

X-original-commit: 8d362af654c1905535d78fbf8d73677633b65d63
2021-07-26 17:03:04 +00:00
William Braeckman 5849acab43 [IMP] fleet,hr_fleet: add support for multiple fleets
Add a layer above the vehicle model to separate vehicles from different
fleets.

Task ID: 2415309
2021-07-09 14:51:26 +02:00
Goffin Simon 7a8786f697 [FIX] fleet: Impossible to upgrade fleet
With PostgreSQL version 9.6, it was impossible to install the module fleet
A traceback was raised saying:

could not determine which collation to use for view column "cost_type"

closes odoo/odoo#61850

X-original-commit: d652dbb9655d98b4121ac685e6444bbf7e303292
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-11-17 15:29:21 +00:00
Xavier Morel e162e6f714 [FIX] test_lint, *: false negative in sql injection linter
The linter would miss / fail to warn on injection of *local variables*
in some cases.

Try to improve it to be stricter and more reliable, after discussion
with odo, sql which is "correctly" dynamic should use psycopg2's sql
package in order to bypass the linter (bonus: it should also properly
escape & quote identifiers).

closes odoo/odoo#53938

Related: odoo/enterprise#11718
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-07-10 07:12:35 +00:00
Kevin Baptiste 5268f3c870 [IMP] fleet: add active, description on service log
Purpose
=======

Add new fields on fleet.vehicle.log.services to make the model more
flexible for several use cases.

TaskID: 2237599
2020-04-16 11:23:41 +00:00
Kevin Baptiste 82df1dfccc [IMP] fleet: model cleanup, dashboard
Purpose
=======

It is currently difficult to know exactly what is used for costs
and services on the contracts.

Hence it make it difficult to evolve the fleet application
We should clean the models in order to have something that is clearer

Specification
=============

Cleanup of models: removed Fuel and Cost. Contract and Services are no
longer inheriting Cost and are seperate models simplifying the use of
Fleet. A contract now has included services and they are no longer
generating cost.

closes odoo/odoo#34090

Taskid: 1931775
Related: odoo/enterprise#4572
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-27 11:54:51 +00:00