Commit Graph
148707 Commits
Author SHA1 Message Date
Noe Antoine 57be5167a9 [IMP] website_slides: add constraints to make membership unique
Before, a partner could be present several times in the list of attendees
(slide_channel_partner model). To avoid noise and confusion, a sql constraint
is added to the model to make the couple (partner, channel) unique in db.

If several exist, we only keep the most advanced one in terms of
completion (see UPG script).

Same move is done for slide activity tracking (slide_slide_partner model).
Certification or completion is considered as more advanced.

Demo data is updated as we try to create a membership that already exists
due to auto subscription of channel responsible. We also make some channel
memberships explicit as some demo data about slide completion exists.

--- Links ---

Task-2777216
Prepares Task-2508019 (Slides membership refactoring)

Also soo UPG PR - odoo/upgrade#2854

Part-of: odoo/odoo#74171
2022-02-28 11:07:38 +00:00
Thibault Delavallée 1bcd34ea6b [REF] website_slides: cleanup membership fields
Purpose of this commit is to finalize the cleanup of current user's membership
on a given slide.

As a followup of odoo/odoo@8b2f887c29 we remove now dead ``_compute_user_info``
method. We also introduce a shortcut to ``user_membership_id.sudo().completed``
by adding its computation directly while computing user_membership_id as well
as user_vote. It allows to remove some sudo on user_membership_id.

Task-2607416

Part-of: odoo/odoo#74171
2022-02-28 11:07:37 +00:00
Thibault Delavallée c0d56da9b0 [IMP] website_slides: quickly lint tests
Purpose is to make a quick reordering / linting of tests while passing by.

Task-2607416

Part-of: odoo/odoo#74171
2022-02-28 11:07:37 +00:00
Antoine Dupuis (andu) fc1f3476d4 [FIX] account_edi - revert to using AccountTax._compute_all to
compute tax amounts corresponding to each invoice line in the edi
document for the invoice.

The issue
In Mexico, companies are required to send every invoice in electronic
format to the government. This document (called the CFDI) specifies,
for each invoice line, the taxes applicable, the amount before tax
and the tax amount. The document also specifies the total amounts
withheld for each tax which was applicable to the invoice.

The PAC (the external service which signs this electronic document
and sends it to the government) does checks on those amounts. In
particular, the tax amounts must satisfy two constraints to pass
validation:

(1) The total tax amount for a tax must be equal to the sum of the
tax amounts reported for each invoice line.
(2) The tax amount reported for each line must be equal to
(tax rate * base amount), rounded either up or down. For example, for
a line with base = MXN 398.28 and an applicable VAT of 16%, the
exact tax amount would be 0.16 * 398.28 = 63.7248, so the acceptable
values for the tax amount on that line are 63.72 and 63.73.

In v14, we used the AccountTax.compute_all method to compute the tax
amounts reported for each invoice line. This gave the exact tax
amount, rounded (either up or down depending on which side of 0.5 it
is). This always fulfils condition (2) but fulfils condition (1)
only if the tax rounding method is 'Round Locally'. Because of this,
in v14 MX users couldn't use 'Round Globally'.

In v15, we use a new SQL-based method to compute the tax amount
reported for each invoice line: we take the total tax amount, and
allocate it among the invoice lines proportionately to the base
amount of the invoice line. This always fulfils condition (1) but
sometimes doesn't fulfil condition (2). This has caused many issues
in customer DBs (see list of tickets at the end).

This was introduced in commit 433656415a and seems to be an issue
for all MX customers who have upgraded to v15.

The solution
@smetl and I have looked into what can be done about this.

Modifying the tax amount computation method in a way which satisfies
both conditions is possible, but requires more work and testing.

The existing v14 code generates tax amounts which satisfy both
conditions, at least when the tax computation method is
'Round Locally'.

A good temporary solution, while we try to modify the tax amount
computation to satisfy both conditions, would therefore be to use
the v14 tax amount computation when the tax rounding method is
'Round Locally'. While not ideal, this will at least enable
customers with the 'Round Locally' rounding method to correctly
submit their invoices to the government. Customers with the
'Round Globally' method will need to wait for the full fix.

