Commit Graph
3053 Commits
Author SHA1 Message Date
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
Martin Trigaux d9287caf94 [IMP] *: convert to private methods
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
2020-05-14 13:59:10 +02:00
Swapnesh Shah 665c2d536f [FIX] hr: use correct company for new employee
Before this commit, Creating New Employee from User's form was taking default company from the current logged-in User instead of the User for which it Employee is being created.

With this commit, We take default company from User for which employee is created.

closes odoo/odoo#51014

X-original-commit: 9206cc4db2a8dc5a7fbc281c1574f09bfba76544
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-11 10:13:29 +00:00
Swapnesh Shah e3b4eac59b [IMP] hr: in plan, display activity name when raising the error about unassigned activity
Before this commit, the user was not aware of the activity for which
configuration is missing. In this commit, we display `Activity name` in the
warning to helpfixing configuration.

Based on Feedback at https://github.com/odoo/odoo/pull/44922#issuecomment-584057134

closes odoo/odoo#50529

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-05-06 06:24:51 +00:00
Aaron Bohy 22a66ae694 [IMP] hr: add Many2OneAvatarEmployee field widget
This widget is a variant of the Many2OneAvatarUser widget, designed
for many2one fields pointing to 'hr.employee'.

Part of task 2195254
2020-05-05 10:05:12 +00:00
Aaron Bohy e63ffeab5a [REF] mail,hr: move openDMChatWindow to MailManager
It will be used by the Many2OneAvatarUser widget defined in the
next commit.
2020-05-05 10:05:12 +00:00
Yannick Tivisse 85b199b9be [IMP] various: Set a default random color on certain tags
Purpose
=======

For a tag to be displayed on a kanban card, it needs to have a color set.
We won't be changing that behaviour, since it would mean having
two options > the color, and whether or not to show it in the kanban

The purpose of this task is to set a color on new tags to make the user
save a bit more time, set a color for him as he might not find the feature,
and make sure the tag will be on the kanban cards.

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

For each of the following models, at creation, set a random integer between
1 and 11 in field 'color'

Models:
res.partner.category
crm.tag
project.tags
hr.applicant.category
helpdesk.tag
hr.employee.category
event.track.tag
mrp.eco.tag
repair.tags

closes odoo/odoo#49967

Taskid: 2234527
Related: odoo/enterprise#10112
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-22 11:32:35 +00:00
Lucas Lefèvre 45170ceeb5 [IMP] various: Hide default user image for unassigned records
Impacted modules: account_analytic_default, crm, event,
hr_recruitment, maintenance, mass_mailing, project,
purchase_requisition, stock_picking_batch, website_slides

The default image displayed when the record is unassigned is
confusing, so we are removing it.

FP request
Task 2234524

closes odoo/odoo#49333

Related: odoo/enterprise#9834
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-28 13:16:29 +00:00
Martin Trigaux 2d00263127 [I18N] *: export saas-13.3 translations
closes odoo/odoo#50031

X-original-commit: 15a7a9f9d71a0b9c46d7caf2f4fbf09a5a4c63fe
Related: odoo/enterprise#10140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-23 07:13:48 +00:00
Swapnesh Shah 7c8ae751f8 [FIX] hr: allow to copy employee linked to user
Before this commit, It was not possible to copy An employee which is already linked to User due `user_uniq` constraints.

Now we add `copy=False` on `user_id` field, so Employee will be copied without linked User.

closes odoo/odoo#49915

X-original-commit: 2a63df03859166414be338c6655ee8c4052666b7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-22 07:28:29 +00:00
dmonzonis 328f6dbc98 [ADD] mail_bot_hr: Bridge module to remove mail_bot dependency from hr
In v12, the hr module did not have a hard dependency on mail_bot, so the
users could uninstall it if they did not want/need its functionality. In
v13, mail_bot was added as a dependency to include the notification
widget and the odoobot state in the user forms modified by the hr
module. However, this also brings potentially unwanted functionality to
anyone who installs an hr related application.

