Commit Graph
139047 Commits
Author SHA1 Message Date
IEL 1bb2ed9623 [FIX] website_sale_digital: allow download without reconciliation
TLDR: after installation accounting app, invoices paid online get status "In Payment" until
reconciliation; this commit allows to download digital content without waiting
reconciliation which may take days or week

Steps:

* Install Accounting app
* Install website_sale_digital
* Create Digital product (Product Type: Service + use Digital Files smart button
to upload a file)
* Setup payment acquirer (e.g. Paypal)
* Buy digital product online and pay
* Open the Sale Order in Portal

Before:

* No "Downloads" button near to product name

After

* User can download files after purchasing

Notes

* In Odoo 13.0 it worked via "post_at" option, which is removed in Odoo 14. See
https://github.com/odoo/odoo/commit/caeb782841fc5a7ad71a196e2c9ee67644ef9074:

  > - Remove the post_at bank reconciliation feature. The "paid" state will be set on the invoices only if reconciled with a journal entry involving the journal's liquidity account.
  >     With invoicing, the payment will do that so the "in_payment" state should never be shown up.
  >     With accounting, only the statement lines have the power to move an invoice to the "paid" state.

---

opw-2353064

closes odoo/odoo#59959

X-original-commit: 103abd3284cea1723adc0e4b90e57961a4fac2a0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-14 09:48:04 +00:00
Samuel Degueldre 57154071c0 [FIX] web_editor: fix dimensionless SVGs in media-dialog on firefox
Previously, dimensionless SVGs (SVGs with no intrinsic width or height)
were rendered with a width of 0 in the media-dialog on firefox. This is
caused by the fact that firefox reports a naturalWidth and naturalHeight
of 0 for dimensionless images, which we were relying on to compute the
image's aspect ratio. See:
https://github.com/whatwg/html/issues/3510#issuecomment-369982529
for more details on the way browsers handle dimensionless images.

This commit fixes that by giving the image a width, letting the browser
render the image, and reading the height of the rendered image to
compute the aspect ratio in the cases where the naturalHeight of the
image is 0.

task-2345120

closes odoo/odoo#59958

X-original-commit: 616c78e00e6d2760e1cf3425fc7247792f2ceb61
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-14 09:47:39 +00:00
Thibault Francois 6ce289606f [FIX] crm: don't bypass access right to find partner:
Problem
-------

Sales people can have restriction on partner they can see
Private addresses, multi company, ....

When they convert a lead to opportunity, it's currently possible
that the wizard will find and link a partner that the current user
cannot see.

Solution
--------
Field that are now computed store field, that were previously
normal field with onchange, should not be computed as sudo
to respect the record rule

closes odoo/odoo#59957

X-original-commit: 182fa38d7f28a92e7171c4ee3a42c8f73217b765
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-14 09:47:12 +00:00
Xavier ALT af2eaae941 [FIX] core: add UPDATE as valid many2many command in SSF
This commit fix the "Unsupported M2M command 1" raised `Form` helper.

The `onchange()` method will in fact emit UPDATE command for many2many
fields when the value submitted an the one in database has changed
(this is the case for example for nested m2m in form views)

OPW-2044631

closes odoo/odoo#59943

X-original-commit: 76bd8208a416cefab6becff9f2d7204c7d196201
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Xavier ALT <xavieralt@users.noreply.github.com>
2020-10-14 08:23:22 +00:00
Jeremy Kersten 550d2935bd [IMP] website: support generic website for dynamic snippet filters
Made the website_id non mandatory on website snippet filters and adapted
the fetching route so that it interprets an unspecified website_id as
the filter being available on any website.

Before this commit website snippet filters had to be limited to one
single website.

After this commit website snippet filters can be made available on all
websites by setting their website_id to no value (this is the new
default of the pre-defined filters).

https://github.com/odoo/odoo/pull/59831
task-2355369

closes odoo/odoo#59831

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-10-13 13:09:45 +00:00
IEL 6aa8e7b51d [FIX] delivery: choose delivery method by partner_shipping_id
Steps:

* Create a delivery method (1) restricted to Spain (any country would do)
* Create a delivery method (2) restricted to Madagascar (same)
* Create a partner, main company, whose country is Spain and the default
delivery method is the first one.
* Create a delivery address for that customer with Madagascar as country and the
default delivery method as the second one.
* Now place a new quotation with such partner and set the delivery address to
the one of Madagascar (multiple addresses setting must be on).

