Commit Graph
143436 Commits
Author SHA1 Message Date
Denis Ledoux b06e4454d5 [FIX] registry: check_foreign_keys, constraint names are limited to 63 chars
When computing the foreign key name,
`check_foreign_keys` didn't take into account the limit of 63 characters
for constraint names.

Because of this, some constraints were dropped and recreated
over and over while they were correct, during install and upgrades.

For instance, when installing `base`
when adding the foreign key for which the name was computed
`base_partner_merge_automatic_wizard_res_partner_rel_base_partner_merge_automatic_wizard_id_fkey`
Postgresql created the constraint under the name
`base_partner_merge_automatic__base_partner_merge_automatic_fkey`
and therefore, as the name did not match,
the constraint was dropped and re-created.

closes odoo/odoo#72234

X-original-commit: 43a4738ebf8a74a389b99f8f58330b3044beaa0c
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2021-06-16 13:15:26 +00:00
Robin Heinz 4cd9bb5552 [FIX] point_of_sale: reprint in manage order
The printer dialog was not shown when going through the manage order if there
was no printer connected.

In order to fix this issue, the tryReprint doesn't check anymore if a printer is
connected or not. It'll print via printer if connected or show the the printer dialog.

closes odoo/odoo#72230

X-original-commit: 7a7aacedde81998ec0f1a7f3283337236e56de42
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2021-06-16 12:18:46 +00:00
Raphael Collet b840d33946 [FIX] base: translations of field labels in views
The commit e123aa2f30 optimizes the call
to fields_get() made in the NameManager to post-process the combined
arch of a view.  The optimization consists in avoiding translations,
with the assumption that the result is only used for validations.  It
turns out that the regular post-processing actually returns the field
descriptions as part of the result of fields_view_get().

We fix this mistake by keeping the optimization only when the flag
'validate' is true, so that the regular post-processing of a view
returns field descriptions with the expected translations.

closes odoo/odoo#72216

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-06-16 09:25:11 +00:00
Younn Olivier 3e82c26c06 [FIX] website: correctly destroy autohideMenu widget
When changing the color of the header with the custom colorpicker and
saving the changes, the autohideMenu widget was destroyed before
finishing the rendering.

The commit fixes the destroy method of this widget, testing if the
variables are defined before using them.

task-2519545

closes odoo/odoo#72193

X-original-commit: c003c8d0620c6eda8f8b482d7519ca00a3007d03
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-15 17:42:02 +00:00
Younn Olivier f9133d1300 [FIX] website_blog: fix covers background color
The background color displayed on the blog posts list page was static,
instead of being the background_color_class saved from the
CoverProperties. Also, on the blog post page itself, the two were
combined which made no sense.

Part of https://github.com/odoo/odoo/pull/71593
task-2497846

closes odoo/odoo#72186

X-original-commit: b3ebc427fd519c29788eadedfca2f956e3695a3e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-15 16:36:31 +00:00
Younn Olivier a18b14d72f [FIX] website_blog: fix cover display on posts list page
This commit fixes a bug happening when changing the background with the
CoverProperties SnippetOption from the blog posts list page.
As it selects the default sizing class and applies it, the min-height
css property was applied and breaking the layout.

The covers min-height is now set as !important to not be overriden in
that context.

Part of https://github.com/odoo/odoo/pull/71593
task-2497846

X-original-commit: aa9591bf546729162f44d1f34cbee094131aba73
2021-06-15 16:36:30 +00:00
Younn Olivier e13924253e [FIX] website_blog: fix blog cover height on post page
As [1] added `!important` flag on .o_full_screen_height and
.o_half_screen_height global classes, the current override in
website_blog was not effective anymore.

Also, the value of the height override is also changed to offer more
differences. Also, simply restoring the old rule would "restore" 13.0
databases but "break" 14.0 databases which relied on it. So a compromise
between both was chosen.

