Commit Graph
151539 Commits
Author SHA1 Message Date
Priyanka Kakadiya 6fb5c3d82d [FIX] mail: fix back button issue to close channel
Before this commit:

When switching to mobile view and refreshing the channel in discuss than back
arrow button is not working

After this commit:

Back arrow button will close the channel

Task-2685187

closes odoo/odoo#85034

X-original-commit: ebe56aac6d11e967d3b2fc8b57031e1b0e8ea726
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-02-21 16:07:54 +00:00
Josse Colpaert 8640044fb7 [FIX] l10n_es_edi_sii: registration date should not be copied when duplicating invoice
closes odoo/odoo#85030

X-original-commit: 9af5338df16579ee3d5554bb03fe6d9e9c77e025
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-21 16:07:50 +00:00
Josse Colpaert 76fc8bcbac [FIX] l10n_es_edi_sii: extracommunity should be regimen 01 for purchases
See doc preguntas frecuentes 4.4:
https://sede.agenciatributaria.gob.es/Sede/impuestos-tasas/iva/iva-libros-registro-iva-traves-aeat/preguntas-frecuentes/4-libro-registro-facturas-recibidas.html?faqId=f8276c3d02bc9510VgnVCM100000dc381e0aRCRD

Add tax agency Bizkaia to the tests too as in v15, so we see that the tests
pass here as well.

opw-2746495

X-original-commit: c35f34eebf3f57a835aa9c3056cf76293c3ca8de
Part-of: odoo/odoo#85030
2022-02-21 16:07:50 +00:00
Raphael Collet 39c1ab249b [FIX] core: discard redundant code
closes odoo/odoo#85028

X-original-commit: b026f17988dfaecac41f0a350cf8cfb52aa3827c
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-02-21 16:07:45 +00:00
root 2c4eeece6c [IMP] project: hooks for overriding domain/sortings/filters
Before this commit there was no easy/clean way to extend the domain, searchbar sorting and filtering.
By adding it in subfunctions we can do clean extending of the domains/filters

closes odoo/odoo#84912

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-02-21 16:07:39 +00:00
roen-odoo b2ab680fc3 [FIX] payment : Wrong logo in payment portal
Current behavior :
In a multi-company environnement if you generate a payment link and access it from incognito page the company was always the logo of the first company.

Steps to reproduce :
- Get in a multicompany environnement
- Create a invoice in company B
- Generate the payment link in the action menu
- Access the link in incognito mode
- The company logo is always the logo from company A

opw-2756438

closes odoo/odoo#85000

X-original-commit: 0e2e79d055e8565e2913b30477fcfdb71e99bdae
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-02-21 14:14:12 +00:00
Benoit Socias c5e96ac750 [FIX] web_editor: revert text color previews
Before this commit when a text color was applied on a text within
which an already colored text already existed, the inner coloring was
lost during preview. All text was therefore set to the initial coloring
of the external selected text.

After this commit the "reset" of the text color preview is done by
undoing the draft "in progress" history step that contains the preview
changes, but that is not stored within the history itself.

