Commit Graph
144228 Commits
Author SHA1 Message Date
Mitul Shah ab2afb0e9d [FIX] survey: fix the warning message while sharing the survey
Currently, while trying to share the survey with 'one page per section'
layout, if the survey has only questions and no sections, a warning is
raised that says 'You cannot send an invitation for a survey that has
no questions'. It is misleading because in this case, what you do not
have is atleast one section with question(s).

This commit fixes the warning message for 'one page per section' type
of survey and gives clear idea to the user about what is missing.

TaskID-2611996

closes odoo/odoo#74694

X-original-commit: 381d18888d81f6797004c718fee5dbd9706b3122
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-04 10:49:01 +00:00
Nasreddin Boulif (bon) bdfda1f02f [FIX] stock: use docids as product_id in report
Steps to reproduce:

  - Install Inventory and Studio modules
  - Go to Inventory -> Products -> Products
  - Open Studio
  - Click on Reports tab
  - Select `Product Routes Report`

Issue:

  Traceback is raised.

Cause:

  No 'product_id' provided in data while getting report values.

Solution:

  If no `product_id` key or value in data, set `docids` (or an empty
  list if no docids) as product_id and set 'warehouse_ids'
  to an empty list.

opw-2619142

closes odoo/odoo#74937

X-original-commit: de6b1636818423b2d2b82f900c3b30515af73279
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-08-10 13:19:39 +00:00
Nasreddin Boulif (bon) 1f37e4e0d6 [FIX] web: Allow array value for many2many search filter
Issue:

  In an action, if we add to the context a key `search_default_x_ids`
  (who is a many2many field) with an array of ids as value, it will
  display/use only the first value in the search bar.

Cause:

  If filter-type is 'field' and it's an array, it will take the first
  value.

Solution:

  Take first value of array only if field-type is a `many2one`.

Inspired by Odoo v13.0

opw-2596345

closes odoo/odoo#74936

X-original-commit: 1083bd204a10c9ec1708ba09e85d50fcba8ba8af
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-08-10 13:18:25 +00:00
Odoo's Mergebot 8aaffd16cb [MERGE] *: remove read access on ir.model.*
Remove read access on `ir.model`, `ir.model.fields`, `ir.model.fields.selection` and `ir.model.data` for employees.
To access such records, the code must use the helpers (`_get`, `ref`,...) instead of CRUD operations directly.

Simplify the helpers to ir.model.data that were public and redundant.
self.env.ref is encouraged instead but with the slight drawback that `ref` makes a call to `exists()` (`_xmlid_lookup` can be used if this wants to be avoided).

Part of task-id 8203

closes odoo/odoo#69120

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-08-10 21:12:46 +02:00
Martin Trigaux 9aedb999f5 [IMP] *: remove xmlid_to_object helper
Use env.ref instead of the xmlid_to_object
To make it more readable and be able to clean old helpers
2021-08-10 14:24:11 +02:00
Martin Trigaux fd67339a3e [IMP] base: remove get_object helper
Not used anywhere, similar to env.ref
2021-08-10 13:49:05 +02:00
Martin Trigaux 15692f3948 [IMP] *: merge ir.model.data helpers
remove _get_id and _get_object_reference that were one liner to
_xmlid_lookup
2021-08-10 13:49:05 +02:00
Martin Trigaux fc6a2be38d [FIX] mass_mailing: give read access to marketing user
Many2one to ir.model
2021-08-10 13:49:04 +02:00
Martin Trigaux c7bac3dee0 [IMP] *: make ir.model.data helper private
No reason to interfact with them directly in RPC
2021-08-10 13:49:04 +02:00
Martin Trigaux abc04a9f18 [IMP] base_setup: avoid call to ir.model.data
Can retrieve the action from _action_show
2021-08-10 13:49:04 +02:00
Martin Trigaux 293d3765fa [IMP] lunch: avoid a call to ir.model.data
Not needed to do it via a specific call, can be included in the
controller data
2021-08-10 13:49:04 +02:00
Martin Trigaux 8e4cec6b07 [IMP] account: remove deprecated method
Never called, action no longer exists
2021-08-10 13:49:04 +02:00
Martin Trigaux 39da150ac2 [FIX] *: add sudo when accessing ir.model.data 2021-08-10 13:49:04 +02:00
Martin Trigaux e8b533088b [FIX] *: add sudo when retriving fields 2021-08-10 13:49:04 +02:00
Martin Trigaux aa8eba2fb9 [FIX] *: add sudo when accessing models 2021-08-10 13:49:04 +02:00
Martin Trigaux 03ff8d4d58 [FIX] *: retrieve model with sudo in selection fields 2021-08-10 13:49:04 +02:00
Martin Trigaux 5dc4cff60a [IMP] base: remove read access to ir.model*
Model, fields and selections are no longer readable
Removes metadata access
2021-08-10 13:49:04 +02:00
Nicolas Lempereur ffd062a3bf [FIX] website_event_track: no cookie lifetime service worker error
If you use firefox and have set cookie to be deleted when you close
firefox, server worker are nuked which cause an error to be shown in
website_event_track:

https://bugzilla.mozilla.org/show_bug.cgi?id=1429714

With this fix, the error is handler and shown in the console instead of
as a traceback to the user.

opw-2556734

closes odoo/odoo#74890

X-original-commit: 8e81db2515dbed196433f2127591384f2e23bfaa
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-08-09 18:38:40 +00:00
Bruno Boi 0bb93b272c [FIX] web: various dropdown style issues
Various styling fixes.
Issues were brought by odoo/odoo@3b73095302

closes odoo/odoo#74752

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-08-10 12:58:02 +00:00
Sébastien Mottet (oms) d46097eb73 [FIX] website: remove useless lang attr in configurator template
The attribute lang was set in the template website.website_configurator.
This is not needed. This commit therefore remove this code.

task-2602521

closes odoo/odoo#74931

X-original-commit: d65efdb9896664cba132a08fe85dad6baa348f3b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-10 12:24:29 +00:00
stefanorigano (SRI) 79d069d21a [FIX] web_editor: add missing style entries
When the user selects text, the editor compares its closest block type
with a pre-made list of text types (eg. p, h1...).
In case of a match, the 'active' class is applied on the relative
toolbar component.

This commit will extend the comparison list adding text styles that were
initially missing (= the code, h4, h5 and h6 tags were never marked as
active).

Related to task-2496339

closes odoo/odoo#74925

X-original-commit: 1f1157c7e5c2df1bf318ad3a32e7030c969f5261
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-10 11:19:48 +00:00
imanie383 8679a0e431 [IMP] web: make menu adaptation customizable
the data dom:autoMoreMenu:adapt was added, so that the external
 code can update the menu directly when needed

closes odoo/odoo#74920

X-original-commit: 7283bc5b07ae489d3ece926e2860c26c3d891d59
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-10 10:58:58 +00:00
Toufik Ben Jaa 4fed9f8997 [FIX] purchase: invoicing status not diplayed on portal
- A typo has been introduced by the PR https://github.com/odoo/odoo/pull/61035
    This forbids to display the "Waiting For bill" tag on the portal
    page for the purchase orders.

closes odoo/odoo#74888

X-original-commit: 0b9d9ff95d2ee9a72b10ddff006399a054bfa56c
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2021-08-09 17:19:23 +00:00
Swapnesh Shah 998e588cfd [FIX] purchase: use correct label/title on kanban
closes odoo/odoo#74892

Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-08-09 19:33:42 +00:00
Jeremy KerstenandYounn Olivier 88cb6db6de [IMP] website_sale*: add to whislist and notify stock
This module allows users to be notified by email when a product out of
stock comes back in stock. For that they can add it to their wishlist
and select the appropriate option.

We show out-of-stock warning in all case whatever the show availibility option.
You cannot custom you 'in stock' message ot free message.

Spec of Pde and Fp

Part of https://github.com/odoo/odoo/pull/68221
task-2458165

closes odoo/odoo#68221

Related: odoo/upgrade#2405
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Kersten Jeremy <jke@odoo.com>
Co-authored-by: Younn Olivier <yol@odoo.com>
2021-08-09 14:13:58 +00:00
Younn Olivier 91ba4a399d [ADD] website_sale_comparison_wishlist: add comparison from wishlist
Add a bridge module to allow users to compare products from the wishlist
page.

task-2458165
Part of https://github.com/odoo/odoo/pull/68221
2021-08-09 13:10:44 +00:00
Younn Olivier 098842d1e9 [FIX] website_sale: fix addToCart methods return values
Some return values were missing on cartHandlerMixin._addToCartInPage and
WebsiteSale._submitForm, therefore it was not possible to wait for their
promises to be resolved.