[1]: https://github.com/odoo/odoo/commit/7cc6fdf36569be85e995c962321f2926822ac604

Part of https://github.com/odoo/odoo/pull/71593
task-2497846

X-original-commit: 3929eece7face5f6ed497a119787cd841b917c08
2021-06-15 16:36:30 +00:00
Robin Heinz 003b7fb8b6 [FIX] point_of_sale: Add missing t-key in templates
closes odoo/odoo#72212

X-original-commit: f1c3c531c2fdfcfff3bacf2dda8609a7d1bb0cb4
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-06-16 07:43:04 +00:00
Adrien Widart 13266efa6b [FIX] resource: allow a working time of 24 hours
It is not possible to define a working time that lasts a whole day. This
can lead to calculation errors.

To reproduce the error:
(Need mrp,hr_payroll)
1. In Settings, enable:
    - Work Orders
2. Create a Work Center WC
    - Working Hours: <Create and Edit>
        - 2 shifts:
            - Monday, From 0 To 24
            - Tuesday, From 0 To 24
3. Create a routing R:
    - Add an operation:
        - Work Center: WC
        - Default Duration: 1440 (i.e., 24h)
4. Create a Bills of Materials BM
    - Routing: R
5. Create a MO:
    - Bill of Material: BM
    - Plan From: Next Monday
6. Save, Mark as ToDo, Plan

Error: Since the operation should last 24 hours, the end time should be
the same. However, the Planned Date field is incorrect: the end time is
one minute too late. This error is even more noticeable when increasing
the quantity to be produced.

On step 2, when setting the 'Work to' field to 24, it automatically
becomes 23:59. The first consequence is directly observable on working
time form: we should have a total of 48 hours/week but the current total
is 47.98 hours/week. Another consequence is the end of the planned date
(as described above).

OPW-2462094

closes odoo/odoo#72210

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-16 07:09:22 +00:00
AaronHForgeFlow 3095789b72 [FIX] sale_mrp: stock_account_get_anglo_saxon_price_unit on multicompany environments
closes odoo/odoo#72192

X-original-commit: 76584fda6b33a951d04d501313d5e2a564a9f6c2
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-06-15 17:24:36 +00:00
Yannick Tivisse 919b8ac501 [IMP] ir_qweb_fields: Don't return empty addresses
Purpose
=======

If the contact widget is used on a template, the 'fa-map-marker' icon
will be displayed, even if the address is empty.

This is most probably coming from this commmit: https://github.com/odoo/odoo/commit/62d73253f355fc857cfc6ca11bd5259957a94474#diff-c4cf79d0ff0cb8f7ca865fdfac774ce8fd95c800471a0932d126acb6fd8e7c27R613-R614

If the address is only composed of empty strings separated by \n, return an empty string.

closes odoo/odoo#72167

Taskid: 2572149
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-15 11:13:05 +00:00
Sébastien Mottet (oms) 4769c4623f [IMP] website: configurator move skip button in first screen
The skip button of the configurator's first screen has been moved beside
the 'let's do it' button for more visibility.

task-2518565

closes odoo/odoo#72191

X-original-commit: e6871f1991a951391fe1942f86ed208385d31b38
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
2021-06-15 17:08:58 +00:00
Cedric Prieels (cpr) e8c586b6d4 [FIX] portal: fix portal searchbar
Small fix which removes an error when the user tries to search for an element using the enter key.
task-2508883
Related PR: https://github.com/odoo/odoo/pull/70305

closes odoo/odoo#71753

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-15 09:03:57 +00:00
oco-odoo a6b4893c57 [FIX] account: taxes: ignore taxes configured as not to be affected by previous taxes when generating tax_ids on tax lines
Consider the following example:

1) Create tax ONE, 10%, include_base_amount=True
2) Create tax TWO, 20%, is_base_affected=False

Create an invoice with just one line of 100€, with taxes ONE and TWO (in this order).

