Commit Graph
139369 Commits
Author SHA1 Message Date
Martin Trigaux c59c10f1bc [FIX] *: correct typos and bad English
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61010

X-original-commit: 62a18bdb372e234107fd2099a2df5f9e3a442c96
Related: odoo/enterprise#14489
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 19:23:41 +00:00
Xavier Dubuc eac3c08ce2 [FIX] mail: fix handling of lastVisibleMessage in channel seen condition
also fix a problem with composer.hasFocus field not always correctly
updated (e.g. when switching from a channel to another in discuss)

task-2278915

closes odoo/odoo#61007

X-original-commit: ecb56a6893dd7b76402c2262fb93f8dea079fde0
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-29 16:35:37 +00:00
Mihran Thalhath d296469ff4 [CLA] signature for MihranThalhath
closes odoo/odoo#61001

X-original-commit: b72055ea365fa39a0f815605a50d5ed3de13cbbc
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 15:40:26 +00:00
Andrea Grazioso (agr-odoo) f505444655 [FIX] stock: delivery date cause fail in production scheduling
Create 3 items:

* FP
 ** manufactured from SFP
 ** reordering rule
 ** manufacture lead time 2 days
* SFP
 ** manufactured from CP
 ** reordering rule
 ** manufacture lead time 2 days
* CP
 ** buy from vendor
 ** reordering rule
 ** manufacture lead time 2 days

Create a sales quotation:
 * Product: FP
 * Delivery Date: +7 days from now
Save and confirm
Run scheduler.

No Manufacturing process will be started.
This occur because the reordering rule (orderpoint) check the
quantity needed at the current date + lead days, while the move
are being planned for the delivery date specified by
the user in the SO.
Moreover the quantities that depends on datetime.now() are not recomputed
so each scheduler run is failing to schedule new orders

opw-2366925

closes odoo/odoo#60993

X-original-commit: 06eaf867ec7cac15a5cd9c972321f6f5d3c194bf
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-10-29 14:00:05 +00:00
Julien Castiaux 7da8e14669 [FIX] config: empty argument --foo= to disable
In the odoorc file, set a `logfile` path, but disable it via the command
line with `--logfile=`. The logs are output to the logfile configured in
the config file instead of stdout.

Parsing `--logile=` yield an empty string which was interpreted as
argument not set and skipped.

Closes #3852

closes odoo/odoo#60992

X-original-commit: bae0d99b8d654283be4d265e3b40a83247a2299c
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2020-10-29 13:50:07 +00:00
Yannick Tivisse c5550eed5a [FIX] resource: Fix erroneous date/datetime comparison
closes odoo/odoo#60975

X-original-commit: febd3251aa970f6711f303d539eeeabebf16e818
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-29 11:42:31 +00:00
uso-odooandLucasLefevre 28a9e90dce [FIX] fleet: Fix access error on assign driver linked to internal user
Currently, Failing at base/models/res_partner.py#L535
We write on the partner because of the related `plan_to_change_car`

When Assign driver linked to internal user without admin rights
it gives an error in security rules due to write on partner.

So while creating the vehicle when driver is assigned pop the value
for related field plan_to_change_car and rewrite the same with sudo.

closes odoo/odoo#60358

Issue: #54199
Taskid: 2309192
X-original-commit: af21dba516de688743f75e6ffb3bc3341578e37a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: LucasLefevre <lul@odoo.com>
2020-10-20 10:43:36 +00:00
Samuel Degueldre b1654e5b2b [FIX] web_editor: fix issues related to loading image info
In order to allow modifying background images, we need information on
the image, this is done by creating a placeholder img and calling the
loadImageInfo function on it. However this function did not account for
the case where an image had not src attribute, which causes an
unnecessary rpc. Other problems could arise from this as an attachment
that doesn't have the correct mimetype but has a matching src could be
returned, causing its image_src field to be false, which we would then
attempt to load as a valid image, causing crashes.