This commit removes the dependency on mail_bot by adding the mail_bot_hr
bridge module, which provides integration between mail_bot and hr if
both modules are installed.
2020-04-10 11:15:19 +00:00
Anh Thao Pham (pta) 3bd345597f [REF] hr*: convert onchange methods to stored-editable computed fields
Impacted modules:
hr, hr_contract, hr_recruitment, hr_payroll, fleet, hr_skills, hr_appraisal, ....

Several onchanges have been converted to computed fields in the following modules :
    Community :
        - hr
        - hr_contract
        - hr_recruitment
        - hr_work_entry
        - hr_maintenance
        - hr_expense
        - hr_expense_check
        - hr_holidays
        - sale_expense
        - account_analytic_default_hr_expense

    Enterprise:
        - hr_contract_salary
        - hr_referral
        - hr_payroll
        - hr_payroll_expense
        - test_l10n_be_hr_payroll_account

There are still 2 onchanges with complex behavior that couldn't be converted easily:
- an onchange that updates "tz" (timezone) that is defined as a related field
  to "resource_id.tz". Apparently it is useless except to initialize the default
  value of "tz".
- an onchange that updates "name" that is defined as a related field to
  "resource_id.name".
  the applicant.

closes odoo/odoo#45414

Taskid: 2169099
Related: odoo/enterprise#8572
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-20 10:32:45 +00:00
Tiffany Chang (tic) 1ac243c21c [IMP] various: Replace incorrect use of "edition"
"Edition" is a French-English false friend word. "Edition" in English
means "version" whereas "edition" in French means "editing". This commit
updates user facing strings/documents that incorrectly use "edition" instead
of "edit" or "editing". Attempts were made to clean up English around
"edition" usage so please excuse any errors from lack of context
knowledge. Code comments and names incorrectly using "edition" were NOT
updated.
2020-03-31 10:31:35 +00:00
Nicolas Lempereur b53cf339e4 [FIX] web,*: phone number ltr even in rtl language
Currently there is two ways in view to have a phone number displayed in
LTR in a RTL language:

- have `widget="phone"` on a field
- have a class o_force_ltr on the field

But this is currently done very rarely and fail in list view because the
direction of data cells is used, eg.:

```
<div style="direction:rtl">
  <table><tr><td style="direction:ltr">
      <span>+1 2 3</span>
  </td></tr><tr><td>
      <span style="direction:ltr">+4 5 6</span>
  </td>/tr></table>
</div>
```

will be displayed as:

+1 2 3
6 5 4+

In this commit, we use unicode-bidi* to optionally add an additional
level of embedding so direction is taken into account by the
bidirectional algorithm.

This commit also adds o_force_ltr class or phone widget on phone fields
where it is not already defined.

*: https://drafts.csswg.org/css-writing-modes-3/#propdef-unicode-bidi

opw-2224828
closes #48425

closes odoo/odoo#48588