Before:

* The delivery method for the quotation is set to the one restricted to Spain
although we're sending it to Madagascar.

After:

* The delivery method for the quotation is set to the one restricted to
Madagascar.

---

opw-2348336

closes odoo/odoo#59890

X-original-commit: 535d429960a0347d01c528c2440c2b8e9ff2fb51
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-13 15:11:47 +00:00
Victor Feyens 4841e5c690 [REV] base: revert 9f7f1db5add5b8a940e53707091133c0bcadd350
Revert commit
"[FIX] base: clearer message in case of conflict for no_gap sequences"

This commit changed the error returned in case of SQL conflict for no_gap
sequences, wrongly disabling the automatic retry (service/model.py) in case
of such errors.

Also adds a comment in the dedicated test to ensure the behavior is explained
and the automatic retry isn't broken once again by the same kind of change.

closes odoo/odoo#59928

X-original-commit: 811cd40fe427c28f9eb244f78ae23c4d3fb42cc8
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-10-14 00:18:35 +00:00
Antoine Prieels ad7ef0800d [FIX] pos_adyen: Adyen for Platforms fixes
- The Adyen sync cron didn't call the function to sync terminals

- Do not specify the merchantAccount when creating a store, the proxy
will add it itself.

closes odoo/odoo#59868

X-original-commit: d5b456a1f75320c8fdf1e989afad91fc74ec9ef3
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-10-13 13:58:38 +00:00
yhu-odoo c8d1042d33 [IMP] mrp: search bom by reference
When select a BOM in the field, now we only search by the finished
product name. In this commit, we will also match the reference of the
BOM.

Task 2326786
PR #57945

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-10-14 07:23:19 +00:00
qsm-odoo fb1c4f12c5 [FIX] web_editor: remove useless code breaking the editor scrolling
Since the editor panel is placed on the right, the content was not
possible to scroll when in a iframe, like for mass mailing. This was
because of some strange code introduced with [1]. As the problem the
mentioned commit says fixing is still fixed without that code, I see
no reason to keep this... especially since it may introduce difference
between readonly and editmode content.

[1]: https://github.com/odoo/odoo/commit/f9bf408a827fa86323bc2d1891cb5173b4781e7b

closes odoo/odoo#59927

X-original-commit: 58ade8c0e17be14fb5bf9cef592c9b9225d21b6d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-14 00:18:12 +00:00
Raphael Collet 7a1e0b2ada [FIX] core: assignment of binary field on new record with origin
The assignment of a binary field on a new record with origin did
actually modify the attachment storing the value of the field on the
origin record!  The fix is simply to avoid messing up with attachments
when updating new records.

closes odoo/odoo#59919

X-original-commit: 6778c4c10fa68c46bde6fae176f547f905e9c02f
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-10-13 17:28:48 +00:00
Raphael Collet 11d521d918 [FIX] core: assignment of size to new records
Upon onchange, the web client sends unchanged image fields on one2many
lines as "bin size" values, while changed image fields are sent as their
full value.  As the value is not base64-encoded, the assignment of that
value crashes.

Fix it by making assignment on new records not crash when decoding the
image: the value is simply not assigned to the field.  In the situation
described above, the record being assigned is a new record with a real
record as origin.  Because the field is actually not assigned, its value
is implicitly the value of the field on the origin record, which is
consistent with the fact that the field was not modified in the form.

X-original-commit: 4442d6f0f29a2bf6e992515cd535c88215855a36
2020-10-13 17:28:48 +00:00
Nicolas Lempereur f0ba2dbfa5 [FIX] web: no safari issue with DST at midnight
On safari with apple device in belgium timezone, this code:

```
x = new Date(2020, 2, 28, 2)
x.setDate(29)
```

returns:

> Sat Mar 28 2020 02:00:00 GMT+0100 (CET)
> Sun Mar 29 2020 01:00:00 GMT+0100 (CET)

This is not consistent with any other combination of OS and browser
tested, where this code would return eg. for chrome on macOS:

> Sat Mar 28 2020 02:00:00 GMT+0100 (Central European Standard Time)
> Sun Mar 29 2020 03:00:00 GMT+0200 (Central European Summer Time)

