Commit Graph
146121 Commits
Author SHA1 Message Date
Nicolas Bayet 4c1c38bb85 [FIX] web_editor: allow iframe on website builder
On website, if an iframe was in the page, the iframe was removed
when calling the redo command of the insertion of the iframe (and
also other cases).
 The reason is because of a sanitization process that is usefull only
 in a collaborative context.

 This commit disable the sanitization when the collaboration is not
 active.

task-2670597

closes odoo/odoo#79056

X-original-commit: 2b9595a1f2d8ee1c019751d4cb080fe9b9f4c05c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 11:56:10 +00:00
Bruno Zanotti c06f4ff321 [FIX] l10n_ar: doc types active field no updatable
We create the document types data with a csv file, but the active field
should be not updatable so the users could active or inactive records.

closes odoo/odoo#78587

X-original-commit: a7ea6f2118ba6555c0391d1941ebfa87b59b43a0
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-10-27 11:56:02 +00:00
Tiffany Chang (tic) 3b48029022 [FIX] mrp: don't default additional components "To Consume" to 1
Previous PR: odoo/odoo#69483 changed the default 'product_uom_qty' from
0 to 1. This was intended for Planned Transfers that are still draft to
default the demand to 1. Unfortunately this made it so new lines added
to confirmed MOs would default their "To Consume" to 1 even when the MO
is locked and the form says 0 (value would auto-switch to 1 after
saving). This commit makes it so the added lines correctly save as 0
again.

closes odoo/odoo#79041

Task: 2677212
X-original-commit: 56a05aeed64b36ca34ff6466c2b890951bdfbc61
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-10-27 07:23:54 +00:00
Thibault FrançoisandThibault Delavallée de10f6093f [FIX] crm: Fix lead multicompany issue
Context
-------

Leads get assigned a different company than the one defined on the salesman
after being merged with another lead.

This happens because some leads assigned to a user_id have no company set. They
are merged with leads that receive self.env.company during assigment to the
to the team and then get merged with the lead without company. So the company
of the new lead is written on the old one.

Behavior before this PR
-----------------------

When the crm.team have the field company_id = False
With the following flow

 1) Create a lead without a user_id and a team_id
 2) Assign a team to the lead
 3) Assign a user_id

The status of the company field on the lead is the following

 1) set the company of the env.user
 2) Keep the company of the lead
 3) set the user company if the current company is not one of the allowed
    company of the user

Behavior after this PR
----------------------

 1) set the company of the env.user
 2) set the company of the team even if it's False
    (so erase the company if the team has no company set)
 3) set the user company if the current company is not one of the allowed
    company of the user

Other changes
-------------

When resetting team and user: void company to avoid having leads without
any information but a company set. It eases assignment.

Task-2520276

closes odoo/odoo#78860

X-original-commit: ff2a6949c3a59be98cd1849e7a2e38c6ccc3187e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
Co-authored-by: Thibault François <tfr@odoo.com>
2021-10-27 06:39:50 +00:00
Thibault FrançoisandThibault François d3f35714f6 [IMP] crm: add tests for current MC behavior
Purpose of this commit is to highlight current behavior of multi company
in lead. Notably a company is set at creation even when no team or user
is set, leading to a lot of issues when dealing with lead merge or convert.

Task-2520276

X-original-commit: dc8d82bbe032cef2f732fdfb1ded3068edc37371
Part-of: odoo/odoo#78860
Co-authored-by: Thibault Delavallée <tde@odoo.com>
Co-authored-by: Thibault François <tfr@odoo.com>
2021-10-27 06:39:50 +00:00
William Braeckman 99b1c30c6a [IMP] hr_recruitment: find duplicate applications ignoring case
Improves the application count compute by ignoring case when matching
applications by email.

TaskId-2669835