X-original-commit: ab067218e069f0a92610c3f0d4137e563e47755c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-03-30 13:50:04 +00:00
Adrian Torres 1daf8eb127 [FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.

This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.

closes odoo/odoo#46325

Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-03-30 13:42:04 +00:00
jbm-odoo b446a1e958 [IMP] hr: Add user slash if no employee set
If employee is not set, the default picture will be user-slash
instead of camera.

Task ID 2221250

closes odoo/odoo#48114

Related: odoo/enterprise#9398
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-20 13:17:31 +00:00
Nisha patel e428d473c3 [IMP] various: Allow to select only internal users on m2x field with res.users
Purpose of this task is to prevent users from setting portal users on
internal documents by mistake, and preventing noise and performance
issues resulting from loading all the portal users in those fields.

This commit fixes internal many2x fields to res.users which are now
restricted to internal users by setting domain (share=false) on form view.

closes odoo/odoo#47553

Taskid: 2172779
Related: https://github.com/odoo/enterprise/pull/9204
Related: odoo/enterprise#9204
Closes: #47553
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-16 10:28:35 +00:00
Victor Feyens 532c083cbb [IMP] *: remove global field definition in ir rules xml
It is a computed field, there is no need to manually set its value.
2020-03-20 16:15:40 +01:00
Anh Thao Pham (pta) 73a9dc77b6 [IMP] hr: move "Job Position" to "HR Settings" tab after "Related User"
closes odoo/odoo#46656

Related: odoo/enterprise#8950
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-13 09:59:06 +00:00
Rémy Voet (ryv) c5e6511e8d [IMP] mail: ease bounce email content update based on alias security
PURPOSE

When incoming emails bounce due to alias security bounce email is quite
generic. Purpose of this task is to ease its customization and update.

SPECIFICATIONS

In order to improve the flexibility of alias, add a customizable html field
on the alias model. This html content will be send as bounce email core content
in case of bounced/unauthorized mail received for this alias,

Obviously it has no effect on 'everyone' security setting as no email will
bounce due to that issue.

If it is not set a default generic mail will be send depending on security
setting. It allows to keep void html fields when no specific bounce content
is required

In HR, an old template allowing some light customization for employee based
security option is removed as it is completely replaced by the new feature.

Also add references message-id of the mail received to the answer so that
threads are correctly set.

LINKS

Task ID 2126509
2020-03-12 13:54:32 +00:00
jvm-odoo 3da7db8cb6 [FIX] hr: fix employee creation from user form
Issue

- Install Employees
- Create a new user
- Click on "Create employee"

Traceback

Cause

In 999ced42989f, we add the user_id key but we
already have in the action_create_employee method

The key is duplicated so this is why there is a
traceback

Solution

Remove the key in action_create_employee since
we have it in _sync_user

OPW-2205354

closes odoo/odoo#46375

X-original-commit: e0c29f1a4cd8d95654963b024fd0b0e1b0578776
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-02-26 16:31:34 +00:00
qho 64460c38ac [FIX] hr: quick user creation and assign user to employee
When creating a new user on-the-fly on the employee detail page (HR Settings/Related User), if the employee is never linked with a user before, the new created user will not be linked with the employee automatically and we have to select the user again.

With this commit, the new created user will be linked with the employee automatically.

Fixes #44442

closes odoo/odoo#46125

X-original-commit: 136c0dbea0ab00ff27daac69c27dc0824a16ff70
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-24 14:44:37 +00:00
Prakash Prajapati da591f5c6c [IMP] hr: Default employee gender should be null rather than male
Purpose of the task is, when creating a new employee, the default
gender should be empty.

closes odoo/odoo#42843

Taskid: 2165484
Closes: #42843
Related: odoo/enterprise#7648
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-12 09:57:58 +00:00
Romain Estievenart e0231481d6 [FIX] base,hr,web: kanban image sizing/look & feel
The image illustrating some kanban cards (like "Employees" or
"Contacts") has a weird scaling and rendering on smaller screen sizes.

Step to reproduce (on small screen):
1. Open Employee
2. Apply a filter
3. Picture is ugly (shape changes to get something pretty weird)

This commit fixes it by:
1. removing the rounding which was only applied (sic) on smaller screens
2. adjusting the size and/or the margins of the image to keep its ratio
   and the alignment with the other kanban cards.

Task ID: 2198419

closes odoo/odoo#45956

X-original-commit: dd5db84464998b45d0524055f9c96bcad894c4c9
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-02-21 14:28:04 +00:00
Martin Trigaux 0cc8610923 [I18N] export saas-12.3 source terms
closes odoo/odoo#45285

X-original-commit: bb281e98f52a2716f00d43a07446a08df698c1dd
Related: odoo/enterprise#8413
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-13 11:45:39 +00:00
jbm-odoo 9a4da8894f [FIX] web: Avoid open too fast zoom
Picture of employees are maximazed directly which is annoying when
you move the mouse in kanban view.

Add the ability to put a waiting time before opening the zoom in
option of the field in the view (default value is 0).

closes odoo/odoo#45229

Taskid: 2191289
X-original-commit: a264b17d8fe18464df439d896ecb7dea106caa5a
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
2020-02-12 15:54:06 +00:00
Xavier Morel e95ccf0908 [FIX] *: domains should not have as many binary operator as there are terms
* modify client-side domain normalisation to error if the domain is
  invalid (not enough terms / segments for the number of operators)
* add better error reporting to attrs / modifiers parsing
* add a few layered error augmentation to provide clearer context
  e.g. "error: invalid domain <thing>" is helpful but "error while
  parsing modifiers for field foo: modifier invisible: invalid domain
  <thing>" is much more helpful
* rework _evalModifiers to deduplicate it in order to more easily
  implement this contextual augmentation
* test that improper domains are properly found improper
* fix a bunch of incorrect attrs domains
* also removed an apparently undefined (& unused) "options" argument
  to a _applyModifiers call

closes odoo/odoo#44642

Related: odoo/enterprise#8175
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-02-12 09:32:17 +00:00
Sébastien Theys 4c492a1989 [FIX] hr: restore chat button on employee form
[1] transformed the button to be `a` instead of `button` for validation reasons
however `header` only renders `button` tags so the chat button was not visible
anymore.

[1] eb2f0aabcf

closes odoo/odoo#45129

X-original-commit: 0075dc37b07b1e81ff8c20e5af49173bf69d55ed
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-02-11 18:11:10 +00:00
mcm-odooandThibault Delavallée de1743ab12 [REF] mail, various: remove user_signature field from mail.template
RATIONALE

Mail template model holds a field telling odoo mail engine to automatically
add the current user's signature to the body. Its use depends on the use
case

  * using the template in the composer on a single record: it is displayed
    in the rendered template in the composer, meaning people could change it.
    This behavior is interesting as it allows to see the email content;
  * using the template in the composer in mass mail mode: it is not displayed
    as only the raw jinja is displayed. It is therefore not obvious that it
    will be appended to the body of the mail. People could add it manually and
    have 2 signatures as a result;

A mechanism automatically adding a signature to sent emails when posting a
message is already implemented and is based on template existence. If a
template has been used when posting, no signature is added in sent emails.
Otherwise it is automatically added. This behavior should not change.

Behavior will therefore be

  * use a template -> specify signature usage in it manually through jinja;
  * do not use a template -> signature added in sent emails;

SPECIFICATIONS

Remove user_signature.

Update template body accordingly. In customer oriented templates that are using
it and do not already contain it, manually add a call to user.signature within
the jinja code. When set to False, just remove its declaration.

Quickly clean some signature integration.

LINKS

Task ID 2089252
Community PR odoo/odoo#39482
Enterprise PR odoo/enterprise#6459
Upgrade PR odoo/upgrate#761

Related: odoo/enterprise#6459
Related: odoo/upgrade#761
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-02-11 14:01:13 +00:00
Swapnesh Shah 5e63519c66 [FIX] hr: Remove unnecessary argument
Followup on 5ce8f1e375
Before this commit, There would be traceback on Launching Plan with `Responsible` set to `other` and No `Responsible Person` defined on activity due to Extra argument.

In this commit, We remove that extra Argument.

closes odoo/odoo#44965

X-original-commit: 009e5526ee398415693d1d3df8f3c2ac546fd258
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-02-10 11:52:59 +00:00
Odoo's Mergebot e753bb1a85 [MERGE] sale_stock : add a default warehouse on the user
Purpose
======
Our current integration between FSM and Stock works well for basic flows, but quickly shows limitations. We don't handle warehouse by employee. Use-case: each worker has a dedicated van with a dedicated stock. I want to track the material used for each intervention to make sure that nothing is stolen.

+ This is also useful in usecases outside of FSM. Example: I have 3 shops (= 3 warehouses), each employee works in a different shop, the default warehouse set on the Sales Order should be the default warehouse of the salesperson. So this should be done sale_stock (and not in FSM)

Specifications
===========
Add a 'Default Warehouse' field on the user only visible if :

- sale_stock is installed
- the 'multi-warehouses' feature is enabled
- domain should only include warehouses which belong to a company the user has access to
- not required

The field should be editable by a user on his own profile and by the admin on all users.

When creating a FSM task from scratch, adding some products creates a SO, the warehouse on the SO should be the default warehouse of the user set on the FSM task.

On SO creation,  set the 'default warehouse' selected on the user assigned to the SO. If there isn't any 'default warehouse' set on the user, fallback on the current behavior (warehouse with
lowest sequence)

