Commit Graph
126133 Commits
Author SHA1 Message Date
Thibault Delavallée 00bf73cd4a [IMP] website_profile: add a specific route to access avatar of users
Purpose of this commit is to give a specific route to access users image
used as avatar in profile and various frontend applications.

Indeed current web/image controller basically checks record access rights
with current user. However in some cases we want to display user avatars
even if current user cannot read user records, which is generally the case.
Indeed res.users is a private and technical model.

To solve that issue we add a controller for avatar. Basically published
and frontend active user avatars are available.

This commit is linked to task ID 1936153 and PR #30770.
2019-02-15 09:57:46 +00:00
Thibault Delavallée cab98785e9 [IMP] website_rating: improve popup / composer rating display
This newly introduced widget for rating [1] is very cool. This commit
simple improves a bit the display and have the stars + review button
displayed as a small one liner to take less place when displayed.

This commit is linked to task ID 1936153 and PR #30770.

[1] See https://github.com/odoo/odoo/commit/4cb228d823e0346e6052091d397249b8e39d576b
2019-02-15 09:57:46 +00:00
jem-odoo d233ac239d [FIX] website_rating: default value is not 'false' in composer
When website_rating is installed, all frontend chatter will have
the string 'false' by default in the composer. This commit fixes
that, restoring the placeholder

closes odoo/odoo#31097
2019-02-14 15:27:35 +00:00
jem-odoo 8ad65abd00 [IMP] website_slides: allow comments on slides
With this commit, the user can activate review on channel content when
creating a channel from frontend, or editing it from backend. Once
activated, the comment tab below the slide content will allow user
to post a comment with optional rating.
The way of commenting is different regarding channel type:
- documentation: user can post comment and vote (list/dislike) on
slide content
- training: user can post comment with review (rating)

Task-1902304
2019-02-14 15:27:35 +00:00
jem-odoo 1878ea95fe [IMP] website_slides: allow to set cover image for webpage slide
Before this commit, the user can only create a webpage slide
by setting its name, category and tags. On the channel grid,
no tumbnail was shown.
This commit allow the user to upload a cover image from the
slide upload modal and to modify it from form view. the
mimetype of webpage slide is now 'forced' through the
modal to 'text/html' to avoid conflit with 'image/png'
when setting the cover image.

Task-1902304
2019-02-14 09:32:43 +00:00
Martin Geubelle 70606f5285 [IMP] hr_payroll: add gantt view for benefits
closes odoo/odoo#30263
2019-02-14 16:44:40 +00:00
57b5e8d9f5 [IMP] base, doc: adapt according to the new gantt view
The view has been rewritten from scratch so the doc and the RNG validation
needed to be adapted.

Co-authored-by: dmo-odoo <dmo@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
Co-authored-by: jat-odoo <jat@odoo.com>

See odoo/enterprise#3437

Task 1856235
2019-02-14 16:44:40 +00:00
Christophe Matthieu b49745e52d [IMP] web_editor: lazy load the wysiwyg
Issue: wysiwyg asset slow down the loading of the website, error
inadvertently introduced: https://github.com/odoo/odoo/pull/29775

The assets are now loaded assynchroneously, when the editor is needed,
its assets will be loaded.

closes odoo/odoo#30700
2019-02-14 15:11:19 +00:00
7daa85dd12 [IMP] base,product,website_sale,*: improve product images
* = account, purchase, website_sale_comparison, website_sale_wishlist

Raw Image & Mixin
=================

Previously, the main image from a product was stored resized. This caused
inconsistencies with the size of the images on ecommerce: the main image was
resized, but the extra images were not.

Now, we always store all raw images, thanks to the new mixin. This way, product
images that were created before the installation of ecommerce will be ready to
be used in ecommerce without any other change.

We also store the resized versions instead of computing them on the fly: this
will take more disk space, but significantly increase the speed of the
pages when displaying images, as well as reduce server CPU load.

Images on variants
==================

Previously, it was only possible to set the extra product images on a template,
and not on a variant.

Now, we allow extra images also on the variants, this gives more flexibility to
the user.

