Commit Graph
128187 Commits
Author SHA1 Message Date
Lucas Lefèvre f6fdde96bd [IMP] hr_*: Improve employee presence state
Purpose
=======
There are currently multiple ways to determine if an employee is presence
or absent:
- login state (user status on chat)
- checkin/checkout from the Attendance app
- leave
- hr_presence (email, ip)
Those states are displayed in several different places and can be inconsitent.
e.g. Logged in -> green in the chat
Not checked in -> red on the employee kanban view.

The multiple ways to determine employee presence described above
should be aggregated together to have a better consistency.

Specification
=============
There are 3 presence states (previously defined in module `hr_presence`),
namely `present`, `absent`, `to_define`. They are now defined as soon as
`hr` module is installed.

The state computation can have several behaviors according to which apps
are installed:

1. `hr` is installed
Check employee presence based on login by default (only for employees with
a user).
Kanban state (private and public): should be green when logged in, red when logged out and
orange when the user is away.
Private employee form: Display a stat button "Connected" on the form view
when the user is logged in or "Last Activity xx/xx/xxx" otherwise.

2. `hr_attendance` is installed:
when the user is logged out, the state
is determined from the checked in/out state. But when the user is logged in,
consider the user as present (even if he checked out).
Kanban state: green for checked in, red for checked out
Private form view: attendance stat button.

3. `hr_holidays` is installed:
Has the highest priority if the employee is on leave.
Kanban state: red if employee is on leave.
Private form view: stat button "Absent Until xx/xx/xxxx" if employee
is on leave.

4. `hr_presence` is installed:
Two additionnal presence checking option: emails sent and IP address connected.
Once a user sent an email or the IP address was connected, he is considered
present for the entire day.

There should be at most one stat button on the employee form view, with the
relevent information.

Task id: 2024482

closes odoo/odoo#34933

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-17 09:11:18 +00:00
Lucas Lefèvre 008634730a [IMP] hr_holidays: Clean leave stat button
1/ Change stat button landing page
----------------------------------
Currently when clicking on the leave stat button
of an employee, the landing page is the leave dashbord of the current
user.

It's more usefull for HR people to land on the reporting
view of the employee.

2/ Remove stat button from public employee
------------------------------------------
It's useless for regular employees to know how
many remaining leave others have.
Hence the stat button is removed from the public
employee form view.
2019-07-17 07:33:11 +00:00
Lucas Lefèvre 0954ead4a6 [FIX] hr_attendance: Allow Marc Demo to checkout
As Marc Demo, at the begining of the month, through
the client action, you can checkin but not checkout.

There is one limitation in the way the attendance state is computed:
It uses the attendance with the most recent checkin date.
Therefore, if an attendance is created in the future, it's the later
attendance which is taken into account, not the current attendance.

Steps to reproduce the problem:

1. Create an attendance in the future with both start and end
date set.

2. Through the client action: checkin

=> the client action stays on the checkin screen because you are
considered as checkout. Hence you cannot checkout.

It's difficult to change the way the state is computed, especially
having the right triggers.

Adding a constraint to avoid attendance in the future is probably a
bad idea. It could unintentionaly fail if the user's time is off by
a few minutes on his computer.

On the other hand, this situation should rarely happen (only when manually
creating an attendance, which has little functional sense).

Solution: Fix demo data to avoid attendances in the future.

Tests needed to be adapted because they used demo data. They no longer
use demo data.
2019-07-17 07:33:11 +00:00
Robot Odoo 1b3db79273 [IMP] gamification, survey : auto create challenge on certification survey badge
This PR allow gaining a badge at the end of a certification survey if succeeded.
The badge can be configured on the survey if the certification mode is activated.

The badge is linked directly to the survey and not the challenge,
because it makes more sense to configure directly the reward on the survey and
not the way to gain this reward. As the way is always the same.
Only one badge can be set on the certification survey.
Only the name, description, image and badge level can be configured.
The rest of badge configuration is automatically set to correspond to the use case.
When a badge is configured on a certification survey, the needed challange, goal
and challenge line are autogenerated.

The badge is available on the user's profile page if he gained it.

Note : To avoid having to create a bridge module only to display the
certification badge on the user's profile page, the default website_published value
of the certification badge is defined directly in the survey module even if
survey does not depend of website. This attribute will be ignored until website
module is installed.