This commit does exactly that.

Tickets linked to this problem (non-exhaustive list):
opw-2695243
opw-2733280
opw-2723571
opw-2724805
opw-2722370
opw-2722388

closes odoo/odoo#85407

X-original-commit: cddb5bc3af4806c7d1b9b09d07a5b9361d2815c0
Related: odoo/enterprise#24767
Signed-off-by: Laurent Smet <las@odoo.com>
2022-02-28 10:14:55 +00:00
Laurent Smet aa856399db [FIX] account: Fix tax details with negative invoice lines
Before this commit:
Suppose invl1 of 1000.0 with 10.0% and invl2 of -100.0 with the same tax. A tax line of 90.0 is created.
If invl1 is created before invl2, the tax details is computing the tax amounts as:
invl1 tax amount = 1000/900 * 90 = 100 (OK)
invl2 tax amount = 90 - 100 = -10 (OK)
total tax amount = 100 - 10 = 90 (OK)
If invl2 is created before invl2:
invl1 tax amount = 100/900 * 90 = 10 (NOT OK)
invl2 tax amount = 90 - 10 = 80 (NOT OK)
total tax amount = 10 + 80 = 90 (OK)

closes odoo/odoo#85406

X-original-commit: bada85c7621b45970c88548c4d09b88b77c08e8e
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2022-02-28 10:14:48 +00:00
Elisabeth Dickinson 82bf20a700 [IMP] mass_mailing: add extra data to themeParams for custom styling
By adding the `style` attribute to the `.o_layout` element
it can be customized according to the data collected
with `themeParams`, making it possible to add a custom background color
in our template design, for example.

See b7537e1d66b4ca26e12f4be16eb1c30632ecee61

closes odoo/odoo#83701

Signed-off-by: Antoine Guenet <age@odoo.com>
2022-02-28 09:22:23 +00:00
akr a38d2f6ab7 [ADD] l10n_eg: add chart of accounts, taxes, tax groups, tax reports, and fiscal postions for Egypt
closes odoo/odoo#85423

X-original-commit: 2d9021c8bc43fac18a1d88f9aef74baa4bc0312d
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-28 08:26:51 +00:00
Fabio Barbero 07df987627 [FIX] portal_rating: fix modifying review
Purpose
=======
Fix bug introduced in efd178daee689192d4e930a075475587038b3e0d
that created a new review instead of modifying your old one in
website_slides.

Task-2723643

closes odoo/odoo#85184

X-original-commit: f939260f9e90b58ea79197939d9644160c84a0a9
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-02-28 07:32:46 +00:00
Antoine Vandevenne (anv) b6c64c4e07 [FIX] payment_stripe: prevent enabling test mode for connected accounts
The Stripe Connect onboarding only allows to create production accounts.
This is problematic because, before this commit, it was possible to set
the state of an acquirer linked to a connected account to 'test', even
though the payments would actually be made on the live environment of
Stripe.

Additionally, this commit fixes a minor display issue that caused the
"Connect" button to be shown when an API key was set, while it should be
hidden as soon as an API key is set.

closes odoo/odoo#85444

X-original-commit: 4f9b19b9a9891cb0c39dcb88991de174be60cef9
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-26 22:26:55 +00:00
Brice bib Bartoletti 6c04a3305e [FIX] PoS: fix tag assignation with round globally
revert commit https://github.com/odoo/odoo/commit/5f25be8eef9a9efc18a995f2c6405d08a657ac96

Goal:
- Gives the expected tag to the account move line created by the PoS.
- Add tests to the PoS regarding the created account move line

Before this commit:
If the configuration was set to round_globally, a pos.order.line was processed
as a refund only if all order.lines were a refund.
This leads to unexpected results in the tax report. Indeed,
since commit https://github.com/odoo/enterprise/commit/46769076526701d96ee4f2653e44b57604cc0b7a
"Negative" line in PoS (debit) are processed as positive to give a
correct results.
This means that if a line is set as debit and is suppose to lower a
line, it makes it bigger.