In most instance, this is not an issue, but for country with midnight as
Daylight Saving Time (DST) change, this is an issue, because the Tempus
Dominus calendar widget will have a duplicated day which might eg. make
a month totally not usable.

This issue can eg. be reproduced in Lebanon timezone at this address:

https://tempusdominus.github.io/bootstrap-4/Usage/

Going to the month of April 2020, an error happen  because to get the
first day of the week of 1st April, we do:

```
this._viewDate.clone().startOf('M').startOf('w').startOf('d');
// .startOf('M') => Apr 01 00:00:00
// .startOf('w') => Mar 28 23:00:00 (safari bug)
// .startOf('d') => Mar 28 00:00:00
```

which gives us the wrong day (28 instead of 29) which causes an error.

Other report of the issue:

- https://www.donedone.com/timezone-specific-browser-specific-datetime-bug-2014/
- https://github.com/date-fns/date-fns : issue 571
- https://forum.mobiscroll.com/t/issue-with-invalid-dates-range-script/108

opw-2271482
closes #59786

closes odoo/odoo#59908

X-original-commit: 112267d62544c56acfdcef96727c32c314c15f16
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-10-13 16:16:45 +00:00
Andrea Grazioso (agr-odoo) 066f4ec97c [FIX] sale: fix quantity non visible in portal
This commit fix the fw port https://github.com/odoo/odoo/pull/58149
which does not work in all scenario

Create a sale order
Put an optional product with long description (no line break)
Save and confirm
Log in the portal with the receiving user, add the optional product to
the order.

The customer can't see the quantity of the optional product.
The number is not showing in the quantity adjustment widet.

opw-2350879

closes odoo/odoo#59801

X-original-commit: 9a91fe7d6064475bc949a5c2aee883ea2f419930
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-12 17:01:02 +00:00
Lucas Perais (lpe) 54260b1dd0 [FIX] web: fetching reference fields' name_get batched in grouped list
Commit e10fd34682 introduced batched reference fields name_gets
across groups but was also buggy as follows:

Have a grouped list view showing at least 2 groups
Have a reference field with different values showed in the list for each record

Before this commit, the name_get of those reference fiels were fetched only for the last group

After this commit, the name_get are fetched in a batched fashion (by model) for each group
and display correctly

closes odoo/odoo#59910

X-original-commit: bbb608a1eff638040f0fc7b951fedf1579cc15b2
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-10-13 16:21:34 +00:00
Nasreddin (bon) 3ae6c043c5 [FIX] website_slides: Google drive does not start (error message)
Issue

	- Install "Elearning" module
	- Activate "Drive" credidentials in settings
	- Go to any course and edit it.
	- In "Content" tab, click on "Add Content"
	- Select `Video` as 'Type'
	- Copy/Paste the Google Drive video link in "Document URL" field
	- Wait for other field to be computed then "Save & Close"
	- Save the course
	- Go to the website to watch this new content

	Youtube error message

Cause

	'mime_type' field is readonly. When saving the course (slide.channel),
	the slide is not saved yet, and therefore drop the 'mime_type' value.
	When generating the `embed url`, it verify if a mime_type is set: if not,
	it will generate an iframe with youtube.com as domain, else,
	a drive.google.com domain.

Solution

	Add `force_save="1"` on `mime_type` field.

opw-2294344

closes odoo/odoo#59917

X-original-commit: 987b9bf408cf5ba2deded7e2015caa6faeb65a87
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-10-13 16:57:41 +00:00
xO-Tx 04be44fa47 [FIX] website: fix theme loader opacity
The goal of this commit is to prevent the theme install/update
loader from inheriting the opacity property from container by
setting a background-color with level of transparency.

task-2312878

closes odoo/odoo#59887

X-original-commit: 1e7424579ba7b59c9bc7a4972b10403610f720cb
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-13 14:59:08 +00:00
Nicolás Mac Rouillon f3014587e7 [FIX] l10n_ar: Previous verify for the partner property fpos then use auto_apply.
The problem here is before this changes, the fiscal position only take into account if them has "auto_apply" True, and for the cases that the partner has their property fiscal position configurate for a company this is not taking into account.