Steps to reproduce:
- drop the Text snippet
- select a word in the middle of a sentence (e.g. "personality")
- set text color to red
- select several words containing the colored one (e.g. "story with
personality for potential")
- open text color palette
- hover over colors but do not click
- leave color palette
=> colored word is not colored anymore

Steps to reproduce a secondary problem also fixed by this commit:
- drop the Text snippet
- select text surrounding some bold (e.g. "have a personality. Consider")
- open text color palette
- quickly hover through several colors (i.e. move pointer downwards)
=> text selection range changed between some of the color previews

task-2742112 (was task-2666200)

closes odoo/odoo#84998

X-original-commit: 9cb5a138244783580c2d1baa4dc01d1824ed20f4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-21 14:14:09 +00:00
Victor Feyens 7337a0b99b [MOV][IMP] product: split views by models
closes odoo/odoo#84997

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-21 13:14:02 +00:00
Victor Feyens a3ac36c941 [MOV] product: split product views by models
Part-of: odoo/odoo#84997
2022-02-21 13:14:02 +00:00
Hoang Tran 74ea165345 [IMP] account_check_printing: improve perf of computed preferred pm
When install the module on a db with huge amount of account move,
prefetching data when accessing partner_id of first move iteration is
costly and should be avoided.

closes odoo/odoo#84989

X-original-commit: c80700ee616e5588669879fd5e020ea868665a8f
Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-21 13:13:56 +00:00
Thibault Francois 4340a7e4d2 [FIX] fleet: fix search method for contract_renewal*
the search method of contract_renewal_due_soon and
contract_renewal_overdue return a domain
id in res_ids where res_ids are id of contract
not vehicle

So it return random result

Solution
--------
Get the vehicle_id from the contract record set

closes odoo/odoo#84987

X-original-commit: 975841953adaa6b7adc8016fb96cc6efc8891613
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-21 13:13:52 +00:00
william b16507ae28 [FIX] account,l10n_*: always auto_install l10n_*_edi
The logic should not be made in the post init hook of account otherwise
modules will only get installed like expected during the database
initialization, based on the country set on the main company before the
installation of `account`.

closes odoo/odoo#84975

Related: odoo/enterprise#24576
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-02-21 12:17:06 +00:00
Pierre-Yves Dufays 5a97a79c54 [IMP] survey: remove column_nb from the survey_question model
Purpose:

The "column choice" is a remainder of a previous implementation in which users
could decide how the survey would look like.

Since the re-design however, this option is no longer working as we prefer
handling this ourselves:
- To make the code simpler
- Because this is not really a "game-changer" feature
- Because we prefer to decide ourselves how the answers will look like to make
sure it always looks nice

As the field is not used anymore and some customers are wondering why it does
not work, we have decided to remove it.

Specifications:

Remove the field column_nb from the survey_question model
In the form, to make sure the "Answers" group is never empty,
we'll move the "Comments" options there instead

Task 2730409

closes odoo/odoo#83645

Related: odoo/upgrade#3231
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-02-21 12:16:57 +00:00
Odoo's Mergebot 95e4eb6adc [MERGE][MOV] product: split product.py
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#84970

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-21 12:24:17 +01:00
Victor Feyens 78776bf3de [MOV] product: split product.py (2)
Files split in two commits to keep lines ownership and git blames.

Part-of: odoo/odoo#84970
2022-02-21 11:24:16 +00:00
Victor Feyens 2e3c21941c [MOV] product: split product.py (1)
Part-of: odoo/odoo#84970
2022-02-21 11:24:16 +00:00
Nicolas Lempereur 79459e037b [FIX] link_tracker: get redirected page title instead of URL
In 2e3075693b06d71222b446bd8a805dacb639d0e4 we used a head request to
determine type of page before trying to get a title out of it.

But requests.head does not allow redirect by default:

https://docs.python-requests.org/en/v2.9.1/user/quickstart/#redirection-and-history

so if an URL was a redirect, we would not longer get the page title.

opw-2457640

closes odoo/odoo#84832

X-original-commit: 63346cf4b77f760121f88762ab2911c37603b548
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2022-02-21 11:24:10 +00:00
Andrea Grazioso (agr-odoo) a358096aec [FIX] web: lost sign between -1 and 0
Create a credit note for an amount between 0 and 1, confirm it.
In Accounting app, open Reporting -> Invoice Analysis
Switch to Pivot View
The credit note amount will be positive

This occur because in `insertThousandsSep` the number -0 is converted
to "0" (string), thus losing the sign before saving it

opw-2759964

closes odoo/odoo#84946

X-original-commit: c71d4c2349e623a4bcc49c2318fbbc9de08e0fa4
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-02-21 10:28:28 +00:00
Ivàn Todorovich f561d2a95c [FIX] sale: Impossible to unset invoice_mail_template_id
Steps to reproduce:

1. Go to Configuration > Website
2. Enable Automatic Invoice and Save
3. Remove the value from Invoice Email Template and Save

Result:

* The field shows as set by the default value.
* The ir.config_parameter doesn't exist.

Excepted:

* The field should be shown as unset.

closes odoo/odoo#84901

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-21 10:28:22 +00:00
Rémy Voet (ryv) 534087fa8d [REF] core: simplify tooling of browse()
Remove str from IdType, because those kinds of ids are no longer
necessary, and lead to unusable recordsets.

Because IdType now only contains int and NewId, simplify (and speed up)
the conversion of the parameter of browse().

Preferably wrap single NewId into a tuple instead of a list, as tuples
are faster.

closes odoo/odoo#83687

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-02-21 10:28:15 +00:00
Rémy Voet (ryv) c2ab0a5c54 [REF] core: simplify some base methods of BaseModel
Simplify __bool__(), __repr__(), __hash__() by removing calls to
getattr/hasattr.  We can expect a performance improvement of these
highly used method (for a single record):
 - __bool__(): 145 -> 108 ns
 - __hash__(): 330 -> 289 ns

Discard support for user id in sudo(), the method now only accepts a
bool.

Part-of: odoo/odoo#83687
2022-02-21 10:28:15 +00:00
Rémy Voet (ryv) ce7704e836 [FIX] base: nondeterministic order of res.partner
Part-of: odoo/odoo#83687
2022-02-21 10:28:15 +00:00
Rémy Voet (ryv) 3fc5996c3e [REF] core: refactor the filtered_domain method of BaseModel
The method filtered_domain() didn't conserve the order of `self`, which
may be confusing, and a subtle source of bugs.  It now preserves the
order from `self`.

The processing of `child_of`/`parent_of` making a search with the
default order of the model, which may be slow.

Add documentation.

Part-of: odoo/odoo#83687
2022-02-21 10:28:14 +00:00
Rémy Voet (ryv) 0e9adf7138 [REF] core: improve doc and params naming
- Improve the documentation of some methods of `BaseModel`.
- Change `args` name of search in `domain`

Part-of: odoo/odoo#83687
2022-02-21 10:28:14 +00:00
Rémy Voet (ryv) 6580fe0610 [REM] core: remove attribute 'limit' from X2many fields
Part-of: odoo/odoo#83687
2022-02-21 10:28:14 +00:00
Rémy Voet (ryv) 8a1302a502 [REM] core: remove mutable default for parameters
Part-of: odoo/odoo#83687
2022-02-21 10:28:13 +00:00
Rémy Voet (ryv) a31cbaf639 [REM] core: remove method _mapped_cache
Remove `_mapped_cache` because the `mapped` do the same stuff.
And it was unused. Also remove useless pass and import.

Part-of: odoo/odoo#83687
2022-02-21 10:28:13 +00:00
Rémy Voet (ryv) 8f7fad7601 [REM] core: deprecate fields_get_keys and get_xml_id of BaseModel
Part-of: odoo/odoo#83687
2022-02-21 10:28:13 +00:00
clesgow 6f2ba1e1b4 [FIX] stock: negative move propagation
When a warehouse used multi-steps for incoming/outgoing shipments,
negative procurements could create returns pickings instead of reducing
the quantity of subsequent moves down the chain.

For example a two-step delivery, a sale order with 5 product A would
have the following pickings linked :
Pick:
- product A : 5 qty
Out:
- product A : 5 qty

Then reducing the amount of product A to 2 in the sale order would do :
Pick:
- product A : 2 qty
Out:
- product A : 5 qty
Return:
- product A : 3 qty

closes odoo/odoo#84900

X-original-commit: c9bc689468d2c775d3b3ec65c8894e4dd66e7249
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-21 09:34:58 +00:00
Bernat Puig Font 6806a72e45 [CLA] Update ForgeFlow
closes odoo/odoo#84896

X-original-commit: 1a5afdef92589ca9ea31bfd30af755de7bb20985
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-21 09:34:54 +00:00
Bernat Puig Font 97835e4a8b [FIX] mrp: date_planned_finished field correctly saved
When creating a MO _date_planned_finished_ is not added.
Consequently calculates wrongly the date planned to finish the MO.

X-original-commit: 2b2509e154af0e58a3f30f1d7fe40fb854b6b881
Part-of: odoo/odoo#84896
2022-02-21 09:34:54 +00:00
Antoine Guenet def50847d5 [FIX] mass_mailing: properly convert base64 images
The function that converts inline images to urls returned the modified
html as a byte string. As a result, the Mail Debug tab showed a
hexadecimal string rather than rendered html. This makes sure the string
is encoded in unicode instead, so the format of the string coming out of
the function is the same as it was coming in.

closes odoo/odoo#84942

X-original-commit: b4094ed004a59512d70913f9cc41de8df894296e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-21 08:41:45 +00:00
Mathieu Duckerts-Antoine 0ae13be7de [FIX] web: action service: button action with html help
The method call_button sometimes returns an action with a help key.
That help was not marked up, leading to an incorrect display of that help.

closes odoo/odoo#84869

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-21 08:41:37 +00:00
Victor Feyens bfe8838445 [IMP] website_sale_slides: forbid adding a course n times in cart
* Also remove unused product_template_id param for /shop/cart/update 
route

closes odoo/odoo#82374

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-21 08:41:34 +00:00
Victor Feyens d4b046e238 [REF] website_sale: pricelist computation & cache
Try to put some logic and clarity in the cached e-commerce pricelist logic
* Try to reduce cache invalidations
* Pass all parameters as id/tuple(ids) to have clean/coherent cache keys
* Add comments

Part-of: odoo/odoo#82374
2022-02-21 08:41:33 +00:00
Victor Feyens 3687826206 [IMP] website_sale: clean /shop/product route
* Remove unnecessary context modifications
* simplify code

Part-of: odoo/odoo#82374
2022-02-21 08:41:33 +00:00
Victor Feyens a647a3323d [REF] website_sale*: cart lines creation & update
Clean whole flow of cart updates (new lines, modified quantities, ...)

* Use clean hooks to differentiate line update and creation, quantity verification, ...
* Avoid write calls with unmodified values, useless recomputations, queries, ...
* Create new lines directly with the correct quantity and values
* Delegate fields computation logic to sale as much as possible (price, discount, name, ...)

Part-of: odoo/odoo#82374
2022-02-21 08:41:33 +00:00
Victor Feyens 945bbe6894 [REF] website_sale*: cart creation & pricelist update
Clean cart creation/updates
Rely on sale computes as much as possible
Remove dead code
Add comments

Part-of: odoo/odoo#82374
2022-02-21 08:41:33 +00:00
Victor Feyens 63338d3f9b [REF] website_sale: clean qweb templates
* Indentation
* use of "cached" methods
* Do not compute prices on /cart page, show the prices in the cart 
instead

Part-of: odoo/odoo#82374
2022-02-21 08:41:32 +00:00
Victor Feyens 1c6ec568ac [REF] website_sale: force website methods to be called on a record
Part-of: odoo/odoo#82374
2022-02-21 08:41:32 +00:00
Victor Feyens 6d587718aa [IMP] website_sale: computes prices on /shop page in batch
Bypass the unnecessary `_get_combination_info` call for each template
and compute the prices in batch, avoiding N-1 times the calls to get the
pricelist price and the fiscal position.

Part-of: odoo/odoo#82374
2022-02-21 08:41:32 +00:00
Victor Feyens a985182259 [FIX] sale: do not discard price computation if feature is disabled
The discount must be computed regardless of user groups (computed fields 
should not be dependent of user groups ideally).
Anyway, pricelist discount policy is by default to show the price with 
discount.

Unless the database and user groups are wrongly configured, this 
shouldn't have any impact.

Part-of: odoo/odoo#82374
2022-02-21 08:41:31 +00:00
Victor Feyens d9f9692a2d [IMP] website_event_sale: use "cached" website pricelist value
Instead of calling the method `_get_current_pricelist` multiple time.

(This should not be noticeable on perf, but is a pure cleanup)

Part-of: odoo/odoo#82374
2022-02-21 08:41:31 +00:00
Victor Feyens b7420cd5c0 [IMP] website_sale: clean fields on website class override
Part-of: odoo/odoo#82374
2022-02-21 08:41:31 +00:00
Victor Feyens 667842b790 [IMP] website_sale: avoid reading attributes when unnecessary
Do not fetch combination info for products having no accessory products, 
this adds additional SQL queries for nothing.

Part-of: odoo/odoo#82374
2022-02-21 08:41:31 +00:00
Victor Feyens 756c5b4922 [REF] event_sale: correctly compute discount for event tickets
Discount wasn't computed the same way in backend sale flows and e-commerce flows.
Now the pricelist discount policy will be considered in the core logic of
event_sale.

Part-of: odoo/odoo#82374
2022-02-21 08:41:30 +00:00
Victor Feyens 6e6d9f3b63 [IMP] website_sale*: methods/routes cleanup
* consistent/clear sale_get_order params (force_create is a boolean value, do not provide integers)
* use one coherent way to get website current pricelist, through the dedicated computed field

Part-of: odoo/odoo#82374
2022-02-21 08:41:30 +00:00
Victor Feyens dfd1d29938 [IMP] website_sale_*: simplify _cart_update overrides definition
Part-of: odoo/odoo#82374
2022-02-21 08:41:30 +00:00
Victor Feyens dc8db07ba7 [IMP] product: do not fetch all categories/variants/templates data
Delegate to subqueries, reduce data fetched from database,
potentially reduce queries when computing prices.

Part-of: odoo/odoo#82374
2022-02-21 08:41:29 +00:00
Victor Feyens a73fb16da0 [IMP] product,website_sale: pricelist API cleanup
* query pricelist filters/domains directly for the correct company 
instead of relying on context/session/... content
* pass the record instead of the id to avoid useless browse calls
* also clearly highlight sudoed partner record

Part-of: odoo/odoo#82374
2022-02-21 08:41:29 +00:00