Example:
aml from PoS: debit: 10 tags: +03
---> report.line [03] is suppose to make a -10 but will do a +10.
As a result, report line [03] is false.

After this commit:
PoS never use "invoice_repartition_line" to create a refund line.

closes odoo/odoo#85461

Ticket: 2718998, 2714310, 2746890
Community-pr: https://github.com/odoo/odoo/pull/85149
X-original-commit: e4dedaf08b41cf3d80bfb01e70de714c9a84167d
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Brice Bartoletti <bib@odoo.com>
2022-02-26 21:30:55 +00:00
Brice bib Bartoletti 4e679ab943 [IMP] PoS: test create_ui_order_data add discount
This commit gives the possibility to create pos_order_line with discount
This is needed in order to reproduce real usecase.

X-original-commit: 49bfb576a76e2ad4449326c4b12ebf57bece7069
Part-of: odoo/odoo#85461
2022-02-26 21:30:54 +00:00
Nasreddin Boulif (bon) 0eaedc4606 [FIX] portal: remove hardcoded line-height rule for o_page_header class
Steps to reproduce:

  - Install website_appointment module
  - Change website theme and select : Cobalt Theme
  - Go to website
  - In menu, click on Appointment
  - Select anyone, select any date and confirm appointment

Issue:

  Title text on each other.

Cause:

  The custom page_header class (in portal module) override the default
  line-height with 2.1 rem (instead of 1.1).
  In some themes, the headings tags font-size has been changed with
  3.875rem (instead of 2.5rem).
  => font-size is too big regarding the line-height

Solution:

  Remove line-height rule.

ref. commit: https://github.com/odoo/odoo/commit/86ab1c55b4229afb74f630b5041a8354c705f849

opw-2745485

closes odoo/odoo#85453

X-original-commit: b84d9597df1be89ba418c7969a2cf8c632eb8316
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-02-26 18:59:36 +00:00
Pierre Paridans 7df7ecae9b [FIX] auth_totp,web: TOTP login from mobile apps
Since PR odoo/odoo#78857 , the TOTP authentication support is broken
when used inside either Android or iOS mobile apps.

Due to our inability to update the iOS app (following review from
Apple), this commit aims at restoring the bare minimum requirements to
make the current mobile apps (specially iOS but also Android)
authentication workflow works.

As extended explanation:
- Set-Cookie header is expected to be sent even when session_id hasn't
  changed (iOS specific).
- Successful credentials check on `/web/session/authenticate` expect a
  successful response with a result containing `uid` set to `null` to
  mark the need of an additional totp handshake (both platforms).

closes odoo/odoo#85463

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-02-26 13:41:23 +00:00
Audric Onockx (auon) 73f873ab4c [FIX] board : drag task between personnal stages in dashboard
Steps :
Install Project and Dashboard.
Project > My task > Favorites (search zone) > Add to Dashboard.
Notice you can drag task between stages.

Issue :
Dashboard > Notice you cannot.

Cause :
m2m groupby normally (in kanban_renderer.js) does not allow drag.
project_kanban overrides its _setState() method to allow it for parsonnal
stages, because they "become m2o" with a user.
Yet, in the dashboard, we pass through the default method, because the
wrong view is created.

Fix :
Take into account the js_class in the arch to create the view.

opw-2752072

closes odoo/odoo#85033

X-original-commit: 4d864c05dfa8f9be25d41bbae318f75a61d0cde2
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-02-26 09:18:51 +00:00
BVE 400b686027 [FIX] account: update default value in alias on journal type change
Steps to reproduce the bug:
- Go to settings and enable “External Email Servers” option
- Go to accounting > Configuration > journals
- Create a new journal, Choose "purchase" type
- save
- Go to advanced settings tab > click on email alias
- Note that default value = `in_invoice`
- Create another journal, choose "Miscellaneous" type > save
- Change the type to "purchase"