After this changes we evaluate for the property fiscal position for the partner and then if non result we seek a fiscal position with the auto apply and the responsability of afip.
So this the same as the original method do.

closes odoo/odoo#59875

X-original-commit: 5ddcad3cb1d6063b7be89e4f0bd35b89885f746b
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-10-13 14:19:24 +00:00
Denis Ledoux 885977da13 [FIX] phone_validation: assign mobile_blacklisted and phone_blacklisted
Make sure to assign a value to the computed fields
`mobile_blacklisted` and `phone_blacklisted`
in their compute method for all record included in `self`

Otherwise, not assigning a value for one record included
in `self` can result in a cache missing error.

```
Traceback (most recent call last):
  File "/tmp/tmp3l14ain7/migrations/base/tests/test_mock_crawl.py", line 143, in crawl_menu
    self.mock_action(action_vals)
  File "/tmp/tmp3l14ain7/migrations/base/tests/test_mock_crawl.py", line 212, in mock_action
    mock_method(model, view, fields_list, domain, group_by)
  File "/tmp/tmp3l14ain7/migrations/base/tests/test_mock_crawl.py", line 238, in mock_view_form
    [data] = record.read(fields_list)
  File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3001, in read
    return self._read_format(fnames=fields, load=load)
  File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3021, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
  File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5620, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 980, in __get__
    raise ValueError("Compute method failed to assign %s.%s" % (record, self.name))
ValueError: Compute method failed to assign crm.lead(974,).phone_blacklisted
```

closes odoo/odoo#59870

X-original-commit: 55d7b9d3304f75aa2089c32c4a907066da4dc4b8
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2020-10-13 13:59:31 +00:00
Thibault Delavallée bb2cd89f00 [FIX] crm: fix query counters due to some runbot errors
To investigate a bit. Sometimes a few extra queries are generated.

Task ID-2359847

closes odoo/odoo#59869

X-original-commit: 36bb56a5e9704c76e84960ec84588524b52406f8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-13 13:59:03 +00:00
oco-odoo 270716c8a2 [FIX] account: tests: remove the default taxes from the invoices created by init_invoice helper
closes odoo/odoo#59798

X-original-commit: f3bb7e12823d13967b32a1f762c3589e5c7aa26c
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-13 12:02:11 +00:00
oco-odoo 00504fe7e7 [FIX] account: cash basis taxis: allow full reconciliation of tax lines on cash basis final account without full payment of the invoice
To reproduce the issue before this fix:

1. Create accounts ACC TAX A, ACC TAX B, with reconcile = True, internal_type = other

2. Create Tax B, with tax_exigibilty = on_payment and account_id = ACC TAX B and cash_basic_account_id = ACC TAX A, 20%

3. Create invoice B, account_id = Tax B, unit_price = 1000, Valide invoice,

