Commit Graph
138333 Commits
Author SHA1 Message Date
Rémi Rahir 91f9853c8c [IMP] doc: update iap documentation
Some informations for the developpers do not fit in the technical
documentation. To solve this, we opened a new documentation page on
iap.odoo.com and this commit adds a reference to the said documentation.

Task - 2330046

closes odoo/odoo#57215

X-original-commit: a7b86da8a0ceea3268de9b0fa249a56223411293
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2020-09-09 07:17:22 +00:00
Nicolas Martinelli 6e382346b4 [FIX] doc: wrong list indentation
closes odoo/odoo#57286

X-original-commit: 892dd6860733c46caf379fd36f57219082331b66
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-09-08 21:23:43 +00:00
Goffin SimonandFlorent de Labarre 617cc39b6f [FIX] mrp: Wrong virtual_available on product.template with kit
Steps to reproduce:
- Let's consider a product.template TP with a kit
- Let's consider the variants V1, the only variant  of TP with a kit
- The virtual_availalbe of V1 is 100 (smart button Forecasted in the form view)

Bug:

The virtual_available of TP was 0 instead of 100
The virtaul_available of a product.template must be the sum of virtual_available of all its
variants with kit

PS: This commit changes the available quantity of product_product_table_kit in demo data.
As this quantity was not equal to 0, the type of the product could not be changed.

opw:2297226

closes odoo/odoo#57325

X-original-commit: 74b762da63e159b1965428b2bcb972293c4efea6
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: Florent de Labarre <florent.mirieu@gmail.com>
2020-09-09 08:29:33 +00:00
Aaron Bohy 4e61415994 [FIX] web: kanban quick create: fix raise condition
Let's assume a kanban view using a custom form view to quick
create record:
  <kanban on_create="quick_create" quick_create_view="view_ref">

Before this commit, there was a raise condition that could lead
to a crash. For instance, click to quick create a record in a
given column, and while the form view is loading, fold the column.

Issue reported on task 2323196

closes odoo/odoo#57322

X-original-commit: 9fed69b9e0e13652fd17e9a7c7c8dd838e2f22ed
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-09 07:59:13 +00:00
Hardik Prajapati dbe6b1b30d [FIX] base_import: remove uppercase under Favorites
this commit removes unnecessary uppercase used under the favorites menu

task - 2325684

closes odoo/odoo#57319

X-original-commit: 1d54564d280d23b506e3764294318a359c0ad681
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-09 07:30:47 +00:00
Hardik Prajapati 31bf0fda8f [FIX] board: remove uppercase under Favorites
this commit removes unnecessary uppercase used under the favorites menu

task - 2325684

X-original-commit: 2522dd4b1be98d3b353dcd76a7f24f256094f5fd
2020-09-09 07:30:47 +00:00
Hardik Prajapati a080882fb1 [FIX] web: remove uppercase under Favorites
this commit removes unnecessary uppercase used under the favorites menu

task - 2325684

X-original-commit: 3dcab1845001c4dbf1161fb38c540cb0184d35b8
2020-09-09 07:30:46 +00:00
Nicolas (vin) 7a39bc0327 [FIX] account: hide currency field when not in multi_currency
There is a bug where the currency field is always visible/editable in the
account_move view, even when multi_currency is disabled.

This commit fix that issue.

Task id #2318610

closes odoo/odoo#57292

X-original-commit: 93b02ae2ddc7d71b8bbfe82bceededa13ef70e0e
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-09-08 21:56:12 +00:00
Anh Thao Pham (pta) 4b4e258c4c [FIX] calendar: access rights of calendar attendee for portal user
Removing default read/write access rights on Calendar Attendee Information for Portal User.

opw-2325322

closes odoo/odoo#57314

X-original-commit: 7df6583dba5d4d11664c21979bfb4f926fabce16
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2020-09-09 06:39:30 +00:00
Anh Thao Pham (pta) 5c6061d38d [FIX] purchase_requisition: fix required UOM in Purchase Agreement lines
- Install "purchase_requisition"
- Go to Inventory > Settings and activate "Units of Measure"
- Go to Purchase > Purchase Agreements and create one:
  * select a product and remove UOM
