Commit Graph
164 Commits
Author SHA1 Message Date
William Braeckman 556c1237a2 [IMP] fleet: reorder/reword fuel types
There was some confusion about all the types of hybrid vehicles.
Also changes the order in which they are displayed.

TaskId-2629318

closes odoo/odoo#82672

X-original-commit: 73171da60059c85355e8675061db485e84aedb05
Related: odoo/enterprise#23460
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-01-13 09:30:56 +00:00
Florian Damhaut c81d5607dc [FIX] hr_fleet: no duplicate contract renewal activity reminder
Step to reproduce:
- Have a fleet contract that need renewal

Current Behaviour:
- A new activity is created everytime the scheduler is called

Behaviour after PR:
- A new activity is only created if there is no current renewal activity present when the scheduler is called

opw-2713537

closes odoo/odoo#81919

X-original-commit: 3610069ea2c10fccf8fcc82c384a2194c4702e06
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2021-12-28 08:07:47 +00:00
Kevin Baptiste 3acd3a08f7 [FIX] fleet: fix missing compute method
The PR #75475 removed the method `_compute_manager_id` without removing
the reference in the field.

closes odoo/odoo#81766

X-original-commit: a4e1477d120c336ace405421ddb860a72cfeafe1
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-22 07:50:51 +00:00
Yannick TivisseandVictor Feyens 18952cdc76 [IMP] *: Convert single create method into multi
Taskid: 2703085
Part-of: odoo/odoo#80824
Co-authored-by: Victor Feyens <vfe@odoo.com>
2021-12-14 19:13:18 +00:00
Yannick Tivisse 6a7c1c51ce Revert "[FIX] hr_fleet: Don't notify future_driver_id as Changed Driver"
This reverts commit 2e58d23e760313dbf58ce6a90f26b7160db460d8.

Actually the fleet officers want to be notified.

The correct way to handle the original issue is to ping the employees
via their documents, instead of on the fleet.vehicle, to avoid setting
them as followers of the car.

closes odoo/odoo#78716

X-original-commit: 437bd8cc54d999a40ee2d83e2fef9c0ced19f47e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-28 12:21:19 +00:00
Kevin Baptiste c715ecb38b [IMP] fleet: add Write Off Date on vehicle
Add the Write Off Date on vehicle.

closes odoo/odoo#77464

Related: odoo/enterprise#21299
Related: odoo/upgrade#2878
Taskid: 2657561
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-19 07:12:04 +00:00
Kevin Baptiste 67a07865d1 [IMP] (hr_)fleet: improve Claim Car Report
The "Claim Car Report" action was not working as expected.
Now the statbutton "Cars" will show the car history of a specific
driver.

closes odoo/odoo#76550

Related: odoo/upgrade#2882
Taskid: 2646113
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-04 11:29:55 +00:00
Philippe Wauthy 52e9668e99 [FIX] fleet: clean service type demo data
Description of the issue/feature this PR addresses:
In fleet, the demo data for service type have two entries for summer tires
The service types are sorted by alphabetical orders instead of id

Current behavior before PR:
The summer tires service type is appearing twice in the demo data
The service types are sorted by id

Desired behavior after PR is merged:
The summer tires service type is unique in the list
The services types are sorted by alphabetical order

task-2641484

closes odoo/odoo#76403

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-21 08:08:47 +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
William Braeckman c80002f660 [IMP] fleet: Improve general UX (Back2basics)
Overall UI review of the fleet app.

Also changes the behaviour of shared fields between vehicles and vehicle
models.

Task ID: 2468228

closes odoo/odoo#72943

Related: odoo/upgrade#2601
Related: odoo/enterprise#19356
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-07-14 14:40:54 +00:00
William Braeckman 677d51e7b0 [IMP] fleet: minor changes to views
Rename some views.

Task ID: 2415309
2021-07-09 14:51:26 +02: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
Yannick Tivisse bc1603167d [FIX] hr_fleet: Don't notify future_driver_id as Changed Driver
We are supposed to notify the driver change when the driver actually changes.

X-original-commit: 2e58d23e760313dbf58ce6a90f26b7160db460d8
2021-06-11 15:36:03 +00:00
Yannick Tivisse 77a27c574d [IMP] fleet: Rename action methods according to guidelines
closes odoo/odoo#71915

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-15 03:54:33 +00:00
William Braeckman f9ae3fdc18 [IMP] fleet: fleet contract multi-company
Adds a multi company rule for the vehicle contract.

