Commit Graph
3097 Commits
Author SHA1 Message Date
Martin TrigauxandXavier Morel 49838338e0 [FIX] *: sanitize action content reading
The open_action_with_context was not using _for_xml_id, producing an
error when reading the action content.

In open_action, the action_name was taken from the context and needs
sanity checks. Ensure only actions from the account module can be
read and only if the user has access to the target model.
This is a limitation of the previous behaviour but, at the moment, all
known calls are made refering to an action from the account module.
Limit the scope of this method while the 14.0 is still early to avoid
having a door open to ready any action, and difficult to close later.

Remove old action fetching from the context in create_move that is no
longer used.

closes odoo/odoo#61602

X-original-commit: a39e94f7e4dc74e850650ac90bbc5f85af130bc8
Related: odoo/enterprise#14695
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Xavier Morel <xmo@odoo.com>
2020-11-10 16:04:29 +00:00
IEL 3c7694b409 [FIX] *: fix image parsing error on saving res config
WHAT: apply 93a7695f65baf00d1f82481d6a2a97e6c11940a8 for all res.config.settings
menus

WHY: the same reason as in 93a7695f65baf00d1f82481d6a2a97e6c11940a8:

	When saving, a read is called. By default, read has
	bin_size to true to avoid performances issues.
	It will return the image size instead of the content

it may lead to image dissapearing or "Incorrect padding" error

HOW:

    find . -iname "*.xml"|xargs grep "\"context\".*'module'" -l | xargs sed -i "s/\(\"context\".*'module'.*\)\}/\1, 'bin_size': False}/"
    git checkout  -- addons/base_setup/views/res_config_settings_views.xml

---

PR for General Settings: https://github.com/odoo/odoo/pull/47297

opw-2346644

closes odoo/odoo#61215

X-original-commit: 7c55efa88b72bd1f3f0f32f7f738e2fda5aa4abd
Related: odoo/enterprise#14547
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-11-02 18:25:20 +00:00
Martin Trigaux e79531c136 [I18N] *: export 14.0 source terms
Including demo data this time

closes odoo/odoo#58862

X-original-commit: 575abde110acb3d12b25f177a863374becef0894
Related: odoo/enterprise#13705
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-29 17:52:02 +00:00
bat-odoo dbff65611c [FIX] hr: Fix the display of the chat icon on employee form
Currently, in employee form view edit mode, the icon of chat is
displayed underneath the name but it should be dsiaplyed in right
side of name like in readonly mode.

So in this commit, Fix the icon display issue and icon should be
right side of the name.

closes odoo/odoo#58623

Taskid: 2344588
X-original-commit: 903c8ef53cb0187075ce9db705a3d0b6faa32c8c
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-28 10:40:12 +00:00
jbm-odoo f5234d127e [FIX] hr: Give name to div for inherit
closes odoo/odoo#58606

X-original-commit: 6807c86d8568367f40a664a3bb69338372d4786e
Related: odoo/enterprise#13601
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-28 10:30:11 +00:00
Didier (did)andSébastien Theys add71e94b5 [FIX] mail: compute display_name for partner and user
task-2322135

closes odoo/odoo#58374

X-original-commit: d9bdbde95c3694ecdaccd58b5475631137c22e93
Related: odoo/enterprise#13478
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2020-09-23 18:59:24 +00:00
Yannick Tivisse 64b1056e5c [IMP] hr: Add a warning when changing employee's company
closes odoo/odoo#57973

Related: odoo/upgrade#1784
Related: odoo/enterprise#13312
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-18 11:00:25 +00:00
Yannick Tivisse 2511f5a889 [FIX] hr: Allow editing some missing fields on My Profile
Purpose
=======

Some fields weren't editable, even when the option is enabled on
the settings.

closes odoo/odoo#57842

X-original-commit: 57d595e87642fa6f7bec62cbb88a39c35cc72589
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-16 14:06:59 +00:00
Martin Trigaux 90d85eb9c5 [I18N] export saas-13.5 source terms
Without demo data

closes odoo/odoo#56869