This commit fixes that by not trying to load image infos when the src of
an image is empty, only looking for attachments of the supported
mimetypes, and also checking that we actually did receive an image_src
before setting it as the original src of the image, which will prevent
accidentally trying to load a falsy src as an actual image.

closes odoo/odoo#60982

X-original-commit: b0993370b6fcec1f966e4bf2994eee7f31da82d5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-29 12:27:13 +00:00
qsm-odoo 9e193cb898 [FIX] web_editor: properly allow to select a bg color for badges
Before this commit, the badges' background color was not possible to
edit: the previews were done correctly but the background color was
removed after final selection.

This was because the background color property is animated on badges,
messing with the related edition function.

Closes https://github.com/odoo/odoo/issues/59337

closes odoo/odoo#60820

X-original-commit: 34238b77ace7e6feeb1f9e693d7cd3b12786505d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-27 14:38:01 +00:00
Priyanka Kakadiya 028495491b [IMP] test_mail: add test for multi company chat
this commit add a test case for the multi company chat.

LINKS:
PR https://github.com/odoo/odoo/pull/47398
Task 2207147

closes odoo/odoo#60989

X-original-commit: cd02e4290a708f9141fcd19773b6f01b47507274
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-29 13:12:34 +00:00
Laurent Smet 364c3f1ff9 [FIX] l10n_et: Fix 3 invalid lines in account.account.template.csv
These lines have an additional column making reconcile=True instead of False
and chart_template_id=False.

closes odoo/odoo#60986

Note: For some reasons, chart_template_id is not required on account.account.template.
X-original-commit: c0fa380845f2ce7b08083136ebffcc80cf82ec47
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-29 12:58:10 +00:00
Nathan de Pryck 8a12247211 [FIX] account: use _for_xml_id to read action
Use of '_for_xml_id' instead of read in order to avoid
access right issue on 'ir.actions.act_window'.

closes odoo/odoo#60946

X-original-commit: 4e65fbf14491ea97415ede6d10385222c8d4d074
Signed-off-by: ndeodoo <ndeodoo@users.noreply.github.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 09:15:47 +00:00
Antoine Prieels 1a278f7b80 [FIX] pos_adyen: Traceback on negative amount
Show a nice error message when starting negative transactions on Adyen
terminals.

opw-2368978

closes odoo/odoo#60985

X-original-commit: 4dc790629e49c6e78a009fde3a22915944bb5583
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-10-29 12:39:09 +00:00
Yannick Tivisse f3c1a8fbd9 [FIX] resource: _get_resources_day_total is ensure_one
closes odoo/odoo#60974

Valueerror: Expected singleton: resource.calendar()
X-original-commit: af94ac4b4a25048adfd82f1de7fe2dc09755fd56
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-29 11:41:15 +00:00
Achraf (abz) 681d0f7ec2 [FIX] account: Show the customer name instead of journal name in kanban view
Issue

    - Install "Accounting"
    - Go to "Accounting Overview/Invoices"
    - Switch to kanban view

Cause

    The wrong field ("journal_id") was present instead of "partner_id"

Solution

    Change with "partner_id"

opw-2367738

closes odoo/odoo#60970

X-original-commit: e4ac9891450d96149551d19ac2d2f74f410f877c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-10-29 11:23:14 +00:00
oco-odoo 8b3f14087a [IMP] account: improve tests for taxes made on misc operations
- Some tax_base_amounts checks were missing
- The type of repartition used to generate tax lines was not tested; it made the test confusing (as in this case, sales taxes invert their tag, given here the impression the wrong repartition was used, and potentially shadowing a bug)

closes odoo/odoo#60966

X-original-commit: c703b3a2f5a2d4d8bfbf0bc14203dde1b1bdec23
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-29 11:06:08 +00:00
Swapnesh Shah 8e1fdb209c [FIX] mail: add missing context
context was lost while replacing field `email` during https://github.com/odoo/odoo/blob/d62d1e23c876b6154d1ef8d972a482e280430f34/addons/mail/views/res_partner_views.xml#L16

