Commit Graph
142285 Commits
Author SHA1 Message Date
Julien Castiaux e08ee893d1 [FIX] mail: sanitize dots in generated mail alias
Create a company whoose name ends with a dot like "Bidule Inc.", change
the company of the user to that new company, head to the Accouning
module and create a new journal of type purchase. Traceback because the
generated mail alias for that journal uses the company name and that the
local-part of an email cannot ends with a dot.

From the RFC standpoint, the local-part of an email address (the part
before the @, `john` in `"John Doe" <john@example.com>`, cannot begins
with, ends with or contain following dots.

The email sanitizing function have been updated so it takes care of the
above requirement.

See also #61811
opw-2448692

closes odoo/odoo#69864

X-original-commit: f0e840ae6db387e1dfc99cc21e09d84eb126e7b9
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2021-04-26 16:31:19 +00:00
Achraf (abz) d907f86b4e [FIX] purchase_product_matrix: Allow to change PO lines order
What are the steps to reproduce your issue ?

    1. Install 'purchase_product_matrix'
    2. try to edit a PO with more than one line
    3. try to change the order of a product line

What is currently happening ?

    Traceback: TypeError: Cannot read property 'data' of undefined

What are you expecting to happen ?

    Change order lines without traceback

Why is this happening ?

    There is a function 'reset' that checkes if 'ev' exists:
    https://github.com/odoo/odoo/blob/e0af10ccc92cb3b07f0eea6fa44ebf5a1bdc86aa/addons/sale/static/src/js/product_configurator_widget.js#L119

    And in 'purchase_product_matrix' there is a override of this same function that calls it
    and then tries to use an 'ev' attribute without checking it before

How to fix the bug ?

    Check 'ev' before accessing it

opw-2513061

closes odoo/odoo#69856

X-original-commit: 25312bc576b9e0330eb316e77d8a177ee0434832
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-04-26 15:26:39 +00:00
wan 4865753c46 [FIX] account: remove tip on onboarding tour
Task 2352493

When the user is asked to fill in the label on the invoice, the tooltip
tells him that the label can be auto-filled by configuring its products.
This leads the user to configure products. But then, as he doesn't fill
in the label, the tour is "broken".

closes odoo/odoo#69871

X-original-commit: 78b5536a4c6fa7a20d8fd182fcd85726c2a8555f
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-04-26 17:43:31 +00:00
Alessandro Fiorino 4bd87b8375 [CLA] add Digital Domus
closes odoo/odoo#69855

X-original-commit: 16c09f3964ef32f0729efd815ba5f397e07c8925
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-04-26 15:12:33 +00:00
Valentin Chevalier 99e785b0d3 [FIX] payment_stripe: load Stripe.js library on the payment form
When the payment form is displayed, Stripe.js library isn't loaded, thus preventing the customer to pay online.

When the refactor of assets was done, the link to the Stripe library was moved to __manifest__.py.
As the link does not end with '.js', the file wasn't loaded anymore.

See PR #60632

closes odoo/odoo#69849

X-original-commit: 8535b090a36fe6472c4b3d8211f3be39c7f1c58a
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Signed-off-by: Valentin Chevalier <chevalierv@users.noreply.github.com>
2021-04-26 14:21:11 +00:00
Nicolas Lempereur 8418f15104 [FIX] mrp: use float_time for mrp_time_counter aggregate
To display an aggregate in a list view, the field format method is used.

But since mrp_time_counter that extend float_time has no format method,
you would see eg. 2.07 as aggregate and 2:04 on the line which is a
little confusing.

opw-2514634

closes odoo/odoo#69795

X-original-commit: 020958f55d384e546eb61c98763d45b5db1ed206
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-23 17:53:10 +00:00
ram c89e6587a9 [IMP] rating: update stored rating keys
Purpose is to lessen used storage space by shortening rating keys. See related
branches for more details.

Task ID-2439720
COM PR odoo/odoo#66992
ENT PR odoo/enterprise#16757
UPG PR odoo/upgrade#2302

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-26 14:10:20 +00:00
ram ddf7195ae3 [IMP] rating, project, im_livechat: improve handling of ratings
RATING

Rating texts currently have a negative skewness. Indeed apart top rating
all ratings have a negative feeling. In this commit we update them
to match more closely a 1-5 range from dissatisfied to satisfied, ok being
the middle value.

PROJECT

Filter customer rating were taking in account ratings from first e-mail
instead of current satisfaction.

IM LIVECHAT

Livechat did not catch feedbacks without comment.

Task ID-2439720
COM PR odoo/odoo#66992
ENT PR odoo/enterprise#16757
2021-04-26 14:10:20 +00:00
Odoo's Mergebot a40b52edf4 [MERGE] mail, mass_mailing, test_*: improve reply-to management
PURPOSE

We receive a lot of tickets from people who set a reply-to on their email
templates and are surprised that it doesn't work.  Indeed this field is used
for mass mailing emails and templates but not in regular Chatter.

SPECIFICATIONS

Update reply-to field placeholder to "Preferred email address when sending
via mass mailing options".

Update reply-to field helper message to "Preferred email address when sending
via mass mailing options. <br> Only used when the answer is not added into
the original discussion.""

Update the no_auto_thread field label to "Reply to" in composer and introduce
a new radio button replacing the checkbox

  * The original discussion (update)
  * Another email address (new)

Rename fields on mail_thread and wizard: ``no_auto_thread`` should be replaced
to ``reply_to_force_new`` to ease understanding and be prefixed by reply_to.

Propagate radio keys (update and new) to mass mailing in order to have a
coherent naming (was thread and email). This naming is also coherent with
gateway naming (message_update and message_new).

LINKS

Task ID-2117639
COM PR odoo/odoo#40931
ENT PR odoo/enterprise#17941
UPG PR odoo/upgrade#2419

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-26 17:39:03 +02:00
Thibault Delavallée c8aabac87d [IMP] mass mailing: update reply_to_mode keys
Propagate reply_to radio keys (update and new) to mass mailing in order to have
a coherent naming (was thread and email). This naming is also coherent with
gateway naming (message_update and message_new).

LINKS

Task ID-2117639
COM PR odoo/odoo#40931
ENT PR odoo/enterprise#17941
UPG PR odoo/upgrade#2419
2021-04-26 14:18:33 +00:00
shreya thakrar e4cace7115 [IMP] mail, test_mail, website_(form,sale): rename no_auto_thread field
PURPOSE

Rename fields on mail_thread and wizard: ``no_auto_thread`` should be replaced
to ``reply_to_force_new`` to ease understanding and be prefixed by reply_to.

SPECIFICATIONS

For better understanding, this commit renames ``no_auto_thread`` field of
``mail.message`` model to ``reply_to_force_new``, to indicate that if the
field is checked (☑) replies should check gateway alias rules instead of
updating mailed threads.

It is also more coherent with reply_to namespacing used in various mail models
(notably new composer fields and ``reply_to_mode`` of mass mailing and mail
composer models)

LINKS

Task ID-2117639
COM PR odoo/odoo#40931
ENT PR odoo/enterprise#17941
UPG PR odoo/upgrade#2419
2021-04-26 13:53:42 +00:00
shreya thakrar 59ce7d3969 [IMP] mail, mass_mailing: ease "reply to" fields understanding
PURPOSE

Right now, `reply_to` field on email template is misleading due to poor
explanation. This commit improves the placeholder and tooltip of the fields
to make the purpose of the field clearer especially for non technical users.

SPECIFICATIONS

Update reply-to field placeholder to "Preferred email address when sending
via mass mailing options".

Update reply-to field helper message to "Preferred email address when sending
via mass mailing options. <br> Only used when the answer is not added into
the original discussion.""

Update the no_auto_thread field label to "Reply to" in composer and introduce
a new radio button replacing the checkbox

  * The original discussion (thread)
  * Another email address (new)

Rename fields on mail_thread and wizard: ``no_auto_thread`` should be replaced
to ``reply_to_force_new`` to ease understanding and be prefixed by reply_to.

LINKS

Task ID-2117639
COM PR odoo/odoo#40931
ENT PR odoo/enterprise#17941
UPG PR odoo/upgrade#2419
2021-04-26 13:53:20 +00:00
Thibault Delavallée 4ef24369c8 [IMP] test_mass_mailing: add tests for replies to mailings depending on update mode
Purpose of this commit is to add tests related to answers through mail gateway
when having reply-to mode of mailing set to either updating existing threads
(aka replying on mailed records), either creating new threads (aka using the
reply-to alias configuration).

LINKS

Task ID-2117639
COM PR odoo/odoo#40931
2021-04-26 13:53:03 +00:00
Thibault Delavallée b36b74fa57 [IMP] test_mass_mailing: add test for archives / deletion
Purpose of this commit is to add tests for current behavior of ``keep archives``
field on mailing, used in combination of ``reply-to`` target (either new thread
or update existing threads).

LINKS

Task ID-2117639
COM PR odoo/odoo#40931
2021-04-26 13:52:45 +00:00
Thibault Delavallée 230b8258a5 [IMP] test_mass_mailing: improve test data management and test users, merge mailing tests
In this commit we try to simplify tests organization by

  * merging mailing_internals and mass_mailing tests, as they globally handle
    mailing-related tests (blacklist, opt-out, gateway update through replies
    and clicks);
  * move wizard (mailing.test) tests in their own file as they target a
    specific model;
  * add some loggers to reduce noise;
  * add some users wrappers to test using real users;

LINKS

Task ID-2117639
COM PR odoo/odoo#40931
2021-04-26 13:52:38 +00:00
Sébastien Theys 6855cc3d2c [FIX] web: prevent test_menus loading DiscussWidget if no mail module
Follow up on bd67479316

This test file is not respecting Odoo module dependencies.

If the module is not defined, calling `[Symbol.for("default")]` will crash.

Old require system didn't have this syntax, the similar guard was done just
before using the class.

closes odoo/odoo#69845

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-04-26 13:37:05 +00:00
Goffin Simon d14299bc7b [FIX] account: Access error in multi companies
Steps to reproduce the bug:

- Let's consider two companies C1, C2 and a partner P in C2
- Let's consider an customner invoice I in C1 with P as customer
- Go to Accounting > Accounting > Partner Ledger and select I
- Click on Reconcie

Bug:

An access error was raised due to the ir.rule res.partner company

opw:2446242

closes odoo/odoo#69833

X-original-commit: 2279d84b4aefc8e488ccc33c30b816e988867589
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-04-26 10:42:22 +00:00
Swapnesh Shah a0f2fbfce7 [FIX] purchase_stock: confirm receipt date if needed
Before this commit, There would be Traceback (AttributeError: 'bool' object has no attribute 'date')
on Confirm Receipt Date If order has no Receipt Date.

Now, Button Confirm Receipt Date will be hidden if there is not Receipt Date to confirm.

Original behavior was fixed on #60659 but attribute was replaced
here which misses this condition.

closes odoo/odoo#69828

X-original-commit: 1d680f488f68be4e6157ffd5d8d9dcbb86915ab8
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-04-26 09:46:20 +00:00
Michael Mattiello (mcm) a3b3ca9568 [FIX] web: fix bouncing edit button prevention
The PR https://github.com/odoo/odoo/pull/68799 tried to prevent the
form's edit button to bounce when quick editing.
The fix was wrong and some field continued to bounce the button.

This commit prevents the edit button to bounce when clicking on
any field by checking if we are quick editing.

closes odoo/odoo#69826

X-original-commit: 8393b3c51b38bd285acb91279cb08a28c241c9ca
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-04-26 09:35:30 +00:00
Jacky (trj) 174a10c7b8 [REF] stock_account: removed duplicated fix in _compute_average_price() from product
closes odoo/odoo#69821

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-04-26 09:03:25 +00:00
Dharmraj Jhala 9ef6cc2663 [FW][FIX] mass_mailing: show correct recipient count in merge wizard
Right now, when o2m/m2m are set from default_get from web client,
the compute methods from the records being set yield `NewId` when
we try to get ID for the record, even if the records are existing.
It can result into wrong computation when the ids of the records
are used in preparing the data.

The same thing happens in the wizard that is used to merge mailing
lists. When we select multiple mailing lists and open the wizard
to merge them, they are set in the `src_list_ids` of wizard, but
number of recipients are always zero for them, because the method
that computes `contact_nbr` (recipients) on mailing lists fetches
data from the query, but we can't match (or find) the stats from
query result because we don't get the actual ID in recordset for
existing records.

This commit fixes the behavior by using `_origin` on the records
while finding data in the compute method, and thus getting the
correct recipient count.

Task ID-2471692
COM odoo/odoo#67213

closes odoo/odoo#69820

X-original-commit: 71430334bffa4b5da3f9374c734e6231cb42a7c7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-26 09:03:10 +00:00
dht-odoo bf8bd2d4d5 [FW][FIX] mass_mailing: improve default values management when merging mailing lists
Since PR #55995 is merged, we get traceback while trying to merge the
mailing lists. This has recently been fixed in odoo/odoo@fc1005aa1e .

However code can still be improved to correctly take default values from
context instead of always relying on active_ids, as well as ensuring we
are effectively working on mailing lists.

Apart from that, this commit also shortens the action name to 'Merge'
from 'Merge Selected Mailing Lists'.

Task ID-2471692
COM PR odoo/odoo#67213

X-original-commit: 58722d7e855aac75f76e48c24265130c7f03cec9
2021-04-26 09:03:09 +00:00
Andrea Grazioso (agr-odoo) cca0a59dd1 [FIX] point_of_sale: take into account fiscal position in order list
- Create Tax Exempt fiscal position
- Create Customer with Tax Exempt in fiscal position
- Enable Tax Exempt fiscal position in POS settings
- In POS, set customer to one with Tax Exempt
- Create a sale, apply, payment, validate, and click New Order
- Click magnifying glass to reprint receipt
- Default tax is automatically applied to all past orders/receipts

This occur because:
- in Pos OrderList the total is based on the amount total, and not the
actual amount paid
- the fiscal position object is not present when retrieving the order
via `selectedOrder`

opw-2485178

closes odoo/odoo#69786

X-original-commit: ffc91d4e49fd8c316de708191879563e8e59eb9a
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-04-23 16:23:18 +00:00
Florent de Labarre 5f6eaede31 [FIX] account_edi_facturx: wrong ID
To be compliant with the facturx, the name of invoice should be the sequence given by Odoo (ex : INV/2021/04/0001) and not the ref.

closes odoo/odoo#69663

X-original-commit: 41d323c5ca665098fe2e54a40bc11a8f26ce463a
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-04-22 10:31:39 +00:00
Nikunj Ladava af9454361f [IMP] l10n_no: update report line sequence
- report line should be in alphabetical order

task- 2502322

closes odoo/odoo#69793

X-original-commit: 676c9a3a7c739e13b49f1482581178c01582996a
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-04-23 17:13:44 +00:00
Robin Heinz eb5420da2c [FIX] pos_cash_rounding: fix when multiple payment method
When a pos user combines payment methods with and without rounding, we
must be sure that the rounding is made by payment method and not only on
the total amount of the order.

As the total may change depending on the combination of payment method
used, we had to adapt the methods that checks that an order is paid, and
also propagate the new rounding made on the invoice.

We also don't allow anymore a user to validate an order with a payment
badly rounded.

closes odoo/odoo#69754

X-original-commit: 8cf38faec03d167a7509f0ad6e041a13e4f7ad53
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-04-23 10:45:20 +00:00
Dharmraj Jhala ebc49bc143 [FIX] {test_}mail: set bounced alias in bounce autoreply
Before this commit

When someone tries to send a mail to a restricted alias (which can be
anywhere in 'To', 'CC' or 'BCC') and if the sender is not allowed to do
so, the mail bounces. However bounced mail shows info as if it bounced due
to address provided in 'To', even though it is not always the case.

Example you send a message to

  * 'To': 'valid@gmail.com' (okay)
  * 'Cc': 'myalias@odoo.com' (not allowed for you)

Mail bounces because you are not allowed to send a mail to alias provided
in 'Cc', but it shows the message that: `The following email sent to
valid@gmail.com cannot be accepted because [...]`.

After this commit

Boucing alias is shown in message body. Above example becomes `The following
email sent to myalias@odoo.com cannot be accepted [...].`

Note: Because the alias can be present in `Bcc` too (which will not available
in the message values we get in `message_route_verify` method), we simply use
display name of the alias instead of finding mail address matching with alias
from the message values.

Task ID-2390310

closes odoo/odoo#69788

X-original-commit: 15325b19c15a649041db75bacbe8409ae4c58df7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-23 16:29:59 +00:00
Thibault Delavallée 8f56f1ead0 [FW][FIX] sale: correctly redirect customers in "Pay Now" template
Mail holds a "Pay Now" notification template holding notably customized
links to portal for records like sale orders or invoices. It allow to
give a more personalized button than a plain simple "View document" link.

Currently frontend / backend links are not always correctly computed in this
template. This commit fixes that behavior.

Task ID-2513724
COM PR #69607
ENT PR odoo/enterprise#17849

closes odoo/odoo#69714

closes odoo/odoo#69744

closes odoo/odoo#69774

X-original-commit: c417ea6243cb968d17f5db0919ec8cd034f4cb5f
Related: odoo/enterprise#17889
Related: odoo/enterprise#17902
Related: odoo/enterprise#17916
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-23 15:24:58 +00:00
Thibault Delavallée effebe148f [FW][FIX] mail, various: fix document access link computation
Purpose of this commit is to fix computation of access link. In some cases
msg_vals modification leads to invalid URL computation, notably for frontend
or backend differentiation for target recipients.

Followup of odoo/odoo#63292 .

Task ID-2513724
COM PR odoo/odoo#69607
ENT PR odoo/enterprise#17849

X-original-commit: e618597876692f2d24f8e9308c747b8d1f2d8905
2021-04-23 15:24:58 +00:00
Aaron Bohy 31fcd5a0f1 [FIX] bus: prevent longpoll requests storm
Before this commit, it might happen that, in some situations,
with several tabs opened, the CrossTabBus called the longpolling
route repeatedly, thus slowing down the server, and freezing the
webclient.

The issue was tricky to reproduce. It was a race-condition that
could occur when several tabs performed simultanous calls to
addChannel, while being unloaded or becoming mastertab in the
meantime (e.g. when opening/closing/refreshing several tabs
simultaneously).

This issue has been introduced by [1] which by mistake (probably)
made each tab calling itself the localStorage to update the list
of channels when it was notified that the list of channels in
the localStorage just changed. So if several tabs had a slightly
different list of channels at a given moment (e.g. at startup),
it might happen that they in turn, undo what another tab just
put in the localStorage, and thus produced an infinite loop of
localStorage writes and longpolling request aborts/calls.

The issue could be reproduced with the OCA module [2], which
performs several addChannel at webclient startup.

This commit restores this part of the code as it was initially
written in [3].

Closes #69067

opw~2502799
maybe opw~2451865 as well

[1] https://github.com/odoo/odoo/commit/6448420
[2] https://odoo-community.org/shop/product/web-notify-2670#attr=10773
[3] https://github.com/odoo/odoo/commit/38581f67236377daa767ca2216529a26b8708b00#diff-f6eccad21ae3543606ab8f97b8b097d015412caeaee2bf8cc928eb3ccabac9f5R149

closes odoo/odoo#69777

X-original-commit: a52aa41d04330efb81090409ec7fbcbbedaca317
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-04-23 15:38:17 +00:00
Florent de Labarre 145d48d23b [IMP] auth_signup : add hook to add custom fields
closes odoo/odoo#65276

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-01-29 21:35:14 +00:00
Anh Thao Pham (pta) e09cb7a27d [FIX] account: display credit notes on portal
- Create an invoice for a portal user
- Add a credit note for that invoice
- Connect with portal user
- On Invoices & Bills menu, the correct count is displayed (i.e. 2)
- Open Invoices & Bills page
The "All" filter only displays out_invoice and in_invoice, making impossible to view
the other types (out_refund, in_refund, out_receipt, in_receipt).

opw-2486471

closes odoo/odoo#69792

X-original-commit: 159bc7b0c081fd54df2f2396b18e9a63892caa2e
Signed-off-by: William André (wan) <wan@odoo.com>
2021-04-23 17:11:09 +00:00
Antoine Guenet 1129e5727d [FIX] web_editor: apply "editor_enable" class to iframe body
Before introducing the new Odoo Editor, the body of an iframe containing
the editor has the class "editor_enable". Now it's applied to the main
document's body. This ensure the class is applied on the iframe's body
like before.
As a consequence, some CSS had to be adapted:
- The position property of the snippets menu which had been overridden,
  probably as an ad-hoc fix for the fact that this class was missing.
- The top padding which is applied to accomodate a top toolbar which was
  removed with the new editor and can now be removed.

closes odoo/odoo#69767

X-original-commit: b7cbb8a8fdbebdb7d33e3286fa9f4ec760ad9fe6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-23 14:20:36 +00:00
Sébastien Mottet (oms) f89f17c168 [IMP] website: add data-snippet attribute on rendered snippets
Add the 'data-snippet' attribute on each snippet rendered
by the configurator when building website pages.

closes odoo/odoo#69706

X-original-commit: 7c203eda4210eec7db476aa5ac056150b795b921
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
2021-04-22 15:02:29 +00:00
wan 002f89bd84 [FIX] account: never set default for invoice_date
For customer invoices:
* do not set default date because if you prepare an invoice (and it gets
  a default date), then validate it the next day, the date will be wrong
* set the date when posting if it wasn't set, because why not?

For vendor bills:
* do not set default date because you rarely encode a bill at the bill
  date. Forcing the user to enter it reduces risks of user error
  (duplicated vendor bill)
* do not set it when posting, same reason.

opw-2492862
Related #68368
Closes #68367

closes odoo/odoo#69639

X-original-commit: 41041d8016d11f017d92d28f32ab2cf42f1349a9
Related: odoo/enterprise#17866
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-04-22 08:16:08 +00:00
Julien Banken 0bc56aa7a2 [IMP] phone_validation: improve mobile/phone search
PURPOSE

This commit aims to simplify the phone filter of the lead search view
to better manage phone numbers containing letters.

SPECS

The current phone filter will remove all non-digit characters from the
input string. When the user enters an american phone number containing
letters, the filter can sometimes return phone numbers that do not match
exactly with the provided input string.

eg: If the user types "hello123" in the search bar, the filter will
return all phone numbers matching with "%123%". This pattern will indeed
match with "hello123" but it will also match with many other phone numbers
containing only "123".

To fix the issue, the phone filter will no longer trim all non-digit
characters from the input string. The filter will be more standard and
will better manage phone numbers containing letters.

LINKS

Task ID-2424185
COM PR odoo/odoo#64078

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-23 13:15:49 +00:00
Julien Banken 4b8c55697c [IMP] crm: add tests for phone / mobile search
This commit aims to add tests to ensure current behavior of seach on
mobile/phone field. Some unsupported cases are commented to highlight
current feature state.

LINKS

Task ID-2424185
COM PR odoo/odoo#64078
2021-04-23 13:13:47 +00:00
David Monjoie 1551a459cb [FIX] web_editor: update Odoo Editor lib to commit f031cf78
closes odoo/odoo#69761

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-23 12:30:49 +00:00
Sébastien Geelen (sge) 6c095fbee5 [FIX] web_editor: Fix floating toolbar position when inside a iframe 2021-04-23 12:20:08 +00:00
Sébastien Geelen (sge) 1158e7f99f [FIX] web_editor, mass_mailing: remove snippets from plain text mail 2021-04-23 12:18:04 +00:00
Sébastien Mottet (oms) fb5506cad0 [FIX] website: handle configurator images download timeout
The timeout for images download from unsplash is set to
3s. The exception raised when this limit is reached was
not correctly handled.

closes odoo/odoo#69758

X-original-commit: abca5f73c9e2b992f2638341e81bcb01d86872a6
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-04-23 12:13:23 +00:00
Xavier Morel 95128e6472 [FIX] web: test broken in Firefox
This is arguably a 20 years old Firefox bug (at the very least an
under-specified area of the spec where Firefox's behaviour is
technically allowed under spec but not super useful or convenient):
`window.getSelection()` simply doesn't work when invoked on a form
field: https://bugzilla.mozilla.org/show_bug.cgi?id=85686.

Getting the selection data more explicitly by looking up the focused
form element, then checking *its* selection, seems to work fine and be
cross-browser.

Also focus() the input while at it: according to MDN

> Calling element.select() will not necessarily focus the input, so it
> is often used with HTMLOrForeignElement.focus.

And jQuery doesn't really document whether `select()` will implicitly
`focus()`, so better safe than sorry.

closes odoo/odoo#69579

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-04-21 06:22:48 +00:00
Xavier Morel f6790b9895 [IMP] web: drop event during click() dispatching if disabled
Causes the failure of [0] on FF as it expects that clicking a disabled
button does nothing, which is what happens for Chrome, but the event
is dispatched for Firefox.

Asking the internet it looks like Firefox is in the right here:
click() ultimately calls dispatchEvent (directly), dispatchEvent
should go through even on disabled event. This was specifically fixed
in Firefox[1], and there is an issue opened against Chrome[2] (cf
also: spec discussion[3]).

There's an other issue which mentions inconsistencies between the
actual browser and WPT[4], but for us Chrome always 100% does the
"wrong" thing.

Anyway add a disabled flag in click, though I don't know that it's the
right fix, and it may need to be added to other events as well?

[0] https://github.com/odoo/odoo/blob/c89cdcf11c66e80c33cd77edceaee7eb59a704b3/addons/web/static/tests/fields/relational_fields/field_many2one_tests.js#L2044
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=329509
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=1115661
[3] https://github.com/whatwg/html/pull/5805#issuecomment-672960163
[4] https://bugs.chromium.org/p/chromium/issues/detail?id=1116161
2021-04-20 14:11:30 +00:00
Xavier Morel fe8204a48d [FIX] web: overspecified test
Testing what's literally just a native feature seems odd, but in this
case it's also way over-specified: Firefox's error message for the
conversion of a symbol to a number is

    can't convert symbol to number
2021-04-20 14:10:31 +00:00
Dhruv Patel 11b85c7c13 [FIX] mail: small image attachment preview too small for its box
In the chatter, the attachment preview image size is fixed with 160*160
but the actual preview area is 200*200px so the image is not filling correctly.
It appears padding around the image, especially visible when hovering it.

So with this commit, We should make sure to use a properly sized image in the
preview. we have to also provide the perfect resolution and preview for
the small images without upscaling incorrectly. For large images, it should be
display based on the aspect ratio.

Task : 2483885

closes odoo/odoo#69755

X-original-commit: 08f152bb9ceb6bd4560aa177b392b0420162e131
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-04-23 11:12:18 +00:00
Adrien Widart 15cc585904 [FIX] sale: display correct order line value
To reproduce the error:
(Need sale_management)
1. In Settings:
    - Line Subtotals Tax Display: Tax-Included
2. Create a tax T:
    - Included in Price: True
3. Create and save a SO
    - Add a line with T
4. Switch to mobile view

Error: The amount of the order line is incorrect, it does not consider
the option from step 1.

OPW-2484646

closes odoo/odoo#69737

X-original-commit: 8c21d57d62377b7b1a9bac8857177bc05ab885d6
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-04-23 09:16:53 +00:00
Adrien Widart b6fc91d243 [FIX] google_calendar: force notification sending
Suppose both Google Calendar and Odoo Calendar are synced. Google will
not send any invitation to attendees when the user creates an event from
Odoo.

This fix requires Google to notify attendees when an event is created,
modified or cancelled.

OPW-2501413

closes odoo/odoo#69735

X-original-commit: 48cc3ed28e51ce34c1740f9b394d971234e0bdbe
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-04-23 09:10:40 +00:00
Benjamin Frantzen (bfr) b27614b136 [FIX] account_edi_ubl: extracting the pdf from the imported xml doesn't raise an exception any more when creating a new invoice
Before this commit, when an attachment was present in the xml (pdf) and the import was to create a new invoice, it crashed when trying to post the pdf on the not-yet existant invoice.

This commit also fixes:
- In the tests, `create_invoice_from_file` didn't handle the subfolder parameter correctly
- `create_invoice_from_file` now returns the created invoice

closes odoo/odoo#69722

X-original-commit: e81457501f4815a4d9add7a56a9dfe66a7656269
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-04-22 16:57:12 +00:00
Julien Mougenot 08bb6e2e50 [FIX] im_livechat: Convert external_lib assets
Before this commit: some assets in im_livechat have not been converted
to the new manifest asset declaration system.

This commit converts these assets.

closes odoo/odoo#69612

X-original-commit: b6e1945a20b69dfc7cf83cd4380e92d949665093
Related: odoo/enterprise#17851
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-04-21 15:49:57 +00:00
Julien Mougenot c20e5ad072 [FIX] base_import: Convert test.xml assets
Before this commit: some testing assets in base_import_module have not
been converted to the new manifest asset declaration system.

This commit converts these assets.

X-original-commit: 3509493e8d0c0106f1dfc7dabe2e3edeec98fbd7
2021-04-21 15:49:57 +00:00