Commit Graph
140385 Commits
Author SHA1 Message Date
Xavier Morel 34f0866078 [FIX] core: disable werkzeug's merge_slashes
Werkzeug 1.0 adds a `merge_slashes` feature which calls rule.build()
*during match*[0] (= during dispatch).

However at this point our environment still contains an invalid /
placeholder UID, so `display_name` / `name_get()` fails dramatically.

One possibility would be to update the slugifying to not access the
record (outside of the id) if the environment is not "proper", an
other alternative is to just disable the feature since it seems to not
have been necessary so far.

The latter seems less hacky so do that for now, we can always swap the
solution later if we need to.

[0] https://github.com/pallets/werkzeug/blame/048cdfd9b969c0c3a133d7ff43b8ad1ad6a673ec/src/werkzeug/routing.py#L904
2020-04-22 11:31:20 +00:00
Xavier Morel 9a93d3db11 [FIX] *: collection.<ABC> is deprecated 2020-04-22 11:31:20 +00:00
Xavier Morel d9c685a757 [FIX] odoo_referral: werkzeug.url_encode removed from werkzeug 1.0 2020-04-22 11:31:20 +00:00
Xavier Morel c58c618833 [FIX] core: modules moved or removed in Werkzeug 1.0
Those were deprecations implemented in 0.15

* all middlewares have been moved from `werkzeug.wsgi` to
  `werkzeug.middleware`, including the `SharedDataMiddleware` we use
* ProxyFix was moved to werkzeug.middleware.proxy_fix, this had
  already been fixed but I forgot the import
* sessions support was moved to a separate package
  (`pallets/secure-cookies`), however while distros are starting to
  update werkzeug to 1.0 (e.g. done on Arch, and in Debian
  Experimental) they're not bundling secure-cookies so using a
  vendored version seems like the least bad thing we can do, even more
  so as conditional dependencies are not really a thing (e.g. even
  with just pip we can't depend on secure-cookie iff werkzeug >= 1.0)
2020-04-22 11:31:13 +00:00
Goffin Simon 5b80a301db [FIX] stock_account: User not allowed to update product cost
Steps to reproduce the bug:

- Login with demo user (no accounting app access)
- Go to any product with Update Cost button and try to update it

Bug:

Error message "You don't have the access rights to post an invoice" even if
the inventory valuation was manual.

opw:2240513

closes odoo/odoo#49950

X-original-commit: edc54cdf6d39d7689902903fa637df2a709b4396
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-04-22 10:06:12 +00:00
Arnold Moyaux 6825147ecb [FIX] purchase_stock: remove forgotten print
Remove forgotten debug print in test

closes odoo/odoo#49944

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-04-22 09:38:50 +00:00
Xavier Morel 9d4ee88263 [FIX] core: vendored sessions.py so it actually works
* remove SessionMiddleware we don't need as it's responsible for most
  imports
* fix relative imports to absolute imports from werkzeug
* remove py2/py3 compatibility imports, shims and conditions as we're
  P3 only
* remove deprecation warning (duh)
2020-04-22 09:28:14 +00:00
Xavier Morel 39fb7f9d31 [ADD] core: vendor werkzeug 0.16's sessions.py
In Werkzeug 1.0, sessions support was moved out and into a separate
package (secure-cookies). Issue is distros are already starting to
update werkzeug to 1.0, without necessarily adding
secure-cookies (e.g. arch, debian experimental). Plus secure-cookies
has some changes e.g. different filename & al. So just vendor the
"continuity" version which is the last werkzeug before removal.

This commit copies the original file as-is so we can track eventual
changes if necessary.
2020-04-22 09:28:14 +00:00
Xavier Morel 3f2a18b0f2 [FIX] core: improve warnings configuration
DeprecationWarning was configured as `once` which might be why I
missed some previously: `once` means the *filter* will only signal
once, meaning only one DeprecationWarning gets shown per run. Even if
there are 5 *completely different* warnings getting generated by the
codebase.

`default` should be more suitable, I think I'd originally
misunderstood it as "whatever the default is for this warning" but
what it *actually* means is "print once for each (module, lineno)".

An alternative could be `module` which would show the warning once per
module but wouldn't trigger from different warnings in the same module.
2020-04-22 09:27:29 +00:00
Arnold Moyaux 00114a4ee7 [FIX] stock: forecasted quantity incorrect
Usecase to reproduce:
- Install stock with demo data
- Go on drawer form view.
- The quantity forecasted and the report for forecasted quantity do not
indicate the same quantity

It happens because the quantity on forecast is wrong. It's due to the
part that select the quants. The condition wh IS NOT NULL remove all
the quants. Also using a not null on a table is probably not a good
practice.

Also complete the request is order to take quants in transit

closes odoo/odoo#49941

X-original-commit: 405522de1f97cfb7571d6096f727a4a2d03561d6
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-04-22 09:21:45 +00:00
Xavier Morel 92b007cb89 [IMP] core: update werkzeug dep to 0.16
allows having DeprecationWarnings pop up on runbot
2020-04-22 06:41:43 +00:00
Xavier Morel 0655974d5a [IMP] safe_eval: opcodes blacklist & cleanup
There are bytecode operations we don't support because we've never
needed them, and there are bytecode operations we don't support
because they're vectors of security issues.

Currently no difference is being made between the two, so when looking
to add a new opcodes it's hard to know whether it's been considered
and rejected or whether it just hasn't been considered (or found
useful) yet.

