Commit Graph
3195 Commits
Author SHA1 Message Date
William Braeckman ecddd5f729 [IMP] hr_*: Improve tests execution speed by using setUpClass
closes odoo/odoo#79063

Taskid: 2669222
Related: odoo/enterprise#21920
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-27 13:16:42 +00:00
Kevin Baptiste 497c2b9ab8 [IMP] hr: show employees on Department form
Show an "Employee" stat button on the department form view.

closes odoo/odoo#78680

Taskid: 2672986
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-21 15:47:10 +00:00
William Braeckman c4621c4099 [IMP] hr: update hr plans wording
To avoid mixing both plan and planning in hr plan options it was decided
to reword menus to plan instead of planning.

TaskId-2664863

Part-of: odoo/odoo#78148
2021-10-21 11:08:54 +00:00
Kevin Baptiste 60d62a1d9d [REF] hr*: misc cleanup
*: hr_expense, hr_holidays, hr_work_entry_holidays

- Remove unused template;
- Remove unused fields (hr_expense);
- Rename group_days_allocation to convey proper meaning;
- Remove deprecated method.

closes odoo/odoo#78128

Related: odoo/upgrade#2907
Taskid: 2665866
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-20 15:15:03 +00:00
Kevin Baptiste 3cad69a838 [IMP] hr: make Plan company dependent
It was possible to assign a user that was not part of the same company
as the employee's for an activity which is misleading.

Make hr.plan and hr.plan.activity.type company dependent.

closes odoo/odoo#77524

Related: odoo/upgrade#2879
Taskid: 2658773
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-15 07:24:38 +00:00
Kevin Baptiste 5437dbf5dc [FIX] hr: fix avatar generation on employee rename
It was not possible to rename an employee with an existing image
profile, as it was trying to assign the size of the avatar (coming from
the webclient) as the avatar itself.

closes odoo/odoo#78299

Taskid: 2660773
X-original-commit: 425ddb217664ba3fdae9e8c1527317fee0fe9368
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-13 15:22:56 +00:00
Sébastien Theys 3a87aaf914 [IMP] mail, *: clean up message component by introducing view model
* = hr, hr_holidays, sms, snailmail, website_livechat

Message model incorrectly contained data related to a specific component (only
one) even though there can be multiple message components per message model.

This cascaded to adapting related component/models to the same principle.

closes odoo/odoo#76718

closes odoo/odoo#77779

Related: odoo/enterprise#20964
Related: odoo/enterprise#21426
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 15:40:49 +00:00
Pierrot (prro) 8f6d24a12b [FIX] hr: mark offline employee status
How to reproduce the problem:
- Install the Employees app
- Create a new user and create an employee form for this user
- Log in with this user, then log out
- On the user's Employees form, the employee still appears as connected

Cause of the problem : as soon as a user logs in,
the system saves the date of his last connection. That value was wrongly
used in the process of computing the user's status.

Now, if the user is offline, he is shown as "Not Available" or "Away"
(grey or orange).

opw-2623386

closes odoo/odoo#77545

X-original-commit: e2991ff6121fee790ef6ead1354cec250428835c
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-01 06:28:59 +00:00
Swapnesh Shah b948b197da [IMP] hr: Make timezone required on saved record
`tz` field is technical field related to `resource_id`, which is required field on that model.

However it is possible to try to write a void value, which leads to an issue as it is technically required.
With this commit we make the tz field required at write.

closes odoo/odoo#77372

X-original-commit: 7cda3632b1f50ea757d25369e8a1261d8aeab16d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-29 08:33:22 +00:00
sofiagvaladze 415ab27126 [IMP] hr_holidays: Time Off smartbutton
task - 2634892

closes odoo/odoo#75941

Related: odoo/upgrade#2852
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-29 08:32:44 +00:00
Sébastien Geelen (sge) e3a0a62622 [FIX] note, project, hr: collaboration opt-in on html fields
Activate the new opt-in option for the collaboration
on some html fields.