Both extra images on template and variant have been given a sequence field to be
able to sort them easily.

On /shop we always display the image of the template for performance reasons.
On /product we never display the image of the template, unless the variant has
no image, then the template image is the fallback.

Carousel
========

The carousel view has been cleaned and improved:

- remove the duplicate XML that was created with the product configurator fix
- use a single loop from a single source to get all the images, instead of
	merging the different sources in the view with complex conditions
- improve the HTML structure, reduce the CSS with appropriate classes

Preview Image
=============

Both in website and backend: make better use of `preview_image` to display
a small image whenever possible, to reduce download size for the end user.

task-34045
PR: #30656

Co-authored-by: Parth Gajjar <pga@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-02-14 16:37:25 +00:00
Sébastien Theys 413c63556f [IMP] tools,base,web: improve image tools
Add support for a 256*256 image, to be used in the following commit.

Define sizes in named variables instead of being hard-coded in several places in
the code.

Allow parameters `preserve_aspect_ratio` and `upper_limit` to be passed from
the different helper methods.

Factorize the code inside `image_resize_images` to make it easier to read.

Add new function to compute whether the size of an image is above a given size.

task-34045
PR: #30656
2019-02-14 16:03:09 +00:00
Dharmraj Jhala 38843624d4 [IMP] web: allow preview_image option for image widget of qweb field
With this option we can define which field is going to be displayed by the qweb
image widget, while logic is still applied to the original field.

For example, we want to show a thumbnail image but when user updates it with the
web editor, we want to update the actual field instead of the thumbnail field.

This is similar to the preview_image of the JS image widget.

task-34045
PR: #30656
2019-02-14 16:03:08 +00:00
Robot Odoo 1f2766a955 [IMP] Add employee profile
[IMP] hr_*: introduce the employee profile
================================

## General Purpose

We want an 'Employee profile' gathering every data about an employee.
The main form view is modified to become this employee profile.
A user can also see his own profile through the Preferences menu.
The new profile replaces the current Preferences view if the `hr` module is installed and the current user is linked to an employee. The Profile will show the employee of the current company.

A user should be able to see and edit his own profile.

*Problem*:
Many fields on hr.employee are protected by `groups="hr.group_hr_user"`.
Therefore, a regular user cannot see or edit those fields.

This protection must be bypassed to allow read/write access to the regular user's own data.
A similar mechanism already exists for `res.users` (for Preferences)

The better (least worst) solution found is to reuse this mechanism by adding related fields on `res.users`.

Pros:
- Don't change security access on hr.employee
- Don't implement yet another custom security layer, risking to add new security breaches
- A lot of fields are added by other modules on hr.employee.
  It would have required to integrate them with the custom security layer.
- Fields added by other modules on the user's preferences view (normal view, not the profile)
  are automatically included in the employee's profile view.
- Allow the hr.employee form view to be different than the user profile accessible
  through the Preferences menu.
  E.g. add custom buttons only relevant to the logged in user such as "Request a leave".
Cons:
- Each field from hr.employee that you want to appear on its profile
  must be added as a related field on res.users
- Those related fields must be added to user's preferences view (duplicate views)
- They also must be added to `SELF_[READABLE | WRITABLE]_FIELDS`

Note:
When the front-end loads the views it gets the list of available fields for the user (according to its access rights). Later, when the front-end wants to populate the view with data, it only asks to read those available fields. However, in this case, we want the user to be able to read/write its own data, even if they are protected by groups (groups are kept on the related fields on res.users). The front-end need to be made  aware of those fields by sending all field definitions.

## Changed modules

### hr_attendance

Adds a stat button to this employee profile showing the number of hours worked last month.

Remove the Boolean computed field `manual_attendance`.
This field is just a shortcut to add/remove the employee's user in the "Manual Attendance" group.
The checkbox is confusing on the employee's form and this should be done through the normal group management screens.

### hr_presence

Display the presence status on the employee kanban template.
The status is a colored chip which can be green (present), orange (to define) or red (absent).

