Commit Graph
145072 Commits
Author SHA1 Message Date
William Henrotin 3ee10159db [FIX] mrp: backorder sequence fallback
In case a production order loses its procurement group. The backorder
generation process do not have access to the last backorder sequence
used. This commit set a default value to avoid any traceback.

The new backorder  name will not be guaranteed exact related to the
production sequence but will be unique in any cases.

closes odoo/odoo#76091

X-original-commit: aae07e88a8166cf26a8c81bb8ee37d630fd6672c
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-09-07 15:50:25 +00:00
Arnaud Joset 7dbc9ec17a [FIX] microsoft_calendar: rename sync range ICP parameter
Before this commit, the ICP used to get the date range of events to sync was improperly named.

closes odoo/odoo#76083

Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-09-07 15:50:21 +00:00
Mathieu Duckerts-Antoine acf222be06 [FIX] project: project_graph and project_pivot components
During the refactoring of the project_graph and project_pivot views,
their static key "components" were incorectly set making impossible for
OWL to render them. This is now fixed.

closes odoo/odoo#76065

Related: odoo/enterprise#20647
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-09-07 15:50:14 +00:00
Mathieu Duckerts-Antoine 7545913020 [REF] *: graph archs cleaning
We clean various graph archs taking into consideration that:
 - the default type of a graph is "bar".
 - a bar chart is by default stacked.
 - the field attributes type="row" and type="col" does not make sense for
   a graph view (since its implementation was separated from the pivot
   implementation a long time ago))
 - the boolean attributes should now take 1 or 0 as value (but the other
   values are accepted for retrocompatibility).

Part-of: odoo/odoo#76065
2021-09-07 15:50:14 +00:00
wan 3d7b9bbf27 [IMP] {website_,}event_booth_sale: remove is_event_booth from product
This is now a type of product.

task-2605931

closes odoo/odoo#75862

Related: odoo/enterprise#20555
Related: odoo/upgrade#2797
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-09-07 15:50:02 +00:00
william-andre 1a89580c4a [IMP] {website_sale_,}gift_card: remove is_gift_card from product
This is now a new type

task-2605931

Part-of: odoo/odoo#75862
2021-09-07 15:50:01 +00:00
william-andre c8ec3e954b [IMP] {website_,}event_sale: remove event_ok from product
This is now a type of product.

task-2605931

Part-of: odoo/odoo#75862
2021-09-07 15:50:01 +00:00
wan fa034b2a64 [IMP] *: product back2basics 15.0
Rework the whole view, generally.

task-2605931

Part-of: odoo/odoo#75862
2021-09-07 15:50:00 +00:00
wan a0f38c6d97 [IMP] *: partner back2basics 15.0
Review the whole view generally

task-2605931

Part-of: odoo/odoo#75862
2021-09-07 15:50:00 +00:00
Julien Castiaux b8b89bf47d [FIX] core: prevent redundant default on related
Setting a default value on a readonly related field without an inverse
method is nonsense.  We log some warning when it happens.

We also fixed other cases where a related field has a default value
that overrides the target field's value.

closes odoo/odoo#67762

Related: odoo/enterprise#17313
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2021-09-07 15:49:48 +00:00
Adrien Widart 91287782d8 [FIX] point_of_sale: remove monetary widget of discount field
Considering the field declaration:
https://github.com/odoo/odoo/blob/fe5deb4ee4c8e07aed2f2cff6210271bfaa61476/addons/point_of_sale/models/pos_order.py#L1121
`discount` is a rate, not an amount. Therefore, suppose a discount of
10%, when opening a POS-generated SO, the discount shouldn't be "$10".

OPW-2629493

closes odoo/odoo#76010

X-original-commit: 225fb81cc0e7d44678f2b53a9722f5dbd28a9bf6
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-09-07 14:34:08 +00:00
Csaba Tóth d8af84b929 [FIX] base: update Hungarian time format
The official time format is %H:%M:%S (with colons not with dots)