closes odoo/odoo#78541

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-27 05:54:40 +00:00
Kartik Chavda 9e0621db01 [IMP] project: improve follow and unfollow functionality for project
Currently, unfollowing a project removes the user from all the tasks he was
following. Conversely, following a project or updating your notification
preferences makes the user a follower of all the tasks of the project without
distinction. These consequences are a bit extreme in case the user misclicked,
or simply decided he no longer wanted to be a follower of every newly created
task.

In this commit, when unfollowing a project should not remove the user from
the followers of all the tasks, and following a project should not add the user
to the followers of all the existing active tasks, neither should updating the
user's notification preferences But if the user explicitly update the user's
notification preferences for the project then its propagated to all the tasks
that the user is currently following.

closes odoo/odoo#67142

Task-id: 2440659
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-26 20:25:04 +00:00
william-andre 498284dc13 [FIX] l10n_au: ABN number for demo company
The number that was there before was a TFN, not an ABN because of
confusion between those two tax numbers.
See
https://github.com/arthurdejong/python-stdnum/commit/cc3a970e893ebe6635982bcd49c48e6549cb5ac3
https://github.com/odoo/odoo/commit/a72f7222c9f5987a20461be9c837e3de73801ff7

closes odoo/odoo#79040

X-original-commit: 755c074a1e4a17e3947d1017446e0d58e2ecacb3
Signed-off-by: Laurent Smet <las@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-26 19:40:59 +00:00
Rémy Voet (ryv) 88bacad9a0 [FIX] stock,mrp: fix confusing labels
"Material Availability" vs "Component Availability" label means
the same thing but it shouldn't.
- Rename these and add a help string for both fields.
- Change decoration to be green if the MO Readiness is
'ready'.
- The logic of `_compute_*_availability` doesn't take in account the
'ready' `(reservation_)state` to distinct clearly both fields
(`(reservation)_state` vs `*_availability`)

task-2668922

closes odoo/odoo#79033

X-original-commit: acc385137a6a59f3632d91a7fcabd5ab42e8bc7f
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-10-26 19:40:56 +00:00
luvi 29f83c0306 [FIX] web: missing template when editing ControlPanel
This fix adresses an issue when editing the control panel from Owl based views.
Currently, if you don't have a custom search to an Owl view, the template editor will appear blank as the component misses its searchViewId value from its props.
The commit also introduce a test when clicking the edit ControlPanel button in that case.
With the fix, you can edit the search template and get the default template

closes odoo/odoo#79023

X-original-commit: f5c8e855f07d68a34dccd9977b53999911a66f62
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-26 19:40:51 +00:00
Laurent Stukkens (LTU) 3384e4aee2 [IMP] project: add task dependency test
This commit adds a python test for the task dependencies.

task-2663173

closes odoo/odoo#78980

X-original-commit: a71862fb86e6eef801093add300c2668458aa964
Related: odoo/enterprise#21887
Signed-off-by: Xavier <xbo@odoo.com>
2021-10-26 19:40:46 +00:00
Fabio Barbero 44e5f0cd2c [IMP] event_*, website_event_*: improve UI
Purpose
=======
Give the user a better experience when handling events by removing
useless views and using coherent names of fields.

Specifications
==============
Add placeholders in multiple fields, change names in event_event module
to be more consistent with each other, remove and add filters/measures
in events and tracks.

Task-2646692

closes odoo/odoo#77389

Related: odoo/enterprise#21294
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-26 19:40:39 +00:00
Raphael Collet aa0cdacced [FIX] core: related field attributes
A related field copies the attributes from its target field, except for
the attributes defined on the related field itself.  The implementation
of this feature was not working properly for attributes with a truthy
default value.

closes odoo/odoo#79025

X-original-commit: dec4a7ec478fa02f19dee8c8426c88d17dc3c7f3
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-10-26 16:06:48 +00:00
William Braeckman e8dc76ee0b [IMP] lunch: add possibility to notify users on lunch arrival
There was no way for the lunch manager to notify users that their meal
had arrived prior to this commit besides manually sending a message to
the concerned users.
There now is a dedicated button after the order has been confirmed by
the lunch manager to send notifications.

TaskId-2587476