The journal entry then contains:
- The payable/receivable line => 130
- The base line => 100
- The tax line for ONE => 10
- The tax line for TWO => 20

The bug this commit fixes concerns the tax_ids set on tax lines. In our example, none should be set, since tax TWO is not affected by ONE. But tax line for ONE actually had tax_ids=TWO, hence impacting TWO's base. This was wrong; the base for TWO is 100, not 110.

closes odoo/odoo#72063

X-original-commit: ff2d1728c835e7d43638502d69245291d0fa3c59
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-06-11 14:46:42 +00:00
Jairo Llopis e7f22391ef [FIX] sale: do not grant access to purchase invoices by default
Sales people should only access customer invoices by default.

Notice that [the equivalent rule in the `purchase` module][1] makes more sense.

[1] https://github.com/odoo/odoo/blob/e2247a860d3d4931d641928a6313bef4649e0edf/addons/purchase/security/purchase_security.xml#L62

@Tecnativa TT30228

closes odoo/odoo#72002

X-original-commit: dde96d6601d6b63762c6a57a8e0260eabad81289
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-06-10 16:08:07 +00:00
Nicolas Lempereur 435a9fd314 [FIX] website: timeline widget has vertical line
In fb556ed09c7e the middle vertical line is removed from the timeline
widget because the display was changed to table.

We need display:block so this commit override the value (adding
"height:100%" also fixed it but not for all browser (eg. in safari)).

opw-2558670

closes odoo/odoo#72198

X-original-commit: 7971bcc3ed2c14254b089a6871d151952b4c4d62
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-06-15 18:24:33 +00:00
Jairo Llopis ba812ddd99 [FIX] sale: improve compute expected date performance
Without this patch, each time the compute reaches the line with `.filtered()`, it needs a new fetch from the database. With too many sale orders, this becomes a bottleneck.

Now, before getting to that line, Odoo knows that it'll need all sale.order.line records, so it can fetch them all at once.

In a production database, loading the sale.order list goes down from 7s to 500ms with this patch.

@Tecnativa TT30390

closes odoo/odoo#72141

X-original-commit: 7969a052a19f3572e4819d163f969ae02bc8a80e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-06-14 15:50:17 +00:00
Thibault Delavallée f27b186a63 [FIX][IMP] mass_mailing: make document fields required on trace model
Traces are always linked to documents as mailings are sent on
documents. Those fields should be required to ensure database
coherency.

Task ID-2525759

closes odoo/odoo#71786

Related: odoo/upgrade#2513
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-15 11:46:51 +00:00
Odoo's Mergebot bc95997644 [MERGE] (test_)mail: improve activities tests and access checks
Overall purpose of this merge is to add some tests on activities notably
about ACLs and access to records.

See sub commits for more details.

Task-2272475

closes odoo/odoo#71131

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-15 15:06:43 +02:00
Brieuc-brdandqsm-odoo ebc56f7605 [IMP] web_editor: add label for animated shapes
This commit adds a little label on the top corner of animated shapes
previews.

Part of #70843
task-2319488

Related: odoo/design-themes#17
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-06-15 12:17:41 +00:00
Brieuc-brd 0da5c12179 [IMP] web_editor: reorder the list of shapes
Reordering the names (data-select-label) in snippets.xml
to have a more logical list.

Part of #70843
task-2319488
2021-06-15 11:53:50 +00:00
Brieuc-brd 50458a208d [IMP] web_editor: clean and improve shapes
1. Change some shapes to apply correctly the color presets:
e.g. the default color of the shape erased the background
color of the preset.
2. Improve some shapes to have a better render by changing
the colors and/or adding animations.
3. Some svgs could give the same result. To have a clean list,
many svgs were combined.
4. Letting the old svg files to assure the compatibility with themes.
5. Improve the preview of some shapes for a better reading.