4. Register a payment of 600 for invoice B (so, that's half the invoice, when including the taxes). The cash basis tax creates a miscellaneous operation MISC A, containing a line on ACC TAX A.

5. Create a mis operation MISC TVA, like this:
line 1 : account_id = ACC TAX A, credit = 100
line 2 : account_id = 401100, debit = 100

6. Reconcile the following move lines:
line of MISC A with account ACC TAX A (100)
line of MISC TVA with account ACC TAX A (100)

==> The lines should be fully reconciled

To solve that without breaking the fix made here https://github.com/odoo/odoo/commit/c43acc34b873dc70cf792675fe1d58d8b0e116b1 , we rely on the tax_exigible field of account move lines. When all the reconcile lines are exigible, it means we're not reconciling the transition line of a cash basis entry, and so we can directly full reconcile.

Fixes https://github.com/odoo/odoo/issues/58996
OPW 2350494

X-original-commit: b8ab3c78ff9354091f5154bb03a716c32a609de2
2020-10-13 12:02:11 +00:00
Laurent Smet 07b407822c [FIX] account,l10n_lu: Fix default suspense account generation
closes odoo/odoo#59660

X-original-commit: fa5231983d1af929a26c83f5d64461cf657fc88a
Related: odoo/enterprise#13964
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-13 08:09:15 +00:00
Achraf (abz) b2cf9a643d [FIX] point_of_sale: Send invoice by email with qr_code
Issue

    - Install "Point of Sale"
    - Enable "Qr Code" in Invoicing
    - Open new POS session
    - Set random customer
    - Try to send the invoice by email

Cause

    The 'qr_code_urls' doesnt exist in the dictionary.

Solution

    Add 'qr_code_urls' with all generated qr code urls to the dictionary in report.point_of_sale.report_invoice

    EDIT:
      use `_get_report_values` function of report.account.report_invoice instead of generate all qr code urls

opw-2357088

closes odoo/odoo#59847

X-original-commit: 4bc17f78f46ac2c9bc0bc97bc1a29b3da3f26563
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-13 11:03:30 +00:00
Benjamin Vray f937e602a7 [FIX] website: fix menu direction of header dropdowns
Before this commit, the menu direction of header dropdowns was
related to the window width but it was wrong because of the right
panel. We also enable it in editor mode.

task-2312878

closes odoo/odoo#59846

X-original-commit: ced500e9bcbb5c84033463689d135ad4c7dc4f39
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-13 11:03:06 +00:00
std-odoo 0a0b40c3c0 [FIX] digest: send the digest tips 2 hours after the database creation
PURPOSE

We want to send the digest tips 2 hours after the database creation.
It can not be done directly on the digest itself because its field
is a date and not a datetime.

So we change the "Next Run Date" of the digest to now, and we run
the digest CRON 2 hours after its creation.

LINKS

Task 2351561
Internal odoo/internal/pull/1051

closes odoo/odoo#59844

X-original-commit: d2e3c03f89c6c62dc06e05f5fe06104205245e20
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-13 11:01:36 +00:00
Achraf (abz) 0927466ed9 [FIX] manufacture: Automation rules raise traceback
Issue

    - Install `Manufacture` and `Purchase`
    - Go to `Manufacture`
    - Enable Studio
    - Create new rules
    - Select `Purchase Order` model
    - Try to select autocomplete proposition with `Deliver to` field

    Traceback raised.

Cause

    The _search function does not return indexable value.

Solution

  Cast _search to a list.

  PS: search can be used (instead of _search) to get iterable value.

opw-2357391

closes odoo/odoo#59832

X-original-commit: 8af2dbb06723213163ee3ad617e5c9309099b4bc
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-13 09:29:02 +00:00
Goffin Simon 5d5c460784 [FIX] account: Updating currency on Vendor bill
Steps to reproduce the bug:

- Enable Multi-Currencies and Multi-Companies
- Create a vendor bill
- Remove the default journal
- Set an other currencies

Bug:

A traceback was raised

opw:2350490

closes odoo/odoo#59546

X-original-commit: d9f8efcc330bc7454411aad3546de663424724f7
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-13 07:51:27 +00:00
Nicolas Lempereur b2be7e7193 [FIX] sale: default on product change in configurator
When a product is set on a line and we change product with the product
configurator wizard, we will use the attributes values of the previous
product.

But then since the attributes are the ones of wrong product, not
attribute is selected and if eg. we have radio button with one option
and custom value, it will never be selectable (because the radio button
is hidden and unselected).

In this commit, we do not use the current variant values when we change
product in the product configurator wizard.

note: this commit also increases the limit of (custom values) inside the
product configurator wizard, for an arbitrary 10000 limit. Without this
change, each opening of the wizard would only keep 40 customs values and
discard the other ones.

opw-2333091
closes #59016

closes odoo/odoo#59803

X-original-commit: e9c54f6b3d5c36b658308e1900ab68dcc9de0357
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-10-12 17:40:07 +00:00
Xavier Morel a183f2102b [FIX] core: make --test-file work with symlinked modules
While individual addons paths are normalised, module and resource
paths are not.

As a result, when symlinking modules into directories on the
addons path, the path of test modules is only half-normalized: it's
normalised up to the addon path (which likely did not need it in that
setup) but not above that.

This is an issue when using `--test-file`, because that path is fully
normalised, and so the path of the provided test file and that of the
corresponding test module will not match, leading to the tests
unexpectedly not getting run.

Normalize the test module's path before the comparison, using the same
routing used for --test-file.

closes odoo/odoo#59822

X-original-commit: 536809662e542994451be793cd09e87adbf31776
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-10-13 07:25:13 +00:00
Tiffany Chang (tic) 11c710d990 [FIX] delivery: add barcode app check into package wizard
Because the barcode app bypasses the detailed operations for receipts
(with default settings set), an error was being thrown when doing "put
in pack" when a carrier is set (saving during the delivery package
wizard) because the picking move lines are incorrectly selected. This
commit adds in a check for when the wizard is accessed via the barcode
app so that the error does not occur and the same behavior as when no
carrier is assigned is followed.