Task ID: 2563156
2021-06-14 07:34:02 +00:00
William Braeckman 99858e7643 [IMP] fleet: compute state on date changes
Currently changing the expiration date of a fleet contract doesn't reset
the state. This commit aims to fix this.

Task ID: 2563156
2021-06-14 07:34:02 +00:00
dht-odoo 5ce7ad709c [IMP] hr: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Models -> Fields

1) fleet.vehicle -> description
2) fleet.vehicle.log.contract -> notes
3) hr.job -> description
4) hr.contract -> note
5) hr.leave.allocation -> notes
6) hr.applicant -> description
7) lunch.product -> description
8) lunch.order -> product_description
9) lunch.product.report -> description

Task Id: 2499504

X-original-commit: afe52b050a7667f3f20696cd48cd922f635a941c
2021-06-07 05:24:08 +00:00
Yannick Tivisse 9a5b2e2549 [MOV] fleet: Split model files according to coding guidelines
closes odoo/odoo#70612

Related: odoo/upgrade#2493
Related: odoo/enterprise#18250
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-04 08:47:45 +00:00
William Braeckman 32a8dc42f8 [IMP] fleet: add trailer_hook field to vehicles
Task ID: 2487706
2021-06-04 07:20:15 +00:00
William Braeckman e85763d982 [IMP] fleet: minor changes to views
Adds two new columns to the vehicle model tree view.
Changes the name of the vehicle model action.
Modifies the order by which vehicle manufacturers are ordered.
Adds filter and modify goupby on vehicle, vehicle model/brand.

Task ID: 2487706
2021-06-04 07:20:15 +00:00
William Braeckman 9b5768688a [IMP] fleet: add vehicle model categories
Adds categories to vehicle models

Task ID: 2487706
2021-06-04 07:20:15 +00:00
Nicolas Lempereur 9921b88c0b [FIX] fleet: new contract no vehicle no error
If you set the type (cost_subtype_id) of a new contract
(fleet.vehicle.log.contract) before setting vehicle_id you got an error:

 name = record.cost_subtype_id.name + ' ' + name

 TypeError: can only concatenate str (not "bool") to str

 because vehicle name was False.

 opw-2527268

closes odoo/odoo#70973

X-original-commit: 7d956af5106b9efe22b602af007088ce8c2c16ce
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-05-18 11:57:23 +00:00
Aurélien (avd) fc396a4d17 [IMP] fleet: improve ux + fix contracts/services archive bug
Revamp the kanban view of fleet.vehicle.log.services.

Add some ux improvements (new filters, better naming,..).

Fix bug where contracts/services of archived fleet.vehicle were
not counted in statinfo.

When a fleet.vehicle is archived, archive its related contracts/services.

closes odoo/odoo#62556

Taskid: 2389823
Related: odoo/upgrade#2063
Related: odoo/enterprise#15036
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-24 12:32:11 +00:00
Yannick Tivisse 497698bfa2 [FIX] fleet: Fix compute method to work in batch
closes odoo/odoo#64716

X-original-commit: a408494c6be551e169a8eec2d76cd57acda97fee
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-18 17:08:47 +00:00
Goffin Simon d060eb9063 [FIX] fleet: Module fleet_account doesn't exist
The module fleet_account has been replaced by account_disallowed_expenses_fleet
in https://github.com/odoo/odoo/commit/db9da432b7aedcd1bc944e23e59459c9c92801b7

opw:2382169

closes odoo/odoo#61867

Related: odoo/upgrade#1947
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-11-18 15:15:38 +00:00
Kamesh Patel 039650f824 [IMP] Fleet: driver end date activity
PURPOSE

Currently, when changing the driver of a vehicle, we don't set the end date
of the last driver and we can't automatically set it because this end
date can be another date that the start of the new driver.

SPECIFICATIONS

When we change the driver of a vehicle, add an activity to specify
the end date of the last driver.

LINKS

Task-2328981

closes odoo/odoo#58170

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-24 08:43:33 +00:00
uso-odooandLucasLefevre 28a9e90dce [FIX] fleet: Fix access error on assign driver linked to internal user
Currently, Failing at base/models/res_partner.py#L535
We write on the partner because of the related `plan_to_change_car`

When Assign driver linked to internal user without admin rights
it gives an error in security rules due to write on partner.

So while creating the vehicle when driver is assigned pop the value
for related field plan_to_change_car and rewrite the same with sudo.

closes odoo/odoo#60358

