Commit Graph
29 Commits
Author SHA1 Message Date
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Rohitkumar (roku) 99b09bcd42 [IMP] hr_fleet: improve the employer On/Offboarding plan activities
PURPOSE:
Companies want to have a better integration, we need to focus on the On/Offboarding process,
 to find automation and something to show to our customers.

In this commit, we add the "Fleet Manager" in the responsible list of the activities
generated from a plan.

Case 1:
 If employee is not linked with fleet, `Employee XXX is not linked to a vehicle`
 this  warning will be appeared.

Case 2:
 If employee linked with  fleet  but doesn't  fleet manager set  on fleet,
`Employee's vehicle XXX is not linked to a fleet manager.` this warning will be appeared.

task-3081261

closes odoo/odoo#108892

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-07 18:02:31 +01:00
Philippe Wauthy d5472861ef [IMP] hr(_fleet): add private car plate
Not all employees have a company car. This commit adds a private license plate field on hr.employee.
The field allows the HR Officer and HR Administrator to search for emloyees based on their license plates.
If fleet and hr apps are installed, the search is based on both the company car and private car license plates.

task-2936873

closes odoo/odoo#101146

Related: odoo/enterprise#31796
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-26 16:55:11 +02:00
Leonardo Pavan Rocha 2981fdec6f [IMP] hr_fleet: overwrite ir.attachment kanban view
In the assignation logs in hr_fleet, it is possible to access the list of
attachments and upload new files to a certain log. However, we currently
enter the form view for ir.attachment to create the record and many technical
fields are shown that are not necessary. This commit overwrites the kanban view
adding an upload button that will open the file upload dialog of the OS and
automatically add the uploaded files to that certain assignation log.

task-2742923

closes odoo/odoo#83755

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-24 15:59:57 +02:00
Leonardo Pavan Rocha 5dba452227 [IMP] fleet, hr_fleet: improve assignment logs view
Assignment logs list view can be accessed both from fleet and from hr_fleet,
however they show many repeating fields and, for this reason, this commit
improves these views by leaving the repeating fields as optional="hide".

task-2742923

Part-of: odoo/odoo#83755
2022-05-24 15:59:56 +02:00
Vincent Schippefilt 05fc9a6733 [IMP] *: use _read_group instead of read_group
This commit modifies most of the usages of read_group and uses
_read_group instead. _read_group doesn't join automatically on the
many2one fields when no order_by is specified, making it more performant
when the "name" of the many2one is not relevant, which is the case for
most back-end cases

closes odoo/odoo#84908

Task-id: 2479334
Related: odoo/enterprise#24877
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-03-02 17:10:48 +00:00
Kevin Baptiste ef38588090 [FIX] hr_fleet: bring back Attachments on assignation log
The "Attachments" column was removed in odoo/odoo#76550, but it seems that it
is still needed after all.

closes odoo/odoo#83106

Taskid: 2741777
X-original-commit: 60e4057bc51f9879c756b6efdeb90368ca64b4cd
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-01-20 16:08:22 +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
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
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 a81942cf7e [MOV] hr_fleet: Split model files according to coding guidelines
Applies the same changes as 6747402a96d3bd6013aa9e0ec29bca17c8ffc4a9 to
hr_fleet

Task ID: 2415309
2021-07-09 14:51:26 +02:00
William Braeckman 61dba5d86c [IMP] hr_fleet: allow searching an employee from a license plate
Allows an hr officer to lookup an employee from his license plate.

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 cf92bf2d24 [FIX] hr_fleet: Unsubcribe the employee when unassigned from the vehicle
If the driver is a follower of the vehicle he will still be notified on the
chatter activities

closes odoo/odoo#72072

X-original-commit: f5419a1860c94df95f663c64370b23a8943a4e68
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-11 15:36:05 +00:00
Raphael Collet 35a9f6c27a [FIX] core: SELF_READABLE_FIELDS and SELF_WRITEABLE_FIELDS on res.users
Avoid setting up those lists with method __init__() on the model, since
the model's class no longer has the expected parent classes.
2021-05-06 07:30:24 +00:00
Goffin Simon 1b0004d29a [FIX] hr_fleet: Changing mobility card
Steps to reproduce the bug:

- Let's consider an employee E and two partners P1, P2
- P1 is the private address of E and P2 is the partner linked to the user of E
- Let's consider two vehicles V1, V2
- The driver of V1 is P1 and the driver of V2 is P2
- Change the mobility card of E

Bug:

The mobility card of V1 was not updated but the mobility card of V2 was updated.

opw:2431316

closes odoo/odoo#68817

X-original-commit: 43c4db07166bf97f0954bb553ea67e1ed5d50d3b
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-04-06 11:13:55 +00:00
Goffin Simon 14a1c6b21c [FIX] hr_fleet: mobility card on employee not repercuted on vehicle
Steps to reproduce the bug:

- Let's consider a partner P linked to an employee E and a vehicle V
- Let's change the mobility card of E with 12345

Bug:

The mobility card on V was not changed.

opw:2431316

closes odoo/odoo#64343

X-original-commit: 81e574aae3059844179dd9f54a241cd51a2474fd
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-01-11 14:54:51 +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
jbm-odoo 5889dc3cc4 [FIX] fleet,hr_fleet: Fix user rights
Task ID: 2170625

closes odoo/odoo#47079

X-original-commit: ee13013808460c5100bec03ed415fc184ff031e5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-06 12:43:06 +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
fw-botandLucas Lefèvre 205ed1d320 [FIX] hr_fleet: count distinct vehicle_id per driver
closes odoo/odoo#39681

X-original-commit: c98a5041cdad149e14d84e6289a53fd42f617e16
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Lucas Lefèvre <lul@odoo.com>
2019-10-31 18:26:34 +00:00
Prakash Prajapati 1a33056557 [IMP] various: Clean stat buttons across all modules.
Purpose
=======

Make them consistent.
Make sure context is correctly set.
Prevent creation when necessary.

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

See https://www.odoo.com/web#id=2024467&action=333&active_id=1251&model=project.task&view_type=form&menu_id=4720
for the detailed list of all the requested improvements.

TaskID: 2024467

closes odoo/odoo#34561

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-01 11:39:51 +00:00
RomainLibert acd8638575 [IMP] hr_fleet: Adapt module with new hr.employee.public model 2019-05-31 10:21:21 +02:00
Lucas Lefèvre d77ce4c2a9 [IMP] hr_*: introduce the employee profile
General Purpose
===============

We want an 'Employee profile' gathering every data about an employee.
The main form view is modified to become this employee profile.
A user can also see his own profile through the Preferences menu.
The new profile replaces the current Preferences view if the hr module is installed
and the current user is linked to an employee.

A user should be able to see and edit his own profile.

*Problem*:
Many fields on hr.employee are protected by groups="hr.group_hr_user".
Therefore, a regular user cannot see or edit those fields.

This protection must be bypassed to allow read/write access
to the regular user's own data.
A similar mechanism already exists for res.users (for Preferences)

The better (least worst) solution found is to reuse this mechanism by adding related fields on res.users.

Pros:
- Don't change security access on hr.employee
- Don't implement yet another custom security layer, risking to add new security breaches
- A lot of fields are added by other modules on hr.employee.
  It would have required to integrate them with the custom security layer.
- Fields added by other modules on the user's preferences view (normal view, not the profile)
  are automatically included in the employee's profile view.
- Allow the hr.employee form view to be different than the user profile accessible
  through the Preferences menu.
  E.g. add custom buttons only relevant to the logged in user such as "Request a leave".
Cons:
- Each field from hr.employee that you want to appear on its profile
  must be added as a related field on res.users
- Those related fields must be added to user's preferences view (duplicate views)
- They also must be added to SELF_[READABLE | WRITABLE]_FIELDS

Note:
When the front-end loads the views it gets the list of available fields
for the user (according to its access rights). Later, when the front-end wants to
populate the view with data, it only asks to read those available fields.
However, in this case, we want the user to be able to read/write its own data,
even if they are protected by groups (groups are kept on the related fields on res.users).
The front-end need to be made  aware of those fields by sending all field definitions.

hr_attendance
=============

This commit integrate attendance in the new employee profile.
It also adds a stat button to this employee profile showing
the number of hours worked last month.