closes odoo/odoo#78649

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-26 14:11:00 +00:00
William Braeckman 93cd3d295f [IMP] hr_attendance: improve overtime display on attendance closing
Improves on the display when closing an attendance to display today's
overtime aswell as the total overtime the employee has.

Also small cleanup, remove unused variable.

TaskId-2655689

closes odoo/odoo#77841

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-26 14:10:56 +00:00
William Braeckman 4a29ba94ad [IMP] hr_holidays_attendance: improve leave_type name_get
The name_get for leaves types would previously not show the number of
hours available to the user for the extra hours time off type.
This commit adds that special case of time off type.

This commit also improves the leave_type name_get overall, by allowing
the hours to be display upon initial loading when requesting new
leaves/allocations properly.
Thanks to this change we do not need to display the number of extra
hours available at all time in the form views.

TaskId-2655689

Part-of: odoo/odoo#77841
2021-10-26 14:10:56 +00:00
Mohammed Shekha d4727f4424 [FIX] web: support readonly attribute on toggle_button widget
before this commit: applying readonly attribute on toggle_button doesn't work,
toggle_button still clickable and value is still changed even though widget is
readonly, there is no effect of readonly attribute on toggle_button widget.

after this commit: if toggle_button widget has readonly attribute then it will
not be clickable, button of toggle_button will be disabled so that user can
easily understand that element is not clickable.

task-2339995

closes odoo/odoo#79012

X-original-commit: 74d42d4a328c517d0ced56d9e437fb40b00a14d0
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-26 13:23:24 +00:00
Tiffany Chang (tic) bc840e2431 [FIX] purchase: correct amounts for purchase report multi-company/currency
Selection of multiple companies to view multi-company data was added
in v13, but at the time there was no way to have reports correctly
take into account currency rates when also working with multi-currency.
v14 onwards is able to correctly apply the currency rates, therefore we
fix the purchase report to do so.

Steps to reproduce:
1. Start with existing demo data + add a new company with currency = EUR
2. Activate multi-currencies + set a currency rate (not 1) for Euro to $
3. Open Purchase Report (Purchase > Reporting > Dashboard)
4. Activate demo company + new EUR company
5. Switch between USD and EUR company as selected company

Expected result:
  Dashboard monetary quantities switch between $ and EUR, i.e. both the
  amount changes according to current exchange rate and symbol.

Actual result:
  Currency symbol changes, but amount stays the same.

closes odoo/odoo#79001

X-original-commit: 083a3776835b471dbbd6dedc44f233a6cf5d7cc8
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-10-26 13:23:20 +00:00
Alvaro Fuentes 0e0fde5cc7 [FIX] stock: fix search default property for missing locs
It may happen that there is a property defined on some field that is not
the default property, but rather the property associated to a record.
For example
```
=> select id,name,company_id,fields_id,value_reference,res_id from ir_property where name like '%property_stock_inventory%'
+------+--------------------------+--------------+-------------+-------------------+----------------------+
| id   | name                     | company_id   | fields_id   | value_reference   | res_id               |
|------+--------------------------+--------------+-------------+-------------------+----------------------|
| 528  | property_stock_inventory | 1            | 4665        | <null>            | product.template,752 |
| 6    | property_stock_inventory | <null>       | 4665        | stock.location,5  | <null>               |
+------+--------------------------+--------------+-------------+-------------------+----------------------+
```
In this case the property with id=528 is not a default property since
res_id is not NULL. Alternatively the property id=6 is a default one.

The issue here is that when searching for the missing locations we do
not filter out the properties with res_id not NULL, thus we may get that
a company has the location define while in fact it doesn't. Following
the example above, this means that we incorrectly get property id=528 as
the one defining the location for the company id=1 here:
https://github.com/odoo/odoo/blob/c5c47da2e96fd5e37030c70d6bb1bae4c4047fa8/addons/stock/models/res_company.py#L107
This not only prevents the creation of the correct default property but
also the default locations
https://github.com/odoo/odoo/blob/c5c47da2e96fd5e37030c70d6bb1bae4c4047fa8/addons/stock/models/res_company.py#L36-L51

