Commit Graph
149406 Commits
Author SHA1 Message Date
Andrea Colangelo 17eab595f0 [CLA] Andrea Colangelo
closes odoo/odoo#87399

X-original-commit: 164e84869d96406a8685591313d59daa6bb754b5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-03-29 09:54:48 +02:00
Thibault Libioulle 2e7cc0d82f [IMP] payment{,_stripe},{,website_}sale: clean up stripe connect code
This commit removes deprecated actions and methods kept after the merge
of PR #79621 in stable.

Follow-up
task-2685160

closes odoo/odoo#84789

Related: odoo/upgrade#3256
Related: odoo/enterprise#25369
Signed-off-by: Thibault Libioulle (tle) <tle@odoo.com>
2022-03-29 08:57:43 +02:00
Olivier Dony 4c98b836d4 [FIX] reqs: bump deps for deployments without security backports
Update the default requirements according to latest security risks in
relevant dependencies. The baseline required version is kept in
comments, and it perfectly safe to use when security backports are
present. In other words, using the official Debian/Ubuntu packages
on a supported LTS version of these operating systems, with
unattended upgrades turned on, is a simpler safe option.

closes odoo/odoo#87397

X-original-commit: b488bd8f88a56af553c090351ff6b2ecdfb411dc
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Olivier Dony <odo@odoo.com>
2022-03-29 02:27:49 +02:00
roen-odoo 1dd6fa6b64 [FIX] hr_timesheet: Fix traceback when grouping timesheets by date
Current behavior:
When accessing your timesheets with /my/timesheets/ and changing language to something else than english
you get a traceback

Steps to reproduce:
- Have timesheets app installed
- Have atleast one other language than english installed (e.g French)
- Go to /my/timesheets and group the timesheets by date
- Change the language by accessing for example fr_FR/my/timesheets
- You get a traceback, because we try to convert a string into a datetime object wich is not working correctly with different languages

opw-2785268

closes odoo/odoo#87381

X-original-commit: 5e3ee492c97dddb6f9430144429febfa6327d4d0
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-03-29 01:20:30 +02:00
Jinjiu Liu ed9814059b [FIX] website_slides: added redirection for invalid slide URLs
Reproduction:
1. Install eLearning, delete sitemap.xml from Settings->Technical->
Database structure -> Attachment
2. Regenerate sitemap.xml by opening odoo.com(or localhost)/sitemap.xml
3. Open a URL, for example,
http://odoo14:6014/slides/slide/tools-and-methods-25
4. A ValueError is thrown

Reason: the URL generation for model slide.slide uses the default
method, which doesn’t filter out the category slides. An example of a
category is: http://odoo14:6014/slides/slide/unforgettable-tools-28 The
tools-and-methods is a category in the course content

Fix: Added a special case for category slides. If it's a category,
redirect to the channel's homepage

opw-2579913

closes odoo/odoo#87369

X-original-commit: eca5ea22624268eaccc5cf9fa7585d51cb6d16cc
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-29 00:09:10 +02:00
Fabio Barbero 101c08011a [IMP] digest: update documentation links
Purpose
=======
Update documentation links for digest in settings menu.

Task-2800588

closes odoo/odoo#87351

X-original-commit: ca7502b0c2d46dd16547272cec0265c8c4aeca8e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-29 00:09:07 +02:00
Fabio Barbero 1356a490e1 [IMP] digest, *: show pictures stored on Odoo
Purpose
=======
Pictures from the digest emails are currently stored on the database
itself, meaning that if the database expires (e.g. after trial expires) all
pictures from previously sent emails won't be visible.
This is an issue since digest tips are meant as a marketing tool to bring
people to Odoo after trying a database.

