Commit Graph
146158 Commits
Author SHA1 Message Date
oco-odoo 9a80e2fa47 [FIX] purchase, sale: filter taxes properly when using a foreign VAT fiscal position
Before, when a foreign VAT fiscal position was used on a purchase order or sale order, no filtering was applied on the available taxes. We now make their behavior consistent with the invoices'.

Part-of: odoo/odoo#79144
2021-10-28 14:37:43 +00:00
oco-odoo d849333b33 [FIX] purchase, sale: display foreign VAT properly on pdf
When printing a sale order or a purchase order using a foreign VAT fiscal position, the domestic VAT was always used on the pdf report instead of the foreign one.

Part-of: odoo/odoo#79144
2021-10-28 14:37:43 +00:00
Agustín Castro Bugallo 04e74c2f27 [FIX] hr_attendance: fix ambiguous column on upgrade
Avoids the ambiguity of the department_id column in
hr_attendance_report.py

While upgrading to Odoo 15.0, if the database contains
a module that adds the column department_id to
the table hr_attendance_overtime, the following error occurs:

```
Traceback (most recent call last):
  File "/home/odoo/src/odoo/15.0/odoo/service/server.py", line 1246, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/home/odoo/src/odoo/15.0/odoo/modules/registry.py", line 87, in new
    odoo.modules.load_modules(registry, force_demo, status, update_module)
  File "/home/odoo/src/odoo/15.0/odoo/modules/loading.py", line 472, in load_modules
    force, status, report, loaded_modules, update_module, models_to_check)
  File "/home/odoo/src/odoo/15.0/odoo/modules/loading.py", line 365, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/home/odoo/src/odoo/15.0/odoo/modules/loading.py", line 199, in load_module_graph
    registry.init_models(cr, model_names, {'module': package.name}, new_install)
  File "/home/odoo/src/odoo/15.0/odoo/modules/registry.py", line 425, in init_models
    model.init()
  File "/home/odoo/src/odoo/15.0/addons/hr_attendance/report/hr_attendance_report.py", line 50, in init
    """ % (self._table))
  File "<decorator-gen-3>", line 2, in execute
  File "/home/odoo/src/odoo/15.0/odoo/sql_db.py", line 89, in check
    return f(self, *args, **kwargs)
  File "/home/odoo/src/odoo/15.0/odoo/sql_db.py", line 310, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.AmbiguousColumn: column reference "department_id" is ambiguous
LINE 6:                         department_id,
                                ^
``
upg-42212

closes odoo/odoo#79141

X-original-commit: 3622b1bb2e678394a3b21f213b62c90009e75dd9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-28 13:06:11 +00:00
Aaron Bohy e3f08513c2 [FIX] web: router: do not push unnecessary entries in history
Before this commit, the router didn't considered as equal an
integer value given as an integer or as a string (e.g. "1" or 1),
whereas form the url point of view, it's exactly the same, and the
information is lost anyway.

As a consequence, pushing something like { id: "1" } in the url
that already contained id=1 created a new entry in the history,
which isn't what we want as the url is the same.

This commit fixes the issue by converting string values into
numbers when it is possible.

This commit also changes the way the action service pushes the id
and active_id in the url, as there's no need to pass string values
anymore (this was the case in the early days of the wowl branch).

closes odoo/odoo#79132

X-original-commit: e576155fc55e0493a1d1236960dd1c7a36db9e8c
Related: odoo/enterprise#21948
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-28 13:06:00 +00:00
Nathan Marotte (nama) 707cd830f8 [FIX] sale_mrp : wrong delivered quantities on kit return
Issue: When returning a product sold that is only made of kits and
validating the return, the delivered quantities of the sales order was
set back to the full amount delivered

Steps to reproduce :
  1) Install MRP and Sales
  2) Create a BoM Kit for a new product [Nested Kit] that has one or
    more consumable or storable product as component
  3) Create a BoM Kit for a new product [Main Kit] that has
    [Nested Kit] as component
  4) Create a SO for [Main Kit], confirm, validate delivery
  5) Check SO, 1 product is delivered (correct)
  6) Go back to the Delivery, create a return for the delivery
    (don't validate)
  7) Check SO, 0 product is delivered (correct)
  8) Now validate the return for the delivery
  -> Check SO, 1 product is delivered (bug)

Why is that a bug:
 Since the Main Kit was returned, the delivered should be 0 and not
 the full amount initially delivered. It was set back to 1 because we
 didn't look at the type of picking, when computing the quantity
 delivered, the fall back considered that if all the moves were done,
 everything was delivered, but it is the opposite when returning

opw-2542337

closes odoo/odoo#78915

X-original-commit: 206c9c8da4d8001525a540561174326e49d1188d
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-10-28 12:21:23 +00:00
Yannick Tivisse 6a7c1c51ce Revert "[FIX] hr_fleet: Don't notify future_driver_id as Changed Driver"
This reverts commit 2e58d23e760313dbf58ce6a90f26b7160db460d8.

Actually the fleet officers want to be notified.

The correct way to handle the original issue is to ping the employees
via their documents, instead of on the fleet.vehicle, to avoid setting
them as followers of the car.

closes odoo/odoo#78716

X-original-commit: 437bd8cc54d999a40ee2d83e2fef9c0ced19f47e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-28 12:21:19 +00:00
Swapnesh Shah 0fed1ba061 [FIX] purchase: reset reminder status on cancel
Steps to reproduce:

* Create PO
* Confirm Receipt Date
* Cancel PO
* Draft and Confirm again

Current behavior:

* Button for Confirm Receipt Date is not visible

Expected behavior:

* Button for Confirm Receipt Date should be visible

This is happening as we are not resetting the value of `mail_reminder_confirmed` on cancelling PO.

With this commit, we reset value of `mail_reminder_confirmed` so use can Confirm Receipt Date again.

closes odoo/odoo#79122

X-original-commit: 9e48afe5bf4f52b7cc2705fe434b4647df752a59
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-10-28 11:35:01 +00:00
Kevin Baptiste ba619ce027 [IMP] hr_holidays: allow users to cancel Time Off
A user without Time Off rights is now allowed to cancel their own
validated time off when:
    - It's not yet started;
    - No work-entries has been generated for it yet.

The time off is archived and the days taken reallocated.

closes odoo/odoo#76722

Taskid: 2643713
Related: odoo/upgrade#2843
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-28 11:34:57 +00:00
Florent de Labarre d5f855be9e [FIX] product: same price with different pricelist
- Create a report to show price on each template
--> Issue: The price is the same

closes odoo/odoo#78870

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-10-28 10:51:57 +00:00
JF Aubert aa2d0abb1b [FIX] mrp_subcontracting: Allow to create backorder for tracked products
This commit fixes the 'You need to supply a Lot/Serial Number...' message
when validating a receipt with backorder for subcontracted tracked products.

closes odoo/odoo#79121

Task: 2604664
X-original-commit: 2ab8f5cc681d45323e540ca57f85168fd587cf02
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-10-28 10:05:37 +00:00
Romain Derie f51a53e6ee [FIX] website: avoid calling external services during test
`s_map` snippet is calling maps.google.com which might be the reason this tour
experience some race condition when trying to drag and drop the
`s_newsletter_subscribe_form` (which happen after the `s_map` snippet was
dropped).

When the race condition happen, we can see on the screenshot that the snippet
was drag & dropped into the footer instead of the `s_text_image` inside the
`#wrap` as it should be (see comment on first step of the test).
The reason the snippet is not dropped where it should be is because the `s_map`
was not removed as it should have been (seeing the screenshot), so the page was
scrolled and the footer became the first available and visible `o_editable`.

