Commit Graph
169906 Commits
Author SHA1 Message Date
ahmad(alah) 8fd5c00ebd [FIX] calendar: hide res model name while creating an event from another model
Before this commit when you create an event from a lead, a button appears to jump back to the lead but while you're creating the record, it already appears but empty.
This commit hides the button in case the res_model_name is null, which happens while we are creating the event and before hitting save.

closes odoo/odoo#154956

Task: 3747059
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-03-07 08:25:53 +00:00
Carlos Lopez 5439cfcc40 [FIX] point_of_sale: Convert shipping_date to datetime correctly before creating procurement.
Since shipping_date is a Date but date_planned is a datetime, before this commit, the date_planned in picking was one day less.
complementary to https://github.com/odoo/odoo/commit/fe9e230b500af316e6f80af453a4073d9dff24b7

closes odoo/odoo#154533

Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2024-03-07 08:25:52 +00:00
Nicolas Viseur (vin) b104a50d6d [FIX] account_qr_code_emv: fallback error
The account_qr_code_emv module has an issue at the
moment where it will only return errors in
_get_error_messages_for_qr for the country the qr
code is intended for.

This makes sense since you want to check all countries
in later versions where we have multiple of them.

But it causes an issue with the standard implementation
where if you are using a country that is not supported
by an EMV QR, _get_error_messages_for_qr will just
return None.

This means that:
    - The default QR CODE selection on the invoice that
    depends on that may select EMV QR for unrelated
    countries.
    - If it gets selected, this method will not check
    that the currency is correct for said countries.

To fix this issue, we will simply return an error
message in the common module, which will serve as a
fallback once all the EMV QR methods have been checked.

Task id # 3758668

closes odoo/odoo#156847

X-original-commit: 5290fb7a2d400ce1c9732e8d835f6b7990c0d145
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2024-03-07 05:07:08 +00:00
Daniel Kosky (dako) 62f7de632a [FIX] account: actionable errors widget state
The widget for actionable errors does not update when the errors it
displays are updated due to, for example, a recomputation of the field.

This results in irrelevant errors being displayed in the view, when a
particular configuration is correct. The correct errors (or an absence
of any errors) will not be displayed until the view is refreshed.

This commit adapts the component, such that the record data is accessed
directly from the template. This means that the recordObserver, and the
method it uses can be removed (as they were redundant)

closes odoo/odoo#155914

Task-id: None
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2024-03-06 23:39:44 +00:00
Alexandre Kühn 885ae723d7 [FIX] im_livechat: mention partner in full composer should not crash
Making a mention in full composer when `im_livechat` is installed
was making the following crash:

```
TypeError: Cannot read properties of undefined (reading 'type')
    at SuggestionService.fetchSuggestions
```

Steps to reproduce:
- install module `im_livechat`
- open contacts app form view
- open full composer (e.g. Log note => expand icon)
- type @ + a character
=> throws error above

This happens because `SuggestionService` methods can optionally pass
a thread, but livechat overrides wrongfully assume they were always
provided.
This commit fixes the issue with optional chaining, taking into
account it's optional.

No test because full composer doesn't work in unit tests, tours
require adding steps blindly and I've already wasted too much time
to no avail.

closes odoo/odoo#156773

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-03-06 17:48:16 +00:00
Romain Derie 139baee01f [FIX] web_editor: correctly check the toggle of new window link
Before this commit and most likely since commit [1], the "Open in new
window" option of link would not persist through editions.

Steps to reproduce:
- Create a link in the website builder
- Set its "Open in new window" property to true
- Save, and see that it works as expected
- Now enter edit mode again, the toggle will be off and not on as it
  should be since the `target="_blank"` was correctly added.

For easy of debugging and understanding, you can just grep this line
```js
this.initialNewWindow = this.initialNewWindow || this.linkEl.target === '_blank';
```