Currently, the presence status is only computed when accessing the report view. As this commits displays it on the employee kanban, it should be updated more frequently.
The state should not be updated every time the kanban view is loaded since the computation is a bit heavy. Instead: add a cron to update status every hour.
-> The status is accurate on the report view (status is still updated
   when loading the view)
-> The status in accurate at 1 hour on the kanban view

### [ADD] hr_attendance_presence

Bridge module between `hr_attendance` and `hr_presence`.

This PR integrates `hr_presence` module in the employee profile and adds the presence status on the employee kanban view. But `hr_attendance` adds at the same place a similar status icon for checkin/checkout.
This bridge module makes the status from `hr_presence` invisible as `hr_attendance` should be the main presence control mechanism.

Also, this commit adds the ability (through a new setting option) for `hr_presence` to take into account checkin/checkout to determine the presence status.

### l10n_be_hr_payroll
integration with employee profile

[ADD] hr_skills: Introduce a new module for employee resumé and skills
=======================================================

Purpose
-----------

Consultancy companies need resumé and skills of their consultants.
For big projects, they often need to send them to their customers.
These information are also useful to statistics.

Specification
-----------------

### New models

####  `hr.resume.line.type`
Types of resumé lines. e.g. *Experience*, *Education*, *Hobbies*

#### `hr.resume.line`
It is a line in the resumé of an employee.

#### `hr.skill`
Name of a skill. e.g *French*, *Python*, *Piano*

#### `hr.skill.type`
Skills can belongs to a particular type. A skill type has skill levels associated.
e.g. *Languages*, *Dev*, *Music*

#### `hr.skill.level`
Levels available for a particular skill type. Each level has a label
and a progress (between 0 and 100) associated.
e.g. *Intermediary (20%)*, *Advanced (85%)*, *Expert (100%)*

#### `hr.employee.skill`
These are skills which employees have. It links an employee with a particular skill
and level.
e.g. Mitchell has an *Intermediary* level in *Python*

### Access Rights

Only a `hr_user` can create/edit `hr.resume.line.type`, `hr.skill`, `hr.skill.level`, `hr.skill.type`.
If employees are allowed to edit their infos (setting), they can also create/edit `hr.resume.line`,
`hr.employee.skill` for themselves.

### UI

Resumé lines are displayed, grouped by type, in a new 'Resumé' tab in the employee
form. Resumé lines can be reordered (handle widget)

Emloyee skills are displayed in the Resumé tab, grouped by skill type.

[IMP] hr, hr_holidays, hr_expense: Change onchange parent_id behaviour
=========================================================

Purpose
-----------

When the manager (parent_id) of an employee changes, it doesn't always mean that other responsibles (Leave responsible, expense responsible, coach) should also change.

Specification
-----------------

When changing the employee's manager, the leave responsible, the expense responsible and the coach should be changed only if the field was not set or if the responsible is the previous manager. In that case, they should be set to the new manager. Otherwise, it means the field was most probably set manually and it should be left unchanged.

Task 1913089

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#30502
2019-02-14 19:09:34 +01:00
Lucas Lefèvre bad9190730 [FIX] hr_holidays: reload dashboard on new allocation
When a new allocation is requested from the leave dashboard,
the page is not reloaded. Therefore the displayed data is not
up to date with the new allocation count.

This commit makes the page reload after each new allocation.
2019-02-14 16:28:55 +01:00
Lucas Lefèvre 8e14972830 [ADD] hr_skills: Introduce a new module for employee resumé and skills
Purpose
=======

Consultancy companies need resumé and skills of their consultants.
For big projects, they often need to send them to their customers.
These informations are also useful to statistics.

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

New models
----------

1/ `hr.resume.line.type`
Types of resumé lines. e.g. *Experience*, *Education*, *Hobbies*

2/ `hr.resume.line`
It is a line in the resumé of an employee.

3/ `hr.skill`
Name of a skill. e.g *French*, *Python*, *Piano*

4/ `hr.skill.type`
Skills can belongs to a particular type. A skill type has skill levels associated.
e.g. *Languages*, *Dev*, *Music*