The `s_map` snippet is probably still in the DOM (despite a step is in charge
of removing it) because it is recreated after the google maps server reply,
which sometimes is probably taking an unexpected long time.

Anyway, external services should never be called during tests, removing the
snippet from the tour is an "easy" first step to try to fix the race
condition.

closes odoo/odoo#79120

X-original-commit: 37c9ae2c3b228e5abbe5bdb84df2c381d9f2fcb3
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-10-28 10:05:33 +00:00
Simon Genin (ges) 28aabf0f69 [FIX] web, base_setup: show_effect param is always a boolean
The show_effect was either "True" or false which is inconsistent.
This was caused by the fact that the string value came from the backend
and the boolean came from the default value of get_param.

By wrapping the result of get_param in a bool constructor, we make sure
the type is always consistent.

closes odoo/odoo#78742

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-28 09:17:34 +00:00
Katherine ZaoralandBruno Zanotti c402d9d82f [ADD] l10n_ar: creating data on the fly for tests
Add a generic common model for tests where we create on the fly all the
data used in the tests (for l10n_ar, l10n_ar_edi, l10n_ar_reports).
Also, move part of the initialization, helpers, and generic unit test
from l10n_ar_edi to l10n_ar.

closes odoo/odoo#79096

X-original-commit: 185cec58afe0f00545f1e5d5b1e3652ec9c5559c
Related: odoo/enterprise#21931
Signed-off-by: Josse Colpaert <jco@openerp.com>
Co-authored-by: Bruno Zanotti <bz@adhoc.com.ar>
2021-10-28 08:33:24 +00:00
John Laterre (jol) eac2440fe0 [ADD] l10n_din5008: isolate din 5008 from l10n_de
DIN 5008 is not specific to Germany.
It also applies to Switzerland, Austria (& Lichtenstein).

