PURPOSE
=======
When you close a payroll (employees), there are often a lot of document
linked. Archiving an employee should archive the contract, cancel future
leaves, archive the private address
Specification
=============
Add departure date (hr):
- Add a Date field to both hr.departure.wizard and hr.employee. In
the wizard, the field is required.
- In toggle_active() method in hr.employee, set departure_date to
false when unarchive the employee.
- If user has a current running contract, a user error will raise if
user enter a departure date earlier than the start date of the
contract.
Add checkbox to set a closing date on hr.contract (hr.contract):
- In the hr.departure.wizard, set the departure date to be the end
date of runing contract. Set the states of all draft contracts to
"cancel".
Add checkbox to free car (hr.fleet):
- In the hr.departure.wizard, set end_date to
fleet.vehicle.assignation.log, if there is no end_date or end_date >
departure_date
- Go through fleet.vehicle, find records with dirver_id to be the
employee, set it to False.
Add checkbox to archive private address (hr):
- when the private address not link to a internel user, set
employee.address_home_id.active to Flase
- unarchive it after the employee unarchived
Add checkbox to cancel future appraisals (hr.appraisal)
- find all appraisals link to the employee and state in
['new', 'pending'], set their state to 'cancel'.
Add checkbox to cancel future leaves (hr.holidays):
- only consider leaves are not in state ['refuse', 'cancel'],
find leaves with to_date > departure_date, set their state to
'cancel'.
PR #42526
Task 2153106
Related: odoo/enterprise#7471
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
In Employee / Work information / Responsible: there is a lack of
information on the "help message" The objective is to change text
in the help message by the ones below:
Field "Coach":
-Employee responsible of this employee.
-The "coach" has no specific rignts or responsibilities by default.
Field "Time Off":
-User responsible for approving "time off" of this employee.
-If empty, the approval is done by any administrators or approvers (determinated in settings/users)
Field "expense":
-User responsible for approving "Expenses" of this employee.
-If empty, the approval is done by any administrators or approvers (determinated in settings/users)
TaskId :2168330
closes odoo/odoo#43467
Closes: #43467
Related: odoo/enterprise#7778
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Open Employees>[DEMO]. Go to HR Settings and generate badge id
Now go to POS Settings, enable "Login with Employees". Now open
the session and login by scanning the [DEMO] employee badge.
The badge will not be recognized, this is caused by the fact that the
badge is 8 digits randomly generated, while the parser recognize
cashiers only if the barcode has a prefix of 041.
Fixed the badge id generation, and adjusted the length to other barcodes
in the system
opw-2151942
closesodoo/odoo#43228
X-original-commit: 90bcda64ba6058169b48ff8214e7c2a98eb9a0f8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Without demo data, for the odoo-master transifex project
closesodoo/odoo#41935
X-original-commit: dab7670b73506fb3a835695ee3bd735e0c5e5c2b
Related: odoo/enterprise#7287
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Followup of a425695e
The terms were back in 12.0
Courtesy of Juan José Scarafía
closesodoo/odoo#41624
X-original-commit: 85d0c7001a997748d7691205bbb8d066597591a5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When we add a user to employee, we can have problem with leave,
expense or coach manager. It's due to those compute fields.
closesodoo/odoo#40795
Related: odoo/enterprise#6865
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Some modules might want to add buttons in the form header of the employee public
(e.g. hr_appraisal).
This commit adds an empty header to easily allow view inheritance.
Note: this empty header is not displayed if no buttons are indide.
Task 2028794
PR odoo/enterprise#6495closesodoo/odoo#39565
Related: odoo/enterprise#6495
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Current activity types master data cannot be unlinked through a quite harsh
override of unlink using xml id existence, introduced at 2602642a78.
Some of them are real master data, other could be unlinked if users want it.
Finally custom activity types may cause errors when removed if used in some
side models like server actions or automated actions.
To allow more flexibility we remove the removal constraint and implement
a fallback mechanism. It is implemented in mail.activity.mixin when calling
activity_schedule(xmlid, ...). If the given xmlid is not found
_default_activity_type() specifies the default activity to use. It can
be overridden in modules if some specific behavior is wanted.
e.g.
def _default_activity_type(self):
"""Define a default fallback activity type when xml id not found
only used in in activity_schedule() for now.
"""
try:
return self.env.ref('mail.mail_activity_data_todo')
except Exception:
return False
In this commit we also
* restrict deletion of activity type (hr.plan and ir.actions.server);
* fallback on default activity type if xmlid ref not found in
activity_schedule;
* correct calls to activity_schedule and replace some manual creation calls
by activity_schedule;
Task ID 1961156
PR #39013
Related: odoo/enterprise#6238
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Make some fields editable in multi edit.
Some onchange are tranformed in compute fields.
id=2078674
closesodoo/odoo#39711
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Without hr_recruitment it was not possible to import/export the hr.job
as they were not visible.
closes#22069closesodoo/odoo#39948
Taskid: 2088277
X-original-commit: e4de2b2e56ba188e45c5c18e4f25cca515fcb306
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose
=======
This is the first huge step to improve the test suite in several ways:
- Make them demo data independent, allowing to modify the demo data without having to adapt the tests depending on it. It also allows to have a beautiful + convenient demo dataset to make a demonstration, and to configure complex data in the tests to manage the corner cases.
- Improve the test performances by converting them into SavepointCase. Each test will be rollbacked to it's initial state, after the setUpClass call. That way the different data are not re-created at each test for nothing.
- Introduce several test classes in base/tests/common.py to launch a TransactionCase, HttpCase or SavepointCase test with an available demo user, portal user or a large set of partners.
- This is the first step to tend to a rolling release process, allowing to execute the tests (or a subset of the tests) on a migrated base, for example.
closesodoo/odoo#39868
Taskid: 2075739
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
* the employees file apparently never worked as the marital status was
updated before template files were added (respectively
0eb58775c9 and
b60de0db41)
* the purchase template was never updated to reflect the Big Demo Data Changes
(58fc4e4409).
Fixes#39074
Employees file update split off of task 2059779.
closesodoo/odoo#39823
X-original-commit: 80a2f6877378a87638c04061ceaf69965c1707c0
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: Prakash Prajapati <ppr@odoo.com>
Before this commit:
Private email and phone are related of partner 'address' fields.
But the phone was read-only and the email is editable.
After this commit:
As phone and mail are related, they are read-only. We must edit
them on the partner of Address field.
close#38518closesodoo/odoo#38872
X-original-commit: ed6fb25ca0671a520c9d003a58eefefcf93dbc1a
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
Since there are message_post overrides using the form `def message_post(self,
**kwargs)` in some modules, this method is intended to be invoked with keyword
arguments only.
This commit enforces this behavior. Calls such as `message_post("body")` will
fail regardless of which addon is installed, forcing users to use
`message_post(body="body")`.
It also fixes a message_post override in hr, and applies the same
mechanism to message_notify, and _message_log.
closesodoo/odoo#33306
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
You DO want to be able to change your user's email address from the
employee profile
closesodoo/odoo#37674
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
Move and adapt gantt unavailability related methods (
_get_work_interval() and _get_unavailable_intervals() ) from
hr.employee to resource.resource. This move allows the unavailability
to be generated for users without related employees (like in FSM in
enterprise).
Task-2069861
closesodoo/odoo#36785
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Currently, parent_id is defined on hr.employee. This field
as an onchange defined.
But the inherit of hr.employee.base in the leave module
adds an onchange('parent_id'). The onchange method is never
called because the onchange in hr.employee does not call super
(which it's not supposed to do because the parent model
does not have the parent_id field).
To fix the issue, parent_id and all its onchange methods
are now defined on hr.employee.base
There are too many image sizes. Since they are stored resized this takes time to
generate when saving a new image, it's more rows on the attachment table, more
files on the disk, ...
64px is close enough to 128px that it can be removed without a big impact on
download size.
It will even reduce download and number of requests when both images are
displayed because now only one has to be downloaded and then benefit from cache.
The difference between the two is typically around 1.5kB which is negligible
these days, especially when the request overhead is around 0.5kB already, not
even taking into account other factors such as latency.
If a 64px image must absolutely be returned, it is still possible to pass the
size parameters to the image route. But the current guideline is to handle
resizing in the views when necessary.
Views
=====
- remove width and height attributes when existing CSS rules are overriding them
(eg. `.oe_kanban_avatar` in the right context)
- add CSS rules instead of width and height attributes when possible
- use `object-fit: cover;` where width and height are forced to avoid distortion
of non-square images
- for products, use `object-fit: contain;` instead, keep ratio but without crop
- add new CSS rules where the expected size was max 64px*64px before due to the
image size itself
- remove `img-fluid` where using size classes to avoid conflicting rules
task-2060865
closesodoo/odoo#36147
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
We should avoid reseting the manager_id on the employee when there is no
manager defined on the department
Also updates the department form view in order to display the fields
better
closesodoo/odoo#37028
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Since the introduction of the public/private employee model, having an
acitivity defined on hr.employee (the private one) for an employee that
has no rights to read it is useless.
Task id 2072987
closesodoo/odoo#37021
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
From the department kanban view,
when clicking on the "Employees" button of a department,
it shows all employee regardless of their department.
This is a consequence of the back2basics commit 9a0fedf
which removed the department filter and added a
search panel instead.
This commit changes the search default filter
to a default filter for the searchpanel.
closesodoo/odoo#36635
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Fix o_text_overflow class (in contact for example).
Add class o_text_overflow in hr_employee view to avoid email to
be too long.
closesodoo/odoo#36626
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
Only one employee per company and per user is allowed.
Based on the company the user is logged in, "My profile"
should redirect to the employee profile of the current
company.
If the user has no employee in the current company,
"My Profile" redirects to the simple "Preferences" screen.
Currently, it always redirects to the employee in the user's
main company (`user.company_id`)
This issue is a consequence of a5b6f31 which uses the context
to know the current company instead of `user.company_id`.
Specification
=============
Un-store the employee_id field on the res.users model.
To achieve this, we need to implement a _search method for this field.
That way, each time we try to access to the employee_id value, the
returned employee depends on the context.