On this patch we fix the domain search for default property. This allows
for the correct creation of the default locations and associated
properties.

This issue was observed during upgrade 40921, where it prevents the
upgrade to 15.0

closes odoo/odoo#79000

X-original-commit: b9d98950826e7272b1df4f6f2467d1d2d14dcc64
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-10-26 13:23:16 +00:00
Thibault Libioulle 95c16f35ce [FIX] project*: fix groups on computed field
*: account_sale_timesheet,
   project_hr_expense,
   project_mrp,
   project_purchase,
   sale_project_account

This commit fixes issue regarding fields in project form stat buttons.
Those fields are evaluated in any cases, and should rather be computed
only when the user has the right group.

Steps to reproduce :
1) Install project with one of this bridge
2) Connect with a user with only the group_project_admin right
3) Go to the form view
4) Issue:
An internal user with the group "Project Administrator" is unable to
access the form view of a project because of missing rights on the
X model.

Desired Behavior
================
The stat button should not be shown and the field not computed.

opw-2675514

closes odoo/odoo#78981

X-original-commit: 981bbf59d624c3a7bd22d6d7bf26c09e14835862
Related: odoo/enterprise#21889
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-26 13:23:04 +00:00
Antoine Dupuis (andu) ad1b55b760 [FIX] base: catch PDFs that fail on PdfFileWriter.write
Issue:
Our functionality for merging PDFs from multiple vendor bills relies on PyPDF2. It is well-known that PyPDF2 is sometimes unable to manipulate even perfectly normal PDFs. To provide a helpful error message to the user when this happens (i.e. give them the names of the vendor bills corresponding to the offending pdfs), the `_get_unreadeable_pdfs()` function is called right before we try to merge the PDFs in `_merge_pdfs`. This function is meant to identify the offending PDFs and provide them to the user.
However, _get_unreadable_pdfs did not notice the problem with 3 of my customer's pdfs, because the error was only triggered once the PdfFileWriter.write function was called in _merge_pdfs. This function, however, is not called in _get_unreadable_pdfs, therefore, it did not notice that anything was wrong.

Fix:
- Change _get_unreadable_pdfs so that it also makes a call to PdfFileWriter.write
- As soon as PdfFileWriter.write fails once, it will continue failing when we append more PDF streams to the PdfFileWriter. I therefore suggest initialising a different PdfFileWriter at each iteration of the for loop in order for an offending PDF to not cause a false positive on subsequent PDFs.

closes odoo/odoo#78966

X-original-commit: 0b4efd37376223806e7ff7273f520b2d17337bc8
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
2021-10-26 13:22:56 +00:00
Fabio Barbero d713e6341e [FIX] event: stop sending confirmation email as public user
Purpose
=======
Fix guest users receiving confirmation emails for events by "Public User".

Specifications
==============
Confirmation emails for events are sent by:

- Organizer (if set)
- Company email (if set)
- The users's email
- Odoo bot otherwise

Task-2657588

closes odoo/odoo#78946

X-original-commit: 45c22f32e97479af2adb5958b75ded32c41d80e8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-26 13:22:52 +00:00
Nicolas Lempereur ad6568444d [FIX] mail: activity view=>no tz for deadline date
In activity view, the deadline date that has no timezone is formatted
from UTC to local timezone, so if the timezone is negative, we display
by error the previous day (eg. 24 october instead of 25 october).

With this commmit, we interpret the date in local timezone so there is
no timezone issue.

note: no test added since this only happen on browser with negative
timezone which would be hard to test.

note: this was fixed similarily in 13.0 with 0735547086 but must have
been lost in a refactoring.

opw-2629681

closes odoo/odoo#78938

X-original-commit: 8935899c6fdc21ad6eff9f09af6e474652efbcd2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-10-26 13:22:49 +00:00
Harald Panten d09e6904d6 [FIX] Fix typo in 24% IRPF tax
closes odoo/odoo#78907

