Commit Graph
139084 Commits
Author SHA1 Message Date
Nicolas Galler c04891cbe0 [FIX] base: correct unit test for compatibility with PIL 7.0
The unit test in `test_base_document_layout` does not pass with
version 7.0.0 of PIL, which is loaded by default on Ubuntu 20.04.
The reason is that the color obtained from the image is slightly
different.  This fix slightly relaxes the test (in fact we don't care
about the exact color obtained in this test, we just want to make sure
that it doesn't crash)

opw-2342394 (original ticket)

closes odoo/odoo#60071

X-original-commit: 99b3f0be1b322ee469871f9496527e8dc3e778bb
Signed-off-by: Thomas Dieuzeide <tdi-odoo@users.noreply.github.com>
Signed-off-by: Nicolas Galler <nicocrm@users.noreply.github.com>
2020-10-15 10:57:33 +00:00
wan 1c30b8a95c [FIX] account: do not auto install modules that depend on Accounting
Moved in the post init hook of account_accountant

closes odoo/odoo#60068

X-original-commit: f997bc8f6e9d5138de6faed80e9774d359bfbe8d
Related: odoo/enterprise#14100
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2020-10-15 10:14:25 +00:00
Prakash Prajapati fb261e7b03 [IMP] hr_timesheet: chrome app icon should not be displayed on mobile
The icon of the chrome app from the timesheet setting should not be
displayed on mobile.

closes odoo/odoo#59564

Task-id: 2323254
Related: odoo/enterprise#13935
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-09 05:18:37 +00:00
nie 54e116269c [FIX] web: Find key in stringified JSON
Steps to reproduce the bug:
- In Projects, switch to the calendar view
- Click a task

Bug:
Traceback here: https://github.com/odoo/odoo/blob/7ba47e7215df69b6556a848532e4f33ef4243e83/addons/web/static/src/js/fields/basic_fields.js#L2181

TypeError: Cannot use 'in' operator to search for 'invisible' in {}

Explanation:
We could change the inherited model of CalendarView from AbstractView to BasicView but it would be adding 400 lines of code to every calendar view. So, for now, and to keep it simple, we just parse the modifiers where it's needed to.

opw:2352436
opw:2352890
opw:2354039

closes odoo/odoo#59876

X-original-commit: 422c52a0823b1a53eeb974e76d08a44cacf4ea0a
Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-10-15 10:04:59 +00:00
Simon Lejeune ffdc64a57d [REM] stock,mrp,purchase: outdated documentation
An updated and user friendly documentation is available at
https://www.odoo.com/documentation/user/14.0

closes odoo/odoo#46185

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-10-15 09:20:05 +00:00
qsm-odoo c7f28395af [FIX] website: show the correct value for hoverable dropdown option
Before this commit, the hoverable dropdown option was broken because
we changed the option selector to the navbar element instead of the
header element. But we forgot to care about the data-select-class
which adds a class on the header. This commit fixes the issues by
changing the $target back to the header element for the related option
as the fact it is linked to the navbar element is only so that the
options appear in a different section, on navbar click.

Part of https://github.com/odoo/odoo/pull/60031
task-2312878

closes odoo/odoo#60031

X-original-commit: e1f8d549895cd9c459e6350430f30d541d02838a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-15 08:51:01 +00:00
qsm-odoo bd5b19023b [FIX] website, *: restore navbar options for 'Boxed' header
*: web_editor

The selector targeting the navbar for the related editor options was
not correct to target the navbar of the 'Boxed' version of the header.

Part of https://github.com/odoo/odoo/pull/60031
task-2312878

X-original-commit: 6a4587022ced3e1d72ff8c34a64c7a39e7572520
2020-10-15 08:50:52 +00:00
xO-Tx afa80ec149 [FIX] website: fix invisible parallax snippet issue
When the height not forced (50% or 100% screen's height), the snippet
simply disappear if there is no content inside (default).

The 4e220bf commit makes parallax snippet empty by default and the
main goal of a8f0cee was to make "DRAG BUILDING BLOCK HERE" placeholders
appear only on drag, that's why we need to add a "min-height" for parallax
to keep it visible when the "Height" selected is auto.

task-2327025

closes odoo/odoo#60032

X-original-commit: f019cd677e68312f90604be6abd04a1b1755ae4d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-14 16:45:10 +00:00
Thibault Delavallée fa11872330 [FIX] event: split unstored / stored fields computation
Otherwise computing unstored fields forces to compute all other already
stored fields. When being in a high charge context this may have a big
impact on DB use.

Task ID-2351463

closes odoo/odoo#59845

X-original-commit: fbde9dd183472237f12014315f063af736950b6c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-13 11:02:17 +00:00
Xavier Morel 23ef558689 [FIX] account: improve warnings.warn call
As-is, the warning will reports that post() is called from within
post, which is not very convenient when trying to find what calls
post() (as there are other "post" methods in the system).

By increasing the stacklevel from 1 (default) to 2, the warning will
report the method's caller, which is a lot more useful.

closes odoo/odoo#60043

X-original-commit: 5bc6eb9b387112138ac118726ff746bad6d00f8d
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-10-15 06:50:13 +00:00
Thibault Delavallée 17e30c988a [IMP] test_mail: add tests about alias defaults management
Purpose of this commit is simply to add tests about alias defaults.
Code protects it against being badly formatted. However having
tests ensuring it is always a good idea to avoid regression.

Task ID-2361179

closes odoo/odoo#60026

X-original-commit: 0075cc02f9a11dcddaf9ca7d70cc1adf7596f6d3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-14 15:57:32 +00:00
Nicolas Martinelli 3319803a93 [FIX] account: wrong rounding with multi-currency
- Create a tax:
  5%
  Included in price
- Set the company currency to USD
- Set the currency rounding of CHF to 0.05
- Set the rate for CHF to 0.654065014
- Create the following invoice in CHF:
  Set a payment term
  Prod 1, 1 unit,  5.0 CHF, tax 5%
  Prod 2, 1 unit, 10.0 CHF, tax 5%
  Prod 3, 1 unit, 50.0 CHF, tax 5%

It is not possible to save the invoice because of an unbalanced journal
entry.

Indeed, the Receivable line is $99.30 while it should be $99.29. This
happens because we round the `total_balance` with the rounding precision
of the invoice currency while it is in the company currency.

closes odoo/odoo#58798

closes odoo/odoo#60035

X-original-commit: dad5e2a575448b68cc1b59880fecfe48dbe30a4e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-14 17:24:32 +00:00
Nicolas Martinelli fa60131f9c [FIX] account: wrong computation with currency rounding 0.05
- Create a tax:
  5%
  Included in price
- Set the currency rounding of the company to 0.05 (e.g. CHF)
- Create the following invoice
  Prod 1, 1 unit,  5.0 CHF, tax 5%
  Prod 2, 1 unit, 10.0 CHF, tax 5%
  Prod 3, 1 unit, 50.0 CHF, tax 5%

The total amount of the invoice is 64.95 CHF instead of 65.00 CHF, even
in a 'Round per line' configuration.

It happens because `compute_all` rounds the amounts following the number
of digits of the currency instead of using the `rounding` field.

Note that there is a discrepancy between the POS computation and the
Account computation: the POS already uses the `rounding` field instead
of the number of digits:

https://github.com/odoo/odoo/blob/80073c5430f0ab562dfc27572c108114161ebb25/addons/point_of_sale/static/src/js/models.js#L1855-L1991

opw-2341566

X-original-commit: 94353ebd6b47a286157f0559b194ff03ea49ff68
2020-10-14 17:24:31 +00:00
IEL 60572d6597 [FIX] stock: keep previously set result package in pickings
Steps to reproduce:

* In Inventory, activate multiple warehouses and storage locations, multi-step routes, Delivery packages
* On the main warehouse, activate 3 steps delivery
* Create a stockable product A
* Update quantity on hand: 100 units in a package PACK1 in Stock/Shelf 1
* Create a new Pick transfer with one move: 120 product A
* Set the transfer as todo and check availability: a move line for the 100 units from PACK1 is created
* Edit the move line: set a destination location, **change the result package to PACK2** and set a qty_done
* On product A, update the quantity on hand: add a *new* package PACK3 of 20 in Stock/Shelf 1
* On the transfer, click on check availability

Current behavior:

* A new move line is created for the 20 units from PACK3 to PACK3: ok
* The move line edited before for the 100 units has its result package **reset to PACK1**

Expected behavior:

* A new move line is created for the 20 units from PACK3 to PACK3: ok
* The move line edited before for the 100 units has its result package kept to **PACK2 as edited by the user** who decided to open the package already

Short analysis:

At the end of `StockMove._action_assign()`, the method `StockPicking._check_entire_pack()` is called. For each package moved by a move line, this method checks if the package is entirely moved (sum of quants == sum of move lines). The check is done by `StockPicking._check_move_lines_map_quant_package`. When the sums match, the package level of the move lines is created or updated. When it happens, it writes the package in the `result_package_id` of the related lines.

It should not change the result_package_id if it was already set.

Thinking further, maybe it should not consider lines with a `qty_done` in `_check_move_lines_map_quant_package`: users already picked these lines, if they decided to empty or change the `result_package_id`, a new check of availability for the remaining quantities should not change these lines.

opw-2346608
Fixes #58491

closes odoo/odoo#60025

X-original-commit: db262912eb716aed1c42be8a9d59c25bdfa400e0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-14 15:56:51 +00:00
Xavier Morel 34575ceaa8 [IMP] core: make post-install tests deterministic
`registry._init_modules` is a set so its iteration order is
non-deterministic (it's randomised on interpreter initialisation
unless PYTHONHASHSEED is provide through the environment). This can
lead to annoying non-deterministic behavior: while the non-determinism
is only at the module level, it's easy enough for modules to have
python-level side-effects (e.g. patch methods, update globals, ...),
which may only be surfaced by an other module executing after them,
but not if said module executes before.

By sorting the modules we should make this much more reliable one way
or another.

closes odoo/odoo#60028

X-original-commit: f9169a468a2328a691ec4f32233ba3bad3622282
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2020-10-14 16:10:58 +00:00
Sébastien Theys 1ff12ed7d1 [FIX] mail: open mentions below composer in chatter
opw-2358094

closes odoo/odoo#60019

X-original-commit: 8c9792d811feeb3080fa1106d358112c630d19f7
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-14 15:13:09 +00:00
Kamesh Patel c8ba009c6c [FIX] crm,mail: clear breadcrumb when redirecting to activities from systray
Before this commit:

When accessing activities from the systray, any existing breadcrumb-item should
be clearer.

After this commit:

Clear breadcrumb-item when access activities from the systray.

Task-2342246

closes odoo/odoo#60018

X-original-commit: a9b32448c4a6227ef8e729436cb793ea9c24c289
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-14 15:12:42 +00:00
Thanh Dodeur 840728b4dc [FIX] mail: adds shadow to RPCs
This commit adds shadow to RPCs that are not supposed to be blocking.

task-2352703

closes odoo/odoo#60017

X-original-commit: 4274a061ff1498f647580c38c7048da8a8cb0a9c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-14 15:11:58 +00:00
Thanh Dodeur c8ed4697f6 [FIX] mail: inverts the zoom scroll direction of the attachment viewer
This commit inverts the zoom direction of the scroll wheel in the
attachment viewer to respect the behaviour of before the refactor.

part of task-2171884

closes odoo/odoo#60009

X-original-commit: 3d9e2e031ea2e92a50769cc69fe37741d32b6820
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-14 14:27:19 +00:00
Dharmraj Jhala aaa1f6c237 [FIX] crm: update 'Default Values' on alias while updating sales team
Whenever when change the 'Leads' of 'Pipeline' boolean field on sales team,
it should also update the linked alias. Mainly, if 'Lead' is checked, the
'Default Values' on the alias should also be updated.

It used to work before a recent refactoring (see commit [1] and [2] for more
information).

This commit adapts the changes done in refacotring and updates the alias values
while updating the sales team.

[1] - https://github.com/odoo/odoo/commit/7cfd364db54e88970ef51c798df3bd4df44222b3
[2] - https://github.com/odoo/odoo/commit/186cfb5ebd35d572d0f635cd7975de7cff0d1055

TaskId - 2357573

closes odoo/odoo#60008

X-original-commit: 0669ee36e195e8e0f98131219b59fcc5cba4cea7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-14 14:26:57 +00:00
Thanh Dodeur 461c3fa91b [FIX] mail: corrects wrong url formatting for attachment download
This commit changes the url formatting of the `services.navigate` in
the attachment viewer. Before this commit, the resulting URL was
erroneous which prevented download and lead to a 404 error.

part of task-2171884

closes odoo/odoo#60003

X-original-commit: b11535bb26ad9a1fd96ec616201eb67c89597cdc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-14 13:37:09 +00:00
Thibault Francois 3af61a49f4 [FIX] sms: fix name_search
Problem
-------

_search_is_mail_thread_sms is looking for ir.model
in the database and then fetch them from the registry
without verification. This can lead to key error
when a model is present in the database but not in
the python anymore. This situation can happen
after a migration.

Solution
--------
Check the model is present in the registry

closes odoo/odoo#60001

X-original-commit: 448626d86a1f06b9f8a7a88111f7cb01600488cd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-14 13:33:49 +00:00
Odoo's Mergebot 347f4413d1 [MERGE] web_editor,web,website,mass_mailing: new Jabberwock editor
This PR replaces Summernote by Odoo's new editor: [Jabberwock](https://github.com/odoo-dev/jabberwock).

closes odoo/odoo#59828

Related: odoo/enterprise#14012
Related: odoo/upgrade#1845
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-10-14 15:06:56 +02:00
Jorge Pinna Puissant d5242066bd [FIX] account: do not set default account
Do not set a default `account_id` for section and note lines. Indeed,
when set the constraint `check_non_accountable_fields_null` will raise.

fine-tuning of c22f99dd09

opw-2357415
opw-2355559
opw-2359283

closes odoo/odoo#59988

X-original-commit: b6791a5183ef1015b47312785501a99ed68e5718
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-10-14 11:24:34 +00:00
Sébastien Delafond 1767b6eedc [CLA] signature for sdelafond
closes odoo/odoo#59987

X-original-commit: 76ea1a25dd9db414f042f70ef68b8a375d6e7758
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-10-14 11:24:12 +00:00
Sébastien Delafond 43fb019fe3 [FIX] packaging: update debian file for 14.0.0 release
X-original-commit: af29d603d721c4a6960096abad9b971f65c998b8
2020-10-14 11:24:12 +00:00
JF Aubert 4e50999d87 [FIX] stock: uom in lot m2m with serial
Consider move uom different from serial product uom
to set up move lines with product uom

closes odoo/odoo#59986

X-original-commit: ee966998fa986936a0407676bb4d54f61c7fce1f
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-14 11:23:13 +00:00
Benjamin Vray 294142bdbf [FIX] website: disable overlay on arrows in gallery snippet
Before this commit it was possible to activate the overlay of the
arrows of the gallery snippet (with themes because of animation
options)

task-2312878

closes odoo/odoo#59973

X-original-commit: 81a00e3469f93cb4686c92db5695316db92eb84c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-14 10:34:53 +00:00
Swapnesh Shah 1cede5bcd4 [FIX] purchase: hide send reminder on unsaved record
Before this commit, Button to Send Sample reminder was always visible which doesn't makes sense as It would work on saved record only.

Now Button will be hidden on unsaved record.

Fixes #58744

closes odoo/odoo#59972

X-original-commit: 3cb26da782042ee391777ed15bcca4eef4a10677
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-14 10:34:13 +00:00
Anh Thao Pham (pta) 0d93827fdc [FIX] point_of_sale: fix decimal button in lang with not dot decimal
- Activate debug mode
- Go to Settings > Translations > Languages
- Activate and switch to a language that does not use dot (.) as decimal separator (i.e. French)
- Go to a POS session
- Select a Product, edit the price with a decimal via the Numpad widget
The decimal is not taken into account.

This is due to the fact that the entered input ('.') is not considered as the decimal point
in this language (i.e. ',') and is skipped.
The same issue happens for quantity and discount.

The dot in the Numpad widget has been replaced by the decimal separator of the language.
Also "field_utils.parse.float" has to be used instead of "parseFloat" because "parseFloat" only
recognizes a dot as separator. (i.e. "parseFloat" returns 12.00 for "12,99")
Howerver "parseFloat" is still useful for checking values as "field_utils.parse.float" returns
an error if its parameter is not a string or if the parsed result is not a number.

opw-2357848

closes odoo/odoo#59971

X-original-commit: a1543d2a283000e2955df5f8131bae5e25e110c0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-14 10:33:49 +00:00
Priyanka Kakadiya 8d4393d834 [FIX] website_slides: properly display muted text in full-screen
Since a refactoring of the handling of the color system and the way the text
muted is handled, the text-muted isn't visible on the full-screen mode of a
course. That is becuase text-muted is based on the font color set for the body,
which in this case is quite similar to the background of left panel in
full-screen course content.

This commit fixes the issue by using `text-600` class that is suited for this
scenario (the background color is fixed here irrespective of the color-palette,
and so should be muted text-color) instead of `text-muted` for the left panel
of full-screen course content.

taskId - 2346013
closes #59390

closes odoo/odoo#59970

X-original-commit: 7f7f9c6c9165fc6697e90ed6616466d9684e28f2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-14 10:33:27 +00:00
c1c1381894 [ADD] web_editor: add new Jabberwock editor lib
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2020-10-14 10:29:11 +00:00
6d6f42f489 [REF] website: adapt to new jabberwock editor
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2020-10-14 10:29:11 +00:00
Gorash 3dc721ab71 [REF] mass_mailing: adapt to new jabberwock editor 2020-10-14 10:29:10 +00:00
95d0ca4b2c [REF] web_editor,web: adapt to new jabberwock editor
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2020-10-14 10:29:09 +00:00
Goaman c469e9bc5d [REM] web_editor,website: empty summernote files
Summernote will be replaced by the new Jabberwock editor.
2020-10-14 10:29:06 +00:00
nie 19d4b71d52 [FIX] sale_timesheet_enterprise: Timesheet date not respecting timezone
Steps to reproduce the bug:
- Set the timezone of the user to Australia/Melbourne
- Set the country of the company to Australia
- Set the time of the system to 20:00 UTC
- Have Project and Sales installed
- Enable Timesheet and Timesheet Timer on project (A)
- Create a task in project (A)
- Click Start and then Stop
- Confirm the wizard

Bug:
The date of the new timesheet line is set to yesterday.

opw:2351204

Original PR: odoo/enterprise#14023

closes odoo/odoo#59966

X-original-commit: b85a5fc39887660992b5dd0f49ca331e38dd6030
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-10-14 10:25:22 +00:00
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