With this commit, we add the same context which is present at the original field at https://github.com/odoo/odoo/blob/12.0/odoo/addons/base/views/res_partner_views.xml#L260

closes odoo/odoo#60955

Fixes: #50978
X-original-commit: 3e9fe7fe3a0714bb7b0370bb941b0be3164db32a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-29 10:27:38 +00:00
Laurent Smet 325af9e412 [FIX] account,*: Manage 'in_payment' state correctly
closes odoo/odoo#60951

X-original-commit: 0a83aa2d6811c3638db151991938473a892c5452
Related: odoo/enterprise#14473
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-29 10:05:55 +00:00
Laurent Smet 516b80fc07 [FIX] account,payment: Fix payment token flow after payment refactoring
- The field 'invoice_ids' no longer exists on account.payment.
- When registering a payment using a payment token, the payment is not posted directly but the payment transaction is processed instead.
It means the payment is not posted until the CRON call. Since 14.0, the journal items can't be reconciled if not posted and then, we can't wait the CRON to update the payment state.
- The payment token is no longer available when registering a payment for invoices.

closes odoo/odoo#60918

Task: 2352628
X-original-commit: 0ad8979cb345805b7b1bdc330621b42e1d625593
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-29 09:25:19 +00:00
Paul Morelle 43dd5c70d1 [IMP] translate: add add/radd methods on _lt class
In order to ease the usage of lazy translation, add the possibility to
add the _lt objects together and with strings.

Adding two _lt objects together or to a string will execute their
translation, so these operations still must be done once the user's
language has been defined.

For example, this is now possible:

    MESSAGES = {
        1: _lt("Hello, world!"),
        2: _lt("Lorem ipsum"),
    }

    def get_text(code):
        return _("Text is: ") + MESSAGES[code]

closes odoo/odoo#60844

X-original-commit: c4596664e5514018c565eaf14b93e000d972bd30
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2020-10-27 15:18:38 +00:00
Nicolas Martinelli c4beae62dd [FIX] stock: incorrect search view
- Activate stock locations
- Go to Inventory > Configuration > Locations
- Click on the 'Products' stat button

The filters `real_stock_available` and `real_stock_negative` are not
applied although they are in `search_default_`.

This is due to c1f7987f49 which refactored the various search
views of products.

The solution is to add the `search_view_id` in the action. However:
- `<act_window>` doesn't support it
- `<act_window>` is deprecated in 14.0

Therefore, we convert the `act_window` element into a regular `record`
and add the appropriate `search_view_id`.

opw-2371962

closes odoo/odoo#60942

X-original-commit: 9677128c42761123e59fa8187a59864eb89f06e8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-29 08:20:08 +00:00
oco-odoo 2aef5cc5bd [FIX] point_of_sale: use compute_all properly for taxes computation
- Use the tax tags returned by the compute_all for the base lines instead of recomputing them separately

Splitting the computation caused inconsistent computation in some cases between the base and tax lines (one could select the refund distribution, while the other selected the invoice one).

- Pass the is_refund parameter to True if either the quantity or the price is negative (but not both)

Those negative lines should correspond to refund repartition (double-checked with the Belgian tax report in v12).

OPW 2351412

closes odoo/odoo#60925

X-original-commit: 7827581b208b464638a91044462d0bc497025326
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-28 17:01:03 +00:00
Thomas Dieuzeide ef5e1a914e [FIX] core: avoid ofxparse DeprecationWarning
In current Debian version (0.19) ofxparse gives the following warning:

ofxparse/ofxparse.py:40: DeprecationWarning: Using or importing the ABCs from 'collections'
instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
  return isinstance(candidate, collections.Iterable)

Since we can't do anything about it, we filter it for now.