Related Enterprise PR: odoo/enterprise#9808

closes odoo/odoo#59792

Task: 2039720
X-original-commit: 945b5f6791ae890498ef9a34828eaf91dc1457e2
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-10-12 16:17:20 +00:00
Lavish Chhatwani 348a5c8467 [IMP] calendar,{google,microsoft}_calendar: merge duplicate 'Calendar' tabs
Before this commit
- If Google Calendar and Outlook Calendar are installed, there are two
  'Calendar' tabs displayed on the user form view which is confusing
  and they both share very similar fields.
- Also, in calendar the 'Sync with Google' and 'Sync with Microsoft'
  buttons were not having the same size.

After Commit :
- Now only one 'Calendar tab is there which contains two groups, one
  for 'Google Calendar' and one for 'Office 365 Calendar'.
- Top margin is added on 'Reset Account' button for both Google and
  Microsoft groups for better UI.
- In calendar, 'Sync with Google' and 'Sync with Microsoft' buttons are
  having the same size.

Note - The scss files are not much needed anymore and thus were removed.
       Also to avoid a bridge module just for the sake of empty container,
       we add it in calendar itself.

Task Id-2323205
PR #56551

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-13 07:31:58 +00:00
Lavish Chhatwani 59797095a0 [IMP] auth_oauth: switch 'Preferences' and 'Oauth' tabs on user form
Current ordering is Access Rights - Oauth - Preferences. However we think
that preferences has an higher priority than Oauth. We therefore switch
both tabs so that Preferences is displayed before Oauth.

Task Id-2323205
PR #56551
2020-10-13 07:30:40 +00:00
qsm-odoo 7cc65665ba [FIX] website: remove useless specific scss for quotes carousel
This reverts commit [1] which was fixed the right way and generically
with [2].

[1]: f011c9aacf3a3010c436d4e4f408cd9ae265de1b
[2]: https://github.com/odoo/odoo/commit/9c08e119b125b82e2c42dc944920dd8a96789e25

closes odoo/odoo#59807

X-original-commit: 281edf192efcf5b3c6c045942f75620af9346501
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-12 17:46:34 +00:00
Samuel Degueldre d8117750ce [FIX] website_sale: fix ribbon modifications not being previewed
Previously, editing a ribbon in the options panel had no preview inside
of the page until the change was validated. This commit fixes that issue
by making the real ribbon invisible, and making the ribbon dummy
visible. The preview still only affects the current ribbon being edited
until it is validated. Unvalidated changes are discarded when clicking
elsewhere in the page.

task-2339986

closes odoo/odoo#59806

X-original-commit: 922f3b67523e24204f15f38517c3dd207884ba66
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-12 17:46:09 +00:00
Benjamin Vray e42dcfba36 [FIX] website, *: keep logged user buttons outside the autohide menu
*: portal

The dividers were removed with the new header templates but we still
needed them to know which items do not need to be folded in the
auto-hide menu. Instead of adding these dividers again, we added a new
class for these elements.

part-of: #59640
task-2312878

closes odoo/odoo#59804

X-original-commit: 59584974aa891b1182164adac3d3563d882bcfd7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-12 17:45:22 +00:00
Benjamin Vray c74deb951d [FIX] website: enable autohide menu in editor mode
Before this commit, autohide menu was disabled in editor mode. This was
thus not really wysiwyg for users anymore.

part-of: #59640
task-2312878

X-original-commit: 969aa3dc11061254c52cf06f0b96d36192d61d40
2020-10-12 17:45:22 +00:00
Baptiste Vergote a9a09da5ed [FIX] base_vat: wrong example vatnumber for CH
As described here:
https://www.estv.admin.ch/estv/fr/home/mehrwertsteuer/fachinformationen/steuerpflicht/unternehmens-identifikationsnummer--uid-.html

The "new" (since 2014) vat number has to be displayed as:
CHE 9 numeric digits plus TVA/MWST/IVA
e.g.: CHE-123.456.788 TVA