closes odoo/odoo#77160

X-original-commit: 504bbafc1d6183e7e8e0a326d1e90eddce6410d7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-09-24 14:00:45 +00:00
Kevin Baptiste 2012a9d205 [FIX] hr: bring back "My Profile"
Since the merge of 0573aca the override was no longer working.

closes odoo/odoo#77097

Taskid: 2651838
X-original-commit: 947194644a09f186899f2b2526cf0b0675af7304
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-24 05:50:48 +00:00
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
Raphael ColletandXavier Dollé 1595c0ee27 [REF] core: replace thread-local "envs" by cursor-bound "transaction"
Refactor the Environments object into a Transaction object, which is
bound to one cursor, and is no longer shared among several cursors.

The following methods/properties have been changed:
 - Environment.envs no longer works (because of the design change);
 - Environment.manage() is deprecated (no longer useful);
 - Environment.reset() is now an instance method;
 - env.clear_upon_failure() is deprecated in favor of cr.savepoint().

closes odoo/odoo#75598

Related: odoo/enterprise#20451
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2021-09-03 15:45:46 +00:00
Louis Wicket (wil) 80d74e7ee0 [IMP] mail, web, *: add support for guest users
* = crm_livechat, hr, hr_holidays, im_livechat, mail_bot, purchase, sms,
    snailmail, survey, test_discuss_full, test_mail, web_editor, website,
    website_livechat

 - Create new model `mail.guest` for guests.
 - Rewrite some RPCs to target routes rather than model methods so that
   guests are able to use them.
 - Patch JS and python models to support guests.
 - Create a stand-alone page and boot the channel in it.

task-2494829

closes odoo/odoo#75496

Related: odoo/enterprise#20417
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-09-02 00:43:34 +00:00
William Braeckman a3980aec99 [IMP] hr: remove personal documents tab
The personal documents tab on the employee form view is removed in favor
of the chatter + documents app to hold and manage documents.
The fields are kept because the salary configurator needs fields to bind
to be able to still request documents. This might change in the future.

Closes odoo/odoo#75506

Task ID: 2628750

Related: odoo/enterprise#20420
Related: odoo/upgrade#2769
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-31 23:35:21 +00:00
sofiagvaladze b320c789a0 [IMP] hr:revert plan automation on triggers
task - 2628793

closes odoo/odoo#75528

Related: odoo/enterprise#20430
Related: odoo/upgrade#2776
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-27 17:43:23 +00:00
William Braeckman d88ea4011b [IMP] hr: use employee tags more
Adds the employee tags as an optional field in the employee list view
as well as in the search view.

Closes: odoo/odoo#75480

Task ID: 2630604

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-27 12:16:00 +00:00
Romain Derie 88b19cfa92 [FIX] base, mail: _render_qweb_pdf should return a bytes-like object
`result` might be a Markup object (eg during tests) or a bytes-like object.

Step to reproduce: click on "Send by Mail" on a SO -> Traceback

Step to reproduce (2):
- Install website_sale
- Add something to the cart
- Go through checkout and click on Pay Now
- Crash, 500 error page, as this step is trying to generate the SO PDF to send
  by mail to the customer, which tries to encode a bytes-like object.

```
AttributeError: 'bytes' object has no attribute 'encode'
```

But if you do that flow during a test, eg
```
./odoo-bin -d mydb --test-tags=.test_02_admin_checkout
```
You have a Markup object, thus you had to encode it.

Now, even during test, we return a bytes-like object.

Related to #68299

Community: https://github.com/odoo/odoo/pull/75377
Enterprise: https://github.com/odoo/enterprise/pull/20449
Part-of: odoo/odoo#75377
2021-08-26 10:21:28 +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
Zelong Lin 51ff8b09db [REF] *: convert JS files to ES6 modules
* = hr, hr_holidays, sms, snailmail, website_livechat, account_invoice_extract,
approvals, documents, mail_enterprise, calendar, crm, mrp, note, website_slides,
crm_enterprise, sign, social, voip