Digest pictures are now taken from Odoo's server
(https://download.odoocdn.com/digests) so that the pictures will still
be visible after the database has expired.

From this commit onwards, it should not be allowed to change a digest
picture with the same name (to display a gif of a newer version), since
all databases with previous versions would receive pictures of a version
that does not correspond to theirs.

This also means that everyone client's Odoo  server will contain pictures
that are never used. This could be fixed if Odoo stored them somewhere
else and didn't make them dependent from the git repository.

Task-2372195

closes odoo/odoo#87343

X-original-commit: 35157677a2a63a2559a72aff21e62e23a3c671a2
Related: odoo/enterprise#25654
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-29 00:08:59 +02:00
Fabio Barbero 71bcd3bca7 [IMP] digest, *: update digest pictures
Purpose
=======
Update pictures with higher quality, up-to-date equivalent.

Task-2372195

X-original-commit: 476ca7e5abfbe25f7375a426a249da6fb41098cf
Part-of: odoo/odoo#87343
2022-03-29 00:08:59 +02:00
Victor Feyens 57cd8080ee [FIX] website_sale: do not assign public/portal user as salesman
for orders created on the e-commerce

closes odoo/odoo#87337

X-original-commit: 3c377de0f14fff1b4448220c0a373dab7b800e27
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-03-28 23:10:56 +02:00
Zelong Lin 72cf79a1ff [IMP] mail: channel_type cannot be changed
get prevention when transforming the channel type.

task-2774330

closes odoo/odoo#85128

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-03-28 23:10:49 +02:00
William Braeckman 2a1928eef7 [IMP] website_sale: disable archived variants
Prior to this commit archived variants would not appear as disabled
 in the shop, the different options will now be greyd out if selecting
 them would result in an archived variant.

TaskId-2762122

closes odoo/odoo#84711

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-03-28 21:45:49 +02:00
Yannick Tivisse 0a84221920 [FIX] sale_coupon: Prevent already encoded-expired coupons to be used
closes odoo/odoo#79022

Taskid: 2439224
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-03-28 19:58:50 +02:00
Jérémy Hennecart (jeh) 32c2321097 [IMP] crm: improve format of duration in log meeting
Instead of displaying the float duration in the log, we display it
with this format:
1.5 => 1 hour 30 minutes
0.5 => 30 minutes

task-2665863

closes odoo/odoo#87057

Related: odoo/enterprise#21799
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-28 19:58:42 +02:00
tsm-odoo b168313f0e [IMP] mail: adapt component tests data seeding
This PR adapts mail components tests after the introduction
of a new way to seed test data.

task-2792108

closes odoo/odoo#86655

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-03-28 19:00:00 +02:00
Tiffany Chang (tic) bee32f88d4 [IMP] repair,stock: allow creation/link of repairs from returns
This feature supports the use case of:
- a customer receives a delivery from you.
- there is a defective product in the delivery
- they schedule a repair (RO) + return (picking) for the product

We want to ease the creation/management of the repair order associated
with the return, therefore the following features are added:

- Create links between ROs and return pickings (smart button in return
  of all repairs associated with it + field in RO)
- Option (requires active setting) to create RO(s) directly from a
  return picking

Implementation notes:
- Because return picking type doesn't have its own "Type of Operation"
  (it is 'code'='incoming'), we default to only incoming picking types
  that have at least 1 other picking type it is the
  'return_picking_type_id' of.
- Originally a Wizard for choosing which/how many products should have
  ROs created for them was designed (i.e. to match return wizard + to
  multi-create ROs), but this was determined to be too complicated due
  to SN/lot selection. Instead simple approach of creating a single RO
  each time button is pushed was implemented to match the helpdesk >
  repair button workflow.
- ROs are purposely allowed for 'draft' and 'cancelled' returns/moves to
  support different types of workflows (e.g. RO is confirmed before
  return is)

closes odoo/odoo#85157

Task: 2732517
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-03-28 18:59:57 +02:00
Tiffany Chang (tic) bee16a76ab [IMP] stock: add missing button hotkey
Based on spreadsheet from task: 2588233, `action_assign` button is
supposed to have data-hotkey="q", but it doesn't. It was probably missed
by accident so we add it in now.

Discovered during task: 2732517

Part-of: odoo/odoo#85157
2022-03-28 18:59:56 +02:00
William Braeckman 9da54951e8 [IMP] website_sale: Update attribute display type in front
Allow editing the attribute's display type from the front end using the
web editor.

Closes: odoo/odoo#85153

TaskId-2675390

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-03-28 18:59:51 +02:00
Alexandre Kühn d7dea4c68d [IMP] mail: turn "Rtc/pingInterval" into field
Task-2734101

closes odoo/odoo#85029

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-28 18:59:47 +02:00
Antoine Guenet 62f9e01d92 [REF] mass_mailing, web_editor: don't redefine target in generic methods
Commit [1] redefined the target in generic methods of snippet options so
that some buttons of the Design Tab snippet option could target a
different node than their parent option. This reverts that in favor of
the more generic `apply-to` data attribute.

[1]: c4bfedc37b

closes odoo/odoo#87325

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-03-28 17:55:28 +02:00
tsm-odoo a3607cae81 [IMP] mail: remove fake model for FieldMany2ManyTagsEmail tests
task-2792108

closes odoo/odoo#87303

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-03-28 17:55:24 +02:00
Alexandre Kühn 39c778c611 [IMP] mail: create 'RtcSession/isCurrentUserInitiatorOfConnectionOffer'
This is exactly the field 'RtcSession/isConnected', but it was badly named.

Task-2734101

closes odoo/odoo#87284

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-28 17:55:20 +02:00
Sébastien Theys 3e249661af [IMP] mail: move getScrollableElement to message list model
task-2801089

closes odoo/odoo#87267

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-28 17:55:16 +02:00
rhe-odoo e4d125463d [FIX] point_of_sale: fix quantity decrease popup
When the popup was canceled, the input value was null and it lead to an error.

Now we add a check to ensure the value exist.

closes odoo/odoo#87194

X-original-commit: b04b5898033ff28c14f84a83d28c43e446f0e4b3
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-03-28 17:55:12 +02:00
Thibault Francois e9e6292b82 [FIX] sale: O qty change to 1
How to reproduce the issue
--------------------------

Set the quantity of a sale order line to 0.0
then change the product_uom of the line
it triggers the computation of the product_uom
and the quantity is changed to 1.0

After this commit
----------------

The default value is not embedded in the compute anymore
The value do not change each time the compute is triggered
if the value was 0.0

closes odoo/odoo#87166

X-original-commit: 9015d25617b3992b0129547a1bec8887d6462bc5
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-03-28 17:55:08 +02:00
Nicolas Bayet f6fccdbdce [FIX] website: propagate action_demand onFailure to promises
Before this commit
The code called `action_demand` without specifying a failure
method.
In website, there is bug arising where a promises is not rejected
causing spinner of the sidebar of the website builder to never stop.

After this commit
Failure is propagated and the website builder bug does not prevent
the user from continuing to work.

closes odoo/odoo#87125

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2022-03-28 17:55:04 +02:00
william d999840957 [IMP] account: avoid subqueries while constraining on user type
Avoid doing a `search` in a loop.

closes odoo/odoo#86204

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-03-28 15:54:41 +02:00
william 51c0612c1d [FIX] account: remove trailing spaces in account_account.py
Part-of: odoo/odoo#86204
2022-03-28 15:54:41 +02:00
Alexandre Kühn b04ea8e173 [IMP] mail: turn "RtcSession/rtcDataChannel" into field
Task-2734101

closes odoo/odoo#85024

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-03-28 13:55:09 +02:00
Didier (did) 6a0cbf8562 [FIX] mail: fix guard on load video
task-2806331

closes odoo/odoo#87324

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-03-28 12:57:02 +02:00
luvi 90695d16df [FIX] web: fields _onClick handler triggered twice
This commit fixes a bug present in FieldEmail and
FieldPhone where the handler on the click event was
triggered twice and was not preventing the field to
turn into quick edit mode appropriately.
A test has been added for EmailField to ensure the
correct behavior

PR enterprise: odoo/enterprise#25506

closes odoo/odoo#87196

X-original-commit: 852e084c355e9be77c693b32bf1119570e4d49d0
Related: odoo/enterprise#25558
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-28 12:56:52 +02:00
Yolann Sabaux dd239a604a [FIX] web: display_name in analytical tag not displayed
Steps to reproduce:
- Install accounting
- Create more than 6 analytical tags
- Create an invoice
- Create a payment
- Go in Accounting>Actions>Reconciliation, tab Manal Operations
- In the field Analytical Tag, click on 'Search More' and selected 1 or multiple tags

Issue:
Void tags are displayed

Solution:
Fetch the field `display_name`

ref commit: 84f0644802865c6454014059842eb6a9d4fd40e4
opw-2734029

closes odoo/odoo#87311

X-original-commit: 936bad32cf1024570da4880ccc5375b02b30c1c2
Related: odoo/enterprise#25631
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-03-28 10:46:28 +02:00
thcl-odoo 1266b7f470 [FIX] l10n_de_sale: add missing incoterm on SO
Current behavior :
Incoterm isn't printed on quotation/order report with DIN5008 layout

Steps :
- Install Sales, Inventory and Germany - Sale
- In Settings :
   - Enable Incoterms under Sales section
   - Select DIN5008 Layout (external_layout_din5008) for documents
- Go to Sales and get a new one
- Select an incoterm in Other info tab

OPW-2759568

closes odoo/odoo#87184

X-original-commit: b6db1b7ba3439d2b0ae7ef7ccc7ee15e1642ecba
Signed-off-by: Claude Thibault (thcl) <thcl@odoo.com>
2022-03-28 10:46:11 +02:00
Pieter Claeys (clpi) 0a1af8c8c3 [IMP] mrp: back to basics part 3
UX improvements in WO & MO views
Don't show reserved field for byproducts

closes odoo/odoo#86586

Task: 2677090
Pr: https://github.com/odoo/odoo/pull/86586
Related: odoo/enterprise#25353
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-03-28 10:45:57 +02:00
Pierre-Yves Dufays fc4d9cfac7 [IMP] base: align version number with other elements in settings
Technical note: We didn't change ".app_settings_block h3" because it is used
all over the place. Instead, we've overridden the margin and padding using
bootstrap classes on that specific element.

Task-2792977

closes odoo/odoo#86456

Related: odoo/enterprise#25289
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-28 10:45:50 +02:00
Antoine Guenet db5b64317e [FIX] mass_mailing: prevent traceback in _getCSSColorValue
mass_mailing has an override of _getCSSColorValue which was basically
never used since the option it's linked to was mostly inactive. Now it's
active it became obvious there is a mistake in it that causes a
traceback to occur when no color is passed to it. This adds the same
check as in the original method and thereby prevents the traceback.

task-2760157

closes odoo/odoo#84926

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-28 10:45:46 +02:00
Antoine Guenet 6d23353e5e [FIX] mass_mailing: move images into attachments
The shape feature only applies to attachments. This moves images from
mass_mailing snippets into attachments so they can be shaped in the
editor.

task-2760157

Part-of: odoo/odoo#84926
2022-03-28 10:45:46 +02:00
Antoine Guenet 6fc2f208ca [FIX] mass_mailing, web_editor: remove animated shapes from mass_mailing
Email clients do not support svg images so we can't support animated
shapes in mass_mailing. This removes them from the options.

task-2760157

Part-of: odoo/odoo#84926
2022-03-28 10:45:46 +02:00
Antoine Guenet 2e23548b39 [IMP] web_editor, mass_mailing: convert svg to png to use shapes in mail
This allows users to use the shape feature on images in mass_mailing.
Since email clients do not support the svg file type, it converts these
svg images into png images on save.

task-2760157

Part-of: odoo/odoo#84926
2022-03-28 10:45:45 +02:00
Thibault Libioulle a423289419 [FIX] web_editor,website_sale: fix click on pricelist while editing
Prior to this commit, when a user edits the Shop page, clicks on the
pricelist dropdown and finally clicks elsewhere, a traceback occurs:
`Uncaught TypeError: Cannot read properties of undefined (reading
'getColorNames')`

This commit ensures the link tools is not toggles on dropdown links,
i.e. the customizable links selector does not contain the dropdown
anymore.

task-2695091

closes odoo/odoo#87300

X-original-commit: 73b98a53e8bd19b3b96502d6006b002819287e44
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Thibault Libioulle (tle) <tle@odoo.com>
2022-03-28 09:50:36 +02:00
Davan CHIEM DAO 3fa052d541 [FIX] l10n_it_edi: Product matching from invoice import
This fixes erroneous matching of product when the product code in an invoice is ambiguous and fixes a missuse of the label from a product rather than the one on the invoice

Previously, a product would be set on an invoice line even if several products share the product code and when a product is set the label is the one of the matched product
Now, a product is set if the code matches one and only one product and the label used is always the one from the invoice

closes odoo/odoo#87313

Task: 2764978
X-original-commit: 47d5dff9f9a8eb0b4eebdf56e2a2d46618972453
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-03-28 07:35:05 +02:00
Paolo (pgi) 7dea86387d [IMP] l10n_it_edi_sdicoop: Added handling of duplicate sending
Duplicate sending should be considered as positive outcome.
We also post a message on the invoice to make the user aware.

closes odoo/odoo#87292

X-original-commit: b49210bdf507850306d6f19306ea8cd6a91e3316
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-03-28 00:15:47 +02:00
Audric Onockx (auon) 0dc5984d4d [FIX] sale_project : create on order when type updated to service
Steps :
Install Sales, Project and Inventory.
Create a Storable Product.
Create a SO with this product, but do not confirm it.
Change this product :
	> Type : Service
	> Sales > Service Tracking : Create a task in SO's project
Confirm the SO.

Issue :
Neither a delivery or a task is created.

Cause :
Confirming the SO calls SO._timesheet_service_generation(),
which filtered its SOLs based on is_service to 'create on order'.
As this field is not updated when changing the type of the product,
the SOL with the service is filtered out.

Fix :
Update SOL_.is_service when changing SOL.product_id.type.

opw-2786655

closes odoo/odoo#87308

X-original-commit: f1518e8c9a6c7819a0d7f72a524c189cd9de5fc6
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-03-26 11:23:38 +01:00
William Braeckman f82843cb7b [FIX] coupon: fix undeterministic error in test
The previous code generation for coupon used `getrandbits` which
provides a less randomised code than uuid4 causing undeterministic
errors during the tests.

TaskId-2786904

closes odoo/odoo#87299

X-original-commit: 7c2d68b466e13a25a6dd7091383b1f9810f1a630
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-03-26 00:11:24 +01:00
roen-odoo f3ce4fc51c [FIX] web: Many 2 One external link was invisible
Current behavior:
If you activate the packaging options of the inventory
tab. The external link of the packaging type in the inventory tab of a
product is invisible.

Steps to reproduce:
- Have inventory module installed
- Activate the packages & product's packaging options
- Go on a product page and then go in the inventory tab
- Add a line in the packaging tree view
- There should be an exteral link next to the packaging type after you
  selected one
- The external link is invisible

Note: similar issue was also present in the Document's workflow rules.

opw-2749832

closes odoo/odoo#87305

X-original-commit: 57a92e6a1178e3bd9d9f8995388cdc67a354c585
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-03-25 20:31:24 +01:00
Rahul Prajapati 99528083c5 [IMP] im_livechat: remove unused _channel_get_livechat_partner_name
Before this commit:

There is an unused method _channel_get_livechat_partner_name

After this commit:

Removed unused method

Task-2801010

closes odoo/odoo#87158

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-03-25 18:38:58 +01:00
tsm-odoo 2e690b4aa3 [IMP] mail, *: make mockserver autofill relational fields' inverses
*: web, website_slides.

Specifying both side of a relation when seeding test data is cumbersome.
Let startServer method handle it.

task-2792108

closes odoo/odoo#86939

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-03-25 18:38:54 +01:00
Raphael Collet 3ba3695642 [FIX] core: avoid NULLs in subselects generated for one2many fields
This fixes a problem that occurs with conditions on one2many fields,
where most conditions are translated with a subquery like

    "model".id IN (
        SELECT "comodel"."model_id" FROM "comodel" WHERE ...
    )

The issue occurs when the subquery return NULL values, i.e., when the
field "model_id" in the subquery above can be NULL.  The fix simply
consists in adding the condition "model_id IS NOT NULL" in the WHERE
clause of the subquery.

The problem with NULL values returned by subqueries is the fact that
they make the SQL condition undetermined instead of false, and this
discards some of the results returned by a query.  Simply consider:

    id NOT IN (1, 2, 3)

The value id=3 makes the condition false, while i=4 makes it true.  Now
consider that the set also includes a NULL value, like:

    id NOT IN (1, 2, 3, NULL)

The value id=3 makes the condition false, but the value id=4 makes it
undetermined.  Therefore this condition is actually undetermined for all
possible values of id, and a query containing that condition simply
returns nothing!

closes odoo/odoo#87285

X-original-commit: 6d680bac0333c6c7ce9f056cba0e1f7e9fa22f9c
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-03-25 17:47:44 +01:00
Raphael ColletandDidier Debondt 036ef5b96d [FIX] core: use EXISTS in domain conditions on many2many fields
This fixes two problems that occur with conditions on many2many fields:
the subtle bug caused by NULL values that are returned by subqueries,
and the performance of those subqueries.

The problem with NULL values returned by subqueries is the fact that
they make the SQL condition undetermined instead of false, and this
discards some of the results returned by a query.  Simply consider:

    id NOT IN (1, 2, 3)

The value id=3 makes the condition false, while i=4 makes it true.  Now
consider that the set also includes a NULL value, like:

    id NOT IN (1, 2, 3, NULL)

The value id=3 makes the condition false, but the value id=4 makes it
undetermined.  Therefore this condition is actually undetermined for all
possible values of id, and a query containing that condition simply
returns nothing!

Regarding performance, consider a domain like [('tag_ids', '=', False)].
It is currently translated in SQL as

    "model".id NOT IN (
        SELECT "model_id"
        FROM "model_tag_rel"
        WHERE "model_id" IS NOT NULL
    )

PostgreSQL does not handle well this "NOT IN" expression when the
relation table is large, and uses some very inefficient query plan in
that case.  The inefficient query plan is possibly related to the
special handling of NULL values, by the way.  This commit changes the
above expression to a "NOT EXISTS" expression (as below), which is
executed with a much more efficient query plan, even with large tables.

    NOT EXISTS (
        SELECT 1
        FROM "model_tag_rel"
        WHERE "model_tag_rel"."model_id" = "model".id
    )

This change was motivated by a use-case with 2.7M account moves, 11M
account move lines and a many2many relation table with 2.3M lines
(`account_move_line_account_tax_rel`).  The query was timing out (15
minutes), and it now takes 15 seconds.

We have replaced all the conditions on many2many fields to use the
relational operators EXISTS and NOT EXISTS.

A test has been added to reflect a case where the many2many table
contains NULL values, like the one for channel_partner in regards to
partner_id and guest_id.

task-2753782

X-original-commit: 334b2aa2aa437d2ed86130f2ed426025f8fe4b86
Part-of: odoo/odoo#87285
Co-authored-by: Didier Debondt <did@odoo.com>
2022-03-25 17:47:43 +01:00
root a611a80093 [IMP] account: add index for invoices
By adding an index the cost of the SQL's will be a lot lower.
See #86615 for info/sample

closes odoo/odoo#87287

X-original-commit: 44b445eba6287348211e002235e1d003b45f2d6e
Signed-off-by: William André (wan) <wan@odoo.com>
2022-03-25 16:52:00 +01:00
Pieter Claeys (clpi) d72b16e7cf [FIX] mrp: don't show reserved column for byproducts
No longer show the reserved column from by-products production registration on an MO.

Task ID: 2797692

closes odoo/odoo#87225

Pr: https://github.com/odoo/odoo/pull/86768
X-original-commit: 7aa08fe325490bf6ca5efe8b9b7be4bcae843826
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-03-25 16:51:53 +01:00