Problem:
the default value = "out_invoice", because it is not updated in the write function after changing the journal type
In the case of type == 'purchase', the default value should be 'in_invoice', and in any other case, it should be 'out_invoice'.

opw-2618357

closes odoo/odoo#85292

X-original-commit: c86b1e5a46b5923136fa920a8bb4fc1c8bd31c2d
Related: odoo/enterprise#24708
Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-25 21:51:17 +00:00
Xavier BOL (xbo) 96533aa014 [FIX] project: remove doc_count field in project kanban view
Before this commit, the `doc_count` field is defined into the kanban
view of `project.project` model but it is never used. Since it is
defined into the view, the compute of this field is unnecessary
called.

This commit removes `doc_count` field in the kanban view of project to
avoid computing the view since this field is never used.

closes odoo/odoo#85405

X-original-commit: 3c62c4aad5cecb9cc305925ca76ef24d375f5a09
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-25 20:13:47 +00:00
Loan (lse) 8d77f113b6 [FIX] website: delete website assets/views on uninstallation
###To reproduce (V15):

Video:
https://drive.google.com/file/d/1wCebPCVQMXmQk7G4CIMkh1MbZ89HW9ek/view
1. Install the module "Product Availability" ("website_sale_stock")
 (that will install ecommerce & stock)
2. Choose a theme for the website (like developement)
3. Uninstall website
=> Internal server error
```
Exception: Unallowed to fetch files from addon website

Error when render the template
Exception: Unallowed to fetch files from addon website
Template: web.frontend_layout
Path: /t/html/head/t[1]
Node: <t t-call-assets="web.assets_common" t-js="false"/> - - -
```

###Analysis:
The assets and view should in theory be deleted in cascade when
the websites records are uninstalled.
However, if a website record fails to be removed,
for instance - in this case - because of pricelist which have an
`ondelete=restrict` PSQL constraint on its `website_id` field.
The PSQL cascade constraints on the other record are dropped
before being applied which result in the resource being still
there but not usable.

Note: this issue is not specific to the website app in particular.
It's just not worth to think for a more sophisticated way to fix
this issue in a stable version.

OPW-2700476

closes odoo/odoo#85443

X-original-commit: ef5296ab32426422698b763c33b2ddb5d0da6cc6
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-25 19:21:46 +00:00
Kartik Chavda 229046e830 [FIX] project: display rating average percentage
This commit display rating average percentage in project update right
side panel view's rating stat button instead of just displaying
rating_avg_percentange field's value.

task-2732325

closes odoo/odoo#82859

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-25 19:21:42 +00:00
smdc-odoo bf1ec3faac [IMP] l10n_it: Change the Italian Chart of account
These changes have been made:
	- Each account name now starts with a upper case letter. This was change to be more coherent with the other localisation
	- There was too much account that allowed reconciliation. Only some should so we have change that (in particular, receivables and payable accounts)
	- We have added tags to account to more easily manage the control domains. By doing so, the control domains can be more precise about where the error lies
	- We have change the type of some account. Before that there was too much 'Current Assets' or 'Liabilities' without distinction for 'Fixed Assets', 'Equity', 'Off Balance'...

It also contains a local migration script to update current installation of the Chart of Account by adding the tags.

task-2468834

closes odoo/odoo#84857

X-original-commit: 534c0384ff64ef141168ee2dd4152116ae0287f8
Related: odoo/enterprise#24498
Signed-off-by: Olivier Colson <oco@odoo.com>
2022-02-25 14:29:44 +00:00
Raf Geens 731d0d85c2 [FIX] orm: string pattern for Reference wasn't correct
In reality the separator is a comma instead of a dot as can be seen
in the code a bit further below.

closes odoo/odoo#85396

X-original-commit: 2a6e9f166d493aaefc006e949ab45e42311ac886
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-02-25 12:35:51 +00:00
Odoo's MergebotandGéry Debongnie [ged@odoo.com](mailto:ged@odoo.com) 98e8e8a5f5 [MERGE][REF] *: update owl to version 2 with fine-grained reactivity
This PR updates owl to version 2 with fine-grained reactivity, and adapts the code in Odoo accordingly.