The goal is to make DIN independent from l10n_de,
for Switzerland and Austria.

closes odoo/odoo#76227

Task: 2613993
Related: odoo/upgrade#2932
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-28 08:33:17 +00:00
Nicolas Bayet 0f668e28bf [FIX] web_editor: allow non editable to be unbreakable
When starting the editor in a web page, if there is no content, the
oe_structure is not editable. Adding snippet at that moment will
trigger `idSet` on the node with isUnbreakable returning `false` for
the node that is unbreakable because of the check
`!node.isContentEditable` in `isUnbreakable`.

When setting the ouid for the first time with `idSet`, `getOuid` is
called with `optimize` to `true`. So all the ancestor of a node that
should be unbreakable will have the wrong ouid.

Performing any command to a node with a wrong ouid is suceptible to
wrongly be reverted.

By removing `!node.isContentEditable`, the node will have the proper
ouid in case an ancestor is not editable.

task-2633368

closes odoo/odoo#79108

X-original-commit: 13804df7740317b8198e7c1de418ff019c05862b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-28 07:49:29 +00:00
Nicolas Bayet 3c80860110 [FIX] web_editor: properly remove hint on mass_mailing
Before this commit, the editor hint were not properly
removed because the queryselector was made on
the wrong document.

Task-2678410

closes odoo/odoo#79104

X-original-commit: d582f43d81cb570017ef6ff90159cdb6a7ff2874
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-28 07:49:25 +00:00
Nicolas Bayet e2763e0f8b [FIX] web_editor: use wrapper around video
When pasting an youtube url in the website builder, the iframe
was inserted without the wrapper used by the website builder.
Now we use the same wrapper as by adding a video through the
video modal.

task-2668224

closes odoo/odoo#79095

X-original-commit: 0cffd7fcdc631b95795d9d819197e5f91ed8195c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-28 07:49:21 +00:00
Nicolas Bayet 85b0845c65 [FIX] web_editor: poperly add youtube on website builder
In the website builder, when pasting a youtube url,
we can transform it to an iframe in the editor through the
Powerbox.
Adding the iframe did not remove the text in the website builder.
Now it properly remove the text in note and the website builder.

X-original-commit: a9c363cb2c6a88f7f4b1ef09b8a8f9caf39d8f32
Part-of: odoo/odoo#79095
2021-10-28 07:49:21 +00:00
Arnold Moyaux a1a1755357 [FIX] sale_mrp: Link to MO on SO
commit 96b56ea fix the link between SO <-> MO in manufacture 3 steps
but break it on other configuration

It happens because without `store after manufacturing` the procurement
group is not copied and used on the MO. And the stat button search on
procurement group with a MO and a SO on it. Before it was searching
on `stock_move.created_production_id` and thus was able to find the MO.

This commit do a mix of the 2 solutions. It search for procurement group
linked to SO and MO + created_production_id to be sure to find all the
MO related to a SO

opw-2645042

closes odoo/odoo#79106

X-original-commit: 2003643a1b20257b84fd2a0144a7cb71f2612797
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-10-28 07:04:58 +00:00
Simon Genin (ges) 5f5e699baa [FIX] web: Form stat button stays correctly disabled
A stat button set as disabled was used to just show some statistics
without an action on click. However, on tasks executed by the Form,
all the buttons would be temporarly set as disabled then set back to
enabled. This would lose the original state of the button and make them
all clickable.