Add an explicit blacklist, which is explicitly subtracted to all
opcodes lists, to allow motivating the bans of certain
opcodes. Opcodes listed in no lists are the "graylists" of opcodes we
either haven't yet considered or have not had a use for.

Also cleanup the existing lists of opcodes to remove long-gone (or
even never-existing) opcodes, and add a few missing opcodes:

* DUP_TOPX was removed from Python 3, replaced by DUP_TOP_TWO
* STORE_MAP was removed in Python 3.5
* BINARY_DIVIDE and INPLACE_DIVIDE were removed from Python 3 (they
  were used to invoke P2's integer division)
* the SLICE+<X> were removed from Python 3, which only uses
  BUILD_SLICE
* CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW were removed in Python
  3.6 and functionally replaced by CALL_FUNCTION_EX (bpo-27213)
* JUMP_IF_FALSE and JUMP_IF_TRUE were removed back in 2.7, replaced by
  POP_JUMP_* and JUMP_*_OR_POP (bpo-4715)
* various finally-related bytecode instructions were added to Python
  3.8 to improve and speed up the handling of return, break and
  continue (bpo-17611).
* INPLACE_REMAINDER, INPLACE_LEFTSHIFT and INPLACE_RIGHTSHIFT were
  mentioned in PEP 202 but never actually implemented: INPLACE_
  instructions were intended to mirror the BINARY_ instructions, these
  mnemonics didn't match the BINARY_ ones, so the actual mnemonics are
  INPLACE_MODULO, INPLACE_LSHIFT and INPLACE_RSHIFT
* while at it, BINARY_ and INPLACE_ mnemonics: as noted above they're
  mirrors of one another with different prefixes (except for SUBSCR
  which doesn't have an INPLACE version), we only supported a fraction
  of the INPLACE codes for unknown reason.

  Initially looked at simply aligning the BINARY and INPLACE mnemonics
  e.g.

       'BINARY_POWER',  'BINARY_MULTIPLY',  'BINARY_FLOOR_DIVIDE',
      'INPLACE_POWER', 'INPLACE_MULTIPLY', 'INPLACE_FLOOR_DIVIDE',
      ...

  so it would be easier to notice discrepancies, but it seems simpler
  and clearer to just move the suffixes to a single list and generate
  the BINARY_ and INPLACE_ mnemonics from that
* moved STORE_SUBSCR from EXPR to SAFE, I don't see how `foo[...] = 3`
  could be in an expression
* remove pseudo-graylist `_POSSIBLE_OPCODES_P3`, was intended as a
  list of new P3 opcodes we might want to add, but the purpose was
  hard to understand and a proper blacklist makes way more sense

closes odoo/odoo#41085

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-03-23 08:56:21 +00:00
Samuel Degueldre a39c90fd6d [FIX] web_unsplash: unsplash images added on website break on products
Before this commit, selecting an unsplash image on website, then going
on a product page and selecting that same image in the media-dialog
would not work, and upon saving, the image would be the image
placeholder.

A previous fix in odoo/odoo#31328 added handling so that you could
choose unsplash images for a product, but it failed to account for
unsplash images that had already been added on a public view (for
example on a website page), which the user can choose in the
media-dialog.

This was caused by the fix only searching for the unsplash attachment on
the current model, and not among public attachments, resulting in an
empty search result.

This commit fixes that by adding that the attachment we are looking for
should either be on the current model, or be a public attachment.

closes odoo/odoo#49937

X-original-commit: 196d6b1630fa443bc1d143f76f62f7a719ca4930
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-22 08:55:32 +00:00
Kevin Baptiste af70d19265 [FIX] fleet: properly display image on kanban
closes odoo/odoo#49936

Taskid: 2237599
X-original-commit: d650ca788c833389f8fb9cfcbdb73ba82044f94e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba-odoo@users.noreply.github.com>
2020-04-22 08:47:33 +00:00
Odoo's Mergebot a1641772aa [MERGE] test_mail: update test models and reorder addon
PURPOSE

Have a cleaner test_mail addons

SPECIFICATIONS

Keep only mail-related tests, move odoobot in test mail full, send "update
notification" tests in mail (specific to mail). Merge some test files to
lessen number of files, perform light file renaming.

Split test mail models file to prepare some cleaning in those models and tests.

Keep only mail-related tests, move odoobot in test mail full, send "update
notification" tests in mail (specific to mail). Merge some test files to
lessen number of files, perform light file renaming.

Split test mail models file to prepare some cleaning in those models and tests.

LINKS

Prepares Task ID 2238597 (clean notification models)
Prepares Task ID 2083854 (improve mass mailing technical flows)
PR #49891

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-22 11:24:38 +02:00
Thibault DelavalléeandRémy Voet 42b5ec0384 [LNT] mail: lint and reorder mail_notification files
In this commit we order fields more logically to ease reading and prepare
future modifications. We also rename the class and some field strings to
be more user friendly.

LINKS

Prepares Task ID 2238597 (clean notification models)
Prepares Task ID 2083854 (improve mass mailing technical flows)
PR #49891

Co-Authored-By: Rémy Voet <ryv@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-04-22 08:40:04 +00:00
Thibault Delavallée 7c3a0daaa1 [REF] test_mail: sun is shining, no more umbrellas
PURPOSE

Have a cleaner test_mail addons

SPECIFICATIONS

Umbrella -> Container, easier to understand that we target a ticket / project
like model using mail.test.ticket and mail.test.container .

LINKS

Prepares Task ID 2238597 (clean notification models)
Prepares Task ID 2083854 (improve mass mailing technical flows)
PR #49891
2020-04-22 08:40:03 +00:00
Thibault Delavallée ba068ee728 [REF] test_mail: rename test models to ease understanding
PURPOSE

Have a cleaner test_mail addons

SPECIFICATIONS

Keep only mail-related tests, move odoobot in test mail full, send "update
notification" tests in mail (specific to mail). Merge some test files to
lessen number of files, perform light file renaming.

Split test mail models file to prepare some cleaning in those models and tests.

LINKS

Prepares Task ID 2238597 (clean notification models)
Prepares Task ID 2083854 (improve mass mailing technical flows)
PR #49891
2020-04-22 08:39:46 +00:00
Kevin Baptiste 1b4767ee79 [IMP] hr_holidays: hide duplicated info on popover
The name of the employee and the dates were shown multiple times in the
popover. This commit aims at showing the relevant information only once.

closes odoo/odoo#49845

Taskid: 2227158
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-22 08:30:19 +00:00
Rémy Baranx (bar) bad0e501c0 [FIX] stock: ambiguous product_id in init query
During the upgrade of some databases to 13.0, the following traceback
was reported:

`psycopg2.errors.AmbiguousColumn: column reference "product_id" is ambiguous`

This commit fixes this issue by prefixing product_id with the table name alias 'm'.

closes odoo/odoo#49927

X-original-commit: 0e3c5d3ee1726db2641cd683a84fe59e867d4319
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-04-22 08:12:25 +00:00
Arnold Moyaux a405de0161 [IMP] stock, mrp, purchase_stock: forecast popover usability
Set the padding on the write for date. Modify the text to be consistent
with the manual and automatic orderpoint. Explains the min, max
and quantity to order mechanism.

closes odoo/odoo#48536

Task: 2161378
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-04-22 08:05:50 +00:00
Arnold Moyaux 90f067cce8 [IMP] stock, mrp, purchase_stock: allow to define vendor, bom on orderpoints
Allow to set a BoM or a vendor on an orderpoint. In this case it's
passed to the values and will be processed by _run_buy and
_run_manufacture to use them.

Task: 2161378
2020-04-22 08:04:32 +00:00
Arnold Moyaux 045416474d [IMP] stock: orderpoint fileds rename and view improvements
There is a mix between qty and quantity. Set everything to quantity

Task: 2161378
2020-04-22 08:03:36 +00:00
Arnold Moyaux db978e3609 [IMP] stock: product view usability
Route diagram directly open with a single warehouse and variant.
Move fields and group to have a cleaner view.

Task: 2161378
2020-04-22 08:03:15 +00:00
Arnold Moyaux 3f2815ab2f [IMP] stock: default min and max for orderpoint
Technicaly it's anoying to create orderpoint and explicitely
set the product_min and product_max to 0.0. If another value
should be use, it would probably not be forgotten.

Task: 2161378
2020-04-22 08:01:16 +00:00
Thibault Delavallée 6e347b196d [MOV] (test_)mail(_full): redispatch some tests and split test mail models file
PURPOSE

Have a cleaner test_mail addons

SPECIFICATIONS

Keep only mail-related tests, move odoobot in test mail full, send "update
notification" tests in mail (specific to mail). Merge some test files to
lessen number of files, perform light file renaming.

Split test mail models file to prepare some cleaning in those models and tests.

LINKS

Prepares Task ID 2238597 (clean notification models)
Prepares Task ID 2083854 (improve mass mailing technical flows)
PR #49891
2020-04-22 08:00:29 +00:00
Arnold Moyaux 712c377a0e [FIX] mrp, stock: route diagram button under routes field
Usabilty. Move the route button under the route params.
People had issue with route and didn't know that this
report exist. We hope that moving it under the route will
help user to configure their route.

Task: 2161378
2020-04-22 07:59:44 +00:00
Arnold Moyaux fc692354b6 [IMP] mrp, stock: default route on orderpoints
Set a default route on orderpoint created by the replenishment report.
First it select the first route on the product if it exists (it's
uselss since it's a preferred route on the report but it's used for
clarity). If the product has no route then it tries to guess it
with vendor pricelist or BoM on the product.

Task: 2161378
2020-04-22 07:58:04 +00:00
Arnold Moyaux 943da6df0f [IMP] stock, purchase_stock, mrp: Replenishment Report
New report to easily order missing products in each warehouse.
Orderpoint have a new type: 'manual'. Manual orderpoint are not
trigger by the scheduler but the user could create replenishment
from the report directly. The report use the forecast report in
order to detect missing quantity for today (it does not search
depending the lead time for each product warehouse due to lake
of performance). It compares missing quantity with incoming RFQ
and other ongoing orderpoint. If it still missing a new entry
for replenihsment is created (it's also automaticaly deleted if
the replenihsment has been done another way).

Task: 2161378
2020-04-22 07:52:45 +00:00
Arnold Moyaux b6fe6de9e9 [IMP] stock: orderpoint order by location
Order by location in order to have a better overview of missing product
by location

Task: 2161378
2020-04-22 07:51:50 +00:00
Arnold Moyaux e69c2c7af0 [IMP] stock: remove useless arg
_prepare_procurement_values on orderpoint never uses product_qty

Task: 2161378
2020-04-22 07:50:36 +00:00
Arnold Moyaux 35bba1a65d [IMP] stock: orderpoint respect guidelines
Task: 2161378
2020-04-22 07:50:25 +00:00
Arnold Moyaux 9ee2323c28 [REF] stock: _procure_orderpoint_confirm multi
Allow to run the execution for a subset of orderpoints

Task: 2161378
2020-04-22 07:50:13 +00:00
Arnold Moyaux 7076a86add [IMP] stock: _get_rule allows to specify route_ids
_search_rule on procurements search in a specific way in this order:
- First: route passed in the procurement values
- Second: route on product/product category
- Third: route on warehouse
- Fourth: remaining route.

However _get_rule doesn't allow to simulate the first usecase with
the route on procurement. This commit add the functionality.
(Usefull for replenishment report where a route_id could be set
on an orderpoint)

Task: 2161378
2020-04-22 07:47:16 +00:00
Arnold Moyaux 4d5060d665 [MOV] stock: stock.warehouse.orderpoint own views file
Create a file for stock.warehouse.orderpoint. It's not linked to
warehouse so it should not share the same file.

Task: 2161378
2020-04-22 07:46:23 +00:00
Aaron Bohy ae4c9d1eca [FIX] web: toggle optional column in list with owl component
Have a list view with an Owl field component (e.g. widget="badge"),
visible. Open the optional field dropdown and make another field
visible.

Before this commit, the '_onToggleOptionalColumn' handler was
executed twice, because two click events where triggered: one on
the label, and one on its associated input (because of the for
attribute, see [1]).

As a consequence, the new field was added, and directly removed
from the view. This could even cause subsequent crashes.

The difference between an Owl component and a legacy widget is
that the Owl component is async (more than a nextTick) as we wait
for the nextAnimationFrame to render. When the rendering is fast
enough (e.g. without Owl components), the click event isn't remap
to the input yet (because we empty the list HTML node), so the
handler is executed only once.

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label

Issue reported on task 2204306

closes odoo/odoo#49920

X-original-commit: b02d347e8770835ad28a6487071930a904bce101
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-22 07:50:00 +00:00
std-odoo 7c0c947b0e [FIX] survey: add missing fields in the question form view
The fields `constr_mandatory` and `constr_error_msg` were removed in some
recent cleaning. They should be available in the survey question form view.

Task ID 2235528

closes odoo/odoo#49919

X-original-commit: 10731089ccd471cb5e70500276061017a1cc6c6a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-22 07:49:37 +00:00
Swapnesh Shah 7c8ae751f8 [FIX] hr: allow to copy employee linked to user
Before this commit, It was not possible to copy An employee which is already linked to User due `user_uniq` constraints.

Now we add `copy=False` on `user_id` field, so Employee will be copied without linked User.

closes odoo/odoo#49915

X-original-commit: 2a63df03859166414be338c6655ee8c4052666b7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-22 07:28:29 +00:00
Kevin Baptiste 62c215298e [FIX] fleet: properly display image on kanban
closes odoo/odoo#49597

Taskid: 2237599
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-16 11:23:42 +00:00
Kevin Baptiste 5268f3c870 [IMP] fleet: add active, description on service log
Purpose
=======

Add new fields on fleet.vehicle.log.services to make the model more
flexible for several use cases.

TaskID: 2237599
2020-04-16 11:23:41 +00:00
Swapnesh Shah 6910a7d91f [FIX] website: name is required at model level
Before this commit,  There would be an error due to the required field `name` which was not passed in vals when the user creates new Redirects through Manage Pages from Website, while the `name` field is required at the model level.

In this commit, we pass 'name' field in the values of `website.rewrite`

Followup on be8fc2296b

closes odoo/odoo#49748

X-original-commit: a8125ebc1480b5b215bf3737f4e799ead5b34d9d
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-04-18 19:25:00 +00:00
Christophe Monniez cc871698fa [FIX] web: improve click_everywhere timeout message
When an element is clicked during the test and a tiemout occurs, message
that appears in Odoo logs is not really clear.

closes odoo/odoo#49907

X-original-commit: 0e1545c52fdca6d311a18533d3d4efed984df329
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-04-22 06:45:42 +00:00
Aaron Bohy 5a4a779faf [FIX] web: qunit assert: doesNotHaveClass
Before this commit, the result of our custom qunit assert
'doesNotHaveClass' was incorrect when it was called with
several classnames.

For instance
  assert.doesNotHaveClass(<span class="a"/>, 'a b');
passed, whereas it shouldn't.

closes odoo/odoo#49892

X-original-commit: c40fc67a130ae8e0f061a89d3a21d2507a0f9ae3
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-21 17:01:01 +00:00
dmonzonis 9654961879 [IMP] web_tour: Allow customization of rainbow man message
Before this commit, the rainbow man message at the end of tours is fixed
to a hardcoded message.

This commit allows to customize the message within the definition of the
tour, to add the ability to use tailored messages depending on the app
the tour is about. If no custom message is set, the old default will
still be used.

Task ID: 2241549

closes odoo/odoo#49779

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-22 06:14:04 +00:00
Goffin Simon 435e47385d [FIX] stock: Internal note displayed in Delivery slip
Steps to reproduce the bug:

- Let's consider a consumable product P with an internal note IN
- Create a SO with P and confirm it
- Process the delivery and validate it
- Print the delivery slip

Bug:

The internal note NI was displayed on the delivery slip.

Fine tuning of https://github.com/odoo/odoo/commit/038221f3180a7a8888503553dbb5eb57875ef3a6

opw:2227613

closes odoo/odoo#49860

X-original-commit: 9b6ea1cdbed02c0f2ccd3e2608e4caf12c8c24ac
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-04-21 11:56:38 +00:00
Denis Zhadan bdb89ee4e9 [CLA] Wiserby OÜ signs Odoo CCLA
closes odoo/odoo#49867

X-original-commit: 54becce444578b6b934b7888fca0679cc0f122c9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-21 12:44:07 +00:00
Odoo's Mergebot 2a1e53750f [MERGE] various: use read_group instead of computing length of 2many fields
PURPOSE

Several counter fields are performed inefficiently. They use compute methods
using length of 2many fields instead of making use of more efficient ORM
methods like read_group.

SPECIFICATIONS

No functional change, only technical performance improvements. Purpose is
to improve count performances (meeting count, applicant count), ... by using
a read_group and maybe adding missing indexes.

LINKS

Task ID 2196182
PR #44662

Related: odoo/upgrade#973
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-21 15:31:50 +02:00
Victor Feyens 9ff94fec74 [IMP] website_forum: improve forum.post child_count performance.
PURPOSE

Several counter fields are performed inefficiently. They use compute methods
using length of 2many fields instead of making use of more efficient ORM
methods like read_group.

SPECIFICATIONS

No functional change, only technical performance improvements. Purpose is to
improve forum.post child_count performance.

LINKS

Task ID 2196182
PR #44662
2020-04-21 12:28:52 +00:00
Victor FeyensandThibault Delavallee 3f6625ef13 [IMP] link_tracker, mass_mailing: uuse read_group instead of computing len of one2many fields
PURPOSE

Several counter fields are performed inefficiently. They use compute methods
using length of 2many fields instead of making use of more efficient ORM
methods like read_group.

SPECIFICATIONS

There may be a lot of clicks linked to a given link tracker. Compute the count
of clicks in batch with a read_group to improve performance.

Same for utm campaign mailing count performances.

Some missing indexes are added to speedup queries.

LINKS

Task ID 2196182
PR #44662

Co-Authored-By: Victor Feyens <vfe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
2020-04-21 12:28:52 +00:00
Victor FeyensandThibault Delavallee 2457e7f6f4 [IMP] hr_recruitment: use read_group instead of computing len of one2many fields
PURPOSE

Several counter fields are performed inefficiently. They use compute methods
using length of 2many fields instead of making use of more efficient ORM
methods like read_group.

SPECIFICATIONS

No functional change, only technical performance improvements. Purpose is to
improve meeting count performances.

An index on applicant is also added to speedup queries.

LINKS

Task ID 2196182
PR #44662

Co-Authored-By: Victor Feyens <vfe@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
2020-04-21 12:28:52 +00:00