This commit removes the previous 6 digits vat number check and regex,
and provide accurate examples on the error message displayed if the
vatnumber given is wrong.

opw-2291581

closes odoo/odoo#59793

X-original-commit: 624e086f0c8ac854fd292d3c6dd14a71ed67b9fe
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-12 16:18:49 +00:00
Andrea Grazioso (agr-odoo) 75e59aeff8 [FIX] sale: calculate untaxed_amount_to_invoice based on invoiced quantity
Enable discounts on sales order lines
Create a service type product with invoicing based on timesheet and
task in sales order's project
Create so for 6 hours and deliver 8 hours.
Create 2 invoices: One for 6 hours with the regular price and 2 hours
h 100% discount.
Invoice status of the order will be Fully Invoiced

Go to Sales>Reporting>Sales Analysis report will show the untaxed amount
associated with 2nd invoice as still to invoice which is incorrect

This occur because when saving the invoice the untaxed amount is
calculated on the amount invoice after discount

opw-2338564

closes odoo/odoo#59638

X-original-commit: be5ec58d0a1a71fc84ca790555cac02a6be5b67a
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-09 12:40:46 +00:00
Joseph Caburnay bb565bcd0e [FIX] point_of_sale: add product on single search result
In this commit, we restore the following behavior from v13: when search
resulted to a single product and 'Enter' key is pressed, the product is
added to the order and the search field is cleared. This works for both
manual keyboard input and barcode input.

closes odoo/odoo#59770

X-original-commit: 225e3898f25ddac061be99c43501c99d4bd3226b
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
2020-10-12 15:02:12 +00:00
wan a942e7561f [FIX] account: bill default invoice date context dependent
The date depends on the user's locale, and needs to be consistent with
the `date` field.

closes odoo/odoo#59580

X-original-commit: ed06aab626cb51b86b4178705b45bbcbfbf2c0f2
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-09 09:03:19 +00:00
IEL d07f540e30 [FIX] hr_expense: correct check for bank settings
TLDR: fix a mess in journal fields check

Steps:

* Create expense "paid by Company"
* Click Post

Before:

* AttributeError: 'account.journal' object has no attribute
'default_credit_account_id'

After:

* Either posted or shows user error about journal misconfiguration

Notes:

* Field ``default_credit_account_id`` is replaced in https://github.com/odoo/odoo/commit/41f119d5325dfbbf916d1d34e63946646ed4d44c
* The error is introduced during incorrect forward-port #58852

---

task-2355177

closes odoo/odoo#59780

X-original-commit: 5c0fca662279702115b5e61c8227f82086693e38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-12 15:20:23 +00:00
Laurent Stukkens (LTU) 0ef25d19bc [FIX] website,website_sale: HTML escape dynamic snippet
Issue
    To do on Community:
    - Install website_sale (eCommerce)
    - Go into Website app
    - Navigate through Product/Products
    - Edit 'Customizable Desk (CONFIG)' and add '&' and/or '<' and/or '>'
      characters into the name
    - Save
    - Go to the Website app Dashboard and click on 'Go to Website'
    - Click on 'Edit' button
    - Drag and drop the 'Dynamic Product' snippet into the website
    - Click on the block 'Your Dynamic Snippet wil be ...'
    - In the right panel, in the 'Dynamic Product' snippet options,
      chose a 'Template' and a 'Product Category'

    A traceback is shown

Cause
    the '&' character crashes lxml.etree.fromstring

Solution
    ensure no '&' is sent to lxmx.etree.fromstring by using
    odoo.tools.html_escape (in order to ensure no other problematic
    characters are sent to the front) on the field values except when
    not applicable (widget rendering with record_to_html should not be
    escaped).
    It is important to note here that this is applicable
    to action servers that are used by the dynamic filter.

opw-2357027

closes odoo/odoo#59805

X-original-commit: f91422115c09be484f2868347566b6392ed0effd
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-10-12 17:45:45 +00:00
David Beguin 26f4fc093c [FIX] survey: let Chart.js handle the session graph max height automatically
Before this commit, the graph y scale in the survey manager screen was based on
the attendees count. But is some attendees do not answer the question, the bars
never reach the maximum height of the graph, and bars can stay really small.

Example: 10 attendees - 4 answers - A: 1 / B: 1 / C: 2

