Commit Graph
165814 Commits
Author SHA1 Message Date
momegahed 631d34e8eb [FIX] l10n_ar_website_sale: fix access to AFIP in ecommerce
Steps to reproduce:
1. install l10n_ar_website_sale
2. try to checkout out using a guest account (without sigining in)
3. error on address form

very similar to:
https://github.com/odoo/odoo/pull/130455

Issue:
due to https://github.com/odoo/odoo/pull/118701 public users can't read
`l10n_ar.afip.responsibility.type` anymore

Fix:

open access to the models

opw-3460719

closes odoo/odoo#134226

X-original-commit: dc3a2be108989343ac62d6c42a064b1b39586bbf
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2023-09-05 14:44:14 +00:00
Brieuc-brd 4736b2afd5 [FIX] web: ListView selection and action icons
=== ISSUE 1 ===
Prior to this commit, there was a missing padding on  the
`o_list_selection_box`.

=== ISSUE 2 ===
On mobile, Cog and Print icons had no margin and were stick next to
their label.

This commit fixes these issues.

task-3454841
Part of task-3326263

closes odoo/odoo#134219

X-original-commit: 80f82816b17d32efbf4cbe4a1956b2457eac8ad9
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-05 14:44:13 +00:00
niyasraphy 36cf1708a4 [FIX] (account,website)_payment, sale: pass argument values in super call
before this commit, on inheriting the function
_get_custom_rendering_context_values the argument values are not received
in the inherited function as it is not passed along with the super

scenario:
* consider that the payment link is shared to customer
* customer made the full payment
* once the sale or invoice is fully paid, the link has to
be shown as fully paid or expired
* for doing this, if we inherit the above function, the
arguments is not passed to the function

after this commit, the argument values are passed to
super and the value can be used re used in the further
inherit of this function

closes odoo/odoo#134195

X-original-commit: 49b91e47c6c24e0023110365e7f9084a2c13ca5a
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-05 12:22:22 +00:00
Louis (loco) f34540c535 [FIX] web_editor: save an image with the correct parameters
Steps to reproduce the problem:
- Go on the "Courses" application and select a course.
- Edit.
- Replace the main image of the course with one of your own.
- Save.

-> The function route `/web_editor/modify_image/` is called two times
leading to the creation of two attachments instead of one.

The `savePendingImages()` function iterates through editable elements
and calls `/web_editor/modify_image/` (through `_saveModifiedImage()`)
for each image with a `o_modified_image_to_save` class inside those
elements. In our case, the image has an editable element parent that has
itself an editable element parent. Because since [1], the
`o_modified_image_to_save` class is removed after the `rpc` call, this
class is not removed while the `savePendingImages()` loops on the
second editable element parent of the image. As a result,
`/web_editor/modify_image/` is called two times. Note that before [1],
the process was partially wrong as well. `/web_editor/modify_image/` was
indeed called only once but with the wrong arguments. This is now fixed
by ensuring that `_saveModifiedImage()` is called with the arguments
coming from the closest editable element. The same logic is applied for
the call of the `_saveB64Image()` function.

[1]: https://github.com/odoo/odoo/commit/8872aab2d108ff3e2ec06ca4579479898c87738c

task-3451349

closes odoo/odoo#134189

X-original-commit: 8ff0151cf06c37e8ee2e344bc96c063b4921ce43
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2023-09-05 12:22:20 +00:00
Jorge Pinna Puissant f609a616d1 [IMP] web: allow to save and read next record in one rpc call
In [1], a new python function was introduced that allows to save and
read in one rpc. This commit, adds the possiblitity to read another
record in the same rpc call. This is particularly useful when you want
to save and read the next record (for instance on a pager).

1: ebd538a194

Task-id : 3453184

closes odoo/odoo#134125

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-05 12:22:19 +00:00
hupo-odoo 8afae04c35 [IMP] account: discount allocation
Provides the possibility for the user to enter defaults accounts for discounts allocation. If provided, discounts on Customer Invoices and Vendor BIlls will be allocation on the specified account instead of the product account.