X-original-commit: 33f251b6489455cd7221f2c62dee0400a69784b8
Related: odoo/enterprise#12836
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-01 11:18:00 +00:00
Francois (fge) 093641cd73 [FIX]hr: employee and user image synchronization
Remove the employee's image by default to avoid unnecessary image storage.
Add a placeholder in the kanban view.

closes odoo/odoo#55243

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-13 07:55:07 +00:00
Sébastien Theys 590a088750 [FIX] mail, *: fix opens and redirects, adapt messaging menu close
task-2244279
task-2262862
task-2274993
task-2277537
task-2282238

closes odoo/odoo#56755

X-original-commit: 17611f4adc5e950b0a75a2a6615b1da3c956387f
Related: odoo/enterprise#12769
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-08-28 17:34:13 +00:00
Dharmraj Jhala 610ba98539 [FIX] mail, crm: do not display body in creation message when having a subtype
Right now on few business objects (like leads, invoices, tasks, helpdesk
tickets etc) creation message contains
  * subtype description;
  * generic creation message;

This looks like multiple creation message on chatter after creation of the
record as you generally have "Task Created - Task created" (subtype description
then generic message).

This happens when we provide custom subtype on creation by by overriding
`_creation_subtype` method.

This commit fixes the issue by only using provided creation subtype and
removing default body. If creation subtype is not provided default creation
message is posted as before.

In this commit we also fix subtype for Lead/Opportunity creation and make
it generic ('Lead/Opportunity created') to avoid inconsistent behavior.

Finally some cleaning is made in method naming. Semi followup of 92e9e84b63

LINKS

Task ID-2288458
PR odoo/odoo#56631
PR odoo/enterprise#12707

closes odoo/odoo#56688

X-original-commit: 2ebbeb4b5443c6405dd9a3b202a1eee9c5c67ebb
Related: odoo/enterprise#12728
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-08-28 07:59:24 +00:00
Thibault Delavallée f5c6f14bb1 [REF] mail: move generic methods from thread to BaseModel
PURPOSE

Since v13 some commits added code in mail thread file. This file is already
quite long and keeping it organized allow to understand its content.

SPECIFICATIONS

Some methods defined on mail.thread may actually be called on models
not inheriting from mail.thread . Instead of having model methods on mail
thread receiving a records parameter it seems better to have those available
directly on BaseModel.

Move static_message_track on BaseModel in models.py. This method is now called
_mail_track, to be coherent with othe rmail-related naming. It is used in
accounting to track values in line model that does not inherit from mail.
thread. Update accounting accordingly (followup of d862965).

Move _message_get_default_recipients_on_records in models.py. Renaming it
_message_get_default_recipients() allow to be compatible with current behavior
and current override available in some addons (like CRM, event, ...).

Move _notify_get_reply_to_on_records in models.py. Renaming it
_notify_get_reply_to() allows to be shorter and coherent.

Move _alias_check_contact_on_record in models.py. Renaming it
_alias_check_contact_() allows to be shorter and coherent. Its override in
hr is also moved on BaseModel.

LINKS

Task ID-2327096 (code cleaning)
PR #56631

X-original-commit: f5df1ed912455e5ed52a65df3149f30a9d424de0
2020-08-28 07:59:23 +00:00
Barad Mahendra 7fee15258d [FIX] hr: Properly define the compute method to avoid access error
Currently, Due to _compute_phones method when going to read
the work_phone and mobile_phone from salary configurator then
it will randomly failed on read access right for those two fields.

So in this commit, Defined the _compute_phones method properly and
remove the compute from mobile_phone as it's not computed anymore.

TaskID: 2283753
Closes: #56205
2020-08-21 04:40:03 +00:00
Raphael Collet 69869ab681 [IMP] core: introduce subqueries in search
Make the method `_search` return a `Query` object, and make that object
generate a subquery when used on the right-hand side of a condition.

closes odoo/odoo#52403

Related: odoo/enterprise#10945
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-08-18 13:02:41 +00:00
Bruno BoiandAaron Bohy 26633ea8bb [IMP] hr: add a standalone version of the avatar employee widget
This will be useful for special views like gantt, grid…