closes odoo/odoo#84314

Related: odoo/enterprise#24218
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Géry Debongnie [ged@odoo.com](mailto:ged@odoo.com)
2022-02-25 13:35:45 +01:00
Jorge Pinna Puissant df944e3f9c [REF] mail: remove the hook useShouldUpdateBasedOnProps
With the new fine-grained reactivity in owl 2, this hook is not
necessary any more.

Part-of: odoo/odoo#84314
2022-02-25 12:35:44 +00:00
Jorge Pinna Puissant 221412630d [FIX] web: extend the timeout when using QUnit.debug
This commit will also ensure that the document is ready before adding
the debug class.

Part-of: odoo/odoo#84314
2022-02-25 12:35:43 +00:00
Jorge Pinna PuissantandGéry Debongnie 09b4668c6b [REF] *: adapt code to owl2 with fine-grained reactivity
On most of the cases, the fine-grained reactivity is bypassed by:
- Setting the optional `deep` argument as `true` on the renderer
    function. This will force a render to update all child components.
- Changing some objects from reactive to non-reactive using `toRaw`
    function.

Part-of: odoo/odoo#84314
Co-authored-by: Géry Debongnie <ged@odoo.com>
2022-02-25 12:35:43 +00:00
Géry Debongnie d90f481448 [REF] web, project: remove the component NotUpdatable
With the new fine-grained reactivity in owl 2, this component is not
necessary any more.

Part-of: odoo/odoo#84314
2022-02-25 12:35:43 +00:00
Géry Debongnie f96c88ee1a [IMP] web: update owl to version 2.0.0 with fine grained reactivity
Changelog : https://github.com/odoo/owl/blob/7845304b7e9cca465ec94af6b1b5272dadc70891/CHANGELOG.md

Part-of: odoo/odoo#84314
2022-02-25 12:35:43 +00:00
Odoo's Mergebot 702d23ac5c [MERGE][IMP] sale_*: split files by models & cleanups
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#85001

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-25 12:40:22 +01:00
Victor Feyens 0ee6456ef6 [FIX] sale_project: ci-style
Part-of: odoo/odoo#85001
2022-02-25 11:40:21 +00:00
Victor Feyens d523925d08 [MOV] sale_stock: split sale_order.py
Part-of: odoo/odoo#85001
2022-02-25 11:40:21 +00:00
Victor Feyens aaa87311bd [MOV] sale_purchase: split sale_order.py
Part-of: odoo/odoo#85001
2022-02-25 11:40:21 +00:00
Victor Feyens bb5cc7d8e2 [IMP] sale_project: remove unused imports
Part-of: odoo/odoo#85001
2022-02-25 11:40:20 +00:00
Victor Feyens 330cf19c52 [MOV] sale_project: split sale_order.py
Part-of: odoo/odoo#85001
2022-02-25 11:40:20 +00:00
Victor Feyens 267e5d694c [IMP] sale_product_matrix: correct name for views file
Part-of: odoo/odoo#85001
2022-02-25 11:40:20 +00:00
Victor Feyens d6131fb4d5 [MOV] sale_product_configurator: split sale_views.xml (2)
In two commits to keep code ownership and blames

Part-of: odoo/odoo#85001
2022-02-25 11:40:19 +00:00
Victor Feyens fe1efab805 [MOV] sale_product_configurator: split sale_views (1)
Part-of: odoo/odoo#85001
2022-02-25 11:40:19 +00:00
Victor Feyens c82681f1ab [IMP] sale_product_configurator: module cleanup
* correct python file name
* alphabetical ordering of imports
* demo data indentation

Part-of: odoo/odoo#85001
2022-02-25 11:40:19 +00:00
Victor Feyens 58ac6db1fe [MOV] sale_mrp: split sale.py (2)
Done in 2 commits to keep code ownership and git blames