Task ID : 1935136

closes odoo/odoo#31486

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-17 12:09:17 +02:00
asa-odoo c27169f0a2 [FIX] point_of_sale,stock: Change demo data uom
delivery: fix test data

closes odoo/odoo#34934

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-17 06:49:21 +00:00
Damien Bouvy d629f90eb5 [IMP] sale_management: no client reload when adding optional product
Purpose
=======

Avoid a complete reload of the web client when adding a optional
product, which loses searches, breadcrumb, etc.

This is achieved by adding a non-stored 'is_present' computed field
which is computed depending on the presence of a SO line linked to the
option line - that way its is dynamically adapted when the option is
added to the SO. Since we wanted a clear feedback when the option was
added to the quote, green colouring and the disappearance of the 'add
to quote' button have been added.

Note that this field *cannot* be stored - since the line_id field on the
option bypasses the ORM (`set null` for the on_delete attribute), it
would not recompute properly upon deletion of the linked SO line.

Task#1950410

closes odoo/odoo#34929

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-17 05:12:39 +00:00
Kevin Baptiste 81a2ad4e05 [IMP] hr_recruitment: Improve general usability (back2basics)
TaskID: 2033500

closes odoo/odoo#34858

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-17 07:02:01 +00:00
Robot Odoo bd3a553ad9 [IMP] base: Clean language usability
1. base: Load translation when language is activated

Purpose
------
Settings > Translations > Languages > I find the language I want
and I click on stat button to activate it.
Now I set it up on my user, it still doesn't work > the langage has not been loaded !!!

Specification
-------
When activating a language load the translation (and open the load translation wizard)

2. base: Add shortcut button to load language

Pupose
-------
On the res.partner and res.user form view if you want to change
the language, it's not easy to know where I can activate more
langages.

Specification
-----------
Add a small icon next to the language field to activate more
languages (similar interface than to send an SMS).

3. base: Clean res.lang tree view

1. Set limit to 200 to display all current 82 languages
in one page (current limit is 80/82).

2. Move some fields to debug mode.

3. Add a button to directly load a language.

4. base: Remove Load a Translation menu

Activating a language automatically load the translation,
hence the menu is no longer necessary.

5. base: Don't show language if only one active

If only one language is active, don't show in the contact
form view (`res.partner`) the language field. Changing the language is
not possible since there is only one language.
Hence the field is useless and therefore hidden.

TaskID: 2026150

closes odoo/odoo#34661

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-17 09:10:03 +02:00
Lucas Lefèvre a5077b300c [IMP] base: Don't show language if only one active
If only one language is active, don't show in the contact
form view (`res.partner`) the language field. Changing the language is
not possible since there is only one language.
Hence the field is useless and therefore hidden.
2019-07-16 17:28:52 +02:00
Lucas Lefèvre 4f47b729b1 [IMP] base: Remove Load a Translation menu
Activating a language automatically load the translation,
hence the menu is no longer necessary.
2019-07-16 17:28:52 +02:00
Lucas Lefèvre 1796c5d74f [IMP] base: Clean res.lang tree view
1. Set limit to 200 to display all current 82 languages
in one page (current limit is 80/82).

2. Move some fields to debug mode.

3. Add a button to directly load a language.
2019-07-16 17:28:52 +02:00
Lucas Lefèvre 1ce23c5050 [IMP] base: Add shortcut button to load language
Pupose
======
On the res.partner and res.user form view if you want to change
the language, it's not easy to know where I can activate more
langages.

Specification
=============
Add a small icon next to the language field to activate more
languages (similar interface than to send an SMS).
2019-07-16 17:28:52 +02:00
Lucas Lefèvre 410abecd24 [IMP] base: Load translation when language is activated
Purpose
=======
Settings > Translations > Languages > I find the language I want
and I click on stat button to activate it.
Now I set it up on my user, it still doesn't work > the langage has not been loaded !!!

Specification
=============
When activating a language load the translation (and open the load translation wizard)
2019-07-16 17:28:52 +02:00
David Beguin a0fc2210e6 [FIX] mail : enable to start livechat conversation
The public user doesn't have an email address.
To start a livechat conversation, the email of the user that start the
conversation is used. As the conversation was started in sudo,
the system user's email address was used.

But, since changes with sudo() and with_users(),
the public user is not able to start a livechat conversation
as the system email is not used anymore in this case as sudo is not
changing the user but only skip the user's access right.