task-2510656

closes odoo/odoo#72712

Related: odoo/enterprise#19241
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-24 14:31:55 +00:00
Martin Trigaux d9e3aab69b [FIX] mail: convert res_model_id to selection
Following the removal of read access on ir.model (odoo/odoo#69120),
the mail.activity.type model was not accessible to non-admin users due
to the res_model_id many2one field.

Before this commit, a project user could not access the Activity Type
menu.

Convert it to a selection field with the selection values being
computed in sudo.

closes odoo/odoo#74981

Related: odoo/enterprise#20214
Related: odoo/upgrade#2734
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-08-23 06:56:00 +00:00
William Braeckman cad3a0c6a0 [FIX] hr: prevent traceback when loading calendar views.
When loading calendar views, the client tries to load 'unusual' days,
linked to the employee of the current user. But it does not check that
the current user is linked to an employee for that company.

Closes odoo/odoo#75305

Task ID: 2628736

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-08-19 10:11:59 +00:00
Sébastien Theys 41445f2ae6 [IMP] mail, hr: access messaging without env in remaining places
Part of task-2582313
2021-08-19 13:55:28 +00:00
Sébastien Theys 1a98248155 [IMP] mail, *: access models without env in models
* = hr, im_livechat, website_livechat

Part of task-2582313
2021-08-19 13:34:59 +00:00
Sébastien Theys 166999e725 [IMP] mail, *: access messaging without env in models
* = hr, hr_holidays, im_livechat, sms, snailmail, website_livechat

Part of task-2582313
2021-08-18 14:56:50 +00:00
Kevin Baptiste 73ed1ffa0b [FIX] hr: make image zoomable again
The zoom feature of Image Widget expects a field `image_` being present
in the view to check if a zoomable image is available or not.

Since #69819 the image field was replaced by an avatar one thus breaking
the zoom.

This commit also puts the Chat icon on kanban cards of
hr.employee.public in the bottom right.

closes odoo/odoo#75099

Taskid: 2622671
X-original-commit: ae8a4b51e801a06d9d7a13be3658d5b6828da7e9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-08-13 16:01:04 +00:00
Sébastien Theys 4cd70f164e [IMP] mail, hr, hr_holidays, *: batch mail partner format
* = test_discuss_full

Overall less queries.

Changes:

- Batch `mail_partner_format`.
- Batch `user.employee_id` compute.
- Remove query for current leave state, use fields (and prefetch) instead.
- Move current leave state in partner format instead of channel info.

Part of task-2622462

closes odoo/odoo#73174

Related: odoo/enterprise#20186
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-12 15:22:59 +00:00
William Braeckman 1aed8b70f5 [IMP] hr: departure wizard
Improve the departure wizard form view aswell as the flow when using it.
Removes the confirmation dialog when archiving an employee to directly
display the departure wizard.
Also changes departure reason to an html field instead of pure text.

Task ID: 2575279

closes odoo/odoo#72367

Related: odoo/enterprise#19116
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-03 14:36:02 +00:00
William Braeckman 27aacca0db [MOV] hr: separate chat_mixin and employee code
In preparation of the next commit, separate the chat mixin from the
employee js code into appropriate files

Task ID: 2575379
2021-08-03 07:17:30 +00:00
Mohammed Shekha 01c460f37a [IMP] mail: support many2many_avatar in kanban and list view
Purpose
The aim of the current task is to adapt the design of this new widget to the
list and kanban views.

SPECIFICATION

Kanban
when there is only one record set in the m2m field, display it like a
many2one_avatar widget when there are two or three records set in the m2m
field, display the avatars next to each other when there are more than three
records set in the m2m field, display the first two avatars, then a grey circle
with +X in it (where X is the number of records beyond the first two), when
hovering the +X avatar, open a tooltip with the list of the remaining records
the display order of the records is the same as the order in the m2m field
the avatars behave like in the other avatar widgets (i.e. darkens on hover and
clicking on it opens the chat) except the +X avatar that does not darken or has
a cursor:pointer; on hover and is not clickable

List
same specs as for the kanban view, with the difference that the widget displays
up to five records instead of three when the widget is editable display it like
the current formview version of the many2many_avatar_user widget (i.e. tags
with avatars)

task-2563591

closes odoo/odoo#72166

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-08-06 09:12:08 +00:00
Gorash 7df343dd1b [IMP] base: QWeb _render return Markup unicode instead of utf8 bytes
In order to limit encoding decoding, the _render method returns a
unicode string in the markup safe object instead of a MarkupSafeBytes

closes odoo/odoo#68299

Related: odoo/upgrade#2454
Related: odoo/enterprise#17270
Signed-off-by: Antony Lesuisse (al) <al@openerp.com>
2021-08-03 16:20:22 +00:00
William Braeckman a83af8780c [IMP] hr,hr_presence: presence report ux improvements
Previously all buttons would be displayed in a single row, this commit
changes it to two rows.
Also the bottom half of the button was unclickable due to an invisible
div, fixed with css.
Another button has been added to undo a manual presence state.

Task ID: 2584198

closes odoo/odoo#72976

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-12 15:11:44 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
Barad Mahendra 639a3d0fcc [IMP] project,hr: generic improvement for the project
Purpose of the commit is to improve the ui of the project and task

So in this comit, project_id and tag_ids should be always visible
in fsm mode too. also re-sequence the task form view buttons and
added class for the proper xpath.

also move the common for for get_unusual_days on employee so it
can be reused.

Related enterprise PR: https://github.com/odoo/enterprise/pull/19134
Closes: #72440
TaskID: 2502339
2021-07-21 04:44:27 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
Samuel Degueldre 08afc0af8f [REF] *: remove use of legacy notifications from tests
When writing the new webclient, the notification service was rewritten,
and all of its uses in production code were changed to use the new
services, however, some tests were still reliant on the old notification
service.

This commit removes references to the legacy notification service so
that we can be one step closer to removing it from the code base.

Part of #72675
2021-07-14 07:34:18 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

X-original-commit: 802e46541117573e028b711ea33dad9df9075a39
Related: odoo/enterprise#19602
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-12 10:57:37 +00:00
Yannick Tivisse 56d8c387ba [IMP] hr_contract: Display first contract date on employee public form
Purpose
=======

The "first contract date" is a usefull information for anybody who onboards
new colleagues. Issue: this information is not on the "public employee" and so,
visible only by hr officer (minimum).

With this task, we would like make this field public and visible by any internal
user in the system. In this way, we don't have to provide too many access rights
to any employees.

closes odoo/odoo#73552

Taskid: 2584098
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-07-12 10:07:17 +00:00
William Braeckman a0fae57e5c [IMP] hr: department views
Moves a field from hr_holidays to hr (`total_employees` of hr.department)
to display it in the department list view.
Widen the department kanban view to display more information and allow
clicking on the department name in the kanban view to edit it.

Task ID: 2582448
2021-07-08 12:00:59 +00:00
William Braeckman d665098579 [IMP] hr,website_hr_recruitment: improve job views
Multiple improvement with job views:
 - Add a sequence field for jobs
 - Display 'Open Positions' on the website event if there is only 1 open
   position
 - Display whether the website is published on both the list and the
   form views of hr.job
 - Fix an issue introduced with 446d906f508880eb787debbec3c23cfd081bb045
   where html field would be cut and html tags would be displayed
Minor change:
 - Add an sql constraint on the estimated number of recruitment to be
   positive

Task ID: 2581595

closes odoo/odoo#72769

Related: odoo/enterprise#19264
Related: odoo/upgrade#2585
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-07-06 09:45:40 +00:00
Thibault Delavallée 76616dc888 [IMP] mail: improve default bounce message
Current bounce message is not very user friendly. Purpose of this commit
is to improve it, by improving wording and overall phrasing used in it.

Form view is improved so that bounce message takes all available width in
form view.

Some tests are added, notably to detect pseudo-void content from editor.

Task ID-2532529
PR odoo/odoo#71793

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-07-07 06:29:01 +00:00
Kevin Baptiste 9e6d2da504 [IMP] hr_attendance: compute overtime on attendances
This commit adds a new model `hr.attendance.overtime`.

When an employee checks out, an overtime entry will be created when:
    - the option is enabled on the company;
    - the employee worked more or less than the number of hours they
    were supposed to work that day.

TaskID: 1904850
2021-07-06 11:35:01 +02:00
William Braeckman bfa0a66e52 [IMP] hr: move personal documents to hr
Previously personal documents on employees were added with the belgian
contract salary module. This changes moves part of those fields to the
base hr module

Task ID: 2578139

closes odoo/odoo#72673

Related: odoo/enterprise#19219
Related: odoo/upgrade#2587
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-24 07:53:49 +00:00
Didier (did) 6240617358 [IMP] mail, *: use explicit export instead of default
* = hr, hr_holidays, im_livechat, sms, snailmail, website_livechat,
    website_slides

Exporting directly on the line of the class or variable definition is less lines
of code and less repetition (and risk or mistake).

Exporting with a name instead of default allows to catch typos more easily when
importing and ensures the same name is used for consistency (and ease of grep).

closes odoo/odoo#72597

Related: odoo/enterprise#19224
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-25 14:56:52 +00:00
Fabien Pinckaers a65f6a5872 [IMP] various: clean most urls to odoo's website
Pages changed on odoo.com so let's update links.

closes odoo/odoo#72707

Related: odoo/enterprise#19239
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-24 15:14:29 +00:00
bit-odoo 800f9c499a [FW][FIX] mail, various: show only my activities shown through systray
Before this commit, suppose we have a scenario like below

  Task-A:
    Activity-1:
      name: Email ( Today )
      Assigned to: User-1
  Task-B:
    Activity-1:
      name: Email ( Today )
      assigned to: User-2
    Activity-2:
      name: Call ( Due in 3 Days )
      assigned to: User-1

When User-1 goes through the systray 'Today' filter shortcut he gets both
Task-A and Task-B in the list instead of only Task-A. Indeed currently
activities are not filtered based on current user with its deadlines.

However purpose of systray is to indicate activities current user has to
perform instead of global activities.

After this commit activities will be filtered based on deadlines as well as the
current user. In order to achieve this behavior we needed to pass a domain like
[
   ('activity_ids.date_deadline','=', fields.Date.today()),
   ('activity_ids.user_id','=', 1)
]

And for that purpose we introduced a non-stored compute field with a search
method.

Task ID-2438822
COM PR odoo/odoo#72219

X-original-commit: f4eaf4d8fb2f97240201104dcd4fc7e2674bce02
2021-06-21 07:51:00 +00:00
Thibault Delavallée c47b0054b8 [FIX] mail, hr, test_mail: correctly Markup-ize bounce notification email content
It is currently escaped as it is not Markup-ed and not considered safe.
It means raw content is currently displayed in sent emails, which is not
really what we expect.

closes odoo/odoo#71911

X-original-commit: 62e6bc216aefe93c4cd1cca8e39f124a8a298386
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-09 11:43:11 +00:00
Krina Oza 962f13a2e0 [IMP] base,hr: imporve the language settings and access to it
Currently, in My Profile all the users have access to language settings
even when the user does not have the rights to activate/deactivate
languages. Also, the language setting list is not user friendly which
needs to be imporved.

so in this commit hide "More Languages" button in My Profile for users
that does not have the rights and the language settings list is
improved by adding seperate buttons to "activate", "disable" and "update" a
language.

PS: groups does not work on My profile so added the compute field based
on group.

closes odoo/odoo#69292

Taskid: 2466771
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-07 09:50:58 +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