The field on the res.user should be a property field to allow multicompany usage.

Task : 2166382

closes odoo/odoo#44257

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-05 17:00:16 +01:00
jdoutreloux b30e280b2d [IMP] sale_stock : add warehouse_id field on user form
We had a default warehouse_id on the users to allow
a better stock managment based on the sale person.

The warehouse_id on a sales order is now computed from
the property_warehouse_id field on a user.
If the user doesn't have a property_warehouse_id set
the warehouse_id on the sales order is the one with the
smallest sequence number in the company of the SO.

Task-2166382
2020-02-05 10:59:38 +01:00
Xavier Morel de590816d8 [FIX] *: deprecated access to url_ utilities through werkzeug root
In 0.15 accessing werkzeug.urls functions directly through werkzeug
is deprecated, the shortcut will be removed in the eventual werkzeug
1.0.

Fix existing uses of these shortcuts. Also cleanup some imports when
they're not far from a werkzeug* import being altered.
2020-02-04 12:42:35 +00:00
Martin Trigaux 65530dfd6a [ADD] *: add ir.model.access on all transient models
Following changes needing ir.model.access on transient models too.
Remove groups declaration on the action to move it to ir.model.access
when possible.
Rules are strict by default with no unlink access by default and high
priviledge asked. Adaptations may be needed later.
Write access is given as a wizard may need to be modified in case the
action triggers an error and the user has to correct a value