A StandaloneM2OAvatarEmployee widget will be available and would allow to
instantiate a Many2OneAvatarEmployee widget anywhere.

Usage:
  const widget = new StandaloneM2OAvatarEmployee(<parent>, <value>);
  widget.appendTo(<Node>);

Where:
  <parent> the widget parent, if it is given
  <value> {number|[number, char]} either the employee id or an array representing the employee: [id, display_name]. If only the id is passed, the widget will fetch the display_name through a name_get rpc.
  <Node> any DOM Node object you want the widget to be appended to.

Examples:
  const w1 = new StandaloneM2OAvatarEmployee(null, 3);
  const w2 = new StandaloneM2OAvatarEmployee(null, [1, 'Mitchell Admin']);
  w1.appendTo(document.body);
  w2.appendTo(document.body);

closes odoo/odoo#54230

Taskid: 2272544
Taskid: 2272582
Related: odoo/enterprise#11412
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Aaron Bohy (aab) <aab@odoo.com>
2020-08-17 08:30:52 +00:00
Martin Trigaux 6156f98288 [FIX] *: adapt action content retrieval
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.

Add sudo for other operations on ir.actions.*
2020-08-17 09:09:02 +00:00
Xavier MorelandOlivier Dony a9a6509713 [ADD] auth_totp
New module for supporting two-factor authentication via time-base
one-time-password (TOTP).

Users (including portal users) can choose to enable two-factor auth in
their user account settings, by scanning a QR code and adding it to an
authenticator app, such as Google Auth, 1Password, etc.

When two-factor is enabled, password-based non-interactive RPC is only
possible by using API keys.

Co-authored-by: Olivier Dony <odo@odoo.com>
2020-08-14 23:06:24 +00:00
Olivier Dony 63e38dad8d [FIX] base,hr*: adapt profile view to security fields 2020-08-14 23:06:24 +00:00
Francois (fge) c06bb52f57 [IMP]hr_recruitment: Back2Basic - Improve Recruitment usability
Added a new tour for the module hr_recruitment

Hr.job:
Form view:
- Using a notebook view for increased clarity
Kanban view:
- Added a toggle button to publish/unpublish a job offer.
- In the menu, added the « Create Interview Form » button to create an interview form.

Hr.applicant:
Generale:
- Use of the "Applicant: Acknowledgement" template by default when an application is moved to the "First Interview" stage.
Form view:
- Possibility to consult an interview after this one and not before
- The "CREATE EMPLOYEE" button no longer directly creates an employee. The employee will be created if the "SAVE" button is pressed.

Hr.employee:
Generale:
- Added of two new certifications.
And some other minor style and name changes.

closes odoo/odoo#55928

Related: odoo/enterprise#12420
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-14 14:51:41 +00:00
Baptiste Vergote 8de815e8fc [FIX] hr_employee: company_id required
On the dashboard of Time Off (calendar view), the banner displaying
the remaining leaves is not shown as _get_contextual_employee_id
of hr_leave_type.py is returning False due to the missing required
on the company_id of hr.employee.

A fix was made in 2bd5e9a but missing the part that the employee_id
is not required. Confirmed by YTI

close opw-2252479

closes odoo/odoo#53109

Related: odoo/upgrade#1596
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-12 10:36:50 +00:00
Barad Mahendra 00a7f3aaad [IMP] various: Reseuence the module and module category
The purpose of this task is to improve the UI of the 'Apps', by
improving the clarity of the kanban, sequencing the apps and
simplifying the app categories in the searchpanel

So in this commit, Added the new sequences for ir.module.module
and ir.module.category records.

TaskID: 2240257
Related Enterprise: https://github.com/odoo/enterprise/pull/12413
Closes: #55907
2020-08-14 07:38:58 +00:00
Sébastien Theys c2918c139b [IMP] web, *: improve mock server and replace most mail mockRPC
Improve mock server:

- add support for mocked `fetch`
- add support for `active_test`
- add support for x2m `in` in domains
- add support for default values computed from a function
- implement a more natural "next id" compute
- allow initial data without ids
- ensure write and x2m commands integrity
- improve bad data/bad commands error messages
- always warn for failing RPC, not only in debug mode
- fix all existing tests that had inconsistency data