To start a livechat conversation, and to post a message, at least
email_from must be filled in.
Anonymous name is used to fill in email_from to bypass the checks
and to build the author given back the thread window.
If anonymous name is empty, we fallback on the company's catchall email
from the mail.channel create user.

Pre-required for task ID: 2028059
Fix Task : 2037048
PR #34918

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-16 15:23:36 +00:00
Simon Lejeune ee50b4a20c [REF] stock_landed_costs: enabled for AVCO
mostly thanks to rev 168f4d75ef

task-1985422

closes odoo/odoo#34795

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-16 14:19:41 +00:00
Thomas Binsfeld d7b0e4b5b7 [IMP] point_of_sale: add hook for load_new_partners domain
To be able to change the domain

closes odoo/odoo#32982

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 13:26:45 +00:00
Martin Trigaux 5d57e1862f [MERGE] Forward port of saas-12.4 to master up to beba36416f
closes odoo/odoo#34924

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 15:45:24 +00:00
Martin Trigaux beba36416f [MERGE] Forward port of saas-12.3 to saas-12.4 up to 40421be73c 2019-07-16 16:36:40 +02:00
RomainLibert 02c48e71f0 [IMP] hr_timesheet: Improve general module UX (back2basics)
TaskID: 2025197

closes odoo/odoo#34855

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-16 12:03:42 +00:00
Martin Trigaux 40421be73c [MERGE] Forward port of saas-12.2 to saas-12.3 up to cf8e74a1a7
closes odoo/odoo#34907

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 11:44:38 +00:00
Martin Trigaux cf8e74a1a7 [MERGE] Forward port of 12.0 to saas-12.2 up to 1bd434da34
closes odoo/odoo#34901

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-16 09:14:17 +00:00
Victor Feyens 8f137f66bc [IMP] purchase: responsiveness (+mobile)
> support kanban view for order lines in puchase form view.

closes odoo/odoo#34737

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-16 08:38:30 +00:00
Ravi Gadhia 561829849f [IMP] purchase: add section and note on order line 2019-07-16 08:18:55 +00:00
mgh-odoo 6b7d9901eb [IMP] sale_coupon: add quick search to coupon programs
- after this commit, a user can search for the coupon by name from
the search panel.
- some typo fixed

task-1972686

closes odoo/odoo#34372

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-16 07:45:15 +00:00
RomainLibert f732984da2 [FIX] various: fix typos
In https://github.com/odoo/odoo/commit/8514ef827e1fcc2224aa0f4e6c2849819005c27d
noCreate should have been spelled as no_create to work this commit fixes
that

closes odoo/odoo#34897

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-07-16 07:55:57 +00:00
Martin Trigaux 1bd434da34 [MERGE] Forward port of saas-11.3 to 12.0 up to d8072d54ac 2019-07-16 09:22:49 +02:00
Sébastien Theys 87f2004902 [IMP] product: optimize create_variant_ids by doing batches
Perf for the creation
=====================

The biggest impact of this change is when each template has only very few
variants to generate and there are a lot of such templates.
And when few templates generate a lot of variants this is potentially just a bit
better than before, and not definitely not worse.

The opposite change was done in commit f8dad1bb4b
due to an issue with unlink but since the unlink is changed to use dichotomy now
we have the best of both solutions.

For example when creating 10000 products, few with a lot of variants (max 1000)
and many with few variants (or only one), the time it takes goes down from at
least 10min (the attempt was canceled before the end) to only 25s.

Perf for the unlink
===================

For the following test case:

- create a template
- give it 3 attributes, 10 values each
- -> that generates 1000 variants
- add the first variant to an order to test it
- not happy with the config, remove one of the attributes from the template
- -> that removes the 1000 variants

This is slow because of the `savepoint` used to archive if `unlink` fails.

With dichotomy it takes 14s.
With a loop (one by one) it takes 5min.

Part of task-1918881

closes odoo/odoo#34650

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-15 16:28:35 +00:00
Lucas Perais (lpe) c8d10d228e [FIX] web: boolean widgets in editable list should activate the row
Put toogle_button or a favorite widget to handle a boolean field in an editable list
click straight up on the widget's button or link