5/ `hr.skill.level`
Levels available for a particular skill type. Each level has a label
and a progress (between 0 and 100) associated.
e.g. *Intermediary (20%)*, *Advanced (85%)*, *Expert (100%)*

6/ `hr.employee.skill`
These are skills which employees have. It links an employee with a particular skill
and level.
e.g. Mitchell has an *Intermediary* level in *Python*

Access Rights
-------------

Only a `hr_user` can create/edit `hr.resume.line.type`, `hr.skill`, `hr.skill.level`, `hr.skill.type`.
If employees are allowed to edit their infos (setting), they can also create/edit `hr.resume.line`,
`hr.employee.skill` for themselves.

UI
--
Resumé lines are displayed, grouped by type, in a new 'Resumé' tab in the employee
form. Resumé lines can be reordered (handle widget)

Emloyee skills are displayed in the Resumé tab, grouped by skill type.
2019-02-14 16:28:55 +01:00
Lucas Lefèvre d77ce4c2a9 [IMP] hr_*: introduce the employee profile
General Purpose
===============

We want an 'Employee profile' gathering every data about an employee.
The main form view is modified to become this employee profile.
A user can also see his own profile through the Preferences menu.
The new profile replaces the current Preferences view if the hr module is installed
and the current user is linked to an employee.

A user should be able to see and edit his own profile.

*Problem*:
Many fields on hr.employee are protected by groups="hr.group_hr_user".
Therefore, a regular user cannot see or edit those fields.

This protection must be bypassed to allow read/write access
to the regular user's own data.
A similar mechanism already exists for res.users (for Preferences)

The better (least worst) solution found is to reuse this mechanism by adding related fields on res.users.

Pros:
- Don't change security access on hr.employee
- Don't implement yet another custom security layer, risking to add new security breaches
- A lot of fields are added by other modules on hr.employee.
  It would have required to integrate them with the custom security layer.
- Fields added by other modules on the user's preferences view (normal view, not the profile)
  are automatically included in the employee's profile view.
- Allow the hr.employee form view to be different than the user profile accessible
  through the Preferences menu.
  E.g. add custom buttons only relevant to the logged in user such as "Request a leave".
Cons:
- Each field from hr.employee that you want to appear on its profile
  must be added as a related field on res.users
- Those related fields must be added to user's preferences view (duplicate views)
- They also must be added to SELF_[READABLE | WRITABLE]_FIELDS

Note:
When the front-end loads the views it gets the list of available fields
for the user (according to its access rights). Later, when the front-end wants to
populate the view with data, it only asks to read those available fields.
However, in this case, we want the user to be able to read/write its own data,
even if they are protected by groups (groups are kept on the related fields on res.users).
The front-end need to be made  aware of those fields by sending all field definitions.

hr_attendance
=============

This commit integrate attendance in the new employee profile.
It also adds a stat button to this employee profile showing
the number of hours worked last month.

Remove the boolean computed field 'manual_attendance'.
This field is just a shortcut to add/remove the employee's user
in the "Manual Attendance" group.
The checkbox is confusing on the employee's form and this should
be done through the normal group management screens.

hr_presence
===========

Display the presence status on the employee kanban template.
The status is a colored chip which can be green (present),
orange (to define) or red (absent).

Currently, the presence status is only computed when accessing
the report view. As this commits displays it on the employee kanban,
it should be updated more frequently.
The state should not be updated every time the kanban view is loaded
since the computation is a bit heavy. Instead: add a cron to update
status every 15 minutes.
-> The status is accurate on the report view (status is still updated
   when loading the view)
-> The status in accurate at 15 minutes on the kanban view

[ADD] hr_attendance_presence
============================

Bridge module between hr_attendance and hr_presence.

This commit integrates hr_presence module in the employee
profile and adds the presence status on the employee kanban view.
But hr_attendance adds at the same place a similar status icon for
checkin/checkout.
This bridge module makes the status from hr_presence invisible as
hr_attendance should be the main presence control mechanism.

Also, this commit adds the ability (through a new setting option)
for hr_presence to take into account checkin/checkout to determine
the presence status.