X-original-commit: 83bb18e47e8644bb3a3fef719467656e327edbe1
Signed-off-by: Olivier Colson <oco@odoo.com>
2021-10-26 13:22:44 +00:00
Xavier-Do 9dceea1818 [IMP] core: skip (setup|init)_models for module without models
Some modules are only adding data/tests/routes/static content.

In this case, it is useless to check the database schema or setup models
in registry.

closes odoo/odoo#78898

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-10-26 13:22:40 +00:00
Xavier-DoandRaphael Collet d4539c188a [IMP] core: use cache for mro in setup_models
With a lot of module installed setup_models can be quite slow.
One of the reason for that are the call to resolve_mro.

This operation is fast, but called for a lot of models/fields this
become an important part of get_depends and setup_base.

- This is call once for each models in setup_base
- This is call more than once for each computed_field in get_depends.

The use of a cache shows significative performance improvements.

During the install of a database with all modules, the install times
is reduced by ~3 minutes over ~14

Part-of: odoo/odoo#78898
Co-authored-by: Raphael Collet <rco@odoo.com>
2021-10-26 13:22:40 +00:00
oco-odoo f40abdce92 [FIX] l10n_es: make mod 303 consistent with the changes introduced in July 2021 with OSS
Mod 303's grid 61 is now divided in 4 new lines: 120, 122, 123 and 124. Grid 61 isn't used anymore. This takes effect starting July 1st 2021; previous periods are unaffected.

Doc:

https://www.agenciatributaria.es/AEAT.internet/Inicio/Ayuda/Disenos_de_registro/Modelos_300_al_399/Modelos_300_al_399.shtml

https://iranon.es/modelo-303-cambios-a-partir-del-3t-y-mensual-de-julio-de-2021/

OPW 2662476

closes odoo/odoo#78876

X-original-commit: 54340263742c069543ec93c85317f0b2cc03e822
Related: odoo/enterprise#21856
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
2021-10-26 13:22:32 +00:00
William Braeckman faefaf7c39 [IMP] resource: improve _attendance_intervals_batch perf
Improves on _attendance_intervals_batch to profit more from batching.
Resources are grouped by timezone since we know they will all have the
same result except for when there are resource assigned attendances.
Those have to be handled separately but are incoroporated in the same
routine.

TaskId-2674527

closes odoo/odoo#78741

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-26 13:22:27 +00:00
William Braeckman 4fbff6a9d4 [FIX] resource: fix timezone being overwritten
If no timezone is given to _attendance_intervals_batch, the timezone was
overwritten by the first resource's timezone.

TaskId-2674527

Part-of: odoo/odoo#78741
2021-10-26 13:22:27 +00:00
jbw 1273eb3f1e [IMP] account: set is_base_affected only visible in debug
Make tax field "Base Affected by Previous Taxes" only visible in debug mode.

closes odoo/odoo#78733

Task: 2608764
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-26 13:22:21 +00:00
Kevin Baptiste 1e99b471f7 [IMP] hr_holidays: show all employees in list view
A time off for multiple employees was not showing who the employees were
in the list view.

Now it shows the avatar of all employees in the list view.

closes odoo/odoo#78758

Taskid: 2674062
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-26 11:04:49 +00:00
William Braeckman 28fe74e051 [IMP] hr_holidays: stop listing portal users for time off manager
Removes the ability to select a portal user as time off manager for an
employee.
This also adds a domain to restrict the time off manager on users that
have access to the employee's company.

TaskId-2671420

closes odoo/odoo#78605

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-26 11:04:45 +00:00
xO-Tx ce3b09dff2 [FIX] web_editor: fix empty save on dialogs
I- mediaDialog/linkDialog:

1- Website editor > Add image/link using "/" commands.
2- The mediaDliaog/linkDialog will be shown to select item.
3- Click on "Add/Save" without selecting any image/setting
   any link.