closes odoo/odoo#75715

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-07 13:12:48 +00:00
Touati Djamel (otd) 88b9ad1c04 [FIX] sale_stock: prevent cancelling of pending deliveries
Steps to reproduce the bug:
- Install sale and inventory
- Create a SO with Qty 10 and confirm it
- Go to the delivery
- Make partial delivery of 5 units and create back-order of remaining 5 units.
- the status of backorder is “waitting”
- Get back to the sale order and cancel it
- the wizard “sale_order_cancel” is displayed, which gives a reminder of some partial deliveries are already done and asks to confirm the cancellation of SO
- Do not confirm the cancellation of SO and click on the cancel button
- Go to the delivery
- The pending deliveries are cancelled

Problem:
The `"action_cancel"` function in the `"sale_order"` model is first called to cancel pending deliveries,
then the `"action_cancel"` function of the `"sale"` model is called, but in that we check if whether one of the deliveries
is already completed in order to display the wizard.

But if the customer clicks the cancel button in the wizard, the SO will not be canceled, but the pending deliveries will already be.

Solution:
Check in the `"action_cancel"` function of the `"sale.order"` model if whether one of the deliveries is already been completed,
if so, do not cancel the pending deliveries and wait for user confirmation in the wizard.

opw-2623404

closes odoo/odoo#76050

X-original-commit: ca7d5701c6a46f7781bdc9af9f2d26cca880eb93
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-09-07 11:35:17 +00:00
Denis Ledoux e9e116ca0d [FIX] stock: report_stock_quantity ambiguous column product_qty
In case there is a `product_qty` column added by a custom module,
`product_qty`, without specifying from which table to take it from
in the view definition, can lead to an ambiguous definition.

```
2021-08-25 12:25:31,624 1145 ERROR db_23001 odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
  File "/home/odoo/src/odoo/13.0/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/odoo/src/odoo/13.0/odoo/modules/loading.py", line 424, in load_modules
    force, status, report, loaded_modules, update_module, models_to_check)
  File "/home/odoo/src/odoo/13.0/odoo/modules/loading.py", line 315, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/home/odoo/src/odoo/13.0/odoo/modules/loading.py", line 202, in load_module_graph
    registry.init_models(cr, model_names, {'module': package.name}, new_install)
  File "/home/odoo/src/odoo/13.0/odoo/modules/registry.py", line 370, in init_models
    model.init()
  File "/home/odoo/src/odoo/13.0/addons/stock/report/report_stock_quantity.py", line 126, in init
    self.env.cr.execute(query)
  File "/home/odoo/src/odoo/13.0/odoo/sql_db.py", line 173, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/src/odoo/13.0/odoo/sql_db.py", line 250, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.AmbiguousColumn: column reference "product_qty" is ambiguous
LINE 21: ...AND whd.id IS NULL) OR ls.usage = 'transit' THEN -product_qt...
```

upg-23001

closes odoo/odoo#76049

X-original-commit: 13468160f8b87fa09a3eb205fb0aacf58650b829
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2021-09-07 11:35:13 +00:00
Touati Djamel (otd) 947dc19151 [FIX] account: copy the invoice_date_due when duplicating an invoice
Steps to reproduce the bug:
- Go to Accounting
- Create an invoice:
    - select a `invoice_payment_term_id`
    - Add product on “account.move.live”
- Save and duplicate it.

Problem:
The `invoice_payment_term_id` field will be duplicated on the second invoice, but not the `invoice_date_due` field

Solution:
The `invoice_date_due` field is set in the `_recompute_payment_terms_lines()` function when adding an `account.move.line`.
As in the duplicate invoice we also have an `account.move.line` we can therefore call this function so that the field is set
https://github.com/odoo/odoo/blob/14.0/addons/account/models/account_move.py#L1043

opw- 2628333

closes odoo/odoo#76045

X-original-commit: aa2e4b9a90d4b67a8b65542ece37ced9b1460557
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-09-07 11:35:08 +00:00
fja-odoo bdac1407a7 [FIX] sale_stock, purchase_stock: fix conversion qty received
Rounding in purchase order is 'UP' which is causing issue when doing
receipt in a different uom than the purchase. Rounding should be
'HALF-UP'