l10n_be_hr_payroll
==================
integration with employee profile
2019-02-14 16:28:54 +01:00
Aaron Bohy 9342b048bf [IMP] web: SearchPanel: default filter values in context
Before this rev., it was possible to specify default values for
categories (fields with attribute select="one") in the context
(e.g. searchpanel_default_fieldname: 5). It is now possible to
specify default values for filters (select="multi") as well
(e.g. searchpanel_default_fieldname: [1,2]).

closes odoo/odoo#31107
2019-02-14 13:11:56 +00:00
Aurélien Warnon 2d83482b9f [FIX] website_slides: count non-members views as public views
Task #1940360
Subtask of #1902304

Purpose
=======

Slide views made by non-members of the channel (typically the website_publisher
designing the survey) should be counted in the "public_views".

closes odoo/odoo#31096
2019-02-14 09:09:20 +00:00
wan 4bad80b346 [IMP] account_check_printing: filter reconciliation with check number
Task 1881964
Allow to search for counterparts with a check number

closes odoo/odoo#31095
2019-02-14 09:22:05 +00:00
wan 5f9f7eb2bd [REV] account: filter reconciliation with check number
This reverts commit 32048e418c63a2efc9339b7ec1a307c406b52d04.
The field check_number is not defined in a default package but in account_check_printing
2019-02-14 09:21:45 +00:00
Arnold Moyaux cb618e9a99 [IMP] stock: _assign_picking in batch
Only search once for batch of moves that should be assign
to the same picking and assign them all at once.
Since the moves are processed in batch for a picking
commit 8fe8ca9 is not needed anymore.

closes odoo/odoo#30699
2019-02-14 11:09:07 +00:00
Arnold Moyaux b328ddda20 [IMP] mrp: MO confirm and create raw moves in batch
Production order are created in batch. Confirm them and
create their componenets moves in batch also. Adapt _get_moves_raw_values
method in order to be multi. action_confirm was already multi.
2019-02-14 10:19:21 +00:00
Arnold Moyaux 8c769cb40c [FIX] purchase_stock: _run_buy check supplier qty
Usecase to reproduce:
- Product with routes MTO and BUY
- Add a supplier on a product with a min qty of 5
- Create a SO with a qty of 1

A PO is created with the supplier and a quantity of 1. It should return
an error since there is no suppliers that sell with this quantity.

It happens because _run_buy directly use the suppliers on the product
without check for date and minimal quantity.
This commit replace it by _select_seller that manage every details.
2019-02-14 10:19:21 +00:00
Arnold Moyaux a2a6b099a4 [REF] stock, stock_*: procurement batch by rules's actions
Improve the procurement requests performance. Instead of processing
procurement request one by one, search rules that apply for each of
them and group them by rule's actions.

The main technical change is the record creation order.
E.g. 2 SO lines with pick ship delivery.
-Before this commit:
line1 -> LAUNCH_RULE -> PICK MOVE1 -> MOVE1 CONFIRM -> OUT MOVE1
line2 -> LAUNCH RULE -> PICK MOVE2 -> MOVE2 CONFIRM -> OUT MOVE2
-After this commit:
line1/2 -> LAUNCH RULE -> PICK MOVE1/2 -> MOVE1/2 CONFIRM -> OUT MOVE1/2

Also there is one batch creation by company_id. It implies that values
are group by company_id. Since company_id are passed by previous
procurement or by the rule, it become a required value and it's added to
the procurement arguments (it was already always passed in the values,
no functional modification).

_run_buy is reworked. It receives a bathc of procurements, those
procurements could be merged in the same PO or the same PO lines.
However the PO/PO lines are created (if procurement couldn't be
merged in an existing one) at the end of the method. It implies
that 2 procurements creating a PO and merged inside, would now create
2 distinct PO (same for po lines). _run_buy in order to fix this issue:
- group procurements by PO search domain. If the PO doesn't exist,
create only one.
- Inside the same PO: merge quantities, move_dest_ids for procurements
with the same product and UoM.

Other _run_ methods are just adjusted in order to process batch.