Part-of: odoo/odoo#85001
2022-02-25 11:40:19 +00:00
Victor Feyens 3b7389a405 [MOV] sale_mrp: split sale.py (1)
Part-of: odoo/odoo#85001
2022-02-25 11:40:18 +00:00
Victor Feyens becf288435 [IMP] sale_margin: clean module
* Split python file by classes
* Remove empty ir.model.access.csv file
* Correct name for views file
* Use setUpClass instead of setUp to avoid multiple setups during tests

Part-of: odoo/odoo#85001
2022-02-25 11:40:18 +00:00
Adrien Widart d9b9f94d18 [FIX] mrp: unbuild MO with several lines for same component
When unbuilding a MO, if the latter has several lines (in its
components) for the same tracked product, it won't work.

To reproduce the issue:
1. Create two storable products P_compo and P_finished
    - P_compo is tracked by USN
2. Update P_compo's quantity to 2
3. Create a MO:
    - Product: Finished
    - Quantity: 1
    - Components:
        - 1 x P_compo
        - 1 x P_compo
4. Process the MO
5. Unbuild the MO

Error: a validation error is displayed while it should not "The serial
number has already been assigned: Product: P_Compo, Serial Number: C01"

The for-loop in `action_unbuild` do not handle the case where there are
several SMs for the same product. In the above case, there are two
component lines for P_compo, so there are two SM in `MO.move_raw_ids`.
When unbuilding the MO, the module creates and processes two SMs (SM01,
SM02) that "produce" two P_compo (stored in `produce_moves`).
When processing the first one in the for-loop, it takes the original
moves (so the `MO.move_raw_ids` with the same product) and uses them one
by one. Since SM01 needs one P_compo, it uses the first SM of
`MO.move_raw_ids` (and reuse the lot of that SM). Later on, when
processing SM02 in the for-loop, it does exactly the same thing: it
takes the original moves and uses the first one. Here is the issue: this
first SM has already been used and so does its lot, so this SM should
actually not be used again.

OPW-2715155

closes odoo/odoo#85354

X-original-commit: 8d2597965202a76ddeea8d8fed60b7ac014e2df8
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-02-25 10:25:43 +00:00
Habib (ayh) 9170895684 [FIX] account: with the owl update, t-key is required
this prevents a Client Error on journal items 'Automatic Entries'

task-2766719

closes odoo/odoo#85045

Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-25 10:25:40 +00:00
Umesh Gupta 3af3abfe4d [IMP] note: display long title properly on kanban view
Currently in kanban view of the notes, if there is long content without space
(for example a very long URL), the content goes out of the kanban card.

This commit improves the behavior by breaking such content into multiple
lines and thus displaying full title on the kanban card.

taskID-2754915

closes odoo/odoo#84607

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-02-25 10:25:36 +00:00
Florian Charlier 6d33510beb [IMP] website_slides: enable cover customization
PURPOSE

Before this commit, the headers for the eLearning module were fixed
(Odoo purple gradient or images), and did not always fit with the color theme
chosen by the users. This commit enables the customization of these
website_slides headers for homepages as well as courses and lessons
(on a per-course basis).

SPECIFICATIONS

This commit replaces the channel and lesson headers with `Cover` snippet, so
that they are customizable (by channel) with the website editor. The
customization includes background, additional filter, text alignment, and text
alignment.
The banners for categories of channels ("All courses", "Certifications", and
"My courses") are now also customizable, and other website blocks can be added
above and below them.

Before this commit, the static header background for courses was updated to a
different color palette for certification tracks (`website_slides_survey`).
With this commit, the aspect of the header will no longer be different when
a survey is added but keep the customization (or default value for courses).

The `o_wslides_gradient` class is now obsolete and is renamed to different
labels depending on its remaining local purpose.
The default aspect of courses and lesson without images is therefore switched
from the Odoo purple to the theme background color.

LINKS

Task-2516830

closes odoo/odoo#78257

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-25 10:25:28 +00:00
Josse Colpaert 8e6595857c [FIX] account_edi_proxy_client, l10n_it_edi_sdicoop: timeouts and concurrency
- Sometimes the refresh_token is not saved in the db because the code
after it fails (timeout).  We also want to avoid 2 processes
trying to renew the token at the same time (=> avoid desynchronization
of the refresh_token)