Issue: #54199
Taskid: 2309192
X-original-commit: af21dba516de688743f75e6ffb3bc3341578e37a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: LucasLefevre <lul@odoo.com>
2020-10-20 10:43:36 +00:00
Kairis ec0eda3233 [IMP] fleet: Add new fuels
Adding some new fuels and link them to the right ATN

closes odoo/odoo#57139

Taskid: 2319585
Related: odoo/enterprise#12983
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-09 14:39:50 +00:00
nie 34c9709404 [FIX] fleet: contract name does not update when changing vehicle name
Steps to reproduce the bug:

- Create vehicle A
- Create a contract for vehicle A
- Change the license plate of vehicle A

Bug:

The name of the contract of vehicle A hasn't changed

opw:2327820

closes odoo/odoo#57251

X-original-commit: 5a031de6c456180b0f447470382e1ae1c7dbd5dc
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-09-08 11:38:18 +00:00
Sébastien Mottet (oms) d0af0ddcc7 [IMP] fleet: add 3 fields specific to bike vehicle type
The three following fields have been added to fleet.vehicle:
	- frame_type (Selection)
	- frame_size (Float)
	- electric_assistance (Boolean)
These fields are specific to bikes and are only displayed in form view when vehicle_type = bike

Number of doors is now set to 0 instead of 5 when the vehicle is a bike.
"plan_to_change_bike" boolean field has been added to the res.partner model and has also been added as related field in fleet.vehicle model.

Task ID: 2238055

closes odoo/odoo#50064

Related: odoo/upgrade#1718
Related: odoo/enterprise#10152
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-31 08:49:03 +00:00
Raphael Collet 1f48130d2b [REF] core: _name_search() now returns a list of ids
This provides a better API to search for records by name without the
formatting part (`display_name`).

This also simplifies all the overridings of `_name_search` that no
longer need to call `name_get()`.  The call to `name_get()` is done in
method `name_search` in a generic way.
2020-08-18 13:02:41 +00:00
Martin Trigaux d5c1649239 [IMP] base,web: _for_xml_id as a safe access point
/web/action/load is the public controller that Should be used by the
webclient to fetch actions
_for_xml_id is the default access method on actions that implements
fields filtering to avoid leaking server action code or other
information not needed by the webclient

Implementing whitelist of fields that can be access per model
2020-08-17 09:08:23 +00:00
Nisha patel e249d2b434 [FIX] fleet: Fix model_count and category in the fleet
Currently, in Configuration > Service Type > Add a new service type.
The category field is mandatory but it does not appear on list view.

So in this commit, display the mandatory category field on list view

Currently, in Configuration > Manufacturers. The count of Models is
always 0 because the it's compute stored field without the depends
so not computed each time.

So in this commit, fix the count of models by adding a correct trigger

closes odoo/odoo#55475

Taskid: 2296851
Closes: #54515
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-05 14:27:54 +00:00
Kevin Baptiste 9213cd3508 [IMP] fleet: usability improvements
- Fix the display of the licence plat on the kanban view
 - Store the Driver on fleet.vehicle.log.services to remember who was
 the driver at the time the service was done.
 - Rename 'Informations' to 'Information'
 - Rename 'Driver' to 'Current Driver' on the contract

closes odoo/odoo#54051

Taskid: 2289808
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-03 06:16:09 +00:00
Victor Feyens 5dc8b7bdd8 [IMP] *: replace default_get overrides by default attribute on fields.
Leave the generic management of fields default to the orm as much as
possible.

* Default method is not called unless necessary.
* Default values are correctly post-processed by the orm when necessary.
2020-07-23 16:38:17 +00:00
Simon Genin (ges) e88fc62222 [IMP] fleet: Improve ux of list views
Small UX improvements on list view and edit text of an empty kanban
screen.

Task ID 2291554

closes odoo/odoo#54234

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-07-15 08:37:56 +00:00
Kevin Baptiste f572fa720e [FIX] fleet: store driver on log services
Changing the driver on a car shouldn't change the
fleet.vehicle.log.services associated. We should keep the driver
assigned to the car at the time the service was done.

closes odoo/odoo#54264

Taskid: 2208080
X-original-commit: 5422bb8d6e3db5d6932570116af74ea634c40a51
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2020-07-09 11:16:48 +00:00
Kevin Baptiste 6a330e0b00 [FIX] fleet: remove default value on fleet.vehicle.log.services
When creating a new service on vehicle, the first vehicle was always
selected by default due to a wrong default value. Same thing for the
contract.