Added test in purchase and sales to ensure this issue is detected in the
 future.

closes odoo/odoo#76006

X-original-commit: 9d3d1949d20834c92449c989299ac8e67f26d05d
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-09-07 11:35:04 +00:00
Julien Banken fbaf666f6f [IMP] portal,auth_signup: improve the invitation portal email
This commit will improve the wording and the layout of the invitation
email sent to the users getting access to the portal. The signup link of
the email will now be a button that emphasizes the call-to-action.
We will also provide in the email another link that will allow the user
to access the login page. This commit will also improve the wording of a
placeholder in the portal backend.

task-2573334

closes odoo/odoo#74210

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-07 11:34:56 +00:00
+3 0134495ba5 [MERGE] *: new OWL reporting views
In this PR, we introduce the new OWL view infrastructure and convert
the graph and pivot views to OWL. More details are given in each commit.

closes odoo/odoo#73311

Related: odoo/enterprise#19469
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: stefanorigano (SRI) <sri@odoo.com>
2021-09-07 12:04:41 +02:00
Aaron Bohy 65d15b40f6 [FIX] test_main_flows: adapt tour to groupby menu changes
Part-of: odoo/odoo#73311
2021-09-07 10:04:39 +00:00
Bruno Boi 164cb86d2d [FIX] web,mail: various dropdown design fixes
apply new control panel styling from sri
remove o_dropdown_menu_right (looks unused)
remove o_dropdown_inline (this is a regression for small screens, apparently we would like to have this possibility on smaller screens. This does not break mobile usage but Mobile styling is still a bit weird though)
fix systray activitymenu in mobile (issue was introduced with 29731b40)
fix subdropdown flickering (before this commit, parent dropdown was in absolute positioning, making the position hook generate flicker, now it it fixed from the beginning)

Part-of: odoo/odoo#73311
2021-09-07 10:04:39 +00:00
Lucas Perais (lpe) 2a784b7c88 [IMP] web: tooling: whitelist web_dashboard and web_cohort
Enable tooling (eslint, prettier) for new converted modules
web_dashboard and web_cohort

Part-of: odoo/odoo#73311
2021-09-07 10:04:39 +00:00
d1e227b07b [IMP] web,*: new PivotView component
Part-of: odoo/odoo#73311
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2021-09-07 10:04:38 +00:00
242b1caa65 [IMP] web,*: new GraphView component
*hr_timesheet,project,stock

Part-of: odoo/odoo#73311
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
2021-09-07 10:04:38 +00:00
Mathieu Duckerts-Antoine 23e84c1750 [IMP] project: new ProjectControlPanel class
The reporting views are going to be converted to OWL so that their extensions
(like the project_graph and project_pivot views) have to be converted too.
We thus need an owl version of the ProjectControlPanel class.

Here we introduce that control panel and refactor a bit the legacy code.

Part-of: odoo/odoo#73311
2021-09-07 10:04:38 +00:00
Mathieu Duckerts-AntoineandJulien Mougenot e7a9ebec31 [IMP] web: introduce processMeasure helper
Both "__count__" and "__count" can be encountered as measure notations
in reporting views. Typically, "__count__" is used in legacy views and
"__count" in new views. The problem is that both can now be found on
legacy or new side (think of favorite contexts for example). It is thus
necessary to write some compatibility code on each side. Here me
introduce an helper to help in that task.

Part-of: odoo/odoo#73311
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2021-09-07 10:04:37 +00:00
Jorge Pinna Puissant 05143f9e50 [REF] web: measure menu for reporting views
The reporting views (cohort, graph, and pivot) currently compute and show
the measures in similar but slightly different ways. The present commit
brings some tools that will be used to harmonize their behavior and
factorize the code via a common template and a utility function.

Part-of: odoo/odoo#73311
2021-09-07 10:04:37 +00:00
Lucas Perais (lpe) 37ac2ec86b [REF] web: introduce Field component
A simple High Order component that is able to get the actual
Field class in the category "fields" registry

It takes as minimal props:
- record: an object containing the fields key: a meta description of fields
- name: the field name
- type: the widget type name that xould select the right key in the registry