- Confirm it and click on "NEW QUOTATION"
An exception occurs with the following message:
"ValueError: Expected singleton: uom.uom()"

"product_uom_id" field of "purchase.requisition.line" model should be required.

opw-2332654

closes odoo/odoo#57313

X-original-commit: 82c727a766f5b7a9554d9766e4eb5c448eae8e31
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2020-09-09 06:38:00 +00:00
Florent de Labarre 5e08aa3def [FIX] stock: impossible to merge quants with different in_date
When there are no conflict the same quant is used, even of in_date is different.
During _update_available_quantity https://github.com/odoo/odoo/blob/12.0/addons/stock/models/stock_quant.py#L209, Odoo use an existing quants without worring in_date (and use min()). Indeed During _gather in_date is not used to find quant (only used to use in ORDER BY) https://github.com/odoo/odoo/blob/12.0/addons/stock/models/stock_quant.py#L111.

It sould be logical to don't group by in_date during merge quants.

Have two quants with same product_id, location_id, company_id, lot_id, package_id, owner_id but with different in_date.
Try to merge quants
--> issue quants is not merge

closes odoo/odoo#57224

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-09-08 09:54:24 +00:00
Nicolas (vin) 3b9311c52c [FIX] l10n_id_efaktur: Fix occurrences of account.move.type
Since the saas-13.3 account.move.type has been renamed to account.move.move_type,
 but there are still two places where move.type is missused.

This commit will correct one of them.

task id #2320980

closes odoo/odoo#57088

X-original-commit: fb8adec848921b4a13a8c5757e67df330d56a2e5
Related: odoo/enterprise#12949
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Nicolas Viseur <vin-odoo@users.noreply.github.com>
2020-09-08 05:59:49 +00:00
Goffin Simon 613752e051 [FIX] account: Error message creating journal
- Let's create a new company C with the name = "Company.name"
- Create a new journal in C

Bug:

A UserError was raised saying:

You cannot use anything else than unaccented latin characters in the alias address.

opw:2321023

closes odoo/odoo#57018

X-original-commit: 953389546f191e3fdb5e9dd994ab663ea9228b5d
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-09-03 10:42:22 +00:00
Christophe Monniez a14a8e59ba [FIX] requirements: downgrade gevent version
Since the usage of gevent 1.3.7 with python 3.6 the CPU usage exploded
on runbot running builds.

Before a better solution is found, I revert to 1.1.2 as before.

closes odoo/odoo#57281

X-original-commit: b1236c731da4c59a211c506b164a5d934ef6bc4a
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-09-08 20:36:45 +00:00
Samuel Degueldre 5314557a78 [FIX] web_editor: various shape fixes (hide on mobile, bad joint, ...)
This commit fixes various things with the shapes: shapes are now hidden
on mobile by default, the shapes "blobs 02" and "blobs 03" now connect
properly, and the shape pager now shows the name of the current page.
Airy shapes now have embedded media-queries so that they're more visible
in the shape selector. The order of the pages in the shape selector has
been adapted so that shapes that are easier to use are on the first few
pages. A number of shapes have been "cut" differently to leave more
space for content, and some shapes have had their top/bottom anchoring
swapped.

task-2319484

closes odoo/odoo#57279

X-original-commit: c0f62593a4da37e8404dddc0a5762879a5ebbf7f
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-08 19:35:02 +00:00
Victor Feyens 2da7bc2adb [REM] portal, *: remove archive_groups dead code
PURPOSE

Clean code and be and more performance oriented.

SPECIFICATIONS

Various portal pages hold references to archive_groups. It was a summary
of customer documents for portal, containing a count of all documents split
by model.

Currently its computation is not used. Indeed archive_groups is displayed
only in 'my_details' page that does not hold any document-based reference
or code call. Other calls to archive_groups are dead code as the result is
not used. Since 13.0 it is even not computed on standard pages to speedup
their load (as it was not used).