10 |
   |
   |
   |       |
0  |_|__|__|_
     A  B  C

After this commit, the max height of the graph is not set on the graph. So the
chart lib will handle itself the height and will adapt automatically the bars
height in function of the data given to the graph. Bars will always take full
height space, relatively to the count of the most voted answer.

Example: 10 attendees - 4 answers - A: 1 / B: 1 / C: 2

2  |       |
   |       |
   | |  |  |
0  |_|__|__|_
     A  B  C

Task ID: 2351455

closes odoo/odoo#59777

X-original-commit: ac64af033f0bbaa698aee424a5cab85fd9b967d2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-12 15:18:48 +00:00
Jérémy Hennecart b6f6a0dacd [FIX] web: fix notification design
Fix the design of he notification which is sometimes broken
(if there are lists or buttons display in it for example)

task-2346462

closes odoo/odoo#59776

X-original-commit: 238654ae53582d791154388c827f725c8d136612
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-12 15:18:22 +00:00
Raphael Collet f243b71dcb [FIX] core: optimize first snaphot in onchange
This patch speeds up the performance of method `onchange`.  Our use-case
is an invoice with 300 lines, where we modify the unit price or quantity
on several lines.  Each modification triggers a call to `onchange` on
the invoice itself.  The latter call went from 1.3 to 0.8 seconds, which
represents a speedup of 30% to 40%.

In the implementation of `onchange`, the first snapshot is preceded by a
"prefetching" phase, where the lines of x2many fields are read, so that
the fields of unmodified lines are in cache.  This is useful because the
fields of those lines are not sent by the client, which only sends ids.
This prefetching represents more than 40% of the duration of `onchange`,
in our use-case.

The prefetching is inefficient for several reasons.  First, it uses
`mapped`, which formats data that is actually never used.  Second, it
accesses new records that have the actual lines as origin.  And on those
records, computed stored fields are not taken from the origin record,
but are (uselessly) computed instead.

We have optimized the prefetching in the following way.  It now reads
stored fields on the actual lines (using `_read` to avoid formatting),
then copies the cache of those fields on the corresponding new lines (to
avoid useless computations).  This makes the prefetching about 10 times
faster!

closes odoo/odoo#59781

X-original-commit: ec50c426d7c2a17c7b72e64adab65eda6328e163
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-10-12 15:20:47 +00:00
Samuel Degueldre 2fbb4cc9f2 [FIX] web_editor: fix background-images not being auto-optimized on drop
Previously, background-images were not properly optimized when inserted,
whereas they should be just like regular images. This commit fixes that.
It also changes the default quality (used for automatic optimization) to
75 as the difference is not usually very noticeable but can bring a big
decrease in image size.

task-2357332

closes odoo/odoo#59779

X-original-commit: 5d8c0aa0f7678f51e0a0931b0410a0273c7c7d1f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-12 15:19:39 +00:00
Antoine Prieels b86ef518f0 [FIX] payment_odoo_by_adyen: Disable test mode
No test mode is available for Odoo Payments

closes odoo/odoo#59778

X-original-commit: 118e52b748a9e0faec45be0ddf1a9e4a94a3f37c
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-10-12 15:19:12 +00:00
Antoine Prieels f52c9fa1c0 [FIX] adyen_platforms: Sync KYC status on update
The response we get after updating data contains the new KYC status,
we then update it on the adyen account so that we don't have to wait
for the cron.

X-original-commit: 59fdb24527e6073cb3c4de5662d25d4d0cea08eb
2020-10-12 15:19:12 +00:00
xO-Tx b8ed38d816 [FIX] web_editor: fix background-sizing preview
with background-sizing option, user drags background image to adjust its
position using an overlay with the same content from snippet (cloned element).

Some CSS child selector rules will not be applied since the clone element has
a different container from the snippet content.

The CSS "background-attachment" property should be the same in
both parallax snippet & its copy, this will keep the preview more "wysiwyg"
instead of getting different result when bg position saved.

This can be improved by copying all style from snippet content and
override it with overlay related style (copying all css into overlay will
not work since it will change the style of its content too)

task-2327025

closes odoo/odoo#59775

X-original-commit: aaa3e63985789ea07464a5957eb18481e70a383f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-12 15:14:37 +00:00