Part of #70843
task-2319488
2021-06-15 11:53:50 +00:00
xO-Tx 9017745fd1 [IMP] web_editor: add animated shapes
The goal of this commit is to add a new page to the shapes
(Floating shapes) and new animated shapes in the current
categories.
Colors should be, as other shapes, linked to the theme.

Part of #70843
task-2319488
2021-06-15 11:53:50 +00:00
Munaf Khan 292ffeec00 [FIX] various: avoid scroll for button(s) within mail templates
Right now, for notifications handled by odoo (which are being displayed on
discuss app / object chatter), few of the buttons have unexpected scroll
(mostly the CTAs that redirect to record / portal views) and ruins the UI.

This commit fixes the issue by improving such templates by using proper
paddings on the button.

TaskId:2518863

closes odoo/odoo#70083

Related: odoo/enterprise#18225
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-15 08:34:37 +00:00
Ivan Yelizariev b35d0509a3 [FIX] web_tour: use .concat to avoid max call stack error
Variable `mutations` may have thousands of records. Using `.push(...mutations)`
would lead to error

STEPS:
* install website_sale
* create many categories:

```
for x in range(0, 4000):
    env['product.public.category'].create({'name': str(x), 'parent_id': 9})
```
* open /shop
* click [Edit]

BEFORE:

```
Uncaught RangeError: Maximum call stack size exceeded
```

---

opw-2515707

closes odoo/odoo#72169

X-original-commit: 853a2cab3f896e99d5a4c498eea6ebf02e787b94
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-15 11:26:16 +00:00
Raphael Collet 7fca29b443 [FIX] base: useless view validations when validate=False
When a view is created/modified, it is required to validate it, the
validation checks the syntax, the inheritances, the fields, etc. When a
view is rendered there are a few more steps to perform like to (dis)able
the `edit` button from a view form if the user only have `read`
accesses. Those postprocess are useless when the view is validated and
should only be performed when the view is rendered.

closes odoo/odoo#68469

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2021-06-15 08:44:03 +00:00
Raphael Collet 4f22ae270a [FIX] base: compute view.xml_id only when needed
This is a pure technical fix, computing `view.xml_id` is only needed
when there is a problem with the view.  Computing the `xml_id` is not
free, as it needs to be retrieved from the database.  During a regular
installation, there should be no problem, the view is validated without
errors or warnings.
2021-06-15 08:44:03 +00:00
Raphael Collet ee8756b311 [IMP] base: bypass _inverse_arch() in view creation
By default, whatever is written on field 'arch' is handled by its
inverse method inverse_arch(), which writes on the low-level field
'arch_db'.  When writing on 'arch_db', the cache is cleared, which leads
to performance loss because the arch needs to be re-fetched.

This optimization bypasses the inverse method on view creation, this is
safe as there is nothing wrong in the cache and makes view creation 20%
faster, and installation 7% faster.
2021-06-15 08:44:03 +00:00
wan d29c8427d1 [FIX] web: increase file upload to 128Mb
Also make this a configurable value, from the server.

This is the limit of the SAAS servers.

closes odoo/odoo#72143

X-original-commit: bcd1c8aade6123dd20d7aebaae8a0f204f258604
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-14 15:51:24 +00:00
Younn Olivier dfe699efe9 [FIX] web_editor: scroll to the bottom of link options
Before, only the url input was focused when initializing the link
tools.

Now, we also scroll to the bottom of the options so that the user
directly has access to them.

Part of https://github.com/odoo/odoo/pull/71909
task-2542318

closes odoo/odoo#72122

X-original-commit: 748418d95059ad7ed5638aa4e4aca76da30fa6b3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-14 11:09:05 +00:00
Younn Olivier c6ed10f020 [FIX] web_editor: compute image quality when mouse button is released
Computing the image quality in preview when the slider was moving was
problematic for large images on chrome and FF. The preview for this
option has been removed.

Part of https://github.com/odoo/odoo/pull/71909
task-2542318