[1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997#

opw-3781477

closes odoo/odoo#156739

X-original-commit: 5ea2e015a8faed502c378d4e5042f8a0cf50cbf9
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-03-06 17:48:15 +00:00
Romain Derie d683947e27 [FIX] website: restore default checked value for form radio buttons
Same fix as for checkbox (commit [1]) and select (commit [2]).
The radio buttons were forgotten.

Check commit [1] for in-depth explanation, but this is basically because
since the qweb engine conversion to OWL (done at [3]), it would toggle
the internal `checked` value and not the `checked` attribute anymore.

[1]: https://github.com/odoo/odoo/commit/b42e9cc686e7d3ccf82cd091a5dc24028fff8a2b
[2]: https://github.com/odoo/odoo/commit/dd504811303a2ace661259d05d1e3b88794dc5be
[3]: https://github.com/odoo/odoo/pull/130467

opw-3755078

closes odoo/odoo#156666

Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2024-03-06 16:10:55 +00:00
roen-odoo 531cb95e87 [FIX] stock: fix text product label reports with special characters
Current behavior:
When printing products ZPL Labels, special characters are not printed
correctly. e.g. quotes become &#39;

Steps to reproduce:
- Modify a product name with special characters
- Print a product label
- Select ZPL Labels

As the report is only rendered as text, the special characters are not
dangerous and can be printed as is.

opw-3684870

closes odoo/odoo#156624

X-original-commit: 7875c91be5dd467374b39bc1a7d05e9f983fbaef
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2024-03-06 16:10:54 +00:00
oco-odoo 375d1c1c8b [FIX] account: early payment discount: correct tax_tag_invert on tax line for included EPD
When configuring the payment term to include the EPD within the payment's journal entry on a customer invoice, the tax_tag_invert field got wrongly set as True. This was hardcoded in the code; computing the field in the regular way gives the proper value.

OPW 3754446

closes odoo/odoo#156588

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-03-06 16:10:53 +00:00
amdi-odoo 3de06d645d [FIX] survey: fix override answers
Purpose
=======
Fix the UserError which is raised when the user submits
an answer to a question having the "save as nickname" or
"save as email" option checked. In testing or non-testing mode.

Specifications
==============
When the question is marked as "save as email" or "save as nickname"
and when the user isn't public, the partner data is already saved
as the question answer (in the form of a user input line).
The answer is then pre-filled in the survey.
This is an issue because when the survey has the "users can go back"
option to False and the user tries to submit the answer, it thinks the
user is trying to changed the already saved user input line and it crashes
for security reasons.

In addition of allowing the answer override if the user can go back,
also allow the override if the question is marked as "save as nickname"
or "save as email".

This issue was introduced in 17.0 when the overwrite_existing optional
parameter has been added on the _save_lines method. Before that, the
existing user input lines were overwritten no matter what.

related odoo/odoo#129329

Task-3756749

closes odoo/odoo#155561

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2024-03-06 16:10:52 +00:00
Andrea Grazioso (agr-odoo) 60f053ba42 [FIX] analytic: check current company applicability
Have company A and company B
With company B:
- Create an analytic plan with default applicability 'Mandatory'
- Add an applicability: domain 'Expense', applicability 'Mandatory'
With company A:
- Open the same analytic plan
- Set default applicability 'Optional', no assigned applicability
- Add an analytc account for the plan
- Create an expense, add amount
- Create report > Submit to Mananger > Approve

Issue: Action will be blocked by Warning message
"One or more lines require a 100% analytic distribution."

This occurs because the system checks all applicabilities of the plan
without taking into account the company

opw-3709374

closes odoo/odoo#155195

Signed-off-by: William André (wan) <wan@odoo.com>
2024-03-06 16:10:52 +00:00
Pedram (pebr) f6ee5e4ad2 [FIX] point_of_sale: correctly handle RPCError
Prior to this commit, in the event of an RPCError, such as UserError or
ValidationError, it would display a generic 'Odoo Server Error' error.
This error lacked useful information for diagnosing and addressing the
issue.

opw-3776047

closes odoo/odoo#156697

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-06 14:30:47 +00:00
Tiffany Chang (tic) 9626504181 [FIX] purchase_requsition: clean report placeholders
Previous PR: odoo/odoo#135739 added in report placeholders for the sake
of easier editing of reports with studio. Unfortunately it didn't check
that these placeholders aren't printed with real records which results
in junk being included in the report, so we add in conditions to avoid
this situation.

Also, since the report was already being edited, clean up some of the
placeholders because they didn't make sense/ didn't do anything (e.g.
the `address` values weren't used + already have a special placeholder
in studio => remove them).

closes odoo/odoo#156674

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-03-06 14:30:46 +00:00
Walid 3f4e15bb4c [FIX] sale_mrp: inherit MO analytic account from SO
Steps to reproduce:
- Enable MTO
- Create a manufactured product (no analytic distribution on the bom)
- Create an SO for that product and set an analytic account on it
- Confirm the SO

Bug:
no analytic account on the created MO

Fix:
inherit MO analytic account from SO if none is set on the BOM

opw-3708134

closes odoo/odoo#156535

X-original-commit: cd72327ff3fb3633e353b7f9443ca973c358fc01
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2024-03-06 14:30:42 +00:00
Antoine Vandevenne (anv) 572ea59d3d [FIX] payment_custom: always load provider view after account_payment
Both the `payment_custom` and the `account_payment` modules made changes
to the visibility of the `payment_followup` group in the view of the
`payment.provider` model. As these modules didn't depend on each other,
the visibility of the group was determined based on the (random) loading
order or the modules, causing the "Journal" field to be either visible
or invisible on other providers than Wire Transfer.

With this commit, a priority is set on `payment_custom`'s view to force
it to always load after that of `account_payment`.

closes odoo/odoo#156514

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2024-03-06 14:30:42 +00:00
duongnguyen-viindoo 79356e9a02 [IMP] website: more lean for industry placeholder
Type an insdustry ... is not kind of something lean for user, this
commit change industry placeholder into a more cleaner version

closes odoo/odoo#156456

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-03-06 14:30:41 +00:00
Loan (LSE) 3b6455eb97 [FIX] pos_restaurant: preparation printers receipt does not show variant
Before this fix:
 Receipts printed with kitchen/preparation printer does not show the details
 of variants products. Just the product template name.
 This is ambigious for kitchen as the variant information is generally
 necessary in order to prepare the order correctly

After this fix:
 Restore the previous behavior regarding the product name used

This bug is a side effect of:
https://github.com/odoo/odoo/pull/152213
due to the changes to `set_full_product_name`

Was also a good occasion to add some tests on the changes name & qty

opw-3755391

closes odoo/odoo#156390

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2024-03-06 14:30:40 +00:00
Mattis Megevand (mmeg) 5fc24f84ea [FIX] base_automation: allow multiple automation rules for same trigger
Steps to reproduce:
- Install base_automation_hr_contract and helpdesk
- Setup two automation rules with model "Helpdesk Ticket" and "On
  incoming message" as trigger
- Create a ticket in helpdesk

Issues:
Traceback is shown because `_message_post` doesn't have the origin
attributes. This is due to the closure being wrong as explained here: https://github.com/odoo/odoo/blob/e2ad568e6cd4de2d721149eb76d04f58c8510191/addons/base_automation/models/base_automation.py#L686-L691

Solution:
Encapsulate the `_message_post` function definition, so that each times
we patch message_post we patch it with a new function.
This wasn't the case before since `_message_post` wasn't isolated.
This solution is similar to the other method patched.
https://github.com/odoo/odoo/blob/e2ad568e6cd4de2d721149eb76d04f58c8510191/addons/base_automation/models/base_automation.py#L711-L734

opw-3758851

closes odoo/odoo#155596

Signed-off-by: Raphael Collet <rco@odoo.com>
2024-03-06 14:30:38 +00:00
Nicolas Viseur (vin) d387f3d0d5 [IMP] l10n_nz: onboarding improvement
This tasks aims to improve the out-of-the-box configuration of the NZ
localization by updating some tax groups, taxes, accounts and default
COA settings.

Task ids 3647518 & 3647460

closes odoo/odoo#154541

Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2024-03-06 14:30:37 +00:00
Lopes Marc (loma) 45e9576a4d [FIX] survey: fix charts size on results page
Purpose
=======

When you go on any survey results page, you notice charts are smaller
than they used to be on version 16. But there are still readable. The
annoying part is when you click on the `print` btn or press `CTRL + P`,
the charts disappear from both the page and the window preview.

How to fix
==========

- add classes `w-100` and `h-auto` to the canvas elements containing
the charts

Also, we empty the before/after print events in the public widget. They
are no longer useful, but someone may have hooked in those function.
We want to avoid the fix breaks someone else code.

see #135683
task-3667969

closes odoo/odoo#152705

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2024-03-06 14:30:36 +00:00
Thomas Becquevort 751d555efa [ADD] l10n_zm: Zambia base package
Description of the issue/feature this commit addresses:

There is no localization for Zambia.

Desired behavior after this commit is merged:

This commit adds the base package of the Zambian localization including:
- Default Settings
- Chart of Accounts
- Taxes
- Fiscal Positions
- Reports (BS, P&L, Tax Report)

task-3391861

closes odoo/odoo#150134

Related: odoo/enterprise#54707
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-03-06 14:30:35 +00:00
Thomas Becquevort (thbe) 7360530c68 [FIX] account: Amounts to Settle views and filters adjustments
This commit replaces the Display Name column by the Name column in the
Amounts to Settle view and adds the Journal Entry to the search options.
It also includes a small modification to the Amounts to Settle opening
action to adjust the amls that are shown.

task-3640027

closes odoo/odoo#148476

Related: odoo/enterprise#54137
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2024-03-06 14:30:32 +00:00
Benjamin Vray 9561a2df74 [FIX] web: fix border radius of buttons within input-group
Since the commit [1] introducing Bootstrap 5, buttons within input
groups (e.g., "search bars") no longer have the same border-radius as
the inputs.

Steps to reproduce the bug:
- In Website edit mode, drag and drop a "Search" snippet onto the page.
- Click on the "Theme" tab.
- Set the inputs "Border Radius" option to 25px.
- Bug: The border-radius is not applied to the right side of the search
bar.

[1]: https://github.com/odoo/odoo/commit/9ea13513342b14e6b8d4e10e162b618a6ab2cce0

task-3662985

closes odoo/odoo#156603

X-original-commit: 58b57af056a83cda3d8caa6c22d8564c3f9816c9
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2024-03-06 12:46:15 +00:00
Earth Patel da9d6b42f9 [FIX] survey: prevent unwanted submission of one-page survey
Previously, In "one_page & page_per_section" survey, pressing Enter would
submit the survey, leading to confusion and accidental submissions, as users
might press Enter intending to navigate through questions.

With this commit, Now, requiring "Ctrl + Enter" to submit, ensures clarity in
survey submission, reducing the chance of accidental submission.

task-3707763

closes odoo/odoo#152850

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2024-03-06 11:02:08 +00:00
Mayurrajsinh Rathod 4543a530c9 [FIX] website_slides: prevent flicker on hover
This commit fixes the flicker issue of buttons hovering over content
on the course page.

Task-3751285

closes odoo/odoo#156543

X-original-commit: bc8162cb9786a8db9c32c62cfd43e5f422c9271a
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2024-03-06 08:41:56 +00:00
Maximilien (malb) f587ca1b94 [IMP] l10n_lu: Adding tags
In this commit we will adds tags to some accounts. The tags added correspond to
a mapping that was added in this PR: https://github.com/odoo/enterprise/commit/81c427ba1a505e1e9d4a64dd6227bbb747214142
This mapping was useful to separate the tax and net amount and then use it in
the appendix A of the annual report.

We decided the use tags instead of this mapping so that it's clearer for the
users and to give control to them.

closes odoo/odoo#149752

Task: 3646832
Related: odoo/enterprise#54525
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2024-03-06 08:41:53 +00:00
Akash Pandey a19231c30d [FIX] account: include inactive tags in ``_get_tag_mapper``
after this commit: [commit](https://github.com/odoo/odoo/pull/148866/files)

If tags belonging to localization are present in the database but with active='f', the user error will still trigger.
As mentioned in the commit if tags are deleted by the end user, then updating the localization module will resolve this and will create the new tags for that localization, but in our case if the tag are present in the db but are active='f', so updating the localization module will not help as noupdate will become true, if the enduser makes any changes to it. so updating the localization will not change active='f' and the user error will keep on coming unless the end user manually set it active='t'.

So, as this mentioned commit is introduced in 16.2, any db migrating to v16.2 or further, when the ```_get_tag_mapper``` is trigger this user error is blocking the migration.

Steps to reproduce:
1. Create a database in saas-16.2
2. Install the module account_accountant and a localization, for example l10n_ee.
3. With debug mode on, navigate to the account tags menu
     (Configuration > Accounting > Account Tags).
4. Archive any tag using the archive action.
5. On the accounting settings page, under Fiscal Localization, trigger a user error when clicking the reload button.

This user error is blocking.
By making the record inactive, the user has made the account tag no-update, so upgrading the module does not solve this.

This commit add a context to include the inactive tags here:
[here](https://github.com/odoo/odoo/blob/saas-16.2/addons/account/models/chart_template.py#L924-L928)

OPW-3716164
UPG-1297494
TBG-1074

closes odoo/odoo#156627

X-original-commit: 328508bbdab1608e596a10f213c4a8e16d8e2a9c
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2024-03-06 07:22:49 +00:00
Deependra Solanki 8bc886447b [FIX] web_editor: ctrl+click on styled link should open the link
Before this commit:

Ctrl+clicking on a styled link is ineffective since the target is the styled
element, which lacks an href.

After this commit:

The target should be set to the nearest `<a>` tag rather than on the styled tag.

task-3773924

closes odoo/odoo#156544

X-original-commit: baf0a2f1e77b2f7aeb7f9fd657650829e5ba5e13
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Signed-off-by: Deependra Solanki (deso) <deso@odoo.com>
2024-03-06 07:22:47 +00:00
Vivek Pathak 764088d6d5 [FIX] website_forum: fix filter removal directs to login user's profile
Before this commit:
- Navigate to the author's profile from a course on website forum.
- Go to the Questions tab and remove the existing filter
- It directs to the login user's profile instead of removing the filter.

After this commit:
Now when the filter is removed and all the questions of the author are shown
from his profile.

Task-3725329

closes odoo/odoo#156536

X-original-commit: bde4e9ec29ff6daab29bc541a2baa07a74496f02
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Signed-off-by: Vivek Pathak (vivp) <vivp@odoo.com>
2024-03-06 05:49:01 +00:00
AH-Yussef f72751dbfb [FIX] website_sale_loyalty: allow to remove coupon from cart
Steps to reproduce
- Install eCommerce app
- Go to Settings and enable Discounts, Loyalty & Gift Card option
- Go to Website app > eCommerce > Loyalty > Discount & Loyalty
- Create a new coupon by setting the Program Type to Coupons and then save.
- Generate a new coupon by clicking the GENERATE COUPONS button.
- Go to Website > site > Homepage
- Go to Shop page
- Add a product to the cart
- Apply the coupon code created
- Remove the coupon code by clicking the bin icon next to the coupon code line
- The coupon code is NOT removed.

Investigation
First, we'll take a look on what happens when a coupon code is applied
- When a coupon code is applied, a new sale.order.line is created for it.
- That triggers `super()._compute_website_order_line()` https://github.com/odoo/odoo/blob/d8ec7735aa8759fa94fc0223945ac9b19e05312e/addons/website_sale_loyalty/models/sale_order.py#L111 which filters out the discount order line https://github.com/odoo/odoo/blob/d8ec7735aa8759fa94fc0223945ac9b19e05312e/addons/website_sale/models/sale_order.py#L66 via the `_show_in_cart()` method https://github.com/odoo/odoo/blob/d8ec7735aa8759fa94fc0223945ac9b19e05312e/addons/website_sale_loyalty/models/sale_order_line.py#L12
- Then a new temporary sale.order.line is created by https://github.com/odoo/odoo/blob/d8ec7735aa8759fa94fc0223945ac9b19e05312e/addons/website_sale_loyalty/models/sale_order.py#L121 meaning that is has no `id`
- Note that we can only apply one coupon from the same program type.

Second, Let's take a look on what happens when we try to remove a coupon code
- A call is made to `cart_update_json()` which calls https://github.com/odoo/odoo/blob/d8ec7735aa8759fa94fc0223945ac9b19e05312e/addons/website_sale/controllers/main.py#L811-L819 which calls https://github.com/odoo/odoo/blob/d8ec7735aa8759fa94fc0223945ac9b19e05312e/addons/website_sale_loyalty/models/sale_order.py#L159
- But as noted above the coupon order line has no id being a temporary record. Hence the `line_id` is None which basically cancels the cart update.

opw-3744910

closes odoo/odoo#156553

X-original-commit: 1657d6f165f78f971d5bf975a8b4e366655d1ab0
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
Signed-off-by: Ali Hassan Youssef (alhy) <alhy@odoo.com>
2024-03-06 02:24:51 +00:00
kdeb@odoo.com 6178be67c8 [FIX] hr_expense: apply old rates to total expenses
Issue:

- Expenses entered in currencies other than the company currency are
incorrectly calculated using today's exchange rate instead of the rate
applicable on the date the expense was made. This results in inaccurate
totals in the "totals to submit" section of the Expenses application.

Steps To Reproduce:

- Go to Expenses.
- See that the expenses to submit is $4,216.44.
- Create a new expense that is 999,999 EUR but $1.00 USD.
- See that the expenses to submit is $783395.96.

Solution:

- summing up total_amount_company directly instead of total_amount and
then converting to the company currency.

opw-3731445

closes odoo/odoo#156591

X-original-commit: 2c8b13e9270d2ccd6651e7618cbc363c1dd49f43
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Kawtar Drissi El Bouzaidi (kdeb) <kdeb@odoo.com>
2024-03-06 00:01:16 +00:00
Dylan Kiss (dyki) 5af3cfc2b9 [FIX] account_edi_ubl_cii: fix PriceAmount rounding
In [1], we added a rounding of the amounts in the `<PriceAmount>` tags
to avoid floating point rounding errors. However, it seems the
`float_round` function does not guarantee to avoid these errors.

Take the example of `price_subtotal` = 250.80 and `quantity` = 3.
We will compute the PriceAmount as 250.80 / 3 which yields
83.60000000000001. Even when using `float_round(amount, 10)`, it still
results in the same amount with the rounding error.

For that reason we use the built-in `round` method of Python instead.

[1] 58d57bbbaaab32ba0183890a9182e6de09b32ac5

closes odoo/odoo#156555

X-original-commit: 0b21d562fe4d315c01421b3f242e274830c34e79
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2024-03-05 20:53:25 +00:00
Alvaro Fuentes 084d2bcd46 [FIX] mail: correctly compute groups on trackings, depending on model
Side effect due to a combination of odoo/odoo#124182 making field_id not
required to keep trackings when removing fields, and odoo/odoo@9c9552fd20
where field is used to find model when computing groups instead of message
in case the tracking is logged on a model different from the field model
e.g. accounting.

Steps to reproduce:
1. Install project_enterprise in saas-16.4
2. Create a task and update some values for Date deadline
3. Upgrade to 17.0
4. Try to open the task in the upgraded DB.

We get an error:
```
ValueError('All tracking value should belong to the same model.')
```

The reason is that `date_deadline` field is removed during the upgrade
and thus `fields_models` is empty in
https://github.com/odoo/odoo/blob/0649134444fa6b26de1c8c25d7c4a3f70c6d64e0/addons/mail/models/mail_tracking_value.py#L120-L121

closes odoo/odoo#156571

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-03-05 19:21:39 +00:00
Alvaro Fuentes 0db60bf1c2 [FIX] mail: fix tracking formatting when having several models
In odoo/odoo@9c9552fd20 a support of tracking value belonging to another model
than the message has been added. In such cases the formatting method written
at odoo/odoo#124182 fails as it expects a single model for all tracking values
it receives. When field is removed 'model' is False, and we fallback on
mail_message model.

Part-of: odoo/odoo#156571
2024-03-05 19:21:39 +00:00
zel-odoo b1d403c4b4 [FIX] mail: avoid sending notif when not needed
When there is no channel members to be updated the seen status, we
should not send a notification to the channel members, otherwise it
will lead into creating a channel member with id undefined.

test case added to check that the notification is not sent when there
is no channel members to be updated.

closes odoo/odoo#156534

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2024-03-05 19:21:38 +00:00
William Henrotin b718dbd744 [FIX] stock: create orderpoints faster
This commit changes the computation of product having a negative forecasted
quantity to create manual orderpoints. The issue was that each replenish
location needed multiple `_read_group` on `stock.quant` and `stock.move`
on all storable product.

This commit makes only 3 `_read_group`s for all products x locations and
post process the group and quantity sum by location in Python.

This method gives some performance gain in time as well as in memory
consumption

closes odoo/odoo#156507

Task: 3653272
X-original-commit: 1a061791e68a524480b4f230031af25411603606
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-03-05 19:21:37 +00:00
David Monnom (moda) ca1b0921d6 [IMP] pos_restaurant: improve preparation display functionality
Behavior before the changes:
- When a note was modified, it cancelled the old orderline and recreated
it with the new note.
- Products were not sorted by category in the order preparation display.
- Clicking on the header of an order sent it directly to the next stage,
regardless of whether lines were crossed out or not.
- There were brackets around the order number.

Behavior after changes:
- When a note is modified, it is modified directly on the existing
orderline.
- Products are now sorted by category in the order.
- Clicking on an order header sends only the crossed-out lines to the
next stage. If no line is crossed out, the entire order is sent.
- There are no longer any brackets around the order name.

taskId: 3764317
enterprise PR: https://github.com/odoo/enterprise/pull/57385

closes odoo/odoo#155246

Related: odoo/enterprise#57385
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2024-03-05 19:21:35 +00:00
Dylan Kiss (dyki) a588a7e82b [I18N] l10n_it_edi_website_sale: correct and translate terms
Correct the terms in this module and translate them in Italian.

closes odoo/odoo#156502

X-original-commit: 8f4ded8ebb85e996c2fc556efd0ad080095ff82a
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2024-03-05 18:06:27 +00:00
Agustín Castro Bugallo 37b0ea801b [FIX] account: check duplicate accounts by normalized code
Function `_pre_reload_data` checks for the existance of accounts with the same
code to avoid creating a duplicate. It does so however comparing with the code
before normalizing it with the length from the template, failing to find
possible duplicates with a normalized code.

closes odoo/odoo#156498

X-original-commit: d60a6d25ad31d85fd3737b0a96ef9958fbed9c70
Signed-off-by: William André (wan) <wan@odoo.com>
2024-03-05 18:06:27 +00:00
Lucas Lefèvre (lul) 52c986ed19 [PERF] spreadsheet: avoid useless evaluation
Steps to reproduce:
- create a relational filter, let's say on `res.company`
- add a default value
- reference the filter in a cell with `=ODOO.FILTER.VALUE("my filter")`

=> every `ODOO.FILTER.VALUE` triggers an evaluation

With this commit, the re-evaluation after the data is fetched uses the
data source mechanism which only re-evaluates when all the data promises
are resolved, instead of evaluating after every resolved promise.

With this commit, the number of evaluations required when loading the
Timesheet report on our prod goes from 5 evaluations to only 3 (each evaluation
is 2-3s) because `ODOO.FILTER.VALUE("Company")` is present two times.

One issue this commit doesn't fix: there one RPC per `ODOO.FILTER.VALUE`
(can be fixed in master very easily because we refactored data fetching)

closes odoo/odoo#156495

Task: 3787125
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2024-03-05 18:06:25 +00:00
JordiMForgeFlow e1c79b6e22 [FIX] account_edi_ubl_cii: Update Sweden EAS
Remove deprecated EAS code '9955' for Sweden, replace by '0007'.

closes odoo/odoo#156481

X-original-commit: 746c8ad63cee8dd432d35b4f6c630cdc710cb44a
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-03-05 18:06:24 +00:00
JF Aubert 36520268b9 [FIX] repair: fix _should_be_assigned
For repaired products with no stock, a new picking is wrongly created,
leading to a gap in the repair sequence.
This because the move is created in 'draft'
and the function does not take it into account.

closes odoo/odoo#156476

X-original-commit: b2f26a522d75d6f1e73076323384163595b29874
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Signed-off-by: Jean-Francois Aubert (ajf) <ajf@odoo.com>
2024-03-05 18:06:23 +00:00
bram1000 85232e56e6 [FIX] website_slides: only allow for a single review per user
Once a user posts a review, they are able to edit this single review
and not create any new ones. However if the user had multiple tabs open
of the same course, then they can still access the "Add a review"
functionality.

This fix enforces the single review per user per course policy.

Task-3721958

closes odoo/odoo#156411

X-original-commit: 61a95ad41e0b0c72554a491c555ddd33d8588566
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Signed-off-by: Bram Van Gaal (brvg) <brvg@odoo.com>
2024-03-05 16:48:20 +00:00
Victor Piryns (pivi) 967e0f7982 [PERF] mail: add missing index on alias_full_name
Description:
Since https://github.com/odoo/odoo/pull/76734, the new field
`alias_full_name` is used in addition to `alias_name` to search on
`mail.alias` and route emails in `message_route`. It's also used as
a search criteria in `_search_alias_email` on `mail.alias.mixin.
optional`. The issue is that the table `mail.alias` can grow quite
large, and only the old field `alias_name` has an index on it, which
may not be selective enough, forcing Seq.Scans on the table with
possibly millions of records. The impact is noticeable on
`message_route` which is a hot path for processing incoming emails.

Adding an index on `alias_full_name` allows PostgreSQL to do an
bitmap OR scan on the two indexes, considerably speeding up search
criteria that are a disjunction between `alias_name` and
`alias_full_name`.

Benchmark:
For domain
```python
[
    '&',
    ('alias_model_id', '!=', reply_model_id),
    '|',
    ('alias_full_name', 'in', email_to_list),
    '&', ('alias_name', 'in', email_to_localparts), ('alias_incoming_local', '=', True),
]
```
with test arguments, on a `mail.alias` table containing over 2M records.

|           | Before | After |
|-----------|--------|-------|
| Timing    | 696ms  | 1ms   |
| Buffer IO | 790MB  | 48KB  |

Specially impactful as those gains needs to be multiplied by the
frequency of the searches.

Reference:
task-3724844

closes odoo/odoo#156237

Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
2024-03-05 16:48:17 +00:00
Victor FeyensandAaron Bohy 6a83ace2b1 [FIX] web: x2many field with empty changes
In some conditions, a x2many field can be considered
as modified by the webclient when in fact there is
no change in 'meaningful' stored fields.

In this case, on save, an empty list of magic commands
will be sent to the server, potentially triggering
unexpected recomputations.

Steps to reproduce:

* install sale_stock & sale_management
* create a new storable product
* create a new SO
* create a new line with this product
* Confirm the SO
* Set or Update the SO delivery date (Other info tab)
* Save

-> In the chatter, you will notice an useless tracking
value being printed for the SO Total, with identical values
before and after update.

Cause

Since the server received an empty list of commands for
the `order_line` field, this triggered a recomputation
of the total amounts of the SO, even though there were no
effective changes in the lines.

Solution

Do not send empty command lists for x2m fields.
This will avoid unexpected recomputation and also improve
performance since the fields were recomputed for 'nothing'

closes odoo/odoo#155549

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2024-03-05 16:48:16 +00:00
roen-odoo 6b0f0df21a [FIX] point_of_sale: fix daily sales report for normal bank payment
Current behavior:
When entering a difference at the closing of the session for a bank
payment method, the daily sales report was not taking into account the
difference for the bank payment method.

Steps to reproduce:
- Start PoS and make a sales with bank and a sales with cash
- Close the session with a difference for both payment methods
- Go to the daily sales report and check the difference for the bank
  payment method. The one for the cash is there but not the one for the
  bank.

Note:
This bring back the original behavior of the report that was removed
here (https://github.com/odoo/odoo/pull/146341) and makes it coexist
with the current one so that all cases are covered.

opw-3737223

closes odoo/odoo#156376

X-original-commit: d9190e34543c4a1151656859acb41556bcb3a364
Signed-off-by: David Monnom (moda) <moda@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2024-03-05 14:22:23 +00:00
lase@odoo.com 6fcd31cc21 [FIX] mrp_subcontracting : generates BOM for dynamic attributes
Current Behavior:

Traceback when printing the BOM overview.

Expected behavior:

Generates a PDF of the BOM overview even if the information displayed
is entirely relevant.

Steps to reproduce:

Inventory > Configuration > Products > Attributes

Create an attribute with Variants Creation Mode set to "Dynamically".

Create a new product with this single attribute and multiple values.

Create a BOM for this product with BOM Type set to "Subcontracting".

Print the BOM overview.

Cause of the issue:

Creating such a product generates a 'product.template' that is not
associated to any variant and hence does not correspond to any
'product.product'. As a result the function_get_bom_data made can not
apply the method _select_seller properly in that case.

Notes:

 - There is no error if a variant was manually created for that product.
 - If the Variants Creation Mode set to "Dynamically" a variant is still
   automatically created to be associated to the product tempalte so
   that the erro does not rise.

Fix:

As the _select_seller method is only defined for product.product
and not for product.template, we can not not apply it here.
Furhtermore, since the additional informations provided by the
override of the method get_bom_data in the the BOM overview will
not be relevant without the existence of a variant, we skip this part of
the code when the argument of _select_seller is not valid.

opw-3698050

closes odoo/odoo#156346

X-original-commit: b983026f004d4958d2a47a0dac9b1b54e24ab04c
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Lancelot Semal (lase) <lase@odoo.com>
2024-03-05 14:22:22 +00:00
Arthur Pierrot (arpi) bd1c5a2699 [FIX] hr_contract: Fix departure date in case of open contracts
Purpose
=======

Take the last expired contract end date if there is not open contract
for the related employee.

closes odoo/odoo#156326

Taskid: 3610709
X-original-commit: c6ddecc09361cde4580242dc4f87594e78e51a57
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-05 14:22:21 +00:00
Julien Castiaux 52d7579435 [FIX] base: serve_fallback infinite redirection
Create an attachment with an URL to a static file that does not exists,
e.g. '/web/static/idontexist.png'. Inside your browser try to access
that file, open <localhost:8069/web/static/idontexist.png>. The browser
fails with a "Too Many Redirections" error.

When a path is not found, nor in the static files, nor in the
controllers, `_serve_fallback` kicks in and attempt to find a resource
outside of the router that matches the URL. In case it finds an
attachment with a matching URL, it'll deliver it.

In this specific case, it finds our attachment and return a redirection
to it's URL, which is the same URL as the request hence it loops back.

Don't deliver URL attachments via `_serve_fallback`, only deliver stored
files.

closes odoo/odoo#156323

X-original-commit: d2bea592db6a66d531b83437d42b273606f629f1
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2024-03-05 14:22:20 +00:00
Renaud Thiry 00ebf747af [FIX] mail: add selection when fetching message type
A new message type was added in stable. This is usually safe,
however in cases where there are related fields on that same selection
fetching them will raise an exception as the ORM has to fetch the translations
for the selection in DB.

We add a hack on mail.mail to update the selections in DB when fetching
the message_type field for the first time.

task-3773301

closes odoo/odoo#156235

X-original-commit: 19683173708a2b029acb4e744871772b6c248715
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Renaud Thiry (reth) <reth@odoo.com>
2024-03-05 14:22:19 +00:00