Example:
Create a journal entry with one product with the following attributes:
quantity: 1
price unit: 100
discount 5

We expect the following account move line:
Without an account set in the settings for discount allocation:
ACCOUNT                                             DEBIT     CREDIT
700000 Sales rendered in Belgium (marchandises)      0         95
400000 Trade debtors within one year - Customer      95        0

With discount allocation account set to "657000 Discount Given":
ACCOUNT                                             DEBIT     CREDIT
700000 Sales rendered in Belgium (marchandises)      0         95
700000 Sales rendered in Belgium (marchandises)      0         5
657000 Discounts Given                               5         0
400000 Trade debtors within one year - Customer      95        0

closes odoo/odoo#133286

Note: the discount is added on another line than the one of the product even though it is the same account because it does not include taxes and analytic distributions.
Task: 3278827
Signed-off-by: William André (wan) <wan@odoo.com>
2023-09-05 12:22:17 +00:00
ravb-odoo b56c565c07 [IMP] hr_contract: make contract and work permit expiration notice periods configurable
Currently the warning messages to warn for contracts and work permits that are
about to expire are hardcoded to be triggered 7 and 60 days in advance
respectively. With this commit, these notice periods are made to be configurable
on a per-company basis.

task-3340931

closes odoo/odoo#124414

Related: odoo/enterprise#42214
Related: odoo/upgrade#4885
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-09-05 12:22:15 +00:00
Odoo's Mergebot fdf0ffb8c6 [MERGE][ADD] product,(website_)sale: product documents
Introduce new model of "Product Documents" to hold documents linked
to a given product template/variant, displayed on:

* quotations
* confirmed sale orders
* e-commerce product page

This will also replace the previous "Digital Files" (website_sale_digital)
logic & module, which allowed to specify product documents available
to customers after the SO invoice was paid.

This exact feature will be lost after upgrade, since we only keep the
choice to link documents on quotations/orders, but:

1) on e-commerce, carts are supposed paid when confirmed
2) on portal, the "Online Payment" settings makes sure the users
have to pay to confirm their quotation.

therefore we consider new configuration sufficient, without needing
a "paid order" choice as well.

task-3249201

See also:
* https://github.com/odoo/enterprise/pull/46106
* https://github.com/odoo/upgrade/pull/5069

closes odoo/odoo#132739

Related: odoo/enterprise#46106
Related: odoo/upgrade#5069
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-05 10:59:17 +00:00
Victor Feyens 5a801bc602 [ADD] product,(website_)sale: product documents
Introduce new model of "Product Documents" to hold documents linked
to a given product template/variant, displayed on:

* quotations
* confirmed sale orders
* e-commerce product page

This will also replace the previous "Digital Files" (website_sale_digital)
logic & module, which allowed to specify product documents available
to customers after the SO invoice was paid.

This exact feature will be lost after upgrade, since we only keep the
choice to link documents on quotations/orders, but:

1) on e-commerce, carts are supposed paid when confirmed
2) on portal, the "Online Payment" settings makes sure the users
have to pay to confirm their quotation.

therefore we consider new configuration sufficient, without needing
a "paid order" choice as well.

task-3249201

Part-of: odoo/odoo#132739
2023-09-05 10:59:17 +00:00
Victor Feyens 9ed1dc5cae [REM] website_sale_digital
Part-of: odoo/odoo#132739
2023-09-05 10:59:17 +00:00
Laurent Smet ac3621084c [FIX] account[_peppol]: Delay link_documents after _call_web_service_after_invoice_pdf_render
If a web-service after the PDF generation failed but does a cr.commit(), the attachments should not be generated.

closes odoo/odoo#134237