task-2458165
Part of https://github.com/odoo/odoo/pull/68221
2021-08-09 13:10:43 +00:00
Younn Olivier 198a075cf4 [IMP] web_editor: add height option on html field
It is possible to specify a height for the html field, instead of the
default 380px.

task-2458165
Part of https://github.com/odoo/odoo/pull/68221
2021-08-09 13:10:43 +00:00
Younn Olivier 4da9533cdf [IMP] website_sale_stock: use free_qty instead of virtual_quantity
Replaces the forecasted quantity by the available quantity to be
coherent with Sales app.

task-2458165
Related to https://github.com/odoo/odoo/issues/68185
Part of https://github.com/odoo/odoo/pull/68221
2021-08-09 13:10:43 +00:00
Romain Derie cfe4a47702 [REM] website: remove unused compute
The field was removed with 15aae7ea34

closes odoo/odoo#74875

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-08-09 15:10:26 +00:00
f57a13f3f6 [IMP] website: add the possibility to share coupon and promotion links
Coupons and promotion programs can now be shared by creating a link that can
directly be used by the customer.

Using the link, the system will try to apply the coupon/promotion to the
customer's order.
If this can't be done, the error will be shown to the user, for instance
"A minimum amount of 1000$ is required to get the free ipad".
That coupon/promotion will then be stored in session and the system will try
automatically reapply it when something is added to the cart.

task-2489749

closes odoo/odoo#69053

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
2021-08-09 14:16:54 +00:00
prro-odoo 280e2f6e04 [FIX] repair: display correct default location
How to reproduce the problem:
- Install the repair App
- Repairs -> Create (a Repair Order) (and activate the debug mode)
- Change the Location Field to something else (than the usual default WH/Stock)
- Open Developer Tools -> Set Defaults
- For Defaults, choose "Location = [the changed Location]", "All Users" -> Save Default
- Create a new Repair Order: the Location is not set to the default we set earlier through the Developer Tools

Cause of the problem : an Onchange method was overriding the default Location

Solution : it will now check, in the onchange, if the change is necessary, before overriding the default.

opw-2545876

closes odoo/odoo#74871

X-original-commit: 9877ad1599513338c5333d3a728edb8d6ebcac26
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-08-09 14:26:46 +00:00
Tiffany Chang (tic) b30016c723 [FIX] mrp: fix MO onchange issue with move_finished_ids
Previous fix commit 5e34a02 was too aggressive in when it would delete
the move_finished_ids. In certain use cases it would result in no
move_finished_ids and a corrupted MO:

Steps to reproduce:
1. Create a new MO
2. Save the MO (do NOT confirm)
3. Update the qty to product_qty (qty to produce)
4. Confirm + Mark As Done

End result: "qty to produce must be positive" error whenever MO was
attempted to be completed and MO can never be completed.

To fix this, we split out when the move_finish_ids. They should all
be deleted ONLY when the product to produce is changed. Unfortunately to
cover all cases, we must always wipe the moves whenever the product is
changed (e.g. when changing the product twice with the original product
being the final saved value, we have no way of knowing to keep the
original move_finished_ids due to onchange only being able to check
against the last saved value, not last selected value).

Additional test + test update done to support preventing this
catastrophe in the future.

Part of Task: 2618962

closes odoo/odoo#74859

X-original-commit: fa468782f4a52334fd055fb5cd11e2c62ddd6f9d
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Tiffany Chang <ticodoo@users.noreply.github.com>
2021-08-09 11:52:46 +00:00
Adrien Widart 3b0c610b1c [FIX] web: get remaining days on a date field
When getting the remaining days before the deadline of an activity, the
module applies the TZ offset on the deadline date. This leads to
incorrect data.

To reproduce the error:
(Need crm)
1. Configure your computer:
    - TZ: America/Anchorage (UTC-8)
2. Log in DB
3. Ensure user's profile has the correct TZ
4. Create a lead
5. Schedule an activity A:
    - To Do
    - Due Date: tomorrow
6. CRM > Sales > My Activities

Error: The deadline of A is "Today" instead of "Tomorrow"

To get the days difference, the module computes the current date in
user's TZ. Then, it takes the deadline value and applies the offset
between UTC and user's TZ to this deadline value. Eventually, it
compares the two dates.

Here is the problem: the deadline is a date, not a datetime. As a
result, when applying the offset, if the user's TZ is a "negative" one
(UTC-...), it will change the date to the previous day.

For instance, suppose current date is 2021/08/06. In above use case, the
deadline is 2021/08/07. When comparing the dates, the deadline
(2021/08/07 00:00:00) becomes 2021/08/06 16:00:00 (because we are
UTC-8), thus the module will display "Today".