4- traceback.

II- mediaDialog (Video):

The same flow for videos will add an empty <iframe> (with
no src specified) to the DOM.

The goal of this commit is to prevent this behaviour
by adding a test on values passed to the 'save' event
listeners.

task-2628964

closes odoo/odoo#78967

X-original-commit: 1e5c7d6f3525823101215cb18b44d2b936c9c521
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-26 07:48:10 +00:00
Jeremy Kersten fa8bc84bc7 [FIX] base: autoresize, be more tolerant with output size
Seems like depending the pillow version, the output image size could differ
from one or two bytes. Now we check the expected size with a tolerance of
+/- 1 byte.

closes odoo/odoo#78965

X-original-commit: 42d3427975592a914b5a61aee304d499750e8afe
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-10-26 07:48:06 +00:00
xO-Tx 23fe084c4c [FIX] web: fix menu items width calculation
ISSUE:

The width of menu items is computed (in 'initAutoMoreMenu')
to check for overflow and fold extra items in a "+" dropdown.

[1] When the page is not in cache yet, the width is computed
while font is not loaded yet and the value obtained is not
the same when font is already available [2] (e.g. if we go
to another page).

This explains why we get an additional folded item comparing
[1] and [2].

The goal of this commit is to fix this behaviour by recomputing
the width after font loading.

IMPORTANT REMARK:

When the code was overridden on 'initAutoMoreMenu', the idea
was to update the menu as soon as the DOM is available and add
adjustments after in this order:

[A]- _adapt();

[B]- await _afterImagesLoading(...);
   _adapt();

But since it's not possible to prevent the changes in menu
width after images are loaded, we remove the first update
in [A] (This update has no effect in current code because
it was placed after the "await..." in [B]).

And we still start the updates on menu after image loading.

task-2618929

closes odoo/odoo#78959

X-original-commit: 69b97d8e95da3efa62882228e79dc357e19e0fe6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-26 07:48:01 +00:00
xO-Tx 04f09503b2 [FIX] web, website: fix initAutoMoreMenu on user navbar
The current code in 'initAutoMoreMenu' doesn't work properly
on navbar after the update on dropdown in [1]. Small tweaks
were added in this commit to fix that.

[1]: 84715436d87bb05b421bc9ccaacda67d07571690

task-2618929

X-original-commit: 29b9280c44534d2f210dbcea83e0049365949f48
Part-of: odoo/odoo#78959
2021-10-26 07:48:00 +00:00
Vincent Larcin a06a99fb12 [FIX] project: remove a traceback when moving a project to a stage with a with an email template
Steps to reproduce:
==============
1) Go to Project app and create a project A if you don't have any project.
2) Go to Project > Configuration > Settings.
3) Enable the "Project Stages" feature.
4) Go to Project > Configuration > Project Stages.
5) Show the Email template field in the list view and set a template on a stage. (create a stage before this step if none exists)
6) Go to the main view of Project App.
7) Move Project A to the stage with the template set.

Expected Behavior:
==============
The system should use the template for the mail tracking.

Current Behavior:
============
Traceback because the method `xmlid_to_res_id` does not exist in `ir.model.data`.

Task-2677199

closes odoo/odoo#78947

X-original-commit: 1d1eaad402dac523404296024f44d3c852ee1daf
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-26 07:47:55 +00:00
lejeune quentin c14a7a4610 [FIX] hw_drivers: fix open cashbox with mapped action
In the new version of Odoo and in the drivers we "map" the actions.
The "mapped" functions must take at least 2 variables as parameters; Self and Data

closes odoo/odoo#78912

X-original-commit: 86653d2024075129c3f52390abdce0abb8d8ec31
Signed-off-by: Masereel Pierre <pim@odoo.com>
2021-10-26 07:47:51 +00:00
Philippe Wauthy fd69a22410 [IMP] resource: assign a search_range for calendar_end
Assign a search_range for calendar_end in the _adjust_to_calendar method in all conditions.
The search_range was only assigned a value if the start and end are on the same date before.

