--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#84970
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/odoo#84832
X-original-commit: 63346cf4b77f760121f88762ab2911c37603b548
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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
closesodoo/odoo#84946
X-original-commit: c71d4c2349e623a4bcc49c2318fbbc9de08e0fa4
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
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.
closesodoo/odoo#84901
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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.
closesodoo/odoo#83687
Signed-off-by: Raphael Collet <rco@odoo.com>
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
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
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
closesodoo/odoo#84900
X-original-commit: c9bc689468d2c775d3b3ec65c8894e4dd66e7249
Signed-off-by: Arnold Moyaux <arm@odoo.com>
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
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.
closesodoo/odoo#84942
X-original-commit: b4094ed004a59512d70913f9cc41de8df894296e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
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.
closesodoo/odoo#84869
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
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
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
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
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
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
* 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
* 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
* order fields, methods according to guidelines
* fix some typos
* rename methods according to guidelines
* remove useless field attributes and class specifications in super()
calls
Part-of: odoo/odoo#82374
There is an issue with the Italian carryover, line vp14b.
Use case:
- Month 1, have a value of 25 in this line => will trigger a carryover to line vp7
- Month 2, add more value to vp14b so that it goes above 25.82.
This will set the bound as None, and thus this will not impact the carryover.
This is wrong, because then the next month we will see a value of 25 in vp7
while it should be 0.
closesodoo/odoo#84938
X-original-commit: ffbc7af321a36d4fd0aebb94d7a636cb1fc34b88
Related: odoo/enterprise#24555
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
Before this commit, the numbering system used by luxon was the default
one set by the browser (in most cases: 'latn'). This caused issues when
translating luxon dates with moment dates, as moment supports some
locales differently (e.g.: ar_001 uses the 'arab' numbering system
while Intl uses 'latn').
To have proper consistency, this commit assigns (as much as possible)
the same numbering systems as luxon for each supported locale.
Warning: since the numbering system is now set according to the user
'lang' parameter, it's now unsafe to use `DateTime.fromFormat(...)` with
static date strings, as they might not be parsable with the current
numbering system.
closesodoo/odoo#84833
X-original-commit: 8bd8b299d57ea930b0549446900bd51d03800041
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Since [1] when fuzzy search was introduced, fuzzy search was also used
when the search term contained numbers.
This is a problem for companies where the shop search is used on
references: the fuzzy search does not match against the whole database
and therefore the exact match might not be found.
After this commit the exact search is used whenever the search term is
made of 80% of numbers or more - because it is very likely to be a
reference or an identifier.
[1]: https://github.com/odoo/odoo/commit/7559626c54e34b41e1549e28276a650accec6986
opw-2715647
closesodoo/odoo#84943
X-original-commit: 7b44907c322a7b78ef4a5cb46627df4f72b21240
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
- A new flag is added to the Setting (l10n_it_edi_sdicoop_demo_mode)
that is computed from the ir.config_parameter
'account_edi_proxy_client.demo'.
If the flag is 'demo', Odoo will not send invoices through the EDI,
if the flag is 'test', Odoo will send invoices to an IAP test server
instance that operates with a test SDICoop service
if the flag is 'prod', Odoo will send invoices to production IAP,
that routes them to the official SDICoop service.
- Some minor UI rework for the EDI parameters on res.company
The EDI settings in the res_company form, under the
'Electronic Invoicing' tab, must stay on the left
closesodoo/odoo#84925
X-original-commit: c5d049c55d21f9885e79182df2bd5f433c5bb782
Signed-off-by: Josse Colpaert <jco@odoo.com>
With this commit we can now call a hook when we want to modify the code for this route.
Before this commit the only way to modify/extend this would be by taking over a big part of the code.
closesodoo/odoo#84905
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Prior to this commit the next call date for the first level would not
take the second level into account, as such it could be that the first
level would be completely skipped instead of being prorated properly.
TaskId-2768435
closesodoo/odoo#84899
X-original-commit: 791b801c7b96a94353031a06dd5da4eeb20ee08b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
This commit orders the records coming from the mock server the same
way they are ordered by the ORM, while also allowing it to support
multiple levels of orderby.
This has been done to increase consistency in the test suite and provide
a more accurate representation of how records would be returned by the
actual server.
Some tests performed their assertions based on this previous
undeterministic system and have been adapted, either by altering
the base setup or the assertions themselves.
closesodoo/odoo#84718
Related: odoo/enterprise#24509
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Ensure the user can keep typing inside a newly emptied inline tag:
* Add Zero-width Spaces (ZWS) in empty html tag
> We add zero-width spaces in elements in certain cases where they would
> not be correctly displayed by the browser if they were truly empty.
> This also ensure the user cursor can stay in an empty elements,
> and thus we keep the ability to add content in those elements.
>
> See the `fillEmpty` utils function.
* Remove lingering zero-width spaces
> However, we never remove those zero-width spaces when they are not
> useful anymore. In particular, keeping those invisible characters in the
> content prevents the ecommerce from saving the new price of a product if
> the previous price was previously completely emptied during edition.
> This commit fixes that.
>
> The issue didn't happen with the previous editor because they were
> using non-breaking space instead, which is removed by the text_content
> method of lxml. However, non-breaking space were visible during edition,
> which was weird on its own.
>
> Some changes had to be made to the deleteForward and backward commands,
> to ensure the new behaviors.
> Author : @dmo-odoo
* Adapt the deleteForward and backward commands
> To ensure the added ZWS do not break the Deletes behaviors,
> we need to adapt the `deleteForward` and `deleteBackward` commands.
Co-authored-by David Monjoie <dmo@odoo.com>
task-2622455
closesodoo/odoo#84891
X-original-commit: 4360643a446271d4ff1898d67a5b5287722a0820
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>