Commit Graph
3014 Commits
Author SHA1 Message Date
yhu-odoo 32fc38ef58 [IMP] hr_appraisal: Improve employee archiving flow
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>
2020-01-29 10:05:12 +00:00
Nisha patel b7c5b28b9c [IMP] hr(_expense,_holidays): modify help message
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>
2020-01-24 09:59:40 +00:00
Lucas Perais (lpe) 9538245267 [IMP] *: adapt views for phone widget sms enabled default
Task 2123526

This commit adapts the views to take into account
that the phone widget enables sending an sms by default

*: crm, hr, sms, base
2020-01-27 09:31:53 +00:00
Andrea Grazioso (agr-odoo) ba69b1d534 [FIX] hr: fix badge generation for cashier
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

closes odoo/odoo#43228

X-original-commit: 90bcda64ba6058169b48ff8214e7c2a98eb9a0f8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-13 15:52:04 +00:00
Swapnesh Shah f13fdbb699 [IMP] hr: Improve model description
Fixes https://github.com/odoo/odoo/issues/42559

closes odoo/odoo#42648

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-02 17:53:36 +00:00
Martin Trigaux b5db1c61ee [I18N] *: export saas-13.1 source terms
Without demo data, for the odoo-master transifex project

closes odoo/odoo#41935

X-original-commit: dab7670b73506fb3a835695ee3bd735e0c5e5c2b
Related: odoo/enterprise#7287
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-16 12:49:55 +00:00
Nicolas Martinelli b0605b4adc [FIX] *: make ribbon text translatable
closes odoo/odoo#41749

X-original-commit: 64c259fc74a8181aa381b6647a9816b6f5530dfd
Related: odoo/enterprise#7216
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-12-04 12:01:16 +00:00
Martin Trigaux b7d91ba25b [I18N] *: remove es_AR translations
Followup of a425695e
The terms were back in 12.0
Courtesy of Juan José Scarafía

closes odoo/odoo#41624

X-original-commit: 85d0c7001a997748d7691205bbb8d066597591a5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-10 10:00:18 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Yenthe666 78ae3da902 [IMP] *: set name element on main containers in configuration views
This will improve the extendibility of view inheritance

closes odoo/odoo#41398

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-12-09 10:38:59 +00:00
jbm-odoo 9725eadfdd [Fix] hr_employee: Fix compute fields
When we add a user to employee, we can have problem with leave,
expense or coach manager. It's due to those compute fields.

closes odoo/odoo#40795

Related: odoo/enterprise#6865
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:40:34 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
Lucas Lefèvre 25dc18bb09 [IMP] hr: Add empty header for view inheritance
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#6495

closes odoo/odoo#39565

Related: odoo/enterprise#6495
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-25 15:46:38 +00:00
Victor FeyensandMichaël Mattiello 0eadc0aa5e [IMP] mail: better prevent activity type removal and add a fallback mechanism
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>
2019-11-25 14:17:31 +00:00
jbm-odoo 6b5bdbb476 [IMP] hr_[contract,employee,recruitment,work_entry]: Add multi edit in view
Make some fields editable in multi edit.
Some onchange are tranformed in compute fields.

id=2078674

closes odoo/odoo#39711

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-06 10:08:50 +00:00
Victor Feyens 48b887618c [IMP] * : replace with_context(allowed_cids=[c]) by with_company(c). 2019-11-18 12:25:05 +00:00
Victor Feyens 9215e73fa2 [IMP] * : replace with_context(force_company=c) by with_company(c) 2019-11-18 12:25:05 +00:00
Xavier-Do eb2f0aabcf [FIX] *: various fixes in xml views 2019-11-13 11:05:14 +00:00
fw-bot 7a18176c86 [FIX] hr: make hr.job visible without recruitment
Without hr_recruitment it was not possible to import/export the hr.job
as they were not visible.

closes #22069

closes odoo/odoo#39948

Taskid: 2088277
X-original-commit: e4de2b2e56ba188e45c5c18e4f25cca515fcb306
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-07 11:53:19 +00:00
Odoo's Mergebot cfc65bd1b7 [MERGE] various: Make the test suite demo data independant
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.

closes odoo/odoo#39868

Taskid: 2075739
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-07 08:37:12 +01:00
Yannick Tivisse edf9e34bae [IMP] hr: Adapt tests to work with/without demo data 2019-11-05 13:08:03 +01:00
Xavier MorelandPrakash Prajapati ab6d0c3851 [FIX] hr, purchase: update import templates
* 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.

closes odoo/odoo#39823