The _adjust_to_calendar method receives a start and end from midnight to midnight in the resource timezone.
Start and end datetimes can be set on a different day via the Gantt view set in month or year for example.
This commit ensures that a search_range is always assigned to find the calendar_end and not only when start and end are on the same day.
This allows to find the end of a shift searched over two days if the employee is only working one day.

Task-2628876

closes odoo/odoo#78746

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-26 07:47:47 +00:00
Victor Feyens 6f270b315c [FIX] purchase_product_matrix: multiple fixes
Same fixes for the purchase scope

1) Do not overwrite lines description if the line was not modified

2) Correctly recompute prices/sellers on quantity change.

When no new line was added to the PO through the matrix, the
prices/sellers were not recomputed, even if the qty was modified for
some products.

closes odoo/odoo#78971

X-original-commit: 591e424fd29856c1ce05ef3436db7f129fb29c2e
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-10-26 06:44:20 +00:00
Victor Feyens e9c487dba8 [FIX] sale_product_matrix: multiple fixes
1) Do not overwrite lines description if the line was not modified

Fixes #78833

2) Correctly recompute prices on quantity change.

When no new line was added to the SO through the matrix, the prices were
not recomputed, even if the qty was modified for some products.

The prices have to be recomputed in this case since pricelist provide
rules based on minimum qty.

X-original-commit: 4f819438aafead57d6bc79e03f9a7980c6420783
Part-of: odoo/odoo#78971
2021-10-26 06:44:19 +00:00
Roy Le bed205a579 [FW][FIX] sale: conflicting context content
Most uses (correct ones) of the `partner` context key content expect a `res.partner` recordset as `partner` context value.
This value is extracted during the pricelist price computation (but not used anyway...).

But in one case, fixed by the current commit, a `res.partner` id is placed in the context, as `partner` value.  In some cases, this may trigger "Comparing Apple and Oranges" errors, since `with_context` calls returns a new or existing environment, verifying whether an environment with the same values (user, context, ...) exists.
During this comparison, the new context, with an id (int) as `partner` value, is compared with existing contexts, potentially including some with a recordset on the same key.  Such a comparison fails on the lowest `__eq__` level, raising "Comparing apples with oranges" error.

This commit fixes this case, by making sure the value put in the `partner` context value is always a recordset, and not an id.

closes odoo/odoo#78963

Note: In the future, this context key should be dropped because it's still a bad practice to put recordsets in the context.
Forward-port-of: odoo/odoo#78950
Forward-port-of: odoo/odoo#78276
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-10-25 17:50:07 +00:00
Alvaro Fuentes 08ab5ddb88 [FIX] base: fix avatar_mixin seed for hsl
Some records have NULL create_date. In that case we get a traceback like
below.
```
 Traceback (most recent call last):
   ...
   File "/home/odoo/src/odoo/15.0/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
   File "/home/odoo/src/odoo/15.0/odoo/models.py", line 4249, in _compute_field_value
    getattr(self, field.compute)()
   File "/home/odoo/src/odoo/15.0/odoo/addons/base/models/res_partner.py", line 259, in _compute_avatar_128
    super()._compute_avatar_128()
   File "/home/odoo/src/odoo/15.0/odoo/addons/base/models/avatar_mixin.py", line 62, in _compute_avatar_128
    self._compute_avatar('avatar_128', 'image_128')
   File "/home/odoo/src/odoo/15.0/odoo/addons/base/models/res_partner.py", line 263, in _compute_avatar
    super(Partner, partners_with_internal_user)._compute_avatar(avatar_field, image_field)
   File "/home/odoo/src/odoo/15.0/odoo/addons/base/models/avatar_mixin.py", line 39, in _compute_avatar
    avatar = record._avatar_generate_svg()
   File "/home/odoo/src/odoo/15.0/odoo/addons/base/models/avatar_mixin.py", line 66, in _avatar_generate_svg
    bgcolor = get_hsl_from_seed(self[self._avatar_name_field] + str(self.create_date.timestamp()))
 AttributeError: 'bool' object has no attribute 'timestamp'
```
Observed during upgrade request 40906