For a pick pack ship scenario, without procurment_jit confirm a SO
containing 500 lines will take 40s instead of 15 minutes.
2019-02-14 10:19:21 +00:00
Lucas Lefèvre c7aa8c5f66 [IMP] mail: allow tracking on groups protected fields
Purpose
=======

Currently fields with a `groups` attribute can't be tracked.
Otherwise changes would be visible by all in the chatter, including
users which normally don't have the access rights because they are
not members of `groups`.

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

Filter tracking field values according to the `groups` attributes.
Users without the access rights should not see them.

If a message is only composed of tracking values and the user doesn't
have the rights to see them, an empty message should not be displayed.
2019-02-13 11:03:33 +01:00
Lucas Lefèvre 0cd13b001a [IMP] hr, hr_holidays, hr_expense: Change onchange parent_id behaviour
Purpose
=======

When the manager (parent_id) of an employee changes,
it doesn't always mean that other responsibles (Leave responsible,
expense responsible, coach) should also change.

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

When changing the employee's manager, the leave responsible,
the expense responsible and the coach should be changed only
if the field was not set or if the responsible is the previous manager.
In that case, they should be set to the new manager.
Otherwise, it means the field was most probably set manually and
it should be left unchanged.
2019-02-13 11:03:33 +01:00
Lucas Lefèvre 1e5778844f [IMP] hr_contract,hr_payroll: Remove unused boolean 'manager' field on hr.employee
The boolean manager field added by hr_contract on the hr.employee model was not used.
This commit removes it.
2019-02-13 11:03:33 +01:00
Arnold Moyaux 973e1b8d42 [IMP] mrp: orderpoint_id passed by procurement
The purpose to set orderpoint_id on MO is to keep the behavior than
purchase_order. It's also a future work for procurement in batch because
after creating a production order, a note is posted with its origin.
Since orderpoint_id was not set on the MO, we would have to keep all
procurements values dict after MO creation and rematch them in order to
log the note with the origin.
2019-02-13 09:02:30 +00:00
Jinal Patel 7e49fda883 [IMP] point_of_sale: Allow to filter partners based on pos orders
Especially used for e-marketing to filter the customers who purchased from store using pos.

Related Task ID: 1931528

closes odoo/odoo#30645
2019-02-13 07:28:08 +00:00
Nimesh Jethva 2d633fc7ac [IMP] mrp : BoM of type kit improvement.
- Hide operation as well as menufacturing readiness when bom type is kit also make help message user friendly.

Task : https://www.odoo.com/web#id=1929631&action=327&model=project.task&view_type=form&menu_id=4720

This commit is related to task ID : 1929631

closes odoo/odoo#30405
2019-02-13 06:16:47 +00:00
Yannick Tivisse 9a8863d01f [FIX] l10n_in: Fix forwardport
closes odoo/odoo#28816
2019-02-13 06:12:39 +00:00
Barad Mahendra 4ef4aa2083 [IMP] payment: Log error message on payment transaction failure
Currently when the payment is initiated there is a message in
sale order for waiting for confirmation.

But when the payment returns an error there is no message on
sales order so it's not clear for the end user that payment
is still pending.

Related Task ID : 58741
2019-02-13 06:12:39 +00:00
Jinal PatelandRohan Patel f735951d5c [ADD] payment_ccavenue: Add new payment acquirer for India
CCAvenue is the most popular payment provider in india.

Co-authored-by: Rohan Patel <rop@odoo.com>

Related Task ID : 58741
2019-02-13 06:12:39 +00:00
Toufik Ben Jaa bed3b4a5cb [FIX] hr_*: access rights issues when changing employee's user
- When changing the user of a `hr.employee` record, access rights errors
  could be triggered.

  Those errors are triggered when a record (for example a leave) is
  linked to this employee and the current user has limited write
  accesses by record rules on this record.

closes odoo/odoo#31032
2019-02-12 15:47:02 +00:00
Nicolas Martinelli 0191b65b25 [FIX] stock: inventory value
- Go to Inventory > Reports > Inventory Valuation
- Select the pivot view

The top row (containing the Total) has an empty 'Inventory Value'.

This is because there is no domain on the line, so it is skipped.

We fall back on the global domain instead.