X-original-commit: da79bb6b3216ee71fe283c394d4c8acb5f76cdab
2021-06-14 11:09:05 +00:00
Younn Olivier dd7a840d84 [FIX] web_editor, website: fix overlay handles display
A new parameter displayHandles was introduced on SnippetOptions to
display or not the handles on a snippet. If a snippet had no option
needing the handles overlay, the overlay (and handles) from its closest
parent with such option was.

Two use cases were not tackled correctly and should display overlay,
even with no option with displayHandles:
- root containers (which have no editable parent)
- inline snippets (movable snippets)

Part of https://github.com/odoo/odoo/pull/71909
task-2542318

X-original-commit: 4b7dd2dbd378a9dc465e3e3fd8e32806df66919a
2021-06-14 11:09:04 +00:00
alt-odoo d5c9f14d31 [FIX] account: error in reconcile rule percentage calculation
Small fixup of recent commit 5800f20ccf63ef8482d1460f46c8c5fe30eac822.

It can happen that line_residual is equal to line_residual_after_reconciliation.
This should lead to a zero reconciled percentage instead of a ZeroDivisionError.

closes odoo/odoo#72064

X-original-commit: 9cc8ac4a86fff81af397c89fbbc197bec222622e
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-11 14:49:01 +00:00
Alvaro Fuentes 4de85d4306 [FIX] sale_timesheet: fix _compute_warning_employee_rate
On account analytic lines, employee_id can be null.
https://github.com/odoo/odoo/blob/c63af09774414a004ef34644b4f38b4fdb1d12bd/addons/hr_timesheet/models/hr_timesheet.py#L48

```
Traceback (most recent call last):
  File "/tmp/tmpowipzc_d/migrations/base/tests/test_mock_crawl.py", line 155, in crawl_menu
    self.mock_action(action_vals)
  File "/tmp/tmpowipzc_d/migrations/base/tests/test_mock_crawl.py", line 245, in mock_action
    mock_method(model, view, fields_list, domain, group_by)
  File "/tmp/tmpowipzc_d/migrations/base/tests/test_mock_crawl.py", line 335, in mock_view_kanban
    self.mock_web_search_read(model, view, [domain], fields_list)
  File "/tmp/tmpowipzc_d/migrations/base/tests/test_mock_crawl.py", line 394, in mock_web_search_read
    data = model.search_read(domain=domain, fields=fields_list, limit=80)
  File "/home/odoo/src/odoo/14.0/odoo/models.py", line 4839, in search_read
    result = records.read(fields)
  File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3020, in read
    return self._read_format(fnames=fields, load=load)
  File "/home/odoo/src/odoo/14.0/odoo/models.py", line 3040, in _read_format
    vals[name] = convert(record[name], record, use_name_get)
  File "/home/odoo/src/odoo/14.0/odoo/models.py", line 5666, in __getitem__
    return self._fields[key].__get__(self, type(self))
  File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 1019, in __get__
    self.compute_value(recs)
  File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 1175, in compute_value
    records._compute_field_value(self)
  File "/home/odoo/src/odoo/14.0/addons/mail/models/mail_thread.py", line 410, in _compute_field_value
    return super()._compute_field_value(field)
  File "/home/odoo/src/odoo/14.0/odoo/models.py", line 4061, in _compute_field_value
    getattr(self, field.compute)()
  File "/home/odoo/src/odoo/14.0/addons/sale_timesheet/models/project.py", line 90, in _compute_warning_employee_rate
    dict_project_employee[line['project_id'][0]] += [line['employee_id'][0]]
TypeError: 'bool' object is not subscriptable
```

```
❯ psql test_14 -c '\d account_analytic_line' | grep employee_id
 employee_id            | integer                     |           |          |
    "account_analytic_line_employee_id_fkey" FOREIGN KEY (employee_id) REFERENCES hr_employee(id) ON DELETE SET NULL
```

Observed on upgrade request 16289
opw-2525553