X-original-commit: 5d343598c2ce03698aa686965ec3887df610ec9a
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-09-05 07:19:52 +00:00
Nicolas Bayet e4bac8c129 [FIX] web_editor: prevent creation of RTCPeerConnection when offline
Before this commit, when the browser was offline and when an attempt
to make a RTCPeerConnection was made, a traceback was raised by
firefox:

> InvalidStateError: Can't create RTCPeerConnections when the network is
> down

This commit prevents the creation of the RTCPeerConnection when the
browser is offline.

task-3186872

closes odoo/odoo#134236

X-original-commit: 8f9a3e1ebd05d9df8ec0d82b93967f1a62f879c4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-05 07:19:51 +00:00
Xavier ALT 0f213505bb [FIX] account: fix incorrect chatter body for incoming vendor bills
As the use of Markup is enforced since [1], we must use a Markup string
when adding the subject to incoming vendor bills body otherwise the
chatter will contain the escaped html, making it quite difficult for
users to understand it.

opw-3453136

[1] https://github.com/odoo/odoo/pull/111850

closes odoo/odoo#134220

X-original-commit: 66194df56d9e724b889527dbfea725ac9b8844b9
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-09-05 07:19:49 +00:00
William Henrotin 9a3dde222a [FIX] {sale_}purchase{_stock}: select sellers depending on date
Commit 72a17bafba6e7 force the PO `date_order` to be >= at ` today() to
ensure the select_seller method take the right seller price. This
introduces an error in the MPS module that may need to create PO in the
past.

Instead, this commit patch the call to `_select_seller` to take at least
`today()`

closes odoo/odoo#134217

Opw: 3167094
X-original-commit: a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-09-05 07:19:48 +00:00
mano-odoo 0cc569004d [FIX] web: o_quick_assign same color as the clock
As the Activity button (clock icon) is the same kind of action
it make sense to apply the text-muted on the quick assign.

To make the hover clearer we apply a text-dark on hover using the
btn-link + contextual classes function. We apply the same to the
`subtask_list_button` and milestones for consistency.

task-3382159

closes odoo/odoo#134196

X-original-commit: 4b8b6e2155eca66652b4a57dfff27b0e81d62573
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-05 07:19:47 +00:00
Yaroslav Soroko (yaso) 95eece118c [FIX] hw_drivers: Error-proof Interfaces
Before, when instatating the interfaces if there was an error inside
Odoo could stop. This PR prevents that and simply avoids instantiating
the interface which causes the error.

closes odoo/odoo#133890

X-original-commit: e8f700f766bde6906076192ffe12eec255454a81
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-09-05 07:19:45 +00:00
Thomas Lefebvre (thle) e561cd5b5d [FIX] hr_holidays_attendance: correct date overtime attendances
Issue:
------
The `date` field of the `hr.attendance.overtime` model
records is not the date of the related leave.

Cause:
------
We use: `fields.Date.today()` instead of the leave field `date_from`.

Solution:
---------
Use `date_from` field of `leave`.

opw-3433480

closes odoo/odoo#134156

X-original-commit: b82a338380e7e693d8123a496e36676260873828
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-09-05 05:33:59 +00:00
Sébastien Theys 53cd2bd72f [REF] mail: tests: remove nextAnimationFrame
In some tests it was no longer necessary.

Negative tests will be slightly weaker, but they are so weak already
that is does not change much, they should be done differently anyway.

closes odoo/odoo#134025

Related: odoo/enterprise#46739
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 21:53:38 +00:00
Sébastien Theys 4458a01606 [REF] mail: tests: remove nextTick
It was no longer used.

Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Sébastien Theys 7a9581e1f3 [REF] web, mail, im_livechat: tests: remove afterNextRender
Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Sébastien Theys e3b774118b [REF] mail, *: tests: remove most remaining afterNextRender
* = base_iban, bus, calendar, crm_livechat, im_livechat

Follow up of https://github.com/odoo/odoo/pull/130451

`contains` is faster and functionally more significant.

Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Sébastien Theys 3ea78a8354 [REF] mail, website_livechat: tests: remove waitFormViewLoaded
This is no longer used since tests properly await what they require.

Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Sébastien Theys 315263f1b3 [REF] mail: tests: remove waitUntilMessagesLoaded of openDiscuss
This is no longer used since tests properly await what they require.

Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Sébastien Theys e25e70b2f5 [REF] mail: tests: remove unused getMouseenter
Part-of: odoo/odoo#134025
2023-09-04 21:53:37 +00:00
Rahul Prajapati 4250ae62b6 [FIX] mail: chatwindow header threadactions display
Before this commit:

When ThreadActions has a length of 1 it will display the threadAction
multiple times.

ex. In Mobile View When starting a new conversation with a partner from the
`New Message` button from the systray. It will have only 1 ThreadAction
which is `close`. So, it will be displayed multiple times.

After this commit:

If there is only 1 threadAction then it should not be displayed multiple times

closes odoo/odoo#134228

X-original-commit: 6a229db2db60e4b0bfdfe585f5ca05e2e373905f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 20:55:14 +00:00
tsm-odoo 4b72cd0e3f [FIX] im_livechat: fix chatbot test page
This PR fixes a server error when trying to test a chatbot that
appeared with the [livechat refactoring].

Steps to reproduce:
- Go to a livechat channel form view
- Click on the "chatbot" smart button
- Click on a chatbot
- Click on the "test" button
- An internal server error occurs

task-3485014

[livechat refactoring]: https://github.com/odoo/odoo/pull/122834

closes odoo/odoo#134227

X-original-commit: dfc50ea4e4fb327876458afee1b807e36ce80c2b
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 20:55:13 +00:00
Benjamin Vray 6566d12a62 [FIX] web_editor: fix opening of colorpicker of the transparent header
Steps to reproduce:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Change the color of the header by picking a color in the "Background"
sub option (below the "Header Position" selector).
- Re-open the colorpicker.
- Bug: The colorpicker is empty.

This bug occurs since [1] because the 'selectedTab' option of the
colorPalette was being reset to its default value when the colorPicker
was opened for a second time. In this commit, we stored the
'selectedTab' props in a variable to be able to modify it (see the owl
[documentation]).

[1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997
[documentation]: https://github.com/odoo/owl/blob/master/doc/reference/props.md#good-practices

task-3440939

closes odoo/odoo#134229

X-original-commit: 2094a52647ce1c321d1e703d96211fc0d642025f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-09-04 19:58:34 +00:00
Julien Castiaux 94595ba992 [FIX] website: 308 wrongly set on all routes
Users sometime want to rename existing controllers URL, e.g. /shop as
french /magasin. The feature is possible within Odoo thanks to 308 type
redirections that can be configured via a hidden ?debug=1-only website
menu.

Upon generating the routing-map (the structure that links URLs to
controllers), when a URL is found inside of the `website.rewrite` model,
two links (called Rules in werkzeug jargon) are registered: the new,
translated, URL is linked to the controller and the original URL is
linked to a redirection to the new URL.

For the context of this PR, it is important to note that the redirection
only applies to the very URL saved inside the `website.rewrite` model:
if a controller has multiple routes, e.g. `/shop` and `/shop/shop`, only
`/shop` is redirected to `/magasin`, `/shop/shop` is left as-is.

Without 308 redirection:

	/shop -> def shop()
	/shop/shop -> def shop()

With 308 redirection:

	website.rewrite(from_url='/shop', to_url='/magasin')
	/shop -> /magasin
	/shop/shop -> def shop()
	/magasin -> def shop()

The redirection is set on the routing dictionnary of the endpoint, this
is the dictionnary that collect the informations set via the `@route`
decorator (auth=, method=, type=, ...).

Prior to [HTTPocalypse], that dictionnary was duplicated so that the
redirection was applied on the single route endpoint that matched
the `website.rewrite` record. With [HTTPocalypse] that duplication has
been wrongly removed: all original routes redirected to the new
translated one.

Bug introduced in [HTTPocalypse]:

	website.rewrite(from_url='/shop', to_url='/magasin')
	/shop -> /magasin
	/shop/shop -> /magasin          <-- wrong
	/magasin -> def shop()

This PR fixes the problem, it makes sure that the redirection is saved
*only* on the route that matched the website.rewrite record, not the
other routes.

[HTTPocalypse]: https://github.com/odoo/odoo/pull/78857

closes odoo/odoo#133960

closes odoo/odoo#134206

X-original-commit: 144a22c22c95004171860cdaecd1f7d7975dc468
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-04 19:58:33 +00:00
Romain Derie 3b19a53191 [IMP] test_website: add a test for 308 redirect with multi url route
This commit introduces a test in Odoo 15 about a broken behavior in Odoo
16 which was not covered by a test.
A fix will be shipped alongside this commit forward-port in Odoo 16.

The behavior involved here is about:
- Having a multi-url defined route
- One of those URL not having a model converter
- One of those URL having a model converter
- Creating a 308 redirect for the URL without model converter

Something like this route (real example from the code):
```py
@http.route([
    '''/shop''',
    '''/shop/page/<int:page>''',
    '''/shop/category/<model("product.public.category"):category>''',
    '''/shop/category/<model("product.public.category"):category>/page/<int:page>'''
], type='http', auth="public", website=True, sitemap=sitemap_shop)
```
And this redirect (real usual example from clients):
```py
self.env['website.rewrite'].create({
    'name': 'Test Multi URL 308',
    'redirect_type': '308',
    'url_from': '/shop',
    'url_to': '/magasin',
})
```

In Odoo 15, everything will work as expected:
1. Accessing /shop will redirect to /magasin
2. Accessing /shop/category/categ-1 will not redirect and user will be
   on /shop/category/categ-1 still

But in Odoo 16:
In the case described above, acessing the URL with model converter from
the route will fail and redirect to a non slugified URL in the form of
`/some-url?param=test.model%287%2C%29` which is basically the
stringified encoded version of the record `test.model(7,)`.

Note:
- It doesn't matter if the route is contained in the other, the error
  will still occur even if `'''/shop'''` was `'''/abc'''`.
- Even if all URL from the route have their own 308 redirect, the error
  will still occur.
- It won't have any issue if there is a 308 on the route with model
  converter: both the one without model converter and other url with
  model converter will work and won't be impacted.

This might be because of a concept of "merging URL" from httpocalypse,
see https://github.com/odoo/odoo/commit/347a3ccf763cc6958d5dc1df3168c9c65245736c

opw-3450054
opw-3466498
opw-3477380
opw-3475694

X-original-commit: 22ca1c48f78cdf575f9a2b0823f9487f942bc7cd
Part-of: odoo/odoo#134206
2023-09-04 19:58:33 +00:00
Benoit Socias 679ede2c32 [FIX] website: get the name of the visitor through the related field
Since [1] if the partner related to a visitor belongs to a company that
cannot be accessed by the current user, an error is raised when trying
to display the list of visitors.

This commit makes the name obtained through an additional sudo on the
`partner_id` record which might not be accessible to the current user.
This is equivalent to using the `name` field of visitor, except that
accessing the `partner_id` field will fail if `website.visitor` itself
cannot be accessed.

Steps to reproduce:
- Go to Settings / Companies
- Create a second company
- Go to Website / Reporting / Visitors
- Select "Edwin Hansen"
- Navigate to its linked partner in the contact field
"Gemini Furniture, Edwin Hansen"
- Navigate to its company "Gemini Furniture"
- In the "Sales & Purchase" tab, assign the second company as the
Company
- Save (this creates an error - but it is saved)
- Go to Website / Reporting / Visitors

=> The page was not displayed and an access error message was
displayed.

[1]: https://github.com/odoo/odoo/commit/d348bed1ad9d3d16b295f013f015706be6c07820

opw-3462104

closes odoo/odoo#134190

X-original-commit: a75673217aef2ffaaa93585526dc1e647a270495
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-04 19:58:32 +00:00
Gabriel de Paula Felix (gdpf) 07f17b0c80 [FIX] microsoft_calendar: traceback restarting synchronizations
Before this commit, when restarting a synchronization with Outlook or Google, a traceback error could be thrown due when accessing a variable possibly null. After this commit, the variable integrity is checked before its access.

Issue from: 3473180

closes odoo/odoo#134181

X-original-commit: e7015b6c0cd2bd009184bfbc69730c211922658b
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Gabriel de Paula Felix (gdpf) <gdpf@odoo.com>
2023-09-04 19:58:31 +00:00
Ivan Yelizariev 602b3f3d39 [FIX] account: prevent reading fake binary fields over rpc
Since Odoo 16 [1] account module uses some non-storable computed Binary fields
to compute and access structured data. Those data is not transformed into binary
data and is not supposed to be used outside of server environment. There are
still use cases when ORM tries to process such fields as normal Binary fields.
For example, on using export wizard [2].

This commit fixes similar problem on reading `account.move{.line}` records via
rpc.

STEPS: create `account.move` record and read it via an RPC call [3]

```
account_move_id = 666
models.execute_kw(db, uid, password, 'account.move', 'read', [account_move_id])
```

SOLUTION

1. Add missing `exportable=False` to the fake Binary fields
2. Block access to such fields via method `check_field_access_rights`

[1]:
https://github.com/odoo/odoo/commit/d8d47f9ff8554f4b39487fd2f13c153c7d6f958d
[2]: https://github.com/odoo/odoo/commit/c925ecb2a22750524020f0d111888fd76eedb0cb
[3]: https://www.odoo.com/documentation/16.0/developer/api/external_api.html

opw-3099975

closes odoo/odoo#134164

X-original-commit: 5193d145b96e34ef1e754b8421cccd8c9dab99e7
Signed-off-by: William André (wan) <wan@odoo.com>
2023-09-04 17:10:12 +00:00
Aaron Bohy 38d0124a93 [FIX] web: correctly eval context for nested x2many
Have a form view with a one2many field (e.g. displayed as a list)
containing itself an x2many field (e.g. many2many_tags), with a
dynamic context depending on the parent record (see the test for
a specific situation).

Before this commit, the dynamic context on the inner x2many wasn't
correctly evaluated, because when we evaluated it, the parent
evalContext hadn't been computed yet (they were computed bottom-up)
when the datapoints were created.

With this commit, we wait for all datapoints and evalContext to be
properly set up before evaluating the static list dynamic contexts.

closes odoo/odoo#134160

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-09-04 17:10:11 +00:00
Didier (did) 145ed67b92 [FIX] mail: avoid crash with link preview from bus notification
Before this PR, a crash occured when a link preview was recieved from the bus.
This is because the link preview was pushed twice on the `message.linkPreviews`
array.

task-3491629

closes odoo/odoo#134135

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 17:10:10 +00:00
FrancoisGe c0b6322e25 [IMP] web: add alwaysApply in useDebounce
The purpose of this commit is to add the alwaysApply option to useDebounced.
This option is used to force execution of the callBack if the debounced
function has been called and is still not resolved when the component is destroyed.

closes odoo/odoo#134096

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-04 17:10:09 +00:00
Prakash Prajapati efd5a01417 [FIX] hr, hr_contract, *_: fix the traceback when open the search dialog
*_ = hr_holidays

Step:
  - Install contract app
  - Create user with payroll manger access and None Employees
  - Login with new user and create contract
  - Click on employee field and click on Search More
Issue:
    When the user does not have access to the employee app and the search dialog accesses the
 employee during search more, so the traceback come.

Fix:
    If the user does not have access to the Employee application, public employee will be
  used in the search more dialog.

Why needed string insead of props.string:
   When we pass related modal in option then undefined appears in m2m search dialog instead
   of field label.

task-3366443

closes odoo/odoo#134022

X-original-commit: 635a2435fe742064dcd68290a4fdcd484ba67ba9
Related: odoo/enterprise#46737
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-09-04 17:10:07 +00:00
Sébastien Theys cda6621fb8 [FIX] mail: set automatic email signature from correct company
When sending an email from a multi-company environment, the automatic
email signature is not corresponding to the company from which the email
is sent.

This is because the user context is not properly forwarded, in
particular the `allowed_company_ids` key.

The issue comes from the new rpc service not autmatically adding the
user context to the request, whereas the legacy rpc service did.

opw-3394780

closes odoo/odoo#133596

X-original-commit: 5d6a0257ccd7f0b0f9a05050151ba66f35aeea37
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-04 17:10:06 +00:00
Damien Bouvy 180de8afe6 [IMP] web, *: replace view all with search more
This partially reverts commit da50ce31ae825ef9f4b527553a2e2caec970d290.

Whilst the behavioral changes done in the task are correct, the wording
is not optimal and was better understood by users before this change.

Task-3483936

closes odoo/odoo#133511

Related: odoo/enterprise#46503
Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
2023-09-04 17:10:05 +00:00
Mélanie Peyrat (mepe) d4f1fb9f10 [IMP] hr_holidays: a time off (duration >= 1day) is displayed as full day
If the duration time off is greater than or equal to 1 day, then it
should be displayed as a whole day event.
Now it's not a case and can be misleading.

Moreover, this change increases querycount for the following reason:
When we create allday calendar event, on top of usual queries -
"calendar_event"."stop_date" and "calendar_event"."start_date" are read.

Note, start_date and end_date are only set for allday events.

task-3103848

closes odoo/odoo#113865

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-09-04 17:10:02 +00:00
lejeune quentin a1bf178ee0 [FIX] point_of_sale: Fix date on iot
With the build of the new iot image we need to fix the date synchronization

closes odoo/odoo#134138

X-original-commit: 41b0edf739f676723b9dab77066296565d6e135d
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-09-04 16:09:30 +00:00
Gaetan Vanden Bergh (gavb) bca14070a6 [FIX] mail: No author reply trigger error due to parent message
Steps:
No precise steps:
Send/Receive a email in discuss
Reply to it via email

Actual result: crash due to parentMessage
Expected result: no crash

opw-3480185

closes odoo/odoo#134123

X-original-commit: 743a298089620865d95f725cae8b3e5ffc9a822e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-04 16:09:30 +00:00
Louis Baudoux 76f6257b6e [IMP] crm_iap_enrich,iap_mail,snailmail: improve IAP notification system
The old implementation had some inconsistencies and didn't allow to have
general error notifications, it was only meant for credit error
notifications.

The notification/log messages of lead enrichment were also improved as
some of them were unclear.

closes odoo/odoo#132233

Related: odoo/enterprise#44488
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
2023-09-04 15:02:50 +00:00
divy-odoo cea1cab535 [FIX] *: resolve the last tour step warnings
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, It shows warnings of 'ignoring action (auto) of last
step' as it can lead to a race condition.

This commit resolves the warnings: `ignoring action (auto) of last step`

task-3429500

closes odoo/odoo#129239

Related: odoo/enterprise#46683
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-04 15:02:47 +00:00
divy-odoo 443c209ed0 [IMP] web_tour: remove default click trigger on final tour step
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, we don't want to execute the default action as it
can lead to a race condition.

With this commit [1], from saas-16.3 we have refactored the web_tour to
OWL. During the refactoring, it lost the condition initially introduced
by PR[2] that handles the final step of tours.

So this commit,
1. Restored the missing condition.
2. Replaced the simple `console.log()` with a warning, because it's easy
   to miss the log compared to a warning.

[1]: https://github.com/odoo/odoo/commit/3a798039d6f200f8e28448ddb6a2d3c46654a203
[2]: https://github.com/odoo/odoo/commit/9733f6e1ab31abf780a5ad671f700fac883b63ee

task-3429500

Part-of: odoo/odoo#129239
2023-09-04 15:02:47 +00:00
Leonardo Pavan Rocha 064213901b [IMP] calendar: rework recurrence in UI
This commit changes the way we define recurrences from the UI so it's simpler.
Instead of showing the user many options for recurrence like we currently do,
we add a selection field for each rrule (daily, weekly, monthly and yearly)
that sets some default values for the recurrence without the user having to
define each field manually. This change makes the definition of recurrence from
the UI closer to what is done in google calendar. In order to allow users to
define more advanced types of recurrence, we also add a custom option in the
new selection field that will show the old recurrence options to the user.

Additionally, the week days widget defined in web takes too much space, so it
was decided to create an overwrite of this widget for calendar only that looks
cleaner and takes less space. This commit introduces this new widget and
applies it to the calendar event form view.

task-3234677

closes odoo/odoo#116649

Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-09-04 15:02:46 +00:00
roen-odoo e28e1a079f [FIX] point_of_sale: Show price without discount in receipt
Current behavior:
When a discount is applied to a product, the receipt shows the price
with the discount applied as the base price.

Steps to reproduce:
- Open PoS
- Add a product to the order
- Apply a discount to the product with the numpad
- Validate the order
- Check the receipt, the base price of the product is the price with the
  discount applied.

(https://github.com/odoo/odoo/assets/32939472/eb0998a7-70a1-432a-8909-868d9307c999)
The price in red should be 70$ (the price without the 5% discount)

opw-3463745

closes odoo/odoo#134045

X-original-commit: d6e4e7c566324de3ef9589b92cacd32d6c386465
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-09-04 10:56:09 +00:00
Alexandre Kühn 43882882eb [REF] mail: simplify record deletion in discuss store
Deletion of record requires removing the record entry
in `records`, and it was cumbersome to make a long expression
each time we want to remove the record from this object.
```js
// before
delete this.store.Model.records[record.localId];
// after
record.delete();
```

closes odoo/odoo#134008

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-04 10:56:08 +00:00
Alexandre Kühn d94f7e534a [REF] mail: simplify code of Record.insert() when new record
- automatically add `_store` on the record
- automatically register in `records` and return reactive when
  `records` is a obj (array => should keep doing it manually)

Part-of: odoo/odoo#134008
2023-09-04 10:56:08 +00:00
Alexandre Kühn a775b239ed [REF] mail: introduce id & get() on all discuss models
1. Introduce `static id` to all models, to uniquely identify
   a record in a model. This allows normalizing discuss store
   for all models, which helps as preparation for managing
   record deletion. Can also be combined

```js
class Message {
    static id = "id";
    id;
}
class Thread {
    static id = AND("model", "id");
}
```

2. Introduce `Model.get()` to easily get a record of model
   from data that can identify the record. This prevent leaking
   the way the record are stored in `records`, as now all records
   are indexed by localId, and localId is technical detail.

```js
Message.get(messageId);
Thread.get({ model: "discuss.channel", id: 1 });
```

Part-of: odoo/odoo#134008
2023-09-04 10:56:08 +00:00
Dylan Kiss (dyki) 09b8c32e9e [FIX] account: branch management fixes
After feedback on the new branch management feature, there were a few
bugs reported. This commit solves several of them:

- Display the company/branch name of a reconciled payment in the info
  popover when viewing customer invoices and vendor bills. This way you
  can see why you don't have access to the payment e.g.
- Make it possible to select the taxes of the parent company when
  creating moves in a branch.
- Allow users with only access to a branch to open the Accounting app.
  The dashboard would fail with a security error before.

task-3461421

closes odoo/odoo#134000

X-original-commit: 92d261d9a3f64fcbb01023e680d362b598061707
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2023-09-04 10:56:06 +00:00