Commit Graph
135599 Commits
Author SHA1 Message Date
Aurélien Warnon b2f87c7c8e [FIX] crm: always display UTM information on opportunity view
This commit fixes the crm.lead form view to always display UTM information when
the lead is of type "opportunity".

Before this change, the UTM information (as well as the 'referred' field) were
only displayed for members of the 'base.group_multi_company', which did not
make sense on a functional point of view.

The 'company_id' field however, that is in the same form group, is still
correctly displayed only for members of the 'base.group_multi_company' group.

Task 2237318

closes odoo/odoo#50337

X-original-commit: d5b07b7c16cf7129f3231985ef607f02fb0c6475
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-04-28 15:02:53 +00:00
Xavier Morel f08b5d22a4 [IMP] web: handling of escaping in literals
Handling of escapes (`\`) was performed during evaluation rather than
parsing, so strings in the AST stored the escaped form (rather than
the proper one), and _formatAST had to mess around in order to try and
get it back into a semblance of relevance (especially as the AST would
store the escaped string without delimiters).

Fix: perform the escapes handling (aka normalisation) during
tokenization where it belongs. This means the AST formatter can now
just JSON.stringify the data. Until and unless we decide to produce a
cpython-compliant
repr (https://github.com/python/cpython/blob/0169d3003be3d072751dd14a5c84748ab63a249f/Objects/unicodeobject.c#L12902-L13006)
which is unlikely.

closes odoo/odoo#50236

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-27 13:59:49 +00:00
Mathieu Duckerts-Antoine 7b402c5e59 [FIX] web: limit on search panel values
Before this commit, if a many2X field with a big comodel was added
in a search panel, the view using it would crash. For instance that
problem occured in the kanban view for hr.job, where res.users
appears as the comodel for the field user_id.

Now, we fix an arbitrary limit of 200 to the numbers of values to fetch
for each many2X fields in the search panel. This avoid the problem
mentionned above.
Furthermore, in case the limit is attained for a field used
as select="one", the values are displayed without being hierarchized.
Indeed the limit can leads to gaps in the knowledge of the hierarchy
and consequently to a bad representation of it.

Task ID: 2154668

closes odoo/odoo#50334

X-original-commit: 8d57153b34c04952a85f6642951cb2697016da84
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-28 14:57:58 +00:00
Pedro M. Baeza 64ae832a8a [FIX] base: allow uninstall of modules to upgrade
Commit 8c1bb22ec0222dca652e0649454b986c06cb1368 forgot to take into
account migrations, during a migration it is possible that some modules
need to be uninstalled because the target version may have removed /
moved them and since during a migration all modules are set `to
upgrade`, the previous condition made this impossible for migration
scripts that use the ORM for module uninstalls (not Odoo's case, mind
you)

With this commit it is again possible to uninstall modules from a
migration script during a migration.

closes odoo/odoo#50322

X-original-commit: a7c90a6d080a77316924cec9d3c64f9662ac7436
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2020-04-28 13:12:27 +00:00
Jorge Pinna Puissant feb830e9f7 [FIX] l10n_fr_pos_cert: traceback if company don't have country
- Install PoS and "l10n_fr_pos_cert";
- Erase the country in the current company;
- Open a PoS session;
- Click on any product.

Before this commit, a JavaScript traceback was raised: TypeError: Cannot read property
'code' of null.

Now, an error message is raise, that informs the user that the company don't have country
setted.

opw-2241993

closes odoo/odoo#50320

X-original-commit: 5ed4b0cb54a20756e44c492cb5a67ff7d40f452c
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-04-28 13:07:20 +00:00
Odoo's Mergebot f731cc3de3 [IMP] web: update Owl to v1.0.7
Update to the version **1.0.7** of the Owl framework.
Some code conflicting with the new behaviour of `mount(target, { position: self })` has been slightly tweaked to work as expected.

closes odoo/odoo#50240

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-28 18:50:55 +02:00
Lucas Perais (lpe)andJulien Mougenot 6def725c6e [FIX] web: Owl compatibility: remount on same node
Keep a reference to the 'mount' method arguments to ensure that components will
be mounted on the same node and in the same way they were originally mounted.

This fix is related to the following changes in the Owl framework:
https://github.com/odoo/owl/commit/b4ad14edc03d4fb2d7a4622c6c1f63f6df5b4541

Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-04-28 09:29:49 +00:00
Julien Mougenot 03415f08f4 [IMP] web: update Owl to v1.0.7 2020-04-28 07:24:23 +00:00
wan 8800869a1c [FIX] l10n_fr_fec: give write access to account.fr.fec
account.fr.fec model needs to have write access as it
explicitely calls write() on its records.

closes odoo/odoo#50081

X-original-commit: f02a783be445238b9497ebd55838143945c99d2d
Related: odoo/enterprise#10162
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-04-24 11:00:05 +00:00
std-odoo 8f47c42228 [FIX] link_tracker: do not allow link tracker duplication
Purpose
=======
We should not be able to duplicate the link trackers (as it
makes no sense from a functionnal POV).

Task-2090344

closes odoo/odoo#50303

X-original-commit: c236b976f6a1bfa92fa6cd6325f652eec461c805
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-28 11:39:05 +00:00
oco-odoo ff26ed5b77 [FIX] account: don't raise an error when using account controls together with section/notes lines on invoices
Section and note invoice lines are now account.move.line objects with a distinct value in display_type field. When restricting the use of accounts on a payable/receivable journal and making an invoice in it with at least one section or note, and only using legal accounts, it always failed, as the note/section account was empty, hence not in the allowed accounts.

closes odoo/odoo#50297

X-original-commit: 28cd50f203c019b78f55fc16120af81c901caef2
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-04-28 11:11:18 +00:00
Commandant Custo 37717f8c2b [FIX] account: report_invoice styling issues in #total table
Steps to reproduce:
- install account
- print any invoice

Previous behavior:
the css rule and classes are ignored on the total table

Current behavior:
displays as intended

This PR fixes two issues:
1/ class attribute was not taken into account anymore ( table-sm )
2/ page-break-inside didn't work

closes #48682
opw-2229181

closes odoo/odoo#50259

X-original-commit: d8bfae0a641f43455b594e8ab2b22ce52cd98d70
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-04-27 18:31:59 +00:00
Commandant Custo 312e02616d [CLA] signature for sve-odoo
X-original-commit: b9d6b548f91311584e36c1d27dec9ce5824f4577
2020-04-27 18:31:59 +00:00
Yannick Tivisse 85b199b9be [IMP] various: Set a default random color on certain tags
Purpose
=======

For a tag to be displayed on a kanban card, it needs to have a color set.
We won't be changing that behaviour, since it would mean having
two options > the color, and whether or not to show it in the kanban

The purpose of this task is to set a color on new tags to make the user
save a bit more time, set a color for him as he might not find the feature,
and make sure the tag will be on the kanban cards.

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

For each of the following models, at creation, set a random integer between
1 and 11 in field 'color'

Models:
res.partner.category
crm.tag
project.tags
hr.applicant.category
helpdesk.tag
hr.employee.category
event.track.tag
mrp.eco.tag
repair.tags

closes odoo/odoo#49967

Taskid: 2234527
Related: odoo/enterprise#10112
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-22 11:32:35 +00:00
Lucas Lefèvre 45170ceeb5 [IMP] various: Hide default user image for unassigned records
Impacted modules: account_analytic_default, crm, event,
hr_recruitment, maintenance, mass_mailing, project,
purchase_requisition, stock_picking_batch, website_slides

The default image displayed when the record is unassigned is
confusing, so we are removing it.

FP request
Task 2234524

closes odoo/odoo#49333

Related: odoo/enterprise#9834
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-28 13:16:29 +00:00
Nidhi Patel 1c2ba7a51f [IMP] hr_timesheet: Improve the filters for 'My Timesheets' menu
Currently, Some filters of the 'My Timesheets' menu do not make
proper sense So purpose of this task is to remove those filters
from the 'My Timesheets' menu.

In this commit, we remove the following filters from the
'My Timesheets' menu:
  -Employee
  -Department
  -My Timesheets
  -My Team
Also, rename the 'My Project' filter into 'My Projects' and that
filter is inside the my timesheet menu so also filter the line for
current user.

closes odoo/odoo#48663

Taskid: 2224472
Related: https://github.com/odoo/enterprise/pull/9564
Related: odoo/enterprise#9564
Closes: 48663
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-28 14:33:59 +00:00
Victor Feyens 1eabd8e60a [FIX] base/populate: do not empty populated list during population.
The population of res users was emptying the list of populated partner
ids.

The lunch.supplier population was crashing because no partner id was
present in the partner population registry to use as `partner_id` for
the generated lunch suppliers.

closes odoo/odoo#50266

X-original-commit: a2adc346906ee753df6d8e49caa4ee5381629695
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-04-28 06:36:59 +00:00
fja-odoo 11c60739e4 [IMP] website, *: warn user about outdated blocks
* = mass_mailing, web_editor, website_crm, website_event, website_form,
website_forum, website_hr_recruitment, website_mail_channel,
website_mass_mailing, website_sale, website_slides

When an outdated snippet's option are activated we display a warning
in the left panel that inform the user about the potential
malfunctions.

To do so the snippet's template key is added to the snippet as
data-snippet.
If a snippet is "t-call" inside another snippet, it will need to use
t-snippet-call instead of t-call to have the key on himself.

Those unique keys are used on snippet selection to retrieve the
snippet's version in the left panel and compare it with the currently
selected snippet's version. Versions are describe with data-vcss,
data-vjs and data-vxml. If a snippet's key is not in the left panel we
consider that snippet as outdated.

Added some tests to ensure that t-snippet and t-snippet-call really have
their template key as data-snippet

Adapted the views to the data-snippet changes adding
data-snippet="tmpl_key".

Part of: https://github.com/odoo/odoo/pull/44569
task-2189669

closes odoo/odoo#50254

X-original-commit: 28a6cd49b6e87b75c2e70771e241c41778bf9e87
Related: odoo/enterprise#10236
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-04-27 16:36:31 +00:00
fja-odoo 51ab03e4b1 [FIX] mass_mailing: fix duplicate snippet_options
The web_editor snippet_options were duplicated

Part of: https://github.com/odoo/odoo/pull/44569
task-2189669

X-original-commit: c8ec4ca2bb12e3a65665f5bdd7ad079243e030bd
2020-04-27 16:36:31 +00:00
fja-odoo b98a235126 [FIX] website_hr_recruitment: remove s_btn snippet
some s_btn snippets were not removed.

Introduce by: https://github.com/odoo/odoo/commit/4ca401a8556448d0ec1cf0e5e0f04de5fd602a1e

Part of: https://github.com/odoo/odoo/pull/44569
task-2189669

X-original-commit: 8575ef7186c2abfb2f562ccb1d98c1e3f622ed63
2020-04-27 16:36:30 +00:00
alt-odoo d9ca5840fd [FIX] base: do not show address type for company contacts
Commit 4497077f55 was intended to show address type for contacts without
company, but we should still keep it invisible for company contacts.

closes odoo/odoo#50260

Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2020-04-27 19:33:37 +00:00
Christophe Monniez 397158b6df [FIX] core: log full path in ir_logging when using postgresql handler
When the PostgreSQLHandler is used to store some logs in the ir_logging
table of a database, the log record pathname is truncated to keep only
the relevant part of the path. In some circumstances, the path is
wrongly truncated, leading to totally invalid paths.

e.g.: When using an addon-path like `/data/build/enteprise` the removed
part correspond to the length of `/data/build/odoo/`. The resulting path
is `prise/....`.

With this commit, the full path is kept.

This commit is mainly a fix for the runbot logs and should not have an
impact on existing databases.

closes odoo/odoo#50246

X-original-commit: f3c96aa21ad0d8756fadc1608107438ba8cd6c05
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-04-27 15:20:02 +00:00
Odoo's Mergebot 02a5be4205 [IMP] tools, website, website_blog: speed up /blog perfs
Part of task-2211013 which optimizes performances, this PR focuses on `/blog`, `/blog/post` performances.

For a database with 20 blog posts & 20 tags, based on 50 tests, this is the optimistic stats:
```
| /blog                 | Query |   Time | Remaining Time |
| --------------------- | ----- | ------ | -------------- |
| Before                |   136 |  0.055 |          0.200 |
| Now                   |    26 |  0.015 |          0.090 |
```

/blog/post from 60+ query to less than 30

task-2211013

closes odoo/odoo#48552

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-04-27 20:13:21 +02:00
Thibault Delavallée ba8e3c3d96 [FIX] mail: do not prevent user from re-entering the same alias value
Followup of 73dc42d6d5: catchall or bounce alias reset to the same value
should not raise an UserError. This happens for example when reinitializing
mail module.

Also enable batch write again.

closes odoo/odoo#50248

X-original-commit: 00709025a9436b35744908481c5e5faa1e3ef655
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-27 15:32:38 +00:00
Martin Trigaux 104ae05e7f [FIX] web: do not translate technical content
Avoid messing up with style by translating it

closes odoo/odoo#50251

X-original-commit: 6151757a8357693e189ff1ab31ece5efdbac65d6
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-27 15:58:11 +00:00
Martin Trigaux 7baa642186 [FIX] mass_mailing_sms: avoid autogenerated name
The name was autogenerated to "XMas Promo 2020-04-27 09:15:11" (which
is rather technical)
Make a static one to avoid changing it everytime the translations are rexeported

X-original-commit: 52a630eb28ead7b21f39dccbbff628ea594c7099
2020-04-27 15:58:10 +00:00
Jeremy KerstenandRomain Derie 697f600784 [IMP] website: add state of customize_view in cache
Add in one shot all the states (active or not) for all keys of customize_view

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 14:10:04 +00:00
Victor Feyens a287d397b8 [FIX] base: automatic multi-company group assignation
Followup fix of #48912

The multi-company group should be given to users if they have access to
multiple companies and do not already have this group.

closes odoo/odoo#50233

X-original-commit: 0c721d90c5cd428ef8d51f195da8e02ee91d4364
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-04-27 13:52:31 +00:00
Jorge Pinna Puissant b88a9116f5 [FIX] calendar: note on meeting planned activity lack new line
- In a res.partner;
- Schedule activity;
- Choose 'meeting' as activity;
- Set a summary : 'test summary';
- Open Calendar;
- Chose a date and an hour;
- Edit the meeting;
- Add a description with a line break;
- Save the meeting;
- open the res.partner view;

Before this commit, the note on the planned activity lack the line
break.

Now, the note in the planned activity has the same output as the
description of the calendar meeting.

opw-2236838

closes odoo/odoo#50226

X-original-commit: 2e9cc92fb45f9328c45520275ab11c7a486a2590
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-04-27 13:52:55 +00:00
Jeremy KerstenandRomain Derie 27de8b1478 [FIX] website_blog: update viewed count without update the write_date
To backport in v13
+ check for optimistic lock

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie dba74ed353 [IMP] website_blog: rename key for viewed post and avoid write
Avoid extra call to session_store.save if we don't touch to the session
Use an explicit name to storage post_viewed in the session

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 1f886b72f3 [IMP] website_blog: add index on website_id and is_published field
task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 02abc57713 [FIX] website: fix mismatch lang code in compute of canonical url
task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie f3df95bad9 [IMP] base: ir_http - don't check the exists in ModelConvert
Http routing and websits module will already do it later and handle the case.

The only ModelConverter used that will be impacted is:
   /web_editor/attachment/<model("ir.attachment"):attachment>
that is a json controller called with eisting data

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 841ebee16d [IMP] website_blog: blog post, replace viewref by is_view_enable
is_view_enable is cached

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 6ae4d132a0 [IMP] website_blog: remove unused code
task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 26efb4ea06 [IMP] website_blog: perf - related author name avoid query res.partner
We use `author_id` (res.partner record) to instanciate our frontend widget
address so it can be changed through left panel in a searchable list.
This require a read on res.partner to get his name, even for visitors.

Using a related will have the same result for visitors while it won't need to
query res.partner table.

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 9247c5e8fd [IMP] tools: avoid useless query on res.users
Without this commit, if `lang_code` or `env.context.get('lang')` was set, we
would still access `env.user.company_id.partner_id.lang` to fill the loop array
even if we break and don't need that value.

Switching from loop to if conditions prevents that.

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 8e150d871e [IMP] website_blog: perf - store related website_id
Without this commit, a simple search like:
`env['blog.tag'].search([('website_id', 'in', (1, False))])`
would generate 4 SQL queries instead of 1.

3 requests would be done on `blog.blog`, see `right_ids` at ORM level.

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 8e081ec61f [IMP] website_blog: avoid exists() in loop
`tags_list()` is called in loops to get nicely formatted URL in blog tag button
but doing an exists here will do everytime an SQL query regardless of the
cache.

We can safely remove the call to `exists()` as the `tag_ids` parameter is
coming from the controller `active_tag_ids` key which is already ensuring the
exists condition.

It make also the number of requests determinists for test with a random number
of tags. From between 200 ~ 300 queries (depending number of tags)-> 116

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie 54048cb228 [IMP] website, website_blog: perf - cache customize show views
Most of the website rendering process depends of customize_show views which are
part of a configuration setup.
Once it has been setup, it will most likely never change afterward.

It makes sense to orm cache those infos to avoid having to query ir.ui.view
table everytime we render something.

Note that just store basic and small infos used for customize_show case.

task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Jeremy KerstenandRomain Derie ad8e65685c [IMP] website_blog: add performance tests
task-2211013

Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2020-04-27 13:49:01 +00:00
Xavier Morel 0ce9165ca5 [FIX] website: search_pages w/ werkzeug 0.15 or higher
The (private) Rule.build method takes a values *dict* parameter. From
the start it was called with an invalid argument, but before 0.15
`append_unknown` would lead to just not using the argument at all
unless the rule is dynamic (aka has converters)[0].

In 0.15 the code was refactored and the `values` mapping is now used
in every case[1], leading to a pretty systematic error when calling
`search_pages`, which occurs any time an auto-completed URL field gets
used on the website e.g. when converting text to a link using the page
editor or when trying to update menu items.

Fixing this in 13.0 because while the current debian stable ("buster")
still bundles 0.14, the soon-to-be-released Ubuntu LTS (20.04) updates
werkzeug to 0.16. Debian Testing (bullseye) also bundles 0.16 but
isn't expected to get released for another year so it's less of a
concern.

Fixes #47356
Relates to odoo/docker#299

[0]
https://github.com/pallets/werkzeug/blob/c769200d1dcf1e21daaa2781f0c5109586daad42/werkzeug/routing.py#L797-L828

[1] https://github.com/pallets/werkzeug/blob/048cdfd9b969c0c3a133d7ff43b8ad1ad6a673ec/src/werkzeug/routing.py#L1020-L1032

closes odoo/odoo#50194

X-original-commit: 4f1589075d2aae65c67a01c5c0f75c19c50a61d6
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-27 07:34:05 +00:00
Swapnesh Shah 52d49d635f [FIX] website_sale: Correct partner search
8b921471e4c11575b64d6e5e84508fc625dd2b07 has introduced wrong context key which replaces `res_partner_search_mode` with the depricated `search_default_customer` which was breaking search functality added by 8766f388da

In this commit we correct context's key.

closes odoo/odoo#50222

X-original-commit: 2e309d41cd7e7f22343379bd8a6b397b7d8684fd
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-04-27 12:01:58 +00:00
Nicolas Martinelli b3e54ac38b [FIX] base: prevent country creation from state form
Prevent unexpected country creation when creating a state. Indeed,
there is usually no reason to create a new country.

opw-2239697

closes odoo/odoo#50210

X-original-commit: a502a404b18a0946d9ff64de9e05c28737e82c57
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-27 10:01:07 +00:00
Odoo's Mergebot 1b1d5c8af5 [FW][MERGE] *: improve performance of users and partners creation.
Users (res.users) and Partners (res.partner) are two main models of Odoo.

This PR aims at improving the performance of their creation:
* Records creation in batch
* Code optimizations to reduce number of queries when possible

Task Id - 2229358

closes odoo/odoo#50209

Forward-port-of: odoo/odoo#48912
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-04-27 13:03:23 +02:00
Victor Feyens 0279cbc4a7 [IMP] base: compute users share in batch.
Instead of triggering one has_group by user (one sql query/user if not already ormcached),
and potentially filling the `has_group` cache with new users data (we don't know if and when this data
will be used anyway), compute this field from the groups information already in cache.

X-original-commit: d771d7e9c8503543d29fdbf2ab961c2a32cc3bac
2020-04-27 12:00:45 +02:00
Victor Feyens 46d267c758 [IMP] base: user defaults groups performance
Improve the performance of the default method for user groups by avoiding a `ref` call,
using the group in cache instead.

Calls to ref always trigger one SQL query to verify record still exists
This means that creating 10k user would trigger 10k queries only for the default.

X-original-commit: e67efb88338ef669059591728e7722fe1dff4bf0
2020-04-27 12:00:45 +02:00
Victor Feyens e3c329b9bc [IMP] *: create users and partners in batch
The main classes of partners and users support batch creation, but
the majority of their overrides doesn't support creation in batch.

Adapting those overrides to support records creation in batch shows
great performance gains:

* On `res_partner` : 2 to 3 times faster
* On `res_users`, with the inherited `res_partner` created in batch:
	up to 10 times faster.

Tests done with 500 to 4k records:

* `res_partner` with only a name provided
* `res_users` with a name and login

X-original-commit: 9c3c5f161580039c1fe50f68acac808c18817997
2020-04-27 12:00:45 +02:00
Thibault Delavallée b3218d37c3 [FIX] crm_reveal: fix reveal view model form view
State field is present twice and statusbar widget is not usable.
Let us fix it by ensuring field is present once and widget is
clickable.

closes odoo/odoo#50207

X-original-commit: 5644eb335e82c7184c27b540fc89ae6e77460992
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-04-27 09:50:17 +00:00