Steps to reproduce on runbot (or local db with -i sale_timesheet and
deoma data)
1. Select Project > Office Design
2. Change project settings:
  Settings tab > Billable=True
  Invoicing tab > Invoice Tasks to=A unique customer
                > Pricing=Employee rate
3. Save
4. Delete Employees > Eli Lambert
5. Open Project main menu -> Traceback

closes odoo/odoo#72081

X-original-commit: 71c3897a07918679717d57f65eeadb34b54cdcbd
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-11 16:16:37 +00:00
Yannick Tivisse cf92bf2d24 [FIX] hr_fleet: Unsubcribe the employee when unassigned from the vehicle
If the driver is a follower of the vehicle he will still be notified on the
chatter activities

closes odoo/odoo#72072

X-original-commit: f5419a1860c94df95f663c64370b23a8943a4e68
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-11 15:36:05 +00:00
Yannick Tivisse bc1603167d [FIX] hr_fleet: Don't notify future_driver_id as Changed Driver
We are supposed to notify the driver change when the driver actually changes.

X-original-commit: 2e58d23e760313dbf58ce6a90f26b7160db460d8
2021-06-11 15:36:03 +00:00
Yannick Tivisse 77a27c574d [IMP] fleet: Rename action methods according to guidelines
closes odoo/odoo#71915

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-15 03:54:33 +00:00
William Braeckman f9ae3fdc18 [IMP] fleet: fleet contract multi-company
Adds a multi company rule for the vehicle contract.

Task ID: 2563156
2021-06-14 07:34:02 +00:00
William Braeckman 99858e7643 [IMP] fleet: compute state on date changes
Currently changing the expiration date of a fleet contract doesn't reset
the state. This commit aims to fix this.

Task ID: 2563156
2021-06-14 07:34:02 +00:00
sofiagvaladze 8804690e7a [IMP] hr_holidays: Improve archived employees management
Add filter on everyone menu
Add archived filters

task - 2416659

closes odoo/odoo#64806

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-15 04:07:52 +00:00
Kevin Baptiste 76e99c336c [IMP] fleet: add pivot views
Add pivot views for:
    - fleet.vehicle
    - fleet.vehicle.log.contract
    - fleet.vehicle.log.service

closes odoo/odoo#71916

Taskid: 2533177
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-09 13:12:40 +00:00
Benjamin Frantzen (bfr) 1ad0a8ce5e [FIX] l10n_it_edi: fix test_ir_mail_server (test_receive_signed_invoice_bill)
closes odoo/odoo#72147

X-original-commit: 3370bb9bf77e76dad4fd72fe7eda3820a3849f5e
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-06-14 17:11:27 +00:00
Adrien Widart c1f97a367f [FIX] purchase: compute unit price with different uom
On a product form, if the purchase UoM is different from the default
UoM, this will lead to an error when creating a RfQ.

To reproduce the error:
(Need stock)
1. In Settings, enable "Unit of Measures"
2. Create a product P:
    - Cost: 100
    - UoM: Units
    - Purchase UoM: Dozens
3. Create a RfQ:
    - Add P

Error: The quantity is 1 and UoM is Dozens, however the unit price is
$14400. The ratio has been applied twice.

When setting the product, an onchange method computes the unit price.
However, the computation is wrong: it first converts the product's
standard price using the purchase UoM of the product. Then, it converts
the result, this time using the UoM of the PO line.

OPW-2519294

closes odoo/odoo#72139

X-original-commit: b37a13d7763e4a69695fdb1567dce5d0f69ff78a
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-06-14 14:38:43 +00:00
Antoine Vandevenne (anv) 2327aa461d [IMP] payment: prevent validation transactions from creating payments
Before commit 139dd9d, only validation transactions made with a validity
check (transfer of a small amount with immediate refund) led to the
creation of an `account.payment` record for the reconciliation. As that
amount was never perceived, there was in fact nothing to reconcile.