X-original-commit: 80a2f6877378a87638c04061ceaf69965c1707c0
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: Prakash Prajapati <ppr@odoo.com>
2019-11-05 18:37:00 +00:00
jbm-odoo 83ab007377 [FIX] hr: Fix consitency in employee form
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 #38518

closes odoo/odoo#38872

X-original-commit: ed6fb25ca0671a520c9d003a58eefefcf93dbc1a
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
2019-10-16 11:52:06 +00:00
Swapnesh Shah 6f128fa959 [FIX] hr: Display archived employee on user form
closes odoo/odoo#38143

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-10-07 19:53:55 +00:00
Martin Trigaux 42417956c0 [I18N] *: export 13.0 source terms
closes odoo/odoo#38028

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-07 07:55:34 +00:00
Odoo Translation Bot b6e7ed6c7b [I18N] Update translation terms from Transifex 2019-10-07 09:11:11 +02:00
Stéphane Bidoul (ACSONE) c8c8413e3e [IMP] mail: enforce kw args for message_{post/notify/log}
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.

closes odoo/odoo#33306

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-02 15:42:04 +00:00
Odoo Translation Bot 40deff7cbe [I18N] Update translation terms from Transifex 2019-10-01 21:21:46 +02:00
RomainLibert 44a500c8d0 [FIX] hr: make the email field visible again
You DO want to be able to change your user's email address from the
employee profile

closes odoo/odoo#37674

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-10-01 10:16:05 +00:00
Geoffroy Larue 9a39194813 [MOV] hr, resource: unavailability methods
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

closes odoo/odoo#36785

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-09-30 07:59:10 +00:00
Odoo Translation Bot d7b8831ea8 [I18N] Update translation terms from Transifex 2019-09-29 01:22:33 +02:00
Martin Trigaux 6378c8fb25 [I18N] *: export saas-12.5 source terms
Still without demo data

closes odoo/odoo#37502

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-27 11:58:55 +00:00
Martin Trigaux c667e95224 [I18N] *: export saas-12.5 source terms
Still without demo data

closes odoo/odoo#37274

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-24 07:33:09 +00:00
Yannick Tivisse b72aaca051 [FIX] hr: Correctly compute last_activity date 2019-09-23 07:56:12 +00:00
Yannick Tivisse cb55db51b7 [FIX] hr,hr_presence: Correctly retrieve config parameters values 2019-09-23 07:56:12 +00:00
RomainLibert 39ebe4094e [FIX] hr: fix button layout 2019-09-23 07:56:12 +00:00
Odoo Translation Bot 974261f7e9 [I18N] Update translation terms from Transifex 2019-09-22 01:19:57 +02:00
Lucas Lefèvre 79228dd4d0 [FIX] hr_holidays: Call onchange parent_id
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
2019-09-20 09:23:27 +00:00
Sébastien Theys b6288e5446 [IMP] *: remove image_64 and clean views
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

closes odoo/odoo#36147

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-09-19 10:23:39 +00:00
RomainLibert 02599afd49 [FIX] hr: Rename Gilles Gravie
closes odoo/odoo#37122

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-19 09:38:49 +00:00
RomainLibert 16c17bc108 [FIX] hr: onchange department don't reset manager
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

closes odoo/odoo#37028

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-17 14:54:24 +00:00
RomainLibert 164feadb42 [FIX] hr: stop planning acitivity if user has no access
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

closes odoo/odoo#37021

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-17 13:30:16 +00:00
Lucas Lefèvre b707a5fd0b [FIX] hr: Open department employees with searchpanel
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.

closes odoo/odoo#36635

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-16 07:29:43 +00:00
Odoo Translation Bot e80b81dca1 [I18N] Update translation terms from Transifex 2019-09-15 01:30:37 +02:00
Martin Trigaux 73e70673e7 [I18N] *: export saas-12.5 source terms
closes odoo/odoo#36853

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-09-13 11:38:37 +00:00
RomainLibert 247df46453 [FIX] hr: remove duplicate group
This duplication was introduced by a forward port

closes odoo/odoo#36841

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-13 10:13:21 +00:00
RomainLibert 2b34d22b42 [IMP] hr: add note field on hr_plan_activity_type
We would like to have a custom note on plan activities

closes odoo/odoo#36796

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-12 14:31:16 +00:00
jbm-odoo 73498572c3 [IMP] hr: Employee Profile set readonly attribute on readonly field
closes odoo/odoo#36698

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-11 14:00:39 +00:00
jbm-odoo 5cddbbf9f2 [FIX] web + hr: Kanban view fix o_text_overflow
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.

closes odoo/odoo#36626

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-09-10 12:20:37 +00:00
Lucas Lefèvre 55a4910b2e [FIX] hr: Redirect to company employee profile
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.
2019-09-10 11:46:01 +00:00