So, we added a locking mechanism and do a commit after we refresh the
token.

- If we have very big invoices to receive, they do not get imported into
the database.  At the moment we risk timeouts.

Our solution is to do a lot of intermediary commits and we link it
to a temporary account_move before doing the import logic and maybe
putting it into the definitive one.

closes odoo/odoo#85372

X-original-commit: ce47d09c05e4bcc91ee4de68db3a7a471bcb4df8
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-25 09:22:56 +00:00
Arnold Moyaux 05ae07c1a7 [FIX] (purchase_)mrp: Correct links with MO and PO
Fine tuning of commit 6acfb2e
It correctly merge the purchase.order in case of direct link and
avoid to relaunch the procurement.

It also correctly set the created_production_id if the demand come
from a SO

closes odoo/odoo#85301

X-original-commit: 9b6fa6c3db55daa3533c0d5cb13da7c98fc3e936
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-25 09:22:52 +00:00
Christophe Simonis c4158bec64 [IMP] project: accelerate the computation of the doc_count field
The query added by 6c207ed1027d9b39eecd19886932b17f1a79dccd is not
optimal. Avoid using `LEFT JOIN` and `OR` by doing 2 queries and adding
their results.

From local tests, a `search_read` on `project.project` is about 4x faster:
2400ms -> 600ms.

closes odoo/odoo#85365

X-original-commit: 0235f2ded8ef6478ed36e2d8ba1c46acef5f1dab
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-02-25 08:26:10 +00:00
Tiffany Chang (tic) ae4610ca00 [FIX] stock: apply missing rename
Previous refactoring: odoo/odoo@3b06565 switched move_line.product_qty
to move_line.reserved_qty. This line was missed during the refactoring
so we fix it now.

closes odoo/odoo#85355

X-original-commit: 624c155e77ae1d3fa964a949f17b4d8c73e9b35d
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-02-25 08:26:07 +00:00
Antoine Guenet e13b4fdb9f [FIX] web_editor: ensure powerbox gets selection from owner document
When checking if the powerbox should open, we check the selection but
that was done on the global document, which returns a wrong selection
for the editable if it's in an iframe. As a result, the powerbox never
opened in mass_mailing.

task-2778414

closes odoo/odoo#85352

X-original-commit: d5b8c26c46b1daf795a6b286af80bb4dad8072ff
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2022-02-25 08:26:03 +00:00
Samuel Degueldre 3620de052a [REF] web, *: remove/deprecate useless code in main web controller
*: website_sale_coupon, test_apikeys

The do_search_read method was only used in a single place: the
search_read controller, whose entire function body was just a function
call. The content of the do_search_read method has been moved to the
search_read controller.

The search_read controller is still pretty useless: it's basically
equivalent to making an RPC on a model and calling the method
web_search_read. As such, this controller should be removed, but lots of
code depends on it and adapting all the code that uses it is out of
scope for this PR. It will hopefully be removed alongside the legacy
views in the webclient (which are its main users).

The call_common method and /web/dataset/load route are completely
unused.

The /web/dataset/call controller is used in only two places and can
trivially be replaced with a call to /web/dataset/call_kw

The non-route methods were removed and the route methods now emit a
deprecation warning telling the user what to use instead.

closes odoo/odoo#84811

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-25 07:35:40 +00:00
Achraf (abz) 2c39189e53 [FIX] web: Add support for () in domain editor for studio
If a report contains a t-if with something like `field in ('a', 'b')`
as a condition, a crash occurs if you try to modify the 'Visible if'
field in the report editor because the domain editor doesn't support parenthesis.

This commit adds this compatibility based on the case of `[]` which is essentially the same thing

opw-2738343

closes odoo/odoo#85331

X-original-commit: bd76793397cb88e12fce4ffc886eefbce0b54975
Related: odoo/enterprise#24722
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
2022-02-25 06:25:04 +00:00