Taskid: 2289808
X-original-commit: 9ec3875249748929c4a8e0c8a16e7b729ab9f2d9
2020-07-09 11:16:48 +00:00
shs-odoo 770494fade [IMP] fleet: Change long description of fleet.vehicle.log.contract model
Purpose of the task is the current name(_description) of model
fleet.vehicle.log.contract is too long and confusion.

So in this commmit, Rename model fleet.vehicle.log.contract
name(_description) to 'Vehicle Contract'.

closes odoo/odoo#52176

Taskid: 2267547
Closes: #52176
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-02 04:16:25 +00:00
Nasreddin (bon) 8f2be8560e [FIX] fleet: User is set to "Plan To Change Car" when set as future driver
Issue

	- Install "Fleet" app and open it
	- Add new car with user X as driver and set state as "Registered".
	- Add new car with user X as future driver and set state as
	  'Waiting list'

	The user is set as "Plan To Change Car".

Cause

	When a user is set to a new car as a future driver,
	the user will automaticly be set as "Plan To Change Car".

Solution

	Add condition to set as "Plan To Change Car" only if the user
	new car state is not "Waiting List".

opw-2259606

closes odoo/odoo#52836

X-original-commit: 6d35733e61b1d8b18acc3510046423aec7fe1c85
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-06-11 10:39:10 +00:00
jev-odoo 223b6cff6e [FIX] fleet: No notification on future_driver_update
Added `future_driver_id` in the 'Changed Driver' subtype.

OPW-2242321

closes odoo/odoo#52150

X-original-commit: d2174b3223e9987ae05920c5c9de54688ee05eda
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2020-05-29 09:30:19 +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
Yannick Tivisse d970bd53fb [IMP] fleet: Add model types (car, bike) on vehicles
closes odoo/odoo#48300

Taskid: 2172282
Related: odoo/enterprise#9467
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-10 09:38:31 +00:00
Raphael Collet 5ab51dee7b [FIX] *: useless old API field parameters 2020-04-07 09:25:08 +00:00
Helly kapatel 1c9a6db16f [IMP] various: Change 'assignation' to 'assignment' across all modules
Purpose
=======
The main definition of 'assignation' is the following:
   "an appointment to meet someone in secret, typically one made by lovers"

The correct word we should be using is 'assignment':
   "the allocation of someone or something as belonging to a particular group or category"

So in this commit change every iteration of the word
'assignation' to 'assignment', across all modules.

closes odoo/odoo#45041

Taskid: 1966215
Closes: #45041
Related: odoo/enterprise#8375
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-20 14:12:51 +00:00
Lucas Lefèvre 594ca5ea8b [FIX] fleet: Assign internal user as driver
With a user with only Fleet Administrator rights.
Assign an internal user as the driver of a vehicle (other than the
current user) => access error, you cannot write on model `res.user`.

Writing on a partner linked to an internal user requires write access to
this user.

closes odoo/odoo#47572

X-original-commit: a693b368d3faddef6774004d40567e26b7d59cec
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-03-13 10:30:10 +00:00
Lucas Lefèvre 2d470a423f [IMP] fleet: Close driver history on driver change
Purpose
=======
If you set a future driver and click on "apply change", a new assignation log is
automatically created for the new driver.
But the end date of the former assignation isn't populate.

Specifications
==============
Set the date "end date" for the former driver with the "start date" of the
new driver.

closes odoo/odoo#44635

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-05 10:01:24 +00:00
Ujas Dubal ff23944ad7 [IMP] fleet: Make the image readonly on the vehicle and model
Currently when user change the image on a vehicle, it change it
for the car manufacturer and the goal of this image is to recognize
the manufacturer of the vehicle.

After this commit is applied, the model and vehicle image will be
fixed as per the selected brand image. user will not be able to
change from the vehicle and model.

closes odoo/odoo#44153

Taskid: 2168922
Closes: #44153
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-19 10:54:30 +00:00
jbm-odoo df44538a8b [IMP] fleet: Add analytic account and mobility card
Create analytic account from fleet (and link it to vehicle) based
on the plate and the fiscal deduction rate (if l10n_hr_payroll_fleet
is installed).

Add on employee a Mobility Card number. This number is set on vehicle
when we put a partner linked to employee on a vehicle.

taskID: 2127641
2019-11-28 10:39:49 +00:00
Kevin Baptiste 84de0832ec [FIX] fleet: remove odometer log from chatter
closes odoo/odoo#41004

Taskid: 1931775
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 07:16:25 +00:00