The way it worked before v14.5 was most likely because the action
manager would not throw an error on an action with those "invalid"
arguments.

Also, a button without a type and name will now be set the disabled
attribute automatically.

closes odoo/odoo#78839

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-27 21:53:57 +00:00
Philippe Wauthy 88d0c49604 [FIX] resource: timezone end before assigning search_range
The end datetime is not timezoned in _adjust_to_calendar before defining the search_range and using the _get_closest_work_time method.
Since _get_closest_work_time will timezone the timestamp received to start searching, the search interval needs to refer to the same end timestamp to avoid erratic behaviors.

Task-2628876

closes odoo/odoo#79049

X-original-commit: cbf0cb6e210959b3ceea554ec68957416a125141
Related: odoo/enterprise#21915
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-27 21:06:48 +00:00
Laurent Stukkens (LTU) fd2a6c904d [IMP] project: add task dependencies in demo data
This commit adds task dependencies data in the demo data.

task-2647340
Related PR: odoo/enterprise#21391

closes odoo/odoo#79103

X-original-commit: d7c2a7eb5b6ee77772b0f104515125f3f31eb50d
Related: odoo/enterprise#21933
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-10-27 19:24:01 +00:00
Fabio Barbero 3f590e88fe [FIX] website_slides: fix traceback on granting access to course
Purpose
=======
Avoid getting a traceback when granting access to an event as a course
responsible.

Specifications
=============
Remove activity after making rpc in _onGrantAccess and _onRefuseAccess
in website_slides/static/src/components/activity/activity.js

PR: /pull/79075
Task-2676752

closes odoo/odoo#79098

X-original-commit: e98ebb5b97f9ce06b072d17de75e42142b11f775
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-27 19:23:51 +00:00
Leonardo Pavan Rocha e5024ead26 [FIX] base: fixes layout designer not containing company data
In https://github.com/odoo/odoo/pull/78652 a fix was made in the layout
designer guaranteeing that the company_details field followed the correct
address format set by the company. However, this fix didn't take into account
all company data, making some `format_address`es raise a `KeyError`. This PR
fixes that by using the company_date defined in `_display_address`.

Fixes https://github.com/odoo/odoo/issues/78942

closes odoo/odoo#79097

X-original-commit: 3cdc770c4966cef88362f8119a96de5501d21b18
Signed-off-by: Leonardo Pavan Rocha <lpr@odoo.com>
2021-10-27 19:23:47 +00:00
Guillaume (gdi) e55d2839a6 [FIX] website: add default color combination to mega menus
Set the background color of mega menus to the first color combination
by default. This ensures that the mega menu is not transparent by
default (important for master where the dropdown will be transparent to
allow transparent mega menus) but mainly ensures that inner components
(links, buttons, titles, etc) use a visible color as otherwise they use
the *header* combination colors which may not work with the default
white background dropdown.

task-2623335

closes odoo/odoo#79094

X-original-commit: 967d21a8d0dd8c79be1fe0a2d2ec3a6edbb389ca
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-27 19:23:42 +00:00
Nasreddin Boulif (bon) 6647d70f53 [FIX] website_slides: Don't set completion_time for encrypt/corrupt PDF
Steps to reproduce:

  - Install eLearning module
  - Go to eLearning, open course Basics of Gardening and edit it
  - Click on `How to Grow and Harvest The Best Strawberries | Basics`
  - Upload an encrypted PDF as Attachement

Issue:

  Traceback is raised :
  utils.PdfReadError("File has not been decrypted")

Cause:

  When trying to calculate `completion_time` to read pages, we try to
  get the number of pages of the pdf but an error will be raised if the
  pdf is encrypted.

Solution:

  If not possible to get number of pages, we dont set/update the
  completion_time.

opw-2612529

closes odoo/odoo#79017

X-original-commit: 8eac410996bd9813cf1972ac6e71560ddb582775
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-10-27 18:41:20 +00:00
Rémy Voet (ryv) 5a35d6748a [FIX] base: fix batched version of get_metadata
- The batch version of get_metadata won't work correctly for the xmlid
returns due to the limit=1 (cause by
718b0f8b63 ). Fix the
previous issue by reversing the order and without limit.
- The read should be read with the correct user.

closes odoo/odoo#79091