closes odoo-dev/odoo#1018

Related: odoo-dev/enterprise#206
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Part-of: odoo/odoo#73311
2021-09-07 10:04:37 +00:00
Lucas Perais (lpe) 82588c57ea [REF] web: introduce useViewArch hook
Part-of: odoo/odoo#73311
2021-09-07 10:04:37 +00:00
Lucas Perais (lpe) 256d143c39 [REF] web: introduce the ViewWidget component
The component ViewWidget allows to deal with the "widget" attributes on view arch's nodes
It retrieves the actual widget component via the registry's category "view_widgets"

It is roughly equivalent to _renderWidget in legacy.

Part-of: odoo/odoo#73311
2021-09-07 10:04:36 +00:00
Lucas Perais (lpe) 2bed0410ec [REF] web: introduce compilation building-blocks for views processing
This commit introduces lib-like functions to help transforming
a view arch to an owl template.

compile_lib contains standalone functions that for the most part
can be applied on individual XML nodes to retrieve information
or to apply standard behavior on them.

compile_nodes contains standalone function that transform a arch node
into a viable Owl template one.

Part-of: odoo/odoo#73311
2021-09-07 10:04:36 +00:00
Lucas Perais (lpe) 1f8d1973d5 [REF] web: introduce ControlPanelBottomContent
The ControlPanel now supports being passed an object "bottom-content" in its display props.
That Object is constituted by a component and by props to pass to it.

The bottom content of the Control panel is rendered as a Slot within that component

If not present, the ControlPanel continues to display its bottom part as usual

Part-of: odoo/odoo#73311
2021-09-07 10:04:36 +00:00
aeb8e49972 [IMP] web,*: view infrastructure
We refactor the action service and allow the legacy and new views to share
a global state within a same action.

We introduce two new components View and WithSearch along with
the search infrastructure: ControlPanel, FilterMenu,...

Part-of: odoo/odoo#73311
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
2021-09-07 10:04:35 +00:00
Julien Mougenot add86e4abd [REF] base_import: Move legacy files
This commit moves the content of the static base_import files to a
dedicated `legacy` folder to mark the transition with the new Owl
environment.

Part-of: odoo/odoo#73311
2021-09-07 10:04:35 +00:00
Julien Mougenot 9b9d3c8c36 [REF] google_spreadsheet: Move legacy files
This commit moves the content of the static google_spreadsheet files to
a dedicated `legacy` folder to mark the transition with the new Owl
environment.

Part-of: odoo/odoo#73311
2021-09-07 10:04:35 +00:00
Julien Mougenot b98637e19c [REF] board: Move legacy files
This commit moves the content of the static board files to a dedicated
`legacy` folder to mark the transition with the new Owl environment.

Part-of: odoo/odoo#73311
2021-09-07 10:04:35 +00:00
Julien Mougenot 42cbcad9c8 [IMP] web: datepicker WOWL
This commit adapts the "old" Owl Datepicker to work with the new Owl
web client. The behaviors have been mostly preserved (i.e. working
with the bootstrap datepicker) and simply adapted to make use of the
new services and registries.

The previous datepicker template and tests have been marked as "legacy".

Part-of: odoo/odoo#73311
2021-09-07 10:04:34 +00:00
Lucas Perais (lpe) a19ad0fe24 [FIX] web: formatter: monetary with human number
HumanNumber now correctly rounds the number according to decimals (bug with value < 1000 eg: 0.02)
It also correctly keeps `decimals` significant figures whatever powers of 10^3 it should keep

The monetary formatter now passes the currency's digits to human number

Part-of: odoo/odoo#73311
2021-09-07 10:04:34 +00:00
Julien Mougenot 0008067ee5 [IMP] web: add date formatter
This commit re-introduces the date formatter to go along with its
datetime counterpart, as well as a few tests.

It also refactors the date parsers to make proper use of the arguments
passed to the functions, namely to alter the timezone.

Part-of: odoo/odoo#73311
2021-09-07 10:04:34 +00:00
Mathieu Duckerts-Antoine 205bb172ba [IMP] web: orm service: add webReadGroup function
Before this commit readGroup was actually calling web_read_group.
With this commit, readGroup calls read_group, and webReadGroup
calls web_read_group, as expected.