ofxparse already fixed it https://github.com/jseutter/ofxparse/issues/155
A Debian bug report has been opened https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973055

closes odoo/odoo#60880

X-original-commit: 00497c03db080914fed81dc3fc66fa5d45f65a4e
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Thomas Dieuzeide <tdi-odoo@users.noreply.github.com>
2020-10-28 10:06:21 +00:00
yhu-odoo 6991ee3a91 [IMP] purchase: show delivery lead time on product form
In the purchase page of the product form, show Delivery Lead Time by
default.

Task 2357198

closes odoo/odoo#60923

X-original-commit: d107532fb65c9dd78a82c16646d0659a49495ec6
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-28 16:37:06 +00:00
yhu-odoo 5d1eaeb817 [FIX] purchase: Delivery Lead Time not working
Currently the delivery date on PO line will always be set to today if
there is no receipt date on PO, which makes the delivery lead time not
working. Fixed this issue in this commit.

Task 2357198

X-original-commit: 147aa4c67fb912a2e62dd8be1fc770db258e28d0
2020-10-28 16:37:05 +00:00
Romain Estievenart 9348cca0f2 [FIX] web: DropdownMenu autoclose behavior should match Bootstrap
Before this commit, with an opened DropdownMenu component, when the user
clicks on a Bootstrap's dropdown the DropdownMenu doesn't close.

This issue is due to a conflict between the global click listener
registered to close the DropdownMenu and the listener registered by the
Bootstrap dropdown:
the last one prevents the event from bubbling up to the `window` element
and be handled by the first one.

This commit fixes it by enabling the `capture` flag on the DropdownMenu
global click listener, giving it the opportunity to handling it properly
 and close the DropdownMenu.