It is not used anymore and its computation and references can be removed
safely, especially with v14 in mind for which we want to remove dead code
to maintain.

Followup of odoo/odoo#55228

LINKS

Task ID-2329081
PR odoo/odoo#55800
PR #12368

closes odoo/odoo#56859

X-original-commit: e75086000ee4317b2ad2994db5d906fbcbd5081f
Related: odoo/enterprise#12830
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-09-01 10:30:32 +00:00
Victor Feyens 594ccdcbf4 [FIX] *: typos and english incoherences
Mainly transifex issues but also some errors found through 'grep' checks.

Fix typos and obscure english strings in xml contents, fields strings/helps, some docstrings, ...
ensuring correct translations base (and fallback when translations isn't available).

closes odoo/odoo#57276

X-original-commit: 4214f05d454bca2b60fda3a288d529c098e84f77
Related: odoo/enterprise#13053
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-09-08 18:12:26 +00:00
Lucas Perais (lpe) 68ef4b6eb7 [FIX] web: avoid displaying noContentHelper after kanban quick_create
Have a kanban with a filter
Quick create a record in one column that won't match the domain

Before this commit, the noContent helper was displayed. This was because
the count of the group was reset to zero after the web_read_group call.

After this commit, the noContent helper is not displayed.

Note that in the quick_create situation, the records are not re-fetched
i.e. there is no search_read after the read_group.

Task-id 2251734

closes odoo/odoo#57247

X-original-commit: 0e12fa135882cd5095dbf15fe2f64231c6a84336
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-08 11:12:03 +00:00
Florent de Labarre 3d686814e2 [FIX] stock: cache is not clear after merge quants
closes odoo/odoo#57236

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-09-08 09:56:22 +00:00
nie 34c9709404 [FIX] fleet: contract name does not update when changing vehicle name
Steps to reproduce the bug:

- Create vehicle A
- Create a contract for vehicle A
- Change the license plate of vehicle A

Bug:

The name of the contract of vehicle A hasn't changed

opw:2327820

closes odoo/odoo#57251

X-original-commit: 5a031de6c456180b0f447470382e1ae1c7dbd5dc
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-09-08 11:38:18 +00:00
Aurélien Warnon 8a27e5336b [FIX] survey: fix minor frontend layout issues
This commit fixes 2 minor issues with the survey frontend layout:
- When hovering an answer option, the word "key"'s offset only worked properly
  for a 3 letters word.
  This does not comply with possible translations and the scss was adapted to
  display correctly with any string.
- The "Continue or press Enter" block needlessly took 2 rows of space if the
  text was slightly longer.
  We provided more space to account for possible longer translations.

Side note: we also added parenthesis between the "add" property on the
"wrapwrap" element XML inherit to ease subsequent overrides.
(Otherwise, the next override would add its own value within our "if else"
statement and that could cause issues).

Task 2334823

closes odoo/odoo#57216

X-original-commit: f3237a2945ae522218af5a7089097c8d561af2c6
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-09-07 16:56:09 +00:00
Jérémy Hennecart d979ed0ea8 [FIX] crm: fix duplicate lead when mmr is desactived
Before when we tried to duplicate a lead without the mrr option
active, a traceback was raised.
If the MMR option was not activated, then the user was not be able to write
on some field because he was lacking the corresponding group. In this case,
the recurring_revenue and recurring_plan fields.

Now, when copying a lead, we purposefully set those fields to 0/False to
avoid a crash if the option is not enabled.

task-2325629

closes odoo/odoo#56927

X-original-commit: 1a5cc55dfeb03ad7d4a63a0286d5d33eaca3cbe2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2020-09-02 09:32:15 +00:00
Jérémy Hennecart a7906b282c [FIX] website_crm: fix compute on default
Now, compute's methods are executed on default, which leads to a crash
when these methods try to use the actual records but there isn't one
yet (e.g. at the creation of a record).

- Fix the traceback raised when creating a lead because of the
visitor_page_count method when self.ids is empty on default compute.

- Since the default_get() and the first_onchange() are also now combined,
we need to adapt the syntax of the default get for the field opportunity_ids,
replacing the array of ids by the command syntax '[(6, 0, ids)]'.

task-2325629

X-original-commit: acbc97bfe290ef3c7b8f7a1160266e49485099ae
2020-09-02 09:32:14 +00:00
Cocographique 3eb72a6d00 [FIX] website: fix shapes overlapping blockquotes
task-2312878

closes odoo/odoo#57096

X-original-commit: f011c9aacf3a3010c436d4e4f408cd9ae265de1b
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-04 12:53:11 +00:00
Moisés López 6c2cf31ff7 [REF] requirements.txt: Use gevent 1.5.0 version with fixes for >=py3.7.4
The following commit fixes >=py3.7.4 compatibility:
 - https://github.com/gevent/gevent/commit/9d27d269ed01a7e752966caa7a6f85d773780a1a
It was released in stable version gevent==1.5.0 on April 10, 2020:
 - https://pypi.org/project/gevent/1.5.0/

gevent==1.3.4 was released on June 20, 2018
 - https://github.com/gevent/gevent/releases/tag/1.3.4

And python3.7.0 was released June 27, 2018
 - https://www.python.org/downloads/release/python-370/

So, the current pinned version 1.3.4 is not optimized for py3.7

It could be a possible reason to reproduce the following error:
 - https://github.com/odoo/odoo/pull/50861

This change upgrades the pinned version to gevent==1.5.0
in order to get an optimized version for py3.7

Bump version to greenlet==0.4.14 for py3.7 since that it is the
version defined in the sha of release of gevent==1.5.0
 - https://github.com/gevent/gevent/commit/a1a72cb9
 - https://github.com/gevent/gevent/blob/a1a72cb9/setup.py#L188

closes odoo/odoo#57219

X-original-commit: bb0b32bd1a3fc0c047d0787b10e8c1c8d696daa5
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-09-07 18:04:02 +00:00
Aaron Bohy 2a44f9dcf3 [IMP] web: tz cookie: test if already set
This commit adds a test to save the effort of re-setting the tz
cookie when it is already set. We also merge the tz cookie script
with the one defining session_info.

Commit motivated by discussion on PR #55726

closes odoo/odoo#57218

X-original-commit: 0a43d8040f0c5ec8e9728b2e9da8c7d46d7292bb
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-09-07 17:22:14 +00:00
Anh Thao Pham (pta) 590b0040f1 [FIX] sale_management: missing variant in SO line name with quotation template
- Go to Sales > Configuration > Settings and activate "Product Configurator"
- Go to Sales > Configuration > Attributes and create an Attribute:
  * Attribute Name: Attribute X
  * Variants Creation Mode: Never (create_variant='no_variant')
  * Attribute Values:
      - Value 1
      - Value 2
- Go to Sales > Products > Products and create a Product:
  * Product Name: Product X
  * Variants: Attribute X (Value 1, Value 2)
- Go to Sales > Configuration > Quotation Templates and create a Template:
  * Quotation Template: Template X
  * Lines:
    - Product: Product X  -  Description: XXX
- Go to Sales > Orders > Quotations and create a Quotation
- Select Template X as Quotation Template
- Add Product X in Order Lines and validate Product Configurator
The Product is added to the SO line but the selected Attribute value is not displayed
in the SO line description, as it usually does.

It comes from the fact that when using a Quotation Template, if an added Product is
defined in the Template, the description from the Template (i.e. XXX) is used instead of
the default generated description.
This is not practical as it is not possible to differentiate several Product X with
different values for Attribute X, because of its Variants Creation Mode set to Never.

opw-2322827

closes odoo/odoo#57195

X-original-commit: b4cc0f0bd4ff9b6b537041a174d5283bbd18dfbd
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2020-09-07 14:33:00 +00:00
Sébastien Theys 618c77259b [FIX] mail: allow tests to await specific events
task-2333915

closes odoo/odoo#57187

X-original-commit: 699106ce65a87f7a24f04e1d8f232b5a6b4e210a
Related: odoo/enterprise#13018
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-09-07 13:16:18 +00:00
Abridbusandsimongoffin 88ccd2dfbd [FIX] stock-account: UserError on div by zero
With:
- Anglo-saxon activated,
- Costing Method: FIFO,
- Inventory Valuation: Automated.

Create a PO for product AAA, receive the product and archive it,
create and try to POST the vendor bill.
> This lead to a ZeroDivisionError: float division by zero

The anglo-saxon entries cannot be generated as the product
is not valued anymore.

This commit is displaying a clearer error message for end users.

more info from SLE on 2250451
opw-2307562, 2317338, 2320080, 2311843

Fine tuning of https://github.com/odoo/odoo/commit/8ce4db8ca04cd8e5266fc186b35deef76506da46

closes odoo/odoo#57016

X-original-commit: 83239af1d396cf7f5aca37e33445405238fcfc48
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: simongoffin <sig@odoo.com>
2020-09-03 10:00:46 +00:00
Mohammed Shekha 47b0c0d2d4 [IMP] web,calendar: display attendance status widget in calendar popover
before this commit, widgets which has specialData attribute
e.g.many2manyattendee were not supported in calendar popover, as widgets with
specialData attribute are meant to be supported in form view.

after this commit, widgets with specialData attribute can be added in calendar
popover, specialData method is called explicitly from calendar_popover to fetch
special data required to render such widgets.

with this commit we also did miscellaneous improvement in many2manyattendee

- many2many_attendee status widget bullet not aligned with attendee name, with
this commit bullet is aligned with attendee name.

- if many2many_attendee does not have status value then do not display status
else blank space is displayed before attendee name.

- in community tentative status color in many2many attendee tags widget has
o-brand-secondary color which is almost light grey, so due to badge light grey
color and tentative status light grey color status is not displayed. To fix
this issue, set tentative status color to simple grey which is bit dark then
badge background color.

task-2058767

closes odoo/odoo#46396

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-07 13:06:41 +00:00
Didier (did) 0cde1189c6 [FIX] mail: chatwindow scroll to the last message when posting
Before this commit, when a user posted a message from a chatwindow, the scroll
did not move to the last message.

task-2314409

closes odoo/odoo#57183

X-original-commit: 8e4f133890b08e7e9a909abbc97b89bb5409119a
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-09-07 12:17:39 +00:00
Nicolas Lempereur bd125e0b72 [FIX] website_form: have several date picker
When multiple date (or datetime) pickers are added to a website form,
the uniqueId value is used to differenciate them thanks to 694af9a19a.

It works well in a lot of case (eg. when adding several field at the
same time, or by change because other code consume uniqueId) but in this
scenario:

- add a date field on a form
- save
- add a date field on a form

it is possible have the second field targetting the first one because
they have the same `'datepicket'+uniqueId()` ID. This happens because
uniqueId is reset at each page opening.

found when working on opw-2326882
closes #57092

closes odoo/odoo#57110

X-original-commit: 75ad994a628ef0d994b44cf6e25fd5340c3ecafd
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-09-04 15:35:03 +00:00
Martin Trigaux 81e1f89225 [I18N] export 14.0 source terms
Currently on branch saas-13.5
Without demo data

closes odoo/odoo#57168

X-original-commit: 32f752b486053b19a8c6167efb5ca0813f2bf3f8
Related: odoo/enterprise#12997
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-07 10:21:46 +00:00
Martin Trigaux 064f995c1a [IMP] base: implement comment
Forgotten TODO
Instead of checking in _for_xml_id (where 99% of calls are static),
verify on the few calls that accept an arbitrary argument

closes odoo/odoo#57117

X-original-commit: efc0263b2574fa355ea794514eb3285d8c449260
Related: odoo/enterprise#12975
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-04 16:21:41 +00:00
Martin Trigaux d823b90220 [FIX] base: add fake fields
Values for "context" and "data" key were injected into the action
dictionnary by report_action to be used by the /report controller
later

Courtesy of William Henrotin (whe) for the test

X-original-commit: 4d43a301fd10cfeb498d9bf6b614779e26e12d16
2020-09-04 16:21:41 +00:00
Martin Trigaux beb308dad6 [FIX] stock: add missing group on server action
This action is called from a product.template view and should be
possible to be executed by any stock user

X-original-commit: 177d5e833989a40726eff040ec1cc25bdef48c06
2020-09-04 16:21:40 +00:00
Martin Trigaux 70aef550fe [IMP] base: remove unexistant field
params is a field of ir.actions.client but not of ir.actions.report

X-original-commit: 98ae8c6e8fa7048649c34fe2048e34193a06e79c
2020-09-04 16:21:40 +00:00
Sudhir ERP Harbor 19f7157267 [CLA] signature for sudhir-erpharbor
closes odoo/odoo#57160

X-original-commit: 8f94fa8c96f9c7e38f52ef95606659f742b2a9e6
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-07 09:11:35 +00:00
Olivier Dony 564fedb2dc [FIX] mail: speed up filtering out blocked emails
For large lists of blocked emails, the time taken to load the records in
cache becomes prohibitive. For instance on a sample blocklist of 600k
entries, the `search([])` to load them could take 80-90s to run!
And this toll is taken every time the mail composer processes an email
batch in mass-mailing mode. Technically, most of the time is spent
iterating on the list of ids many time, in order to prefetch fields
into cache by determining what's missing.

Loading the contents of the list in raw SQL takes a fraction of that
time (400ms vs 90s).

Subsequently using a set for lookups in that blocklist is also much
faster (average time complexity O(1) vs O(n)).

Example: looking up an item in a 600k-entry blocklist is easily 5
orders of magnitude faster!

```
In [1]: blocklist = set(x[0] for x in self._cr.fetchall())

In [2]: len(blocklist)

Out[2]: 634610

In [3]: self._cr.execute("SELECT email from mail_blacklist")

In [4]: blocklist = set(x[0] for x in self._cr.fetchall())

In [5]: %timeit "hello@hello.com" in blocklist
The slowest run took 35.29 times longer than the fastest. This could mean that an intermediate result is being cached.
10000000 loops, best of 3: 31.6 ns per loop

In [6]: self._cr.execute("SELECT email from mail_blacklist")

In [7]: blocklist = [x[0] for x in self._cr.fetchall()]

In [8]: %timeit "hello@hello.com" in blocklist
100 loops, best of 3: 2.24 ms per loop
```

closes odoo/odoo#57129

X-original-commit: 3b9a85754f30f0bef508d0b576ff679c87ead5da
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-09-05 04:34:13 +00:00
Olivier Dony d6e734d436 [FIX] mass_mailing: speed up recipients filtering
Using a `set` to lookup recipients that already received an email is
much faster on average than with a list. `x in list` is O(n) on
average, whereas `x in set` closer to O(1) on average.

Example: for a sample mailing with 50k recipients that is half-through,
filtering the remaining half (25k) took 10s with a list, and 1s with
the set.

X-original-commit: 7948698cc6e6b0af5fc84847ea7ec166882eda0b
2020-09-05 04:34:13 +00:00
JF Aubert 9d77062ddb [FIX] mrp: hide m2m serials column in draft or if components are not
tracked

On production order view, dot not show the Serial Numbers column
when in draft or when no component tracked by serial number

closes odoo/odoo#56889

X-original-commit: 4fc8374ee4470a05b27216999e341418e72f28ea
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-09-01 12:50:22 +00:00
Antoine Prieels 41c0f7c7dd [FIX] pos_hr: No close button
When pos_hr is installed but not checked in the current pos.config,
the close button was not showing for non admin users.

closes odoo/odoo#57141

X-original-commit: ead7e3b801d4f7dcb2d48cf308e405d643dc5368
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-09-07 06:57:20 +00:00
Andrea Grazioso (agr-odoo) 4c46615e6a [FIX] account: revert "avoid traceback when reversing archived values"
This reverts commit d949cb88abbf8f64b383bceba07105df578a4a14 in favor of
https://github.com/odoo/odoo/commit/f4162a75bdc47cd94610ee7626cc68e078313329
To avoid misleading users into thinking that "everything is allright"
while actually there are missing tax_id on the credit note lines

closes odoo/odoo#56845

X-original-commit: 96b5ccb4fa8bafd536f880ba7ff03218c1fe1e1b
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-09-01 08:53:27 +00:00
Didier (did) 467208f6e4 [FIX] website_livechat: missing decorator on message_post
Incorrect override of message_post.
Without this decorator, message_post returns a string `mail.message(ID,)` via
RPC. Discuss needs the message ID to scroll chat window

closes odoo/odoo#57123

X-original-commit: 3939d3aa3b60e0f606a9f7defd695417f7b3f383
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-09-04 17:26:24 +00:00
Xavier Dubuc 8d96bfd080 [FIX] mail, sms, snailmail: prevent message_fetch for hidden threads
Automatically load messages from a thread cache only if the thread cache is used
in at least one thread view.

Ensure thread viewer don't keep thread view records alive when they are not
displayed.

This change is particularly important for performance, to avoid spamming RPC at
init if many threads are opened in chat windows.

task-2310623

closes odoo/odoo#57121

X-original-commit: 8d3413ff647de8d98c6858062dd07dde4160af95
Related: odoo/enterprise#12979
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-09-04 17:01:43 +00:00
alt-odoo 58fb79aa78 [FIX] mrp: no error on workorders scheduled start date update
When a user is accessing a work order in state ready, we are updating it and
rewriting date_planned_start field. We also update accordingly the associated
slot of the workcenter calendar (leave_id), but if the ressource of this slot
is linked to another user, a record rule on resource.calendar.leaves is preventing
the update, which should occur without error, even if the user does not have
Time Off / All Approver rights.

closes odoo/odoo#57120

X-original-commit: 790fb1820fbd49d07206963077216cc304ed2b0a
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2020-09-04 16:47:06 +00:00
Joseph Caburnay cab75e7969 [FIX] pos_restaurant: order management screen random runbot error
Initial rendering of order management screen shows the list of orders
based on the previous render. This is done so that during fetching of
new orders from the server, a list of orders are already shown.

This optimization causes a random runbot error when transferring an
order from one table to the other. The moment the order management
screen is open, it will render orders with the old table, but right
after fetching of orders, the listed orders are immediately updated.

To rectify the random error, we modify the test so that instead of
immediately clicking the transferred order, we wait for its new table
to show before selecting it.

closes odoo/odoo#57104

X-original-commit: 713dd3777ca0ce9d121d5162a3d63de3237509f4
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
2020-09-04 14:27:25 +00:00
Aaron Bohy 7c7b478220 [FIX] web: list: do not call on_attach_callback at reload
Before this commit, the ListRenderer's on_attach_callback hook was
called each time the view was reloaded, even though the renderer
was already in the DOM. As a consequence, sub components were
mounted several times, which could lead to issues.

For instance, go to Inventory > Operations > Transfers, create a
new one. Change the Operation Type to a Receipt, and change again
to a Delivery: it crashed.

Task 2315149
Closes #56701

closes odoo/odoo#57101

X-original-commit: 78f361fb5382e4c7aed9a4e705e20f8d8757300d
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-04 13:40:44 +00:00
Andrea Grazioso (agr-odoo) eda684fc61 [FIX] portal,project: allow other company users to correctly access my/tasks page
In multi-company configuration setup, Company A and Company B.
Have a project in Company A that I want to share with a user in
Company B. The user only has access to Company B.
Share using the project link and open using the user

Traceback error will raise.

Adding a default value to retrieve in case the filter option is used
but the user has no permissions on the records.

opw-2322236

closes odoo/odoo#57090

X-original-commit: bcb62e8f6e20bccc2f2350bdc1268c495b7103da
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-09-04 13:54:45 +00:00
Cocographique c3a3e47f08 [FIX] website: add missing navbar toggler in 'Boxed' header template
task-2312878

closes odoo/odoo#57078

X-original-commit: 501023dbf0b025e70e7a67c19b8b01e989ba575e
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-04 09:33:58 +00:00