Part-of: odoo/odoo#73311
2021-09-07 10:04:33 +00:00
Mathieu Duckerts-Antoine c064eb0681 [IMP] web: add XMLParser class
This class can be used by views to parse their arch.

Part-of: odoo/odoo#73311
2021-09-07 10:04:33 +00:00
Mathieu Duckerts-Antoine e0294887ec [REF] web: debug manager
We refactor some items in the debug registry. In particular, we want to
make them usable in the legacy and new contexts.

Part-of: odoo/odoo#73311
2021-09-07 10:04:33 +00:00
c67b9f9907 [IMP] web: new SampleServer class
Reintroduce the SampleServer class with some modifications:
    - it uses luxon instead of moment
    - it uses the registry from core folder instead of a dedicated one

A util function is also provided to help the construction of a fake orm
using the sample server in order to get sample data.

Part-of: odoo/odoo#73311
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2021-09-07 10:04:33 +00:00
Jorge Pinna Puissant 57992c51b5 [IMP] web: add archParseBoolean util function
This function must be used to parse boolean attributes from archs.
If returns false if the attribute is set to "False", "false", "0"
or "", true otherwise.

Part-of: odoo/odoo#73311
2021-09-07 10:04:32 +00:00
Aaron BohyandLucas Perais 1fd54eeae7 [IMP] web: introduce useTooltip hook
This hook automatically generates custom tooltips (instead of
native ones) for all elements with the "data-tooltip" attribute
set, inside the component using it. The optional attribute
"data-tooltip-position" can be used to enforce a specific tooltip
position.

This commit also makes the WebClient use this hook.

Part-of: odoo/odoo#73311
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-09-07 10:04:32 +00:00
Aaron Bohy 6cfe05ae4b [REV] web: do not close dropdowns on active el change
This is actually not what we want. It changes the behavior of
the favorite menu: when the user deletes an item, a confirm dialog
opens, but we want the dropdown to remain visible.

Part-of: odoo/odoo#73311
2021-09-07 10:04:32 +00:00
Lucas Perais (lpe) 659e7ca975 [IMP] web: core: deepCopy function for Objects
Part-of: odoo/odoo#73311
2021-09-07 10:04:31 +00:00
Julien Mougenot 627c7768c9 [FIX] web: Support primitives for 'in' in domains
Before this commit, the new webclient 'Domain' module only supported
arrays for domains constructed with an 'in' operator.

Now, it also supports any primitive, that will then be wrapped in an
array.

Part-of: odoo/odoo#73311
2021-09-07 10:04:31 +00:00
Stefano Rigano 7f025503ae [IMP] web: handle owl nested dropdowns
Part-of: odoo/odoo#73311
2021-09-07 10:04:31 +00:00
stefanorigano (SRI) 1316dc53ab [FIX] web: correctly target 'o_dropdown_item' child
Partially revert b0c325 removing rules defining '<a>' children as
exceptions. Indeed, to have a child wrapping the entry's content (either
<a> or <span>) is now considered the norm.

This commit will extend bootstrap 'dropdown-item' design to any
'o_dropdown_item' child rather than on 'o_dropdown_item' itself.

Part-of: odoo/odoo#73311
2021-09-07 10:04:31 +00:00
Audric Onockx (auon) 55ff61a1f2 [FIX] account_qr_code_sepa : Fixed format of 'amount of transfer' not correct in QR-code
Reproduce :
- Create an invoice with a sepa QR-code.

Result :
  When reading the QR-code, German banks assume the fisrt 3 characters are the currency name/code, so the first 3 digits of the amount are cut from this amount.

Solution :
  The amount now starts with the currency name/code (3 letters), as prescribed by EPC norms.

opw-2591454

closes odoo/odoo#76051

X-original-commit: 4d5b4de95c474136ba69fbddeab5589204efdc4e
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Audric Onockx <auon-odoo@users.noreply.github.com>
2021-09-07 08:53:20 +00:00