opw-1933191

closes odoo/odoo#31280
2019-02-20 13:39:36 +00:00
Nicolas Lempereur 8183f92de4 [FIX] web: ie11 autocomplete field no open itself
On IE11, in 10.0 up to master in some instance when creating a record
under some conditions the dropdown may be automatically opened and need
to be closed.

This has been pinpointed to 90c1af1151 so it seem that a combination of
fields/code/autocomplete and changing the placeholder at one time causes
the issue.

Since IE11 lie and say it is mozilla 11.0 we just apply the 90c1af1151
when the browser is chrome (we did no did this at first to have the same
behavior accross browsers).

note: there is an opened bug in chromium https://crbug.com/928305 if
solved the hack could be removed completely.

opw-1940592
closes #31271
2019-02-20 10:39:17 +00:00
Jairo Llopis 2b1d3ff82d [FIX] core: log unexpected validation exceptions
Before this patch, any exception raised by a constraint method that
were not of type `ValidationError` were hard to debug, because the
origin line was never logged.

Explicitly logging the error (with traceback) when we catch it
ensures proper contextual info, even in the absence of exception
chaining.

closes odoo/odoo#28612
2019-02-20 09:47:56 +00:00
Mathieu Duckerts-Antoine 01c159fd9f [FIX] web: quotes and backslashes in search view
The commit 6d3ada178f
aimed to solve problems occuring whith (single or
double) quotes when creating new custom filters.
Unfortunately, the point was missed and bugs were
still present. The present commit solves the
orginial problem satisfactorily.
There was also a problem in the management of
backslashes. Type '\\' in the search bar would
lead to a domain like
[('...', 'ilike', '\\\\\\\\\\\\\\\\')].
This has also been fixed. Note that it is
necessary to input "\\" if one is looking for a
backslash in db (as before).

A remark on the _formatAST function (py_utils.js):