With commit 139dd9d, it is possible to make $0-validations (the validity
check is handled by the provider). As this feature now sheds light on
the flawed behavior described above, it has been decided to entirely
stop creating `account.payment` records for validation transactions.

This commit thus prevents the post-processing of validation transactions
from preparing their reconciliation.

task-2494916

closes odoo/odoo#72137

X-original-commit: f460d7a5a995cd7b934d32f82b50aede43efbace
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2021-06-14 13:49:51 +00:00
nie d7961f1489 [FIX] survey: conditional score with sections
Steps:
- Go to Surveys
- Create an new survey:
  - Questions:
    1. First section
    2. First question:
       - Multiple choice: only one answer
       - Answers:
         1. First answer
            - Choice: Yes
            - Is a correct answer: Checked
            - Score for this choice: 1
         2. Second answer
            - Choice: No
    3. Second question:
       - Multiple choice: only one answer
       - Answers:
         1. First answer
            - Choice: Yes
            - Is a correct answer: Checked
            - Score for this choice: 1
         2. Second answer
            - Choice: No
       - Options tab:
         - Conditional display: Checked
         - Triggering question: (First question)
         - Triggering answer: (First question, First answer)
  - Options tab:
    - Layout: One page per section
    - Scoring: Scoring with answers at the end
- Click Test
- Select the two correct answers
- Submit

Bug:
The score is 50% instead of 100%.

Explanation:
Since multiple questions are submitted at the same time, we cannot know
before saving the question whether the following is still going to be
active.

This commit re-evaluates, for each question, which are the ones that are
still active.

opw:2537713

closes odoo/odoo#72126

X-original-commit: ec836acdc7bf10212f14a8bc98eac4cfa2f12e26
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-06-14 13:46:36 +00:00
Odoo's Mergebot 2170e09c48 [IMP] website_sale: don't show product from another website to admin
Before this commit, the alternatives products were not multi-website filtered
to the admin.
The suggested product were filtered by website thanks to the
`website_published` filter.
This only concern the admins, as for portal and public user, all of this is
done automatically by the ACLs anyway, where we force_domain to
`website_published` products, which also filter by website (see the mixin).

This will also eases module inheritance as we use `sale_product_domain()`.

Fixes #67501

closes odoo/odoo#72044

Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-06-14 17:15:59 +02:00
lejeune quentin b4920bfe55 [FIX] hw_drivers: Hide hostapd status in IoT
We call the status of the hostapd in each request of 'get_odoo_server_url()' and 'get_ssid()'
And this call display in the log the status '0' or 'inactive' in the log

With this commit we hide this useless information

closes odoo/odoo#72133

X-original-commit: e5e9f9f91cf9bf35f1e0b307008840a0de134e2f
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2021-06-14 13:13:32 +00:00
Julien Castiaux 2ebcec9807 [IMP] base: prefetch all fields used by get_combined_arch
The `mode` field in used in `_combine` to distinguish `primary` views
from `extension` ones. The field has been retrieved as part of the query
done in `_get_inheriting_views` and manually placed in the cache so the
ORM doesn't perform an extra query just to retrieve the mode.

Using our benchmark (render_all_views test tag, website_sale, mrp,
contacts, crm and timesheet installed), the reported time was 18.46s
with 17890 queries performed without this improvement, it is 17.82 with
17340 queries with.

Closes #72096

closes odoo/odoo#72127

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-06-14 12:55:31 +00:00
Romain Derie 705d5cba33 [IMP] website_sale: applied unpublished style on alternative/suggested
As we do most of the time, unpublished product should have a visual hint to
see they are unpublished
2021-06-11 11:50:49 +00:00
Romain Derie d175c8fe0f [IMP] website_sale: align accessory and alternative products visibility
This only impact admins, as public/portal users have `website_published` forced
to true automatically through the ACLs.

On shop, we don't hide unpublished products for the admin.
2021-06-11 11:17:14 +00:00