Remove the boolean computed field 'manual_attendance'.
This field is just a shortcut to add/remove the employee's user
in the "Manual Attendance" group.
The checkbox is confusing on the employee's form and this should
be done through the normal group management screens.

hr_presence
===========

Display the presence status on the employee kanban template.
The status is a colored chip which can be green (present),
orange (to define) or red (absent).

Currently, the presence status is only computed when accessing
the report view. As this commits displays it on the employee kanban,
it should be updated more frequently.
The state should not be updated every time the kanban view is loaded
since the computation is a bit heavy. Instead: add a cron to update
status every 15 minutes.
-> The status is accurate on the report view (status is still updated
   when loading the view)
-> The status in accurate at 15 minutes on the kanban view

[ADD] hr_attendance_presence
============================

Bridge module between hr_attendance and hr_presence.

This commit integrates hr_presence module in the employee
profile and adds the presence status on the employee kanban view.
But hr_attendance adds at the same place a similar status icon for
checkin/checkout.
This bridge module makes the status from hr_presence invisible as
hr_attendance should be the main presence control mechanism.

Also, this commit adds the ability (through a new setting option)
for hr_presence to take into account checkin/checkout to determine
the presence status.

l10n_be_hr_payroll
==================
integration with employee profile
2019-02-14 16:28:54 +01:00
RomainLibert 6c522c823c [FIX] hr_fleet: count car only once when address_home_id = user_id.partner_id
If employee had the same address_home_id as it's user_id.partner_id then
we counted twice the same car.

Eg: specify address_home_id on demo user using it's partner, system
would have counted two cars. But demo has only one car

closes odoo/odoo#30546
2019-01-25 10:39:02 +00:00
Lucas Lefèvre 607fd63545 [FIX] hr_fleet: fix access rights with employees without user
Commit 55a48e3 added support for computing car count and car reports
for employees without a linked user..
It is computed by accessing the field `address_home_id` (res.partner) to find the driver.
However, this field is private.
Therefore a user in `fleet_group_manager` has an ACL error when accessing
an employee form view which contains a stat button with the car count.

This commit compute the car count and the car report
with `address_home_id` as sudo to fix the issue.

Also fix a typo in attribute `groups` instead of `group` and fix its
value from `fleet_manager` to `fleet.fleet_group_manager`.
2019-01-25 10:37:27 +00:00
Lucas Lefèvre 85cb3ffbf1 [FIX] hr_fleet: Fix access right on employee form
Purpose
======

Since commit 22ee6eb a user can't access an employee form if he is neither Fleet User nor Manager.
=> Access error: Document model: fleet.vehicle.assignation.log
The reason is the computation of the number of vehicule logs.
A regular user doesn't have access rights on this model.

This commit fixes this.

closes odoo/odoo#29835
2019-01-11 08:16:49 +00:00
Yannick Tivisse 55a48e3415 [FIX] hr_fleet: Make 'Claim Report' work for employee without users
If an employee is not linked to an user, the claim report feature won't work.

With this commit, the report can be printed base on the user's partner or
the private employee address.

closes odoo/odoo#30065
2019-01-09 10:48:39 +00:00
jbm-odoo 22ee6ebbfc [ADD] hr_fleet: Add claim report and cars history per employee
Purpose
=======

When an employee leaves the company, the fleet manager must ask to the insurance company
a claim report for this employee. But in oddo, there is no easy way to have an history
of the drivers.

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

1/ On the employee form, add a stat button: "x cars". The button shouldn't be displayed if the count = 0.
   Make a bridge (auto_install: True in the manifest) depending on hr (hr.employee) and fleet (fleet.vehicle.assignation.log)
   - Add a field employee_cars_count (computed) to count the amount of cars the employee drove.
   - Add an method action_open_employee_cars, that return an action (ir.actions.act_window)
     that open on the fleet.vehicle kanban filtered on cars the employee had driven.
2/ In this bridge module, add on the fleet.vehicle.assignation.logs a button (like in expense) to upload
   documents about the car for a particular employee (PV, rapport d'assurance, blabla). On the employee
   form view, add an action button (with groups fleet_manager) to print all the related documents
   (all the attachements on the fleet.vehicle.assignation.logs for the employee).

closes odoo/odoo#28077
2018-11-06 13:01:57 +00:00