We deescape only the chars `'`, `"`, and `\`
because it does not seem possible to produce a
string in the search view that would intend a
search for a line return or a tab for example.

A general remark:

Domains should always be in normalized form.
In that way they could be manipulated and combined
together without a tokenization/parsing!

closes odoo/odoo#29756
2019-02-12 12:45:51 +00:00
Lucas Perais (lpe) 6d5a993cf7 [FIX] web: control panel load/save filter sort param
Before this commit, the wrong semantics was implemented in the webclient
concerning the "sort" char field in ir.filter
Loading a filter with a sort with negative order made the webclient crash

This field holds a JSON string, representing a list of field names
If the order of the field is inverse, there should be a "-" before it
for legacy purposes

After this commit, the semantics have changed for consistency
that is, at save time the sql notation is preferred
We support the legacy notation too for backward compatibility

closes odoo/odoo#31102
2019-02-15 09:58:47 +00:00
Robot Odoo b923ef6c3f [MERGE] mail: fix performance issues with channel seen feature
Revision on https://github.com/odoo/odoo/commit/844fb2b51ea7cfa557b19466c0a53dde19433e7a

There were some performance issue with this newly added feature.
This was particularly the case on channels with multiple users, therefore
we have decided to only enable it on direct chats for the moment.

Also, we avoid unnecessary writing in DB and sending notification on longpoll
if the seen information of a user is already up-to-date.

closes odoo/odoo#31074
2019-02-15 09:25:06 +01:00
Toufik Ben Jaa 9cd8410f69 [FIX] website_sale: avoid to consider quotations as eCommerce carts
- An eCommerce cart is a quotation linked to a website.
- The feature to consider a cart as abandonned wasn't correctly checking
  if the quotation is linked to a website and flag regular quotation as
  abandonned carts.

  This causes issues since Sales may wish to send the quotation by mail,
  but the button is hidden and replaced by the button "send recovery
  mail" which send an email with a specific email template.

closes odoo/odoo#31103
2019-02-14 16:12:08 +00:00
Alexandre Kühn 8ee218aa5c [FIX] mail: notify channel_fetched/channel_seen only when changes
Revision on https://github.com/odoo/odoo/commit/844fb2b51ea7cfa557b19466c0a53dde19433e7a

With the commit above, when the JS notified on `channel_fetched` and
`channel_seen`, it was always writing in DB and sending notifications
on the longpoll.

This is useless if the information on last fetched/seen message
of the conversation remains unchanged, which is what this commit
solves.

Also prevent `channel_fetched` from seding notifications on
the longpoll if this is called on a non-chat channel.
2019-02-14 12:55:24 +00:00
Alexandre Kühn 62294921b8 [FIX] mail: enable seen feature only on direct chats
Revision on https://github.com/odoo/odoo/commit/844fb2b51ea7cfa557b19466c0a53dde19433e7a

There were performance issue with the seen feature in multi-
user channnels, therefore it has been disabled for them.
As a result, only direct chats have this feature.
2019-02-14 12:55:24 +00:00
Toufik Ben Jaa 4a4101c09c [FIX] oe: allow to add attachments on bank statements
- It was impossible to add attachments on the `account.bank.statement`
  form view due to the chatter not being displayed.

  This commit add the chatter widget to the Bank Statements form view.

closes odoo/odoo#31098
2019-02-14 09:48:18 +00:00
Christophe Simonis 1cc285ee30 [FIX] project: count tasks of child contacts
Allow to have the count to match the one you will get when clicking on
statbutton (behavior changed by #27118).

closes odoo/odoo#31081
2019-02-13 17:22:38 +00:00
Toufik Ben Jaa e8b28c02a0 [FIX] website: server images for website_published records
- When a record has `website_published` field set at True the method
  `binary_content` on `ir.http` should bypass the access rules and
  always deserve the content.

  This wasn't the case due to a mistake on the code. The code is
  checking the access rules and may in some cases not return the
  content.

closes odoo/odoo#31068
2019-02-13 13:48:33 +00:00
Alexandre Kühn 98e3ca4e67 [FIX] mail: throttle batched channel_fetched RPCs
Revision on https://github.com/odoo/odoo/commit/844fb2b51ea7cfa557b19466c0a53dde19433e7a

The commit above added the seen icon on messages in a channel.
However, since this feature, there was a performance issue
when opening the systray messaging menu with several pinned
channels: lots of RPCs are made, almost 1 for each preview
in the messaging menu.

The RPCs comes from the reception of the last message in the
channel, to let the current user notify that he has received
the messages in the channel.
Those RPCs were made for each channel, thus the more pinned
channels the more RPCs were made when opening the messaging
menu.

This commit fixes the issue by throttling and batching the RPCs.
To do so, instead of letting the channel model handle the RPC
`channel_fetched`, the mail service now handles it. This has
the advantage to throttle the RPC globally and to batch the
requests to notify that messages have been received on channels.

closes odoo/odoo#31026
2019-02-12 14:38:32 +00:00
Jeremy Kersten 055ca53c20 [FIX] website_forum: fix traceback where answer is not set
+ add button Comment lost during forum conversion to bs4
+ fix typo t/a
2019-02-12 16:46:31 +01:00
Nicolas Seinlet b90fcdb162 [FIX] sale: avoid false positives in reconciliation match
- ILIKE and other regex operators are not appropriate for the
  comparison, as we need an exact substring match.
  Using POSITION() and looking for position != 0 gives the expected behavior.
- Addiionally, regex operator ~  is not available in PostgreSQL 9.x
- Add regression tests

Closes #30720
2019-02-12 15:56:59 +01:00
Nicolas Martinelli f45609d76b [FIX] hr_expense: multi-currency
- Set your company to USD
- Create an expense in EUR:
  Amount: 100
  Tax: 15% Excluded
- Validate, post the journal entries

It crashes because of a missing `.id`, but on top of that... not a
single AML is correct.

opw-1938570

Fwd-port of ab06e9cad36d7398de709d6a6c994cbbeb7737f4
2019-02-12 15:50:01 +01:00
wan 7a1c8d54b4 [IMP] account: filter reconciliation with check number
Task 1881964
Allow to search for counterparts with a check number

closes odoo/odoo#30593
2019-02-12 12:13:59 +00:00