We shouldn't add any offset on a date field.

OPW-2448835

closes odoo/odoo#74858

X-original-commit: 549f0a11deb700dc6a65a3fbff94a889b9b1f278
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-08-09 11:26:51 +00:00
alt-odoo 424c3c727b [FIX] account: prevent ValueError when applying reconciliation rule
If we have a reconciliation model having a rule using a regex, we are extracting
the balance from the label, but we should not raise an error in case the regex
is matching an incorrect float value, and just set a zero balance instead.

closes odoo/odoo#74853

X-original-commit: a8d65794cfe6c7c64e03b13b8cbaa52a67b25b70
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2021-08-09 10:33:15 +00:00
Mohammed Shekha 01c460f37a [IMP] mail: support many2many_avatar in kanban and list view
Purpose
The aim of the current task is to adapt the design of this new widget to the
list and kanban views.

SPECIFICATION

Kanban
when there is only one record set in the m2m field, display it like a
many2one_avatar widget when there are two or three records set in the m2m
field, display the avatars next to each other when there are more than three
records set in the m2m field, display the first two avatars, then a grey circle
with +X in it (where X is the number of records beyond the first two), when
hovering the +X avatar, open a tooltip with the list of the remaining records
the display order of the records is the same as the order in the m2m field
the avatars behave like in the other avatar widgets (i.e. darkens on hover and
clicking on it opens the chat) except the +X avatar that does not darken or has
a cursor:pointer; on hover and is not clickable

List
same specs as for the kanban view, with the difference that the widget displays
up to five records instead of three when the widget is editable display it like
the current formview version of the many2many_avatar_user widget (i.e. tags
with avatars)

task-2563591

closes odoo/odoo#72166

Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
2021-08-06 09:12:08 +00:00
Csaba Tóth a96757e19c [FIX] Fix journal dashboard late counter
Problem: The journal dashboard show wrong values for the late invoices.
Background details: The filter for the "Late" invoices is not in sync with the sql query in the dashboard python code. The filter searchs for the invoice_date_due field while the sql searchs for the date field.

closes odoo/odoo#73992

X-original-commit: f1e9e756b8806aca92fda4d528fd0b23842e967a
Signed-off-by: William André (wan) <wan@odoo.com>
2021-08-09 08:30:31 +00:00
Andrea Grazioso (agr-odoo)andMathieu Duckerts-Antoine 38bff3d7f5 [FIX] web: flip axis does not mess up groupbys
A traceback occurs after the following operations:

1. Go to Accounting-> Reporting-> Invoice Analysis
2. Open Pivot view
    (the pivot view is grouped by ["invoice_date"] (for rows) and by ["product_categ_id"] (for columns))
3. Click on "Flip Axis"
4. Select filter "Invoices"
5. Close row header "Total"

This happens because at some point `this.data.rowGroupBys` and `this.data.colGroupBys`
happen to point to the same object (they are both equal to the action group_by):

At step 2, rowGroupBys is set to be the action group_by (loading the model).
At step 3, colGroupBys is set to be rowGroupBys (and thus the action group_by).
At step 4, rowGroupBys is set to be the action group_by (reloading the model).

So that the step 5, just before the traceback, removes the group by "product_categ_id"
from `this.data.rowGroupBys` and thus `this.data.colGroupBys`.
This causes a problem when generating the pivot table.

The fix to that problem (and to some similar problems) consists
to never equalize `this.data.rowGroupBys` with some other fixed groupby
(action group_by here).

opw-2511057

closes odoo/odoo#74792

X-original-commit: 1e66fd9e9888e75d8952d8812458d806f05dcf8b
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Andrea Grazioso <agr@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2021-08-06 15:04:50 +00:00
Samuel Degueldre 2d3dbe9217 [IMP] tests: allow browser_js ready code to be a promise and await it
closes odoo/odoo#74789

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-08-06 12:33:54 +00:00
Romeo Fragomeli c07f693550 [FIX] web: Hide "View Bookmark" button on PDF.js
The "View Bookmark" button is used to set URL parameter to be able
to jump to bookmark by copy pasting the generated link.

As there is no way to copy this, this feature is useless in our case.

closes odoo/odoo#74833