Other changes done in mail (or dependents) that are not just related to tests:

- remove `direct_partner` from formatter result
  ->`correspondent` can be computed from other keys, especially `members`

- fix `livechat_visitor` convertData
  -> only process if there is value

- add `current_partner` and `current_user_id` as `init_messaging` result
  -> easier to mock than session

- remove usage of `need_moderation`
  -> that was just a search indirection to `moderation_status`

- adapt `partner_id` -> `res_partner_id` key in `_notification_format`
  -> to be consistent with field name

- add name in result of `mail_partner_format`
  -> sometimes display_name is not the same

- remove usage of `is_moderator`
  -> that was just an indirection to `moderation_channel_ids`

Enterprise counterpart: https://github.com/odoo/enterprise/pull/11523
task-2287171

closes odoo/odoo#55854

X-original-commit: 7ba3fecb3377a720d1eb70e7515a0c45da73836d
Related: odoo/enterprise#12391
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-08-13 16:26:35 +00:00
Kevin Baptiste d24de2554e [IMP] hr,hr_attendance,hr_contract,hr_holidays,hr_presence: update employees presence icons
Make the employee presence icons more descriptive.
Allow to quickly filter the Presence Reports based on the user status.

closes odoo/odoo#54527

Taskid: 2246447
Related: odoo/upgrade#1488
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-05 12:22:29 +00:00
Simon Genin (ges) 8a6a4766d9 [IMP] hr_employee: improve form usability
Improve slightly the layout of some forms related to employee and contracts.

Modified modules:
hr
hr_expense
hr_holidays
timesheet_grid
hr_contract_salary
hr_payroll_account

Task ID 2277298

closes odoo/odoo#52981

Related: odoo/enterprise#11156
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-04 09:21:00 +00:00
Nisha patel 7f3a8d9928 [FIX] hr: Hide employee chat button in modals
Currently, the "Chat" button appears in the form view when it is
displayed as a modal and on click sends to the app switcher
because js_class is not loaded on the dialog when employee
form view is opened through the one2many(dialog).
For ex: in online appointment when on click on 'available
emloyee' it will open the employee form view in dialog and there
is a chat icon but it does not work.

So in this commit, we fix this issue by hiding the "chat" button
when the view is displayed as a modal. make a button visible
based on action context and when form view is oped through the
click of one2many then do not display the chat icon on modal
dialog.

closes odoo/odoo#55345

Taskid: 2291340
Closes: #54381
X-original-commit: e2bac64411f80a3fcf2c5d5d60ad3eccf6517e56
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-03 15:48:34 +00:00
Xavier Morel 6835aeb0de [REM] core, *: deprecate <act_window> and <report>
Convert deprecated tags through the codebase.
2020-07-28 13:03:13 +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
Jorge Pinna Puissant 793edf3293 [FIX] hr: activity type configuration on hr plans
revert of 0f4ec36 and bf8a9af

- Employees > Configuration > Planning Types and ensure the activity
    type "To Do" is set to scheduled date several days after previous
    activity (default should be 5 days);
- Check that onboarding Plan has at least 2 activities with activity
    type "To Do";
- Click launch plan.

The activity type configuration is ignored and all activities are due
tomorrow. The previous commit uses the function
_onchange_activity_type_id to fix this issue.

The problem with this commit, is that the _onchange_activity_type_id
function will also change the responsible, the notes and the summary to
set them to their default value.

Now, the activities are due taking into account the activity type
configuration without modifying the already set responsible, notes and
summary.

opw-2265631

X-original-commit: 81e4745a31567af7b58064bd8b4e9bae0756354f
2020-07-16 08:55:09 +00:00
Jorge Pinna Puissant 600bfa1196 [FIX] hr: activity type responsible on hr plans
fine-tuning of bf8a9af1ac549be830bec28c88eb1c565b591941

- Employees > Configuration > Activity Planning > Plans and ensure the
  activities have different responsible;