Before this commit, the widget changed its appearence, but the changes were not
propagated to the model. This is because the controller will not force_save if its mode is edit
(to let changes piling up and save everything when clicking save), which is the case
of the editable list

After this commit, following what has been done at 2f5e44d40b
clicking on a widget in an editable list just activates the row for editing
but doesn't change the widget's value

OPW 2033700

closes odoo/odoo#34878

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-07-15 13:53:48 +00:00
Hetal Dhanak 044904b9d5 [FIX] purchase_stock: fix traceback upon changing schedule date
previously, when user tried to change the schedule_date, it
was being passed as a string instead of datetime. corrected
that.

Task-2034542

closes odoo/odoo#34873

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-15 13:38:59 +00:00
Martin Trigaux d8072d54ac [MERGE] Forward port of 11.0 to saas-11.3 up to d5dd136ba0
closes odoo/odoo#34872

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 13:32:07 +00:00
RomainLibert 8514ef827e [IMP] various: Make some small tree views editable
Purpose
=======

Some formviews are useless since there are so few relevant fields https://nimb.ws/1EdMV7

For instance, to create a new lost reason the user is forced to:
1. Hit create
2. Type in the name of the record
3. Hit save
4. Go back to the treeview
While he could simply type them away in an editable treeview.

The goal of this task is to allow for creation/edition of records in such models
directly from the treeview.

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

Modify tree views from a given list of models for which the
treeview has to be made editable bottom.

If not specified otherwise, the content treeview should stay the same.

If a field is readonly/required/etc. in the formview, it should be in the
editable treeview as well.

Relabeling has to be done of the field itself, not in the view.

TaskID: 2026126

closes odoo/odoo#34577

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-15 12:47:03 +00:00
Yannick Tivisse 14067543d0 [IMP] uom: Remove parentheses on uom names
Purpose
=======

Parentheses in the label of units of measure sometimes make
reading needlessly uncomfortable.

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

Remove parentheses in the name of every standard uom.uom and hardcoded
occurence on views/field names.

TaskID: 2030444

closes odoo/odoo#34492

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-15 12:57:34 +00:00
Martin Trigaux d5dd136ba0 [MERGE] Forward port of saas-15 to 11.0 up to 1d9f64c91e
closes odoo/odoo#34868

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 11:56:22 +00:00
Xavier-Do dd85e312cd [FIX] core: backport of 62533ec7 and f167ae7d
The ready code warning timeout of 2 seconds can be confusing since
it is triggered just after the 2 seconds. We can log this message
at the end in order to give the real timeout.

In JS tests, when the ready code takes too much time, a warning is
logged. As a consequence, the runbot updates the github status as a
failure, causing real pain to people who simply wants to merge their
features.

With this commit the warning is changed into an info and the runbot will
be happy.

closes odoo/odoo#34865

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-07-15 11:37:14 +00:00
Martin Trigaux 1d9f64c91e [MERGE] Forward port of saas-14 to saas-15 up to 5d4c30cb59 2019-07-15 13:15:12 +02:00
Martin Trigaux 5d4c30cb59 [MERGE] Forward port of 10.0 to saas-14 up to bb712ad701 2019-07-15 13:10:00 +02:00
Ghuen Lee 0ab2a7b373 [IMP] account: allow extension of SectionAndNoteListRenderer
Explicitely return the extension of the listview to allow to modify it
in other modules

closes odoo/odoo#34672

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 10:22:22 +00:00
Shreya Modi 783a9b1921 [FIX] lunch: Allow to create and import products on kanban view
-In Kanban view of products, it should allow to create a
product or import it

task-2032878

closes odoo/odoo#34660

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-15 10:44:37 +00:00
Aaron Bohy aac3059873 [FIX] web: wrap char fields in list views
This fix is similar as 793933a1, but for char fields. It prevents
cells containing char fields with long value from overflowing.

closes odoo/odoo#34739

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-15 09:45:31 +00:00
Goffin Simon 0e44904267 [FIX] stock: Delivery slip with serial number
Steps to reproduce the bug:
- Select template type boxed in general settings
- Select show serial/lot number in Delivery slip (in inventory - settings)
- Print the delivery slip with a non tacked product

Bug:

The delivery slip report displayed wrong columns.

opw:2031985