X-original-commit: 652461aed59aa97e48f0a8934316cdb846afd769
Related: odoo/enterprise#20131
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-08-06 16:29:10 +00:00
Nicolas (vin) 9ff1d2df72 [FIX] account: Block archival of journals with auto post entries
At the moment, it is possible to archive a journal for which some
entries are still waiting to be auto-posted in the future.
Add a constrains to avoid make sure that it is no longer possible,
since it shouldn't.

Task id #2585454

closes odoo/odoo#74690

X-original-commit: 850eb5100d6405d3a7293e06910a1c5355fdb8d8
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Nicolas Viseur <vin-odoo@users.noreply.github.com>
2021-08-04 10:29:24 +00:00
Martin Trigaux 45e743a3ef [I18N] {google,mrp}_account: remove old pot file
No need to keep it, it's useless and can confuse translators

closes odoo/odoo#74782

closes odoo/odoo#74832

X-original-commit: 40c74e686f23c10e35000be583716d0c093ce3b3
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-08-06 15:44:45 +00:00
Guenael Labois 04daf0b1e7 [IMP] l10n_ec, base: Moved EC states to base, with a proper code
closes odoo/odoo#74066

Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-08-06 15:19:29 +00:00
Guillaume (guva) ba8b8dcb46 [FIX] l10n_de_skr04 : add missing tag to taxes
Steps to reproduce

- On a DB with german localization and SKR04 chart
- Accounting > Configuration > taxes
- Select Steuerfreie Ausfuhr (§4 Nr. 1a UStG) or
  Steuerfreie innergem. Lieferung (§4 Abs. 1b UStG)

Issue

The tag l10n_de.tag_de_intracom_community_delivery doesn't appear

opw-2545462

closes odoo/odoo#74828

X-original-commit: 21d02671fce48ef0a7ac1c70602613852819b50c
Signed-off-by: William André (wan) <wan@odoo.com>
2021-08-06 15:01:51 +00:00
Younn Olivier 5fe16aa346 [FIX] web_editor: fix image transforms linter issues
This fixes linter issues introduced in
https://github.com/odoo/odoo/pull/71847

task-2554608

closes odoo/odoo#74823

X-original-commit: 5a990248c647d7303ffc578e6fc9dbc1ee4670dc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-06 14:24:32 +00:00
Romain Derie f253018002 [FIX] website_forum: add missing ID which lead to broken JS
That ID was removed with c8c8eb3d56, but the JS code is expecting to find
this ID inside the DOM to increment the flag counter.

Courtesy of @dwa-odoo
Spotted while working on task-2167561

closes odoo/odoo#74819

X-original-commit: 2e3f78569e2bb2e0cd2ad9271b1877a43a8c4abb
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-08-06 14:01:34 +00:00
Adrien Widart fdd4af3e2a [FIX] purchase: use Product Price precision in bills
When the Product Price precision is greater than the currency precision,
it can lead to incorrect data

To reproduce the error:
(Enable debug mode)
1. Settings > Technical > Database Structure > Decimal Accuracy, edit
Product Price:
    - Digits: 3
2. Create a PO
    - Add a product:
        - Quantity: 12
        - Unit Price: 0.001
3. Save, Confirm, Edit the PO:
    - Qty Received: 12
    - (Note that the total is $0.01)
4. Create a bill:
    - Add the PO to the field "Auto-Complete"

Error: The unit price is $0.000 and so does the total

The rounding of the unit price should be based on the Product Price
precision, not the currency precision.

OPW-2601867

closes odoo/odoo#74813

X-original-commit: 1123856c77cce4b69059b63c2bcbb382c7f0719e
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-08-06 13:00:24 +00:00
Susana d9ca0a00b3 [FIX] l10n_latam_invoice_document: Allow to change the l10n_latam_document_number manually when the invoice is in draft status
closes odoo/odoo#74807

X-original-commit: cf2ef8373905888bae61e111d2f1ce58792cad56
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-08-06 11:21:00 +00:00
Aaron Bohy f6c57577fd [FIX] web: correctly put load_views rpc result in cache
In the "view" service, there is a cache s.t. we don't do the
load_views rpc each time we enter an act_window action. However,
before this commit, we never did cache hits because we modified
(in place) the "views" key inside the action, which is used to
generate the cache key.

closes odoo/odoo#74783

Signed-off-by: Bruno Boi <brboi@users.noreply.github.com>
2021-08-06 11:48:10 +00:00
Fabrice Henrion 034430bdb6 [FIX] account: change selection label
Grammar police

closes odoo/odoo#74777

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-08-06 12:11:34 +00:00