- Create a new Employee, assign a Manager (a different user then the one
  connected, you can assign Marc Demo for example);
- Click launch plan.

Before this commit, the activity type responsible is ignored and the
responsible for all activities is the connected user.

Now, the responsible for the activities are assigned taking into account
the activity type configuration.

opw-2265631

closes odoo/odoo#54054

X-original-commit: 0f4ec369dccdf25aed259ae97b5cc8973a1a8c5a
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-07-03 13:03:46 +00:00
Yannick Tivisse 7d281b3f7f [FIX] hr: Don't link another menu_id when lauching an onboarding plan
closes odoo/odoo#53814

Taskid: 2219194
X-original-commit: 2050bd95bf6773f0fd3174d13843f763641e00ab
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-29 14:07:00 +00:00
Hardik Prajapati 999507007e [IMP] hr: Sync some data between user and employee
Purpose of the task is to improve the employee image and phone
behaviour while changing the user.

So in this commit, IF there is no pitcure on employee then apply the
image of user while adding the user to employee from cretae, write
and onchage. do not  change the employee image if employee image is
already set while creating employee or changing the user on employee.

Also improve the phone behaviour when changing the company,
  - Never change the mobile_phone when switching the company
on employee
  - Always change the work_phone when switching the company, except
if empty on res.company.

closes odoo/odoo#50115

Taskid: 2240167
Closes: #50115
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-23 11:53:45 +00:00
Nidhi Patel 8438286478 [IMP] account,hr(_expense): Employee private address should be 'private' instead of 'contact'
Purpose of this task is,lots of business flows can be crashed if
the field Private Address(address_home_id) is a private address instead
of a regular contact.

so in this commit,we change the demo data for employee and set the
private type address on employee for private address and also fix
the flows on which errors could occur.

Currently billing administrator does not have right for private address
and while creating payment from expense it was going to set the
customer from the employee's private address on payment so give the
private address right to the billing adminnistrator.
Also chaned admin/demo user's private address as 'private' instead of
regular contact.
and on hr_expense use the Sudo while accessing the home address this
method is used from payslip too.

TaskID:2170016

closes odoo/odoo#46628

Closes: #46628
Related: odoo/enterprise#8924
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-11 07:09:48 +00:00
Jérémy Hennecart 9389f7ce2e [IMP] *: enable sample data in several views
This commit sets attribute sample="1" in a bunch of list and
kanban views, to enable the new sample data feature when views are
empty.

Task 2232801

X-original-commit: 5471309b35619f307242c2704c7681ba63d2be42
2020-06-22 13:04:02 +00:00
Arnaud Joset 4b7a4d4f0c [IMP] hr: set schedule information always visible
Before this commit the schedule and timezone were only visible in debug mode. As the default timezone is UTC, some misleading information could be displayed in some cases (e.g. planning without internal users).

closes odoo/odoo#52111

Taskid: 2246557
Related: odoo/enterprise#10370
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-22 10:14:27 +00:00
Martin Trigaux ba244cef01 [IMP] *: replace to new _() syntax
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
2020-06-18 13:03:34 +02:00
3fea5b2136 [REF] mail, *: refactor messaging with OWL
This commit is a significant rewriting of client-side discuss, chatter,
chat window, and messaging menu using OWL. The behavior should be broadly
the same, with some slight functional changes here and there.

From a technical standpoint, the code of messaging is mainly organized in 2
main groups of modules:

- models, which are logical entities that depict the client-side state of
  messaging as a whole.
- components, which are in charge of displaying information from models.

This refactoring also introduces new JS guidelines regarding folder structure
(/static) and naming rules for JS modules.

Community PR: https://github.com/odoo/odoo/pull/39023
Enterprise PR: https://github.com/odoo/enterprise/pull/6249

Task-1914207

This PR is a collaborative work by Alexandre, Julien, Sébastien and Xavier,
with the precious help of Lucas to speed it up towards the end.

closes odoo/odoo#39023