closes odoo/odoo#78945

X-original-commit: 559d53fd2a0d437fae595dd4700f2607c8de81a8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-25 15:50:58 +00:00
Thibault Francois fc33e41719 [FIX] crm: fix typo in ValidationError
The validation error raise
"AttributeError: module 'odoo.exceptions' has no attribute 'ValidationEreror'"
Instead the the correct message
"Member assignment domain for user %(user)s and team %(team)s is incorrectly formatted

closes odoo/odoo#78943

X-original-commit: a7ae22d0206eb833d584755e55351c41a12fd274
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-25 15:50:54 +00:00
Nicolas Lempereur 931d5992e8 [FIX] base: typo qweb debuggers ipdb
opw-2677100

closes odoo/odoo#78919

X-original-commit: c7ac78a63c313ac1410b7cb557d2a2a6a8cc64f0
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-10-25 14:49:05 +00:00
Nikunj Ladava 69f65136b4 [FIX] website_slides_survey: fix certificate preview
before this commit,
it was raising an error while try to preview the certificate

after this commit,
prevent the preview of certificate, as it is not possible to
set the preview of certificate

task- 2623276

closes odoo/odoo#78911

X-original-commit: 8c51d83855566cb21578f18ebf460cead484aed2
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2021-10-25 14:49:00 +00:00
Tiffany Chang (tic) b954cae9a9 [IMP] stock: hide SN clear all button when no mls
Hide the "Clear All" button next to "Assign Serial Numbers" button when
there are no move lines to clear.

Follow up to task: 2426281

closes odoo/odoo#75676

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-10-25 14:48:56 +00:00
thcl-odoo 67c7ad017f [FIX] purchase: fix qty received computation
Expected behavior : The log note sent when received quantity is updated should take into account the quantity already received.

Current behavior : The log note sent doesn't take into account the quantity already received for a 'stock_moves'. So it always displays `Received Quantity: 0.0 -> quantity in stock` instead of `Received Quantity: quantity already received -> quantity in stock`

Steps to reproduce the error :
- Create a RFQ with few units of a Storable Product (e.g. 5 units)
- Partially validate the receipt and create a backorder (e.g. 3 units)
- Validate the backorder (e.g. 2 units)

Log notes should be :
`Received Quantity: 0.0 -> 3.0`
`Received Quantity: 3.0 -> 5.0`

But are :
`Received Quantity: 0.0 -> 3.0`
`Received Quantity: 0.0 -> 5.0`

The value is always equal to 0.0 because `qty_received_method == 'stock_moves'` so `line.qty_received` is overridden by 0.0 in parent `_compute_qty_received` even though its value is already set to 0.0 (default) or to the quantity already received

opw-2600221
opw-2613116

closes odoo/odoo#78858

X-original-commit: 0c8ea86fb8d706af139cd2d412d01487e5899df6
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-10-25 12:14:16 +00:00
Didier (did) d32256c051 [FIX] mail: display the call indicator on mobile
and in the notification zone.

part of task-2634175

closes odoo/odoo#78865

X-original-commit: 88fc69c06e4f1516c8d95812395f1e2fbf10f44c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-25 09:53:20 +00:00
Romain Estievenart 2c9da836e5 [FIX] mail: keyboard shouldn't pop on WebRTC call on mobile devices
Steps to reproduce:

1. Log on odoo with a user A on mobile device
2. Log on odoo with a user B on desktop
3. User B call user A
4. User A answer the call and the keyboard popup on the screen => BUG

To avoid this behavior, we disable the input auto-focus when we open a
chat window like other chatting app on mobile devices (like: Signal,
Messenger, WhatsApp...)

closes odoo/odoo#78864

X-original-commit: cf36921df8dff114f26a161c4f9d2f6a05ac2adb
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-10-25 09:53:16 +00:00