X-original-commit: 29a53f19a7729f486cbc6ff69893b8d150c3512d
Signed-off-by: Rémy Voet <ryv@odoo.com>
2021-10-27 17:16:58 +00:00
Nicolas Bayet f950fd1190 [FIX] web_editor: wait editor loading in tests
In a undeterministic circumstance, an element in the editor
is not found. It might be because the check is done before the
editor is fully loaded.

The commit 46c22143b22e204e93c70b21d002eb179be34a33 tried to
wait 100ms, but the bug continue to appear.

This commit only perform the check when the editor is fully
loaded. If the undeterministic bug continue to appear, it means
that the cause is different.

Task-2678110

closes odoo/odoo#79078

X-original-commit: 930b6822961f1ffdd1198e1ab2fe52229e14a50d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 17:16:53 +00:00
William Henrotin 3a1473c75c [REF] *stock*: rename move_lines into move_ids in stock.picking
closes odoo/odoo#78732

Task: 2673000
Related: odoo/enterprise#21815
Related: odoo/upgrade#2956
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-10-27 15:48:51 +00:00
William Henrotin f3fe2d50d9 [REF] *: rename name into partner_id on supplierinfo
Task: 2673000
Part-of: odoo/odoo#78732
2021-10-27 15:48:51 +00:00
Nicolas Bayet 403c06504d [FIX] web_editor: always show codeview button
When activating the editor code view, the button is hidden in
the floating toolbar. This commit always shows the button when
the codeview is activated for a particual html field.

Task-2672259

closes odoo/odoo#79072

X-original-commit: 66d706bbcc1cd49e69f58ac154eee2d6f2ec3628
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 14:01:47 +00:00
Nicolas Bayet e795186dec [FIX] web_editor: delete unicode character
Before this commit, when trying to delete one
unicode character (e.g. 😍), only one javascript character was delete
but one unicode character (e.g. 😍) could be two javascript characters
as the javascript string is coded in utf-16.

This commit fixes that by calculating the size of one unicode character
from the javascript string.

Task-2658890

closes odoo/odoo#79071

X-original-commit: fea5b87615077f5f41dec8c4d1480f157bbd26ae
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 14:01:43 +00:00
Antoine Guenet 218e9bb2aa [FIX] web_editor: prevent pasting blocks into paragraph-related elements
When pasting HTML, we have to be careful not to introduce invalid HTML.
The editor corrected for blocks within inlines but failed to prevent the
invalid pasting of blocks within paragraph-related elements
(eg., `<p><h1>text</h1></p>`). This fixes that issue by unwrapping all
blocks from the copied content when trying to paste within an element
that doesn't accept paragraph-related elements as children.

Notably, this fixes an issue that was caused by that problem, in which
pasted HTML content could not be saved because it was invalid.

task-2632676

closes odoo/odoo#79070

X-original-commit: 9c77834e03516f831a9600f0ba4131c957b3ba74
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 14:01:39 +00:00
Tiffany Chang (tic) 406850f083 [FIX] stock: always show draft outs in forecasted report
Fix a small logic bug which made it so draft outs would only show only
if there were also draft ins.

closes odoo/odoo#79067

Fixes: odoo/odoo#78872
X-original-commit: c764709715f0a86ac531f3be6d73ecadacbdeafc
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-10-27 13:16:48 +00:00
William Braeckman ecddd5f729 [IMP] hr_*: Improve tests execution speed by using setUpClass
closes odoo/odoo#79063

Taskid: 2669222
Related: odoo/enterprise#21920
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-27 13:16:42 +00:00
David Monjoie 30c53a4370 [FIX] web_editor: fix traceback when clicking outside any snippet
This bug was introduced by
https://github.com/odoo/odoo/commit/2a7436d83abe178bd21c0694edc9825f5d70d65f.

closes odoo/odoo#79057

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 11:56:15 +00:00
Antoine Guenet 7dd6698bd4 [FIX] web_editor: properly display the state of list in the toolbar
When selecting text in a list, the toolbar should show that a list is
selected, and which type. It however failed to do that, which is fixed
with this commit.

task-2638422

closes odoo/odoo#77738

X-original-commit: 2a7436d83abe178bd21c0694edc9825f5d70d65f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
Part-of: odoo/odoo#79057
2021-10-27 11:56:15 +00:00
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