Related: odoo/enterprise#6249
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre Kühn <aku@odoo.com>
Co-authored-by: Julien Giannone <jgi@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
Co-authored-by: Xavier Dubuc <xdu@odoo.com>
2020-06-15 18:12:21 +00:00
Julien Mougenot f5f0ca843d [IMP] *: enable_counters with false as default
In the search panel, the attribute disable_counters with default False
has been changed to enable_counters with default False.
2020-06-12 13:34:04 +00:00
Julien Mougenot c4786fccfd [IMP] *: update notifications to optional title
closes odoo/odoo#52826

Related: odoo/enterprise#11084
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-12 09:01:50 +00:00
Nasreddin (bon) e6df7bb718 [FIX] hr: Empty required name on quick create department
Issue

	- Open console in debugger of the browser.
	- Install "Employees" app
	- Go to "Employees" and edit or create any employee
	- In 'Department' field, quick create one

	Error is raised in console and the modal department form view is opened.

Cause

	'name' field is required but empty since 'complete_name'
	is the one set as _rec_name in 'Department' python model.

Solution

	Cherry-pick of 7c0fed48a1

opw-2267356

closes odoo/odoo#52489

X-original-commit: 056618914e9f1f437f8855459c302fc0ac6663c5
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-06-05 10:19:01 +00:00
Yannick Tivisse f1e2fde734 [IMP] hr: Improve settings layout
closes odoo/odoo#51334

Taskid: 2241726
Related: odoo/upgrade#1202
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-26 07:13:59 +00:00
Martin Trigaux 8f57863707 [IMP] *: remove access to ir.property
Only administrators can access properties and configure them.
ir.property may contain sensitive information and should only be
accessed via code call to specific methods
2020-05-26 15:50:11 +02:00
Thibault Delavallée 4a2ac044f8 [IMP] (test_)(mass_)mail(_full): rename and reorganize mail related test classes
Modules holding tests and helpers

  * link_tracker: mainly mock, asserts and tools for link tracker tests
    (MockLinkTracker);
  * mail: mainly gateway mock and base for mail tests
    * MockEmail -> mocks for mail gateway;
    * MailCase -> tools and asserts for mail tests;
    * MailCommon ->     base for mail functional tests);

  * sms: mainly SMS gateway mock and base for sms tests
    * MockSMS -> mocks for SMS gateway;
    * SMS Case -> tools and asserts for mail / SMS tests;
    * SMSCommon -> update of MailCommon with SMS capabilities);

  * mass_mailing: mainly asserts and tools for mass mailing tests
    * MassMailCase -> update of MailCase for mass mailing tools and asserts;
    * MassMailCommon -> update of MailCommon with mass mailing);

  * mass_mailing_sms: mainly asserts and tools for mass SMS tests
    * MockMassSMS -> update of MockSMS for mass SMS tools and asserts;
    * MassSMSCommon -> update of MassMailCommon with SMS capabilities);

Modules for tests

  * test_mail: module for mail app tests (TestMailCommon);
  * test_mass_mailing: module for mass mailing app tests (TestMassMailCommon);
  * test_mail_full: tests integrating all discuss features, currently mainly
    mail and SMS (TestMailFullCommon);

Enterprise: update test_mail_enterprise and test_marketing_automation

Task ID 2247037
Community PR odoo/odoo#50384
Enterprise PR odoo/enterprise#10266
Upgrade PR odoo/upgrade#1122
2020-05-26 10:35:58 +00:00
Yannick Tivisse 12b526432f [IMP] hr: Display chat icons on employee kanban/form views
Purpose
=======

On the Employees App, we dont have a smart way to start a discuss
with a colleague or an employee.

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

Style for each button :
- use fa-comments
- use primary color/action color (green)

On private/public employees form/kanban views, add a button to
start a chat with the user

closes odoo/odoo#51484

Taskid: 2252207
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-25 14:50:19 +00:00
Yannick Tivisse 03a11b5a0e [REV] hr: revert f33644df65bcd4133689855018850c1b1deac7a6
Purpose
=======

By using the user's related company to create a employee, we prevent
creating several employees for the same users on the basic flow.

But this is exactly the way we want people to use the system.

Example: Jojo is working in Belgium, has a belgian employee liked
to a belgian user in the system.