account*: use account.group_account_user for all transient by default
	  remove account.print.journal relic
stock*: use stock.group_stock_user by default
survey: survey user can send invitations
mail: allow any employee to execute wizards
      additional verifications are made to ensure they are executed
      only on the documents the user has access to you
      give portal access to mail.compose.message as portal still does
      some actions like posting messages on the forum
      add ir.rule to avoid reading somebody else messages
      increase the query count because of undeterminist count
crm: saleman for lead2opp, manager for massmailing
     partner manager for actions linked to partners
     avoid a write in test_lead_lost
sms: any employee can send sms
mrp: mrp user can execute wizards
     give unlink access as making write during do_produce operation
base_import: employees can import files
delivery: stock user can deliver
event_sale: sale user can configure the wizards
	    event user inherit from  sale rights
gamification: employee can give badge
google_service: resolve FIXME
hr: add specific rights
    manager can set a plan according to group on button
    anyone who can write on an employee can register a departure
hr_expense: set rights based on buttons
hr_holidays: an approver can make a summary report
hr_recruitment: recruiter can refuse a candidate
hr_timesheet: can use the wizard if can create a timesheet
l10n_eu_service: managers can create fiscal positions
mass_mailing: same group as on mass.mailing.list
membership: accountant can create invoice from membership
payment: accountant can create a link
	 as the source is an account.move
	 keep the payment.acquirer.onboarding.wizard to system user
	 only as it is called during company configuration
point_of_sale: PoS manager only can use wizards
	       never create closing_balance_confirm_wizard records
product_expiry: stock user has rights on stock.picking
product_margin: access from accounting menus
repair: same rules as for above models
sale: set ir.rule for self wizard only
      add rule from model introduced in payment to add salesman group
sale_crm: saleman can create a quotation from a lead
sale_coupon: any saleman can generate coupon
	     add self ir.rule
sale_product_configurator: salesman can select product variants
snailmail: employee can send letters
website: designers can write on website
website_crm_partner_assign: same rule as group on action
website_sale: sale ACL as for payment.acquirer.onboarding.wizard
website_slides: anyone can send invitation

base: base.language.*: allow employee (cf lang_install)
      change.password.user: can not read change password wizard of
      other users
      test.*: no access is needed

Courtesy of Damien Bouvy, William Andre and Antoine Prieëls for review
of acl
2020-02-04 17:54:18 +01:00
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