closes odoo/odoo#34852

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-15 08:43:59 +00:00
Arnold Moyaux ccbd6712f6 [FIX] mrp: MO change the quantity to 0
Usecase to reproduce:
- Create a MO for 5 final units
- Reserve all the components
- Produce 3 units
- Post Inventory (debug mode)
- Edit/Unlock
- Edit a line to consume to an arbitrary amount of quantity
- Change the product qty and set it to 3.

At this point, the reserved quantity and the quantity to consume
still the same than intialy even if the final quantity was updated.

- Mark as done

Then a move is marked as done withtout quantity done and still have
reserved quantity.

It happens because the _update_raw_move function do nothing if the
new quantity to consume is equals to 0.

The arguments returns in _update_raw_move still exists for override
but are not used by the chang_prod_qty method. It's not possible to
cancel the move and then find its parents in order to log the activity.

opw-2023653

closes odoo/odoo#34471

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-15 11:52:47 +00:00
mreficent d9b7cc7ab7 [FIX] purchase: not setting domain is not empty domain
Previous versions of this action had a domain. It was removed at 2d3e6d7383
Set explicitly an empty domain to force the removal when upgrading the module
Similar to 2d03ed43a5

closes odoo/odoo#34581

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 10:02:28 +00:00
Daniel Blanco 0eadcb9c53 [CLA] signature for Blanco Martin & Asociados Signing CLA
closes odoo/odoo#34844

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 08:30:05 +00:00
Grégory Schreiner 6a2be418f9 [CLA] signature for gregory-moka
closes odoo/odoo#34803

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 08:48:10 +00:00
bumanit eab60bd2e0 [CLA] Update bumanit CCLA
closes odoo/odoo#34713

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-15 08:46:00 +00:00
David Beguin ff9c37b08b [IMP] survey : give bagde on survey passed (no cron waiting)
To avoid having to wait the cron that distribute badges to elligible users,
we run the cron manually at the survey passed
if the survey is a certification and if the certification delivers a badge.

Task ID : 1935136
PR #31486
2019-07-15 08:16:43 +00:00
David Beguin be9461bf8b [IMP] gamification, survey : apply badge on certification survey
This commit allow gaining a badge at the end of a certification survey if succeeded.
The badge can be configured on the survey if the certification mode is activated.

The badge is linked directly to the survey and not the challenge,
because it makes more sense to configure directly the reward on the survey and
not the way to gain this reward. As the way is always the same.
Only one badge can be set on the certification survey.
Only the name, description, image and badge level can be configured.
The rest of badge configuration is automatically set to correspond to the use case.
When a badge is configured on a certification survey, the needed challange, goal
and challenge line are autogenerated.

The badge is available on the user's profile page if he gained it.

Once the badge is configured on the survey, he cannot be changed
(remove + create new one), only modified (badge attributes edition).
The only way to remove the badge is to uncheck 'certification_give_badge'.

When removing the badge from the certification survey, all the autogenerated
records (at badge creation) are deleted to avoid ghost records (as they have
no purpose outside of this context). If the badge is owned by someone, the badge
is only archived. If nobody owns the badge, the badge is deleted.

Survey users now have the right to create badges but not challenges or goals.
All the autogenerated records are handled in sudo, to allow the survey user
to configure a badge on their survey.

Note : To avoid having to rewrite the complete context in an xpath expression
only to display the certification badge on the user's profile page,
the default website_published value of the certification badge is defined
directly in the survey module even if survey does not depend of website.
This attribute will be ignored until website module is installed.

Task ID : 1935136
Closes PR #31486
2019-07-15 08:16:43 +00:00
David Beguin 3e5d2e7942 [FIX] website_profile : fix text wrap for badge card in user profile
Task ID : 1935136
Closes PR #31486
2019-07-15 08:16:43 +00:00
Nicolas Seinlet 99b22078de [IMP] point_of_sale: pos order report performance
This inner join permit to have filters on orders to be executed earlier in the query plan
In a multi-company environment with millions of pos lines, the difference is about 10% faster
As you cannot have a line without order, this doesn't introduce reggression.

closes odoo/odoo#34849

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-15 08:01:12 +00:00
Nicolas Vannieuwerburgh 43bec98da8 [FIX] hr_timesheet_attendance: Allow update module
In PostgreSQL, we can't CREATE OR REPLACE VIEW if there is the type of the column change.
To fix it, just drop the view before creating it

closes odoo/odoo#34851

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-15 07:04:26 +00:00