Now Jojo is about to work during 1 year in another company, based in
the USA. Jojo wants another employee, to manage the HR things
properly (payroll, ...), but he doesn't want to have 2 users, he
prefer to manage all its notifications in the same place.

We create another employee for Jojo, in the US company.

So instead of creating the employee in the user's company (Belgian),
as it would raise an error for the second employee, we should use the
contextual company instead, allowing to create the second employee
smoothly.

closes odoo/odoo#51435

X-original-commit: 0318f0acc5e98950c274c90a86a94d4588d2966d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-18 11:58:10 +00:00
Swapnesh Shah fab315489c [FIX] hr: show Create employee button based on company employee
Before this commit, the `Create Employee` button was not visible if user is linked to employee in any other company as the domain was based on `employee_count`. (Which represents Employee belongs to all companies)

With this commit, we check for `employee_id` which makes sure if the user has linked Employee for currently activated company.

Followup on 95564bcd2c

X-original-commit: cb9ac24caea53615e2808a36e850939a1ccaa041
2020-05-18 11:58:10 +00:00
Krupal Oza 6d17897dff [IMP] various: Clean the kanban view design
PURPOSE
=========================

The goal of this task is to set up some kind of guidelines to make
kanban views consistent.
It is fine having different kanban views, but if a UI element is shared
among several kanban views, it should behave/look the same so the user
knows what to expect.

Kanban views can be split into two types:
==> 'documents' kanbans, such as res.partner, crm.lead, etc.
    - those records are created/edited often, numerous
    - 'opening' the card means accessing the record
==> 'dashboard' kanbans,such as stock.picking.type,account.journal, etc.
    - those records are not created/edited often, there are much less numerous
    - usually presented as dashboard, where 'opening' the card means
accessing a set of related 'documents' (clicking on a account.journal
to access account.move, or stock.picking.type to access stock.picking)
    - configuration of the 'card record' is done through a dropdown to
access configuration

Here are some guidelines for consistency. Bear in mind that those are
not rules, but guidelines for consistency that we'd like to keep in
mind when designing.

==> 'documents' kanbans
 - the record is accessed through global click
 - the user avatar is at the bottom right
 - the activity widget is at the bottom left (in last position if
there are other elements)

==> 'dashboard' kanbans
 - the record is accessed through a 'Configuration' option in the card dropdown
 - there is no global click, and therefore no focus shadow
 - the dropdown icon (o_kanban_manage_toggle_button) is always visible,
with icon fa-ellipsis-v
 - the listview counterpart should be presented as a dedicated
configuration menu, and shouldn't be in the 'dashboard action'
 - links in the body of the card are structured as follows: link with
<count>+label, then any additional aggregated metrics (not link) to the right
example https://drive.google.com/file/d/1ZP6HDHTtC7cQ6rDWgqLoPs6U8JCeNVkW/view?usp=sharing

==> global guidelines
 - the title font color is #212529, with 500 weight
 - the subtitle font color is #666666, with 400 weight
 - the font size is 1.083rem
 - text overflow is handled through linebreak, not ellipsis
 - numerical values are aligned to the right
 - the kanban state widget is at the bottom right

SPECIFICATION
=================

AS per guidelines Improved follwing kanban/dashbaord view
 - hr_job
 - hr_department
 - hr_work_entry
 - hr_appraisal
 - fleet_vehicle
 - product_template
 - sale_subscription_template
 - crm_team
 - res_partner
 - event
 - stock_picking_type
 - mrp_eco_type
 - maintenance_team
 - quality_alert_team
 - account_journal

Added the department menu on employee with default kanban view
Added sequence in hr_work_entry list view

TaskID: 2206372
Related Enterprise PR: https://github.com/odoo/enterprise/pull/10341
Closes: #50536
2020-05-18 12:11:22 +00:00
Jorge Pinna Puissant ec29deb024 [FIX] hr: activity type configuration on hr plans
- Employees > Configuration > Planning Types and ensure the activity
    type "To Do" is set to scheduled date several days after previous
    activity (default should be 5 days);