Note: this commit also fixes an issue when a dialog is opened from a
DropdownMenu (like the favorite's delete action) and prevents it from
closing in the background (e.g. when the dialog is still opened).

opw-1879566

closes odoo/odoo#60928

X-original-commit: 7f1bcc8ceb78729725f65585e923b08f94bf75b5
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-10-28 17:22:48 +00:00
oco-odoo f1f3366bc0 [FIX] account, hr_expense: show correct sign for tax_base_amounts of misc operations' lines
Before this, misc operations always used the balance of the base line as the tax_base_amount of the tax line. This was inconsistent with the invoices, for which we invert its sign when making a sale invoice or a purchase refund (as for those operations, positive amounts are put in credit). This commit should make everything behave in the same way.

closes odoo/odoo#60912

X-original-commit: 2ca3158ce2de596526067dbd86da2ef7d4ae85bd
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-28 14:56:20 +00:00
yhu-odoo 5eee84a6b4 [IMP] stock: Add Check Availability button to picking list view
Add Check Availability button to the control panel of picking list view.

Task 2361283

closes odoo/odoo#60298

Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-28 06:59:00 +00:00
Thanh DodeurandSébastien Theys a2d216a80d [Fix] mail: ensures composer cleanup on message post
Before this commit, the state of the composer was not properly saving
its state when focusing out, which caused erroneous composer states
in some corner cases, like when posting messages on mobile in some
browsers. This commit fixes this issue.

opw-2366374

closes odoo/odoo#60913

X-original-commit: 8e79fefdb9990a6480fdae2684e07799e5439b06
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2020-10-28 14:56:47 +00:00
Sébastien Theys abb7d2dab9 [FIX] mail, im_livechat: avoid artificially delaying messaging
Don't delay the insert of partners or channels until it actually takes too much
time.

Don't await `_initMentionPartnerSuggestions` as it is just nice to have.

task-2371485

closes odoo/odoo#60911

X-original-commit: e78805fc3ae9b5dbbf72667e5bd62e5c5346cc53
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-28 14:55:47 +00:00
Nicolas Martinelli fb786296a5 [FIX] website_sale_stock: products in multiple warehouses
- Create 2 warehouses A & B
- In the website settings, set the `inventory_availability` as `always`,
  but do not set a warehouse
- Create a Product P, make some stock in warehouse A
- Create a Product Q, make some stock in warehouse B
- Publish the products
- Go to `/shop` => both products have availability
- Add P in the cart => it works
- Add Q in the cart

Error: 'Some products became unavailable and your cart has been
updated...'.

This happens because the availability is checked on the warehouse of the
SO, not the warehouse of the website (not set in this case).

opw-2361768

closes odoo/odoo#60895

X-original-commit: 6b05fb2b21a3b58cfef3f280941d985eec158b78
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-28 12:09:04 +00:00
wan c514e54b9d [FIX] account: analytic default + add test
* Analytic defaults keep their old value
* The date_maturity is non-sense, it isn't set on lines needing analytic
* Analytic default should work for misc. operations too, but only for
  product/service lines on invoice documents.

closes odoo/odoo#60904

X-original-commit: 4d2b8dd1bef40c592215728fab6c31f192176e93
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-10-28 14:08:02 +00:00
JF Aubert c7debd2edb [IMP] stock : Improve general usability
Purchase
- When a RFQ is in "To Approve" stage, on the printed pdf, keep "Request for Quotation" as a title
- "Send Reminder" action should open the composer when triggered manually.

Inventory
- In tree view of transfer, set date_done optional = hide
- In (mobile) picking view, replace button text with 'add a product'
- fix Vendor Group by in Replenishment report
- Warning message when changing product tracking from untracked to tracked

MRP
- Reporting > Manufacturing Orders : change measure for total quantity grouped by scheduled date = month and by product
- Reporting > Work Orders : change measure for Duration per unit grouped by workcenter and by product & add unit (minutes)
- Reporting > Overall equipment effectiveness : group by loss reason added to the current group by workcenter

closes odoo/odoo#57036

Related: odoo/enterprise#12926
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-08 09:10:51 +00:00
Christophe Monniez a431ee3f52 [FIX] calendar: use a contextual timestamp in test
When the test starts after 00:00:00 UTC, the test fails.

closes odoo/odoo#60891

X-original-commit: c62acb48ac3ae11180a6817321664fb01833d3bd
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-10-28 11:38:42 +00:00
Xavier Dubuc 59ecc564e0 [FIX] mail: do not consider message with subtype as empty
task-2362022

closes odoo/odoo#60890

X-original-commit: 65ffb692164d5370411059dca63223c08c8dc81f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-28 11:38:16 +00:00
Christophe Monniez 56105b65db [FIX] test_event_full: add a step after event registration
When an event is registered during the tour, a link is clicked without
waiting for any result.

As a consequence, the tour stops and the browser cookies are cleaned.
This leads to random failures because sometimes the remaining requests
generated by the link click have enough time to be completed and
sometimes not.

With this commit a simple step is added, that waits for the clicked link
page to be loaded.

closes odoo/odoo#60885

X-original-commit: b261ab598c7a18bbe6590114aa171d61ea9c2767
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-10-28 10:51:51 +00:00
Pedro M. Baeza f79af04c98 [FIX] delivery: Fallback to commercial partner's delivery method
Fine-tune of #59524.

If the delivery address doesn't have any delivery method assigned, you get an
undesired change of behavior: no delivery method is populated in that cases.

Note that the delivery method is not a commercial field that is propagated from
parent to children.

With this patch, we get a very similar behavior, which is fallbacking to the
commercial partner's delivery method if there's no delivery method in the delivery
address.

The only different behavior will be if the order partner is different from the
commercial partner of the delivery address.

closes odoo/odoo#60881

X-original-commit: 682b2e6c214b73f67e849df927bd4bda0af31d5a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-28 10:10:11 +00:00
Priyanka Kakadiya c97e6c1a2f [IMP] mail: remove empty context from rpc
PURPOSE

we need to pass empty context so it can be overriden in session.js. we should be
able to not specify any context and let session handle it.

SPECIFICATION

- removed empty context from thread rpc
- as there is already managed empty context in session, so no need to manage
  empty context in rpc

LINKS

Task 2243187
PR https://github.com/odoo/odoo/pull/54512

closes odoo/odoo#54512

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-28 05:33:31 +00:00
Nicolas Martinelli e4cd2e45ca [FIX] crm: mark as lost
The 'Mark as lost' server action raises an AccessError when executed by
a non administrator.

Due to de4213b771

opw-2371490

closes odoo/odoo#60866

X-original-commit: b80e44bac5de3ccffad42917307bb5f049a7bec6
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-27 18:42:46 +00:00
lejeune quentin eb8d283358 [FIX] point_of_sale: Fix issue for IoT upgrade
When we want to upgrade the IoT box to the lastest version
we need install kpartx to the third partition.
However the source are not up to date and we can't fetch
the package.

So we must update this partition before fetch the package

X-original-commit: 83ec693cc2c4b92b29cdee6f63b283655c2633df

m

X-original-commit: f486e61c36cb39b7b79faf018f5b8ac0448e284c

m

closes odoo/odoo#60655

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-10-27 08:29:16 +00:00
Joren Van Onder 9a9be7b0b7 [FIX] payment_authorize: make it possible to pay after closing popup
Closing the Authorize.net popup with the little "x" doesn't call the
responseHandler. Looking at the documentation (and source) of
AcceptUI.js it seems there's no clean way to detect this.

Because of this the "Pay & Confirm" button remains disabled, requiring
the user to refresh the page.

To solve this don't disable the button at all. Presumably it was added
to avoid issues when spamming the button with clicks on a slow
connection. But simulating this with a slow connection doesn't cause
any issues.

When AcceptJS is not yet loaded it's loaded with web.ajax.loadJS(). It
correctly handles parallel calls before loading is finished and
returns the same promise. AcceptJS correctly ignores subsequent click
events on the button, because it immediately blocks all clicks on the
body (and grays it out).

Using a MutationObserver was also considered but this approach is much
less messy.

opw-2367166

closes odoo/odoo#60870

X-original-commit: 63f759b63284efc5fb9f5dc7dfbe4e2aed982ad0
Signed-off-by: jorenvo <jorenvo@users.noreply.github.com>
2020-10-27 22:30:36 +00:00
Jairo Llopis c84c17fea3 [FIX] base: replace useless vat index with regular one
The custom vat index name matched the name that the system uses for automatic
indexes (when a field has `index=True`).

But the `vat` field  was created with `index=False`, and this means that the
ORM would execute a `DROP INDEX IF EXISTS res_partner_vat_index` when updating
any addon that touches the `res.partner` model. Since this model is so
ubiquitous, this resulted in a ton of unnecessary `DROP INDEX` + `CREATE INDEX`
queries when updating any database.

What's even worse is that dropping or creating an index needs a complete
semaphore lock of the whole table, so if you're updating a high-traffic HA
production instance while it is running, you have a very high rate of concurrency
failures, because almost everybody is going to be using the `res.partner` model
in some way almost all the time.

A deeper investigation reveals that the index itself was useless. It was added in
a6e1eb9 and apparently meant to be used for optimizing name_search(). But even
though a6e1eb9 modified name_search(), it did the substitution in Python[1], so
in practice the database had no way to recognize the pattern and never used the
index. The specificity of that index makes it useless for other cases too, so it
can simply be dropped to save space.

Further, considering that the `vat` field is a common search criterion, it
actually makes sense to enable a normal index on that field, by setting
`index=True`. Neither dropping the index nor creating the default one has any
impact on existing databases, so it's safe in a stable series. A new
installation or a forced update will be necessary to benefit from the changes.

~~Finally, because the bad custom index had the same name as the regular one, an
upgrade script is foreseen to drop the old one before letting the ORM re-create
it properly.~~

Fwd-port note: the upgrade script and version bump were reverted as a
consequence of the unforeseen consequences in #60771.

1: https://github.com/odoo/odoo/blob/a6e1eb9f0ad285fac7d0ca0b9f89f046d78ec9c7/odoo/addons/base/models/res_partner.py#L710

@Tecnativa TT26303

Closes #60346
See also: #60771

closes odoo/odoo#60862

X-original-commit: 2f4a7de3d25cec36ac3b85e3f33122728346c206
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-10-27 17:34:40 +00:00
Xavier Dubuc 454ecb46c9 [FIX] mail, im_livechat: allow to reopen closed chat in discuss
task-2346862

closes odoo/odoo#60859

X-original-commit: 063aa1deccdd6b53d1ab7de68921c95ecf60581c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-27 17:14:00 +00:00
Achraf (abz) 6f8d9ab39b [FIX] mail: Do not send log notes to customers
Issue

    - Install "CRM"
    - Create new lead
    - Set X to customer
    - Send a log note

    X receives log notes by mail

    Reproducible on Project and CRM

Cause

    The customer sends a list of partners who will receive an email
    even when it is a log note

Solution

    Send the list of partners only when it is an email and not a log note

opw-2369280

closes odoo/odoo#60855

X-original-commit: 4e660dfdf40a36eed7123bcea2452874238fddd8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-27 16:23:42 +00:00
LiLEE 5b79e43ef0 [FIX] google_recaptcha: take argument 'action' into effect
Take argument _action_ of method _verify_request_recaptcha_token into effect.
Otherwise it always sends 'website_form' as recaptcha action to google
recaptcha service to verify the token, this would lead to failure.

closes odoo/odoo#60854

X-original-commit: f29a625857128617c2d4d795e648d5ad1f7ab8a4
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-10-27 16:23:20 +00:00
Nicolas Martinelli 691c14c070 [FIX] account, purchase, sale: portal access error
- Install account / purchase / sale
- Ceate an internal user without any access rights
- Go to `/my`

A 500 error is raised because of an AccessError.

When the user has no access rights to any of the mentioned applications,
the `search` call returns an AccessError.

We prevent the access error and return 0 as a fallback.

opw-2367559

closes odoo/odoo#60849

X-original-commit: 54ef98c613219aba3bda41817f7767261b8092d2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-27 15:36:48 +00:00
Nicolas Martinelli 77d3c1e8fe [FIX] base_setup: Default Access Rights
Prevent crash in case `base.default_user` has been deleted.

Note that the user shouldn't be deleted in a first place, but that's
another discussion...

opw-2360615

closes odoo/odoo#60821

X-original-commit: 7342cadcfe8d85edb8a53aef0ecc402dbbc7e935
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-27 12:54:49 +00:00
Goaman 60e165e60b [IMP] wesbite: add comment in tour
closes odoo/odoo#60784

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-10-27 15:29:28 +00:00
Goaman 1981f175a6 [IMP] website: remove unused reference 2020-10-27 15:29:23 +00:00
Raphael Collet 9e6df0fb71 [FIX] core: reinstall hooks after setting up models in registry
Before this patch, adding a field on a custom model discards all
automated actions on that model.  The explanation is relatively simple.
When models are set up in the registry, the classes of custom models are
dropped then recreated.  Given that automated actions are implemented as
monkey-patches on model classes, the setup of models simply loses those
monkey-patches, which explains why they stop working on custom models.

The fix introduces an `_unregister_hook()` method, that is expected to
clean up what has been done in `_register_hook()`.  When the registry is
ready (i.e., not being loaded), the setup of models first invokes
`_unregister_hook()` on models, proceeds with the setup, and finally
invokes `_register_hook()` to reinstall the hooks.

OPW 2362308

closes odoo/odoo#60833

X-original-commit: 67152bf82da2674179297d32e4cec9dd534fa0c9
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-10-27 13:59:20 +00:00