- Check that onboarding Plan has at least 2 activities with activity
    type "To Do";
- Click launch plan.

Before this commit, the activity type configuration is ignored and all
activities are due tomorrow.

Now, the activities are due taking into account the activity type
configuration.

opw-2255586

closes odoo/odoo#51423

X-original-commit: c159479d7f714f2ec871cc4b965de3f961160789
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-05-18 10:56:03 +00:00
Yannick Tivisse 7b714a3bc7 [IMP] various: Update list views with new widgets
Purpose
=======

The following task implemented new widgets/features in the listview for better UI.
https://www.odoo.com/web#id=2195254&action=327&model=project.task&view_type=form&cids=1&menu_id=4720

The goal of the current task is to use those to upgrade our listviews

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

Below are change requests on various listviews.

Remove decoration-bf="message_needaction==True" from every listview in every module.

PRODUCT - stock.view_stock_product_template_tree (product template)

remove all decorations from <tree>
set the following decorations on 'virtual_available' and 'qty_available'
decoration-danger="virtual_available&lt;0"
decoration-warning="virtual_available==0"
also set decoration-bf on 'virtual_available'
apply the same modifications on stock.view_stock_product_tree for product variants

SUBSCRIPTION - sale_subscription.sale_subscription_view_list

remove all decorations from <tree>
'stage_id' field
set <field name="stage_id" widget="badge" decoration-info="stage_category == 'draft'" decoration-success="stage_category == 'progress'"/>
'recurring_next_date' field
set <field name="recurring_next_date" string="Next Invoice" widget="remaining_days" attrs="{'invisible': [('stage_category', '!=', 'progress')]}"/>
set decoration-bf on 'code' and 'recurring_total_incl'
move 'percentage_satisfaction' before 'recurring_total_incl'
set widget="many2one_avatar_user" on 'user_id'
add <field name="activity_ids" widget="list_activity"/> after 'user_id'

ELEARNING - website_slides.slide_channel_view_tree

set widget="many2one_avatar_user" on 'user_id'
'enroll' field
set <field name="enroll" widget="badge" decoration-success="enroll == 'public'" decoration-info="enroll == 'invite'" decoration-warning="enroll == 'payment'"/>

POS - point_of_sale.view_pos_order_tree

remove all decorations from <tree>
'state' field
make visible and move it at the end of the view
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state not in ('draft','cancel')"/>
set decoration-bf on 'name'

APPRAISAL - hr_appraisal.view_hr_appraisal_tree

'state' field
set <field name="state" widget="badge" decoration-info="state in ('new','pending')" decoration-success="state == 'done'"/>
'date_close' field
set <field name="date_close" widget="remaining_days" attrs="{'invisible': ['|',('state','=','done'),('state','=','cancel')]}"/>

PAYMENT - account.view_account_payment_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state == 'posted'"/>
move 'company_id' before 'amount'

CONTRACT - hr_contract.hr_contract_view_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state == 'close'" decoration-success="state == 'open'"/>
set widget="many2one_avatar_employee" on 'employee_id'

PAYSLIPS - hr_payroll.view_hr_payslip_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state == 'verify'" decoration-success="state in ('done','paid')"/>
set decoration-bf on 'number' and 'net_wage'
move 'company_id' before 'basic_wage'
set widget="many2one_avatar_employee" on 'employee_id'

SURVEY - survey.survey_tree

'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state == 'open'"/>

APPLICATION - hr_recruitment.crm_case_tree_view_job

set widget="date' on 'create_date'
set widget="priority' on 'priority'
set widget="many2one_avatar_user" on 'user_id'

TIME OFF - hr_holidays.hr_leave_view_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state in ('confirm','validate1')" decoration-success="state == 'validate'"/>
apply the same changes in hr_holidays.hr_leave_allocation_view_tree

closes odoo/odoo#51305

Taskid: 2256589
Related: odoo/enterprise#10614
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-15 08:24:05 +00:00
Swapnesh Shah 57f2dc20a1 [IMP] hr*: correct term on warning
Followup on a3daff6

Use `time off` word instead of 'leave'.
2020-05-18 08:17:31 +00:00