Commit Graph
166010 Commits
Author SHA1 Message Date
“moda” 65506db8e9 [FIX] pos_self_order: some adaptation after design refacto
This PR contains a few adaptations and fixes after the major design
refactoring.

closes odoo/odoo#137704

Signed-off-by: David Monnom (moda) <moda@odoo.com>
2023-10-10 15:42:52 +00:00
Xavier Luyckx (xlu) bb963f1f7f [IMP] point_of_sale, *: improve demo data
*: loyalty, pos_loyalty, pos_restaurant, product

Part-of: odoo/odoo#137704
2023-10-10 15:42:52 +00:00
stefanorigano (SRI) 46655303d0 [REF] pos_self_order, pos_self_order_sale: design
Following the merge of mobile and kiosk functionalities [1], this commit
adapt and improve the UI in order to fit both mobile devices and TV
screens.

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

Part-of: odoo/odoo#137704
2023-10-10 15:42:52 +00:00
Thibault Delavallée 2d7af57bd5 [IMP] mail: add 'email_from' failure types log
Purpose of this commit is to try to detect and log 'email_from' invalid
values when sending emails based on outgoing 'mail.mail'. This implies
checking the returned messages when having a generic Exception when sending
the emails, as we distinguish two use cases that raise through a simple
raise: missing from and invalid from.

New failure types 'mail_from_missing' and 'mail_from_invalid' are also
added at 'mail.notification' and 'mailing.trace' level, as other failure
types.

Task-3547653 (Mail: Add error type for wrong email_from)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

closes odoo/odoo#138202

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-10 14:07:16 +00:00
Thibault Delavallée 3ffa1a0611 [IMP] test_mail: various improvements in tests
Extract some test preparation, cleanup and improvements before gradually
adding features that impact tests.

Add tests about 'copy()' behavior in 'mail.alias.mixin' as it will be
impacted by multi-company enabled aliases.

Task-3547653 (Mail: Add error type for wrong email_from)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

Part-of: odoo/odoo#138202
2023-10-10 14:07:16 +00:00
Juan Miguel Sánchez Arce ac187363ea [CLA] add new signatures for camptocamp
Forward-port of 137603

closes odoo/odoo#138199

X-original-commit: 11b0c15021247bae990300db6a7942a05b956eda
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-10 14:07:15 +00:00
Kevin Andrew Kotian c7b865588a [CLA] signature for kevin11andrew
closes odoo/odoo#138190

X-original-commit: 53700ccd81f79fd5155529ad968499dc313e346d
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-10 14:07:13 +00:00
Martin Trigaux 6d872cbc1c [ADD] base: add en_NZ language
To avoid using the default en_US (which has different locale settings)

closes odoo/odoo#137722

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-10 14:07:12 +00:00
Julien (jula) 2a41bfcb4d [FIX] website_sale: shows correct product attribute display_type
__Current behavior before commit:__
When changing the `display_type` of an attribute in the website editor,
the page is reloaded. However the template `website_sale.product` is
contained in a `t-cache` on "pricelist,product". This means that the
template will not be rendered again when the page is reloaded. Thus, the
change will not appear for the user.

__Description of the fix:__
Flush the cache from the `ir.qweb` model when the attribute display type
is edited. This way the template `website_sale.product` will be
refreshed.

__Steps to reproduce the issue on runbot:__
- Go on the website product page of *Customizable Desk*
- Open the website editor
- Click on the Legs attribute values
- Under the **Block** section, change the **Display Type**

The page is reloaded but the display type stays the same

([Video][1])

opw-3495159
opw-3493820

[1]: https://drive.google.com/file/d/142VP4prnHskfa7uFoEkadsoQfQVO-uyW/view

closes odoo/odoo#137498

X-original-commit: cc8664973efd7ea3433b5ec5b741f0882fb17dc0
Signed-off-by: Julien Launois (jula) <jula@odoo.com>
2023-10-10 14:07:11 +00:00
Pierre Pulinckx (pipu) daecbbac50 [REM] web: redundant escapeHTML function
In a6fea37, escapeHTML was introduced to replace the corresponding
underscore.js function. It is very similar to the widely used escape
function, except it additionally escapes single (') and double (")
quotes.

The additional escaping is not generally harmful, and is necessary to
safely inject values into attributes. As escapeHTML is almost unused,
remove it and update escape to include quotes.

taskId : 3522892

closes odoo/odoo#137216

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-10 14:07:09 +00:00
Astik Singh d24bbca51f [FIX] mass_mailing: duplicate the "Send final on" field when copy
Before this commit:
In the `mailings` when we enable the A/B testing and click on the "Create an Alternative" button,
the "Send final on" field doesn't copy to the new mailing.

Reason:
The related field are copy `false` by default.

After this Commit:
Now it will copy the "Send final on" into a new mailing

closes odoo/odoo#138195

Task: 3465887
X-original-commit: 3d6dd2402a65af40c77692250fd710d3355960e7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-10 12:35:08 +00:00
Mahdi Cheikh Rouhou (macr) 2c6671e75e [FIX] sale_stock : Create backorder with inventory admin
Issue:
======
We have a delivery order created by a sale order by another user.
A user with administrator access to inventory and sale : own documents
only ,can't deliver products of
that sale order without backorder , it shows access error.

Steps to reproduce the error:
=============================
- Create another user with admin access for inventory and own documents
  for sale.
- Create a sale order with the current user.
- Change now for the inventory admin and deliver some of the products
  and click on no-backorder.
- Access error will show.

Origin of the issue:
====================
The admin user should be able to deliver the products but when creating
no backorder he needs to write on the sale_order.

Solution:
=========
Added `sudo` to the function that logs in the sale_order.

opw-3380566

closes odoo/odoo#138176

X-original-commit: de2d889b053827e39b11a648797ad2f30e646ce6
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2023-10-10 12:35:07 +00:00
Alexandre Kühn b42bcb25b2 [FIX] mail: style mention without @extend
Follow-up of https://github.com/odoo/odoo/pull/132701

`@extend` was used to reuse classnames intended for styling,
such as `.btn`. However, this has the side-effect to increase
specificity on these classnames, which results in breaking style
on the website where the specificity on `.btn` must not change.

This commit fixes the issue by using a mixin rather than
`@extend`. Since using these mixins are not equivalent, we took
the opportunity to slightly improve the constrast of text color
and background.

closes odoo/odoo#138108

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-10 12:35:05 +00:00
TSO d38fd353f9 [FIX] mail: turn twilio credentials method into a util function
similar to https://github.com/odoo/odoo/pull/87440

closes odoo/odoo#138064

X-original-commit: cd706e662dabe5fb9dfbaaa2fde111865387b504
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2023-10-10 12:35:02 +00:00
Rémy Voet (ryv) 0782ec07e7 [FIX] web: display_name "New" fallback should only target new record.
There is a fallback in the control panel
(https://github.com/odoo/odoo/blob/c22cb6bbadd38ecb050f6d4dc14672868beda20b/addons/web/static/src/search/control_panel/control_panel.xml#L137)
if the display_name of the record is empty.
But it is never actually used because there is another
fallback in the form_controller ("New"). This latter fallback
should only be used for new records, not for existing ones.

closes odoo/odoo#138061

Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-10-10 12:35:01 +00:00
Rémy Voet (ryv) 56bd53d81f [FIX] web: take in account false as a valid display_name
The previous commit reverts the ORM fallback of `display_name`. Then the
`display_name` can legitimately be `False` again. But the `Many2one` and
`Many2XAutocomplete` components don't handle this case (and generate a
traceback see task-3424154).

This commit adds the same fallback ('Unnamed record') for these two
problematic components; one when the name_search returns `False` as
`display_name` (autocomplete for Many2Xfields) and another when we read
the many2one `display_name`. This name is not user friendly, but for
the business model it shouldn't happen anyway. It is also better than
the empty string which is confusing with no value. Note that there is
already a fallback for `display_name` that is used in the broadcrumb
(https://github.com/odoo/odoo/blob/50b2a24f22cb470bcc1a9befe677cf794211d7b2/addons/web/static/src/views/form/form_controller.js#L282).

Part-of: odoo/odoo#138061
2023-10-10 12:35:01 +00:00
Rémy Voet (ryv) b67df70b8a [REV] core: remove ORM display_name fallback
This reverts commit 4573ca0c83eb63785016f4389a5157efb21fa9a4.

Because now, `display_name` is implicitly on every form (last breadcrumb
item). Then it will be queried by `onchange` calls. When we create a
new record, `_rec_name` can be `False` and the display_name will be a
technical one: '<model_name>,<NewId0x...>' which is uglier than the
previous situation showing 'New'.

Part-of: odoo/odoo#138061
2023-10-10 12:35:01 +00:00
William Henrotin b05b4f3f7a [FIX] web: mock barcode service
Some Qunit tests (in stock_barcode module) need to mock the barcode
service in order to be executed correctly.
This commit adds a new helper function that simulate the barcode service bus.

closes odoo/odoo#136236

Related: odoo/enterprise#48054
Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-10-10 12:34:59 +00:00
William Henrotin 2bfe5e9722 [IMP] stock, barcode: search pickings from lot/serial number
Give the ability to filter pickings base on lot/serial number set on
stock move lines.

Part-of: odoo/odoo#136236
2023-10-10 12:34:59 +00:00
Xavier Bol (xbo) 6d195397e4 [IMP] stock,purchase_requisiton: remove some warning messages
This commit removes some warning messages displayed in some wizard and
removes the fields used to display or not those warning
messages.

task-3356114

closes odoo/odoo#124820

Related: odoo/upgrade#4899
Related: odoo/enterprise#42472
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-10 12:34:56 +00:00
Kartik ChavdaandKamlesh Pathekar e3bc974ea4 [IMP] base,** : make error message user friendly
Before this commit error messages in odoo are boring and
not much attractive to user. Those were like odoo is preventing
them from doing something user want to do.

In this commit, we have modified the message to be a more friendly
and humorous tone, making it less tedious and more enjoyable. It
aims to enhance the user experience and ensure that interactions
with any application are both pleasant and informative. As a result,
the messages have been clear, short, easy to understand and informative.

task-3356114

Part-of: odoo/odoo#124820
Co-authored-by: Kamlesh Pathekar <kpt@odoo.com>
2023-10-10 12:34:56 +00:00
Lucas Lefèvre (lul) 1bc0cea716 [FIX] spreadsheet: mark pivot cell faster
In HBA's demo sheet, `markAsValueUsed` goes from more than 2% of the total
loading time to less than 1%

closes odoo/odoo#138166

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-10-10 11:07:59 +00:00
Lucas Lefèvre (lul) 9579799cb7 [FIX] spreadsheet: reuse same error
Instanciating an error is very slow.
In HBA's demo spreadsheet, `_assertDataIsLoaded` takes up to 17% of the total
spreadsheet loading time.
With this commit, it's reduced to less than 2%

Part-of: odoo/odoo#138166
2023-10-10 11:07:59 +00:00
Lucas Lefèvre (lul) 3ef421c1d2 [FIX] spreadsheet: faster compute format
`getReportMeasures` is called repeatedly for every pivot function.
In HBA's demo spreadsheet it takes up to 30% of the loading time.

Part-of: odoo/odoo#138166
2023-10-10 11:07:59 +00:00
Lucas Lefèvre (lul) 568be9e7b8 [FIX] spreadsheet: parse group field faster
On HBA's demo spreadsheet, `parseGroupField` takes more than 3% of the total
loading time.
This commit reduces to less than 1.5%

Part-of: odoo/odoo#138166
2023-10-10 11:07:59 +00:00
John Laterre (jol) d3b7002cee [FIX] account: harmonize analytic search view
With this [commit](https://github.com/odoo/odoo/commit/adb8ec875c9b4e299147c46dc60a87fd26fff91f), we created a new 'Analytic Reporting' menuitem.
But no `search_view_id` was specified, so it was falling back on the one from `hr_timesheet` (when installed), which we don't want.

This commit fixes that by forcing the use of the one defined in `analytic`.

task-3463639

closes odoo/odoo#138165

X-original-commit: ed60f37205acf85c05338b0cd00f4e2f5056de60
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-10-10 11:07:58 +00:00
Aaron Bohy c659d10126 [REF] web,crm: remove tempusdominus scss customization
The tempusdominus library has been removed by [1]. This commit
removes scss customizations of the library that have been forgotten.

[1] 910897fc97

closes odoo/odoo#138129

Related: odoo/enterprise#48657
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-10 11:07:56 +00:00
roen-odoo b5af8312da [FIX] point_of_sale: change check for tips default value
Current behavior:
If you delete the default tip product, then activate tips in the PoS
config you will be blocked by a warning message saying that the tip
product is not set even if you set it. To fix this we only check if the
tip product exist if the tips are activated for the current config.
We also remove the compute on the tip product field so that we can set
any product as a tip product.

Steps to reproduce:
-Delete Tip Product
-Open PoS config
-Activate tips
-Try to save, you will be blocked by a warning message
-If you try to turn off the tips, you will be blocked by the same
 warning message

opw-3519123

closes odoo/odoo#138109

X-original-commit: 715dd599baa4fec124c7ec84fee11df0550251b8
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-10-10 11:07:54 +00:00
Gauthier Wala (gawa) b0f4296bfb [IMP] l10n_pl: merge l10n_pl_jpk into l10n_pl
Merge l10n_pl_jpk as it is a functionality that every user that uses l10n_pl should have.
Especially, since the fields will be necessary for the e-invoicing.
Also merge l10n_pl_delivery_date and delivery_date on account_move.
This means the module l10n_pl_sale_stock is not necessary anymore.

closes odoo/odoo#135595

Related: odoo/enterprise#47445
Related: odoo/upgrade#5152
Signed-off-by: William André (wan) <wan@odoo.com>
2023-10-10 11:07:48 +00:00
Romeo Fragomeli 8699142f65 [IMP] mail: remove legacy code in patch_ui_size
As the comment says:
> This function must be removed when the WOWL env will be available in
> the form_renderer.

This code seems not needed anymore.

closes odoo/odoo#135273

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-10 11:07:47 +00:00
kais-odoo ed268f81f4 [IMP] mail,portal,project: add preview to portal link
Before this commit, when the user shares a portal link, the receiver
has to click on the link to understand what it is about.

This commit uses new key called `preview_object` inside
`portal.frontend_layout` template.
When it is defined, it will add some useful information for the
preview link.
This commit also defines `preview_object` in portal view of project
and task to be able to have the preview link to prevent the user
from having to click on the link to understand what it is about.

task-3186692

closes odoo/odoo#113622

Related: odoo/enterprise#37514
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-10 11:07:44 +00:00
Odoo 7f35c48ef5 [FIX] web_editor: strange padding when background color is reset
Before this commit:

On applying background or on remove background color, strange padding
is added on the text.

After this commit:

Now, padding is not added when background is colored is applied or background
color is removed.

task-3237693

closes odoo/odoo#138143

X-original-commit: 29a40a30f3bf7a4a3a205e54fb84e569691d961f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-10-10 09:42:17 +00:00
Antoine Boonen 01aac8ed9e [IMP] *: EDI format for customer list view improvement
account_edi_ubl_cii, account_peppol

Problem
---------
Currently, the tree view for customers does not include information
about the EDI format. Only a custom `group_by format` is present which
is not user firendly.

Objective
---------
As we have more and more EDI format following each type of customer, we
should add an easy way to manage that directly in the customer list.

Solution
---------
1. Extend the `res_partner` search view to add a group_by option on the
format.
2. Extend the `res_partner` tree view to add a optional hidden column on
the format, and one for the PEPPOL eas, endpoint and endpoint validity.
3. Create a server action that executes
`button_account_peppol_check_partner_endpoint` on the selected records
in the list view.

task-3531419

closes odoo/odoo#137567

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-10-10 09:42:16 +00:00
Tom De Caluwé bf984dde0a [FIX] base: use non-breaking spaces for thousand separators
Avoid line breaks in monetary amounts.

opw-3482329

closes odoo/odoo#137036

X-original-commit: 73bc3e9e7b1c2878a9d65f0b7bef5a5e1da17346
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-10-10 09:42:15 +00:00
tsm-odoo 4716251144 [IMP] bus: better websocket error logging
Before this commit, diagnosing websocket handshake error was
cumbersome since the only information available was the return
code of the initial HTTP request (400).

The HTTP stack does not log `werkzeug.exceptions.HTTPException`
and derivated classes since they are valid responses. This commit
adds a log in order to provide more insight about what went wrong.

closes odoo/odoo#138083

X-original-commit: 50af40302c2849b99e8e501bc170cf887ca8e6fa
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-10 08:19:37 +00:00
Thomas Becquevort (thbe) da89bbe07c [IMP] web: No quick filter available message replacement
Description of the issue/feature this commit addresses:

When opening a view with the quick filters available with a domain which
returns no data, a message shows up saying that no filter is available for
the data that has been retreived and tells the user that updating the filters
will allow him to display more records and maybe make the quick filter
available. This message is displayed in a way which is not so great for user
experience as it is written in a very thin column making the text being
written one word per line. The example used to point out that problem is using
the mexican localization, going in the accounting app, in the tax report
and clicking on any value equals to zero.

Desired behavior after the commit is merged :

This commit replaces that message with a "All" button like it would be if the
domain had returned data and some filters were available. Only this time, no
filter is available under the button as there is still no data to filter.

Adding this fix, there is no messy message showing up in the quick filters
column when the query was not able to rertrieve any data with the given domain.

task-3462024

closes odoo/odoo#138060

X-original-commit: 262b71aad23296f059938496a740ba61e71daea8
Related: odoo/enterprise#48636
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Thomas Becquevort (thbe) <thbe@odoo.com>
2023-10-10 08:19:36 +00:00
Prakash Prajapati 506e779261 [FIX] project: hide empty stages when user perform subtask action
Step:
  - Install project app
  - Activated  Task Dependencies
  - Create project and task
  - Add sub-task
  - Click sub-task action

issue:
    In the commit below we have passed the default_project reference so we get the
   current project stage.
Fix:
   we pass 'subtask_action' context to subtask action and we checked that context
   in _read_group_stage_ids method if subtask_action context is found then we will not
   fetch project's stages.

Side effect of this commit-https://github.com/odoo/odoo/commit/23cf9318084c8a00f37ffcefefa3e056583d2d77

task-3390279

closes odoo/odoo#138024

X-original-commit: 82c29c03cbaa351600b782082554378b4a320b73
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-10 08:19:34 +00:00
David 37eb4cc268 [IMP] pos_self_order, pos_online_payment_self_order: settings behavior
Previously, mobile self-order was not available when restaurant mode was
deactivated.

Now it's possible to activate self-order mode without the restaurant
option activated. Self-order will then be forced to "pickup zone" mode
and pay after "each order".

---

Previously, when the self-order was closed, a popup indicating this
appeared in full screen.

Now, this popup has been replaced by a banner at the top of the screen,
so that the self-order can still be used in read-only mode.

---

Previously, when the kiosk was loaded and there was no product available
in the pos_config, a traceback was raised. Now, when we are in this
case, we display a message indicating to first add products in full
screen.

---

Fixed a traceback when trying to start the POS by clicking on the image
of the landing page. The function start() had been removed. It is now
restored.

closes odoo/odoo#137671

Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2023-10-10 08:19:32 +00:00
Joseph Caburnay bb9677d673 [FIX] pos_self_order: show take away price
Steps to reproduce:

- Activate "Eat in / Take away" (`pos_self_ordering_takeaway`) setting.
- Set the alternative fiscal position.
- ISSUE: When selecting take away in the app, the take away price is not shown.

FIX: The issue is because during the loading of the products, only the default
price is computed. In this PR, we are now computing the take away price as well.
And in the ui, depending on the choice, we are showing the correct price.

closes odoo/odoo#137653

Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
2023-10-10 08:19:30 +00:00
Nasreddin Boulif (bon) e22010ad89 [FIX] website_slides: hide suggested slides page slide when click prev
Step to reproduce:

  - Install `Elearning` module
  - Go to any course and a content as document
  - Upload a pdf with more than 1 page
  - Go to the website and click on the course then on the content with
    the document
  - Go to last page and click on next button (should display suggested
    slides page)
  - Click on previous button

Issue:

  Page displayed is not the last one, but the one before.

Cause:

  When clicking on the previous button, the current page is still the
  last page (just with the suggested slides page on top of it as
  overlay), and therefore will decrease it to the page number before
  last page (nb last page - 1).

Solution:

  When clicking on previous button, if we are on the suggested slides
  page (by checking if overlay is not hidden since no attribute is set
  on `EmbeddedViewer` to know if we are on that page), hide it.

opw-3482712

closes odoo/odoo#137644

X-original-commit: 422625615b2f6708667fa44d2a9e83ad3e66e5af
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-10-10 08:19:29 +00:00
Aaron Bohy b3972b26a1 [REF] web,*: remove legacy service provider
This service was used to redirect legacy service requests to the
wowl service infrastructure. It has been incrementally simplified
with the codebase getting converted. It now only allows to redirect
calls to the effect service, which doesn't seem useful anymore.
This commit thus removes it.

Part of task~3439226

closes odoo/odoo#138120

Related: odoo/enterprise#48654
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-10-10 07:15:47 +00:00
Arnaud Joset 24d63c1474 [REV] base_geolocalize: revert useragent selection
The commit  https://github.com/odoo/odoo/commit/160e8bfbf72a3e5d7cc8d8cbe7bc4f310f298baa introduced a way to update the
useragent used to request openstreetmap nominatim service.

It was introduced as a bad fix to prevent an erroneous blacklist from the
service. Once the blacklist has been removed, this fix was not necessary
anymore. It also allows to abuse the free service which is against the
osmfoundation policy. The best solution would be to decrease the amount of
request. The Google Place Map service is also available to avoid using the
openstreetmap service with large database.

closes odoo/odoo#138078

X-original-commit: 2726d2724e06e5818eaf2d0010971554372c4727
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-10-10 07:15:45 +00:00
Manushi Shah (mash) cc46c13cd3 [FIX] website_forum: fix traceback on searching in help webpage
Steps:
- Open Helpdesk
- Enable the 'forum' feature on a helpdesk team
- Open the help webpage
- Search for something
- Traceback appears

Issue:
- When we search for something, we get a traceback instead of search results.

Cause:
- In the template, we do not get the value of create_uid.id as we are trying to
compute it from post_id.

Fix:
- Instead of computing the value from post_id, we need to compute it from post
hence we will obtain the values by writing post.create_uid.id

closes odoo/odoo#138086

Task: 3461563
X-original-commit: 068d81d4466e2293153f1f7c71e32ee7e3ad33c0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-10 01:59:49 +00:00
Abdelouahab (abla)andJulien Castiaux 5dd1efe3d8 [FIX] auth_oauth: missing user in signin endpoint
Install auth_oauth and via the /web/login, click the "Log in using
Odoo.com" button. You are redirected on odoo.com which ask you for your
odoo.com login and password. When the login form on odoo.com is
submited, you are redirected back on your local database.

The problem is that, in case a new account was created on-the-fly, then
the login fails with a cryptic error. The actual error is that
`request.env.user._is_internal` fails because `user` is an empty
recordset where it should had been the just-authenticated user.

The problem is an inconsistent transaction state between the cursor of
the request, the cursor used with `auth_oauth` (which created a new
user) and the cursor used with `authenticate` (which authenticated the
new user). Yes, there are 3 cursors. The newly created user just isn't
present in the transaction of the request's cursor.

Here is the lifetime of the 3 cursors:

* request.env.cr, it begins when the http request enters Odoo, it is
  commited when a http response exits Odoo.
* /auth_oauth/signin, it begins roughly at the beginning of the
  controller, it is commited once after the user is created (so before
  the authenticate transaction begins but AFTER the request transaction
  begun), it is commited again when the controller exits.
* authenticate, begins when authenticate is called, is commited when it
  returns.

Because the request transaction started before, it cannot access user
created by /auth_oauth/signin.

Because the route is `auth='none'`, if system administrators append the
`auth_oauth` module via `--load` (cli) or `server_wide_modules` (odoorc)
then the controller can be accessed without database. This is the reason
for the explicit registry/cursor/environment inside this controller, we
needed to make sure we are connected to a database, we cannot rely on
request.

The new approach used in this work is to benefit from `ensure_db()`, the
function that is used by various web `auth='none'` controllers such as
/web and /web/login. It makes sure that the database we want to connect
to is already present on the request, otherwise it repeats the request
but this time connecting it to the database. Using this approach we can
have a `auth='none'` controller whose request.env is guaranteed to be
connected on the right database. We can avoid to create explicit new
registry/cursor/environment within the controller and just use request's
ones.

Because the /auth_oauth/signin controller now simply use the request
transaction, the above point:

> Because the request transaction started before, it cannot access user
> created by /auth_oauth/signin.

just doesn't stand anymore as the user is created within the same
transaction. The extra `cr.commit()` must still be present for
`authenticate` to see the newly created user.

opw-3421701

closes odoo/odoo#138051

X-original-commit: e165568f9795af213c8467a7f17948ed781b0799
Signed-off-by: Olivier Dony (odo) <odo@odoo.com>
Co-authored-by: Julien Castiaux <juc@odoo.com>
2023-10-10 01:59:48 +00:00
Mayurrajsinh Rathod 388f66368a [FIX] calendar: modify template for resource appointment
This commit removes the organizer's name in the mail template when booking
an appointment scheduled based on resources.

Task-3458881

closes odoo/odoo#138043

X-original-commit: ca08d996c2ca0f6de6eeddc44609b96f844d8d25
Related: odoo/enterprise#48625
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-10-10 01:59:46 +00:00
alsh-odoo 74801ad8e9 [FIX] hr_work_entry_contract: compute duration without employee
This traceback arises when the user changes the 'end_date' without the employee
value, while creating a new 'Work Entry'.

To reproduce this issue:

1) Install 'hr_work_entry_contract'
2) Open 'payroll' and create a new 'Work Entry'
3) Select 'Work Entry Type' as 'Unpaid' and change the 'To' date

Error:- 'KeyError: False'

On the '_get_duration_batch' method, when the user is not given employee value,
there will be no 'contract_id' as it is getting value from 'employee_id'.

It leads to the above traceback as 'result[work_entry.id]' is getting value
through 'employee.id'.

See:- https://github.com/odoo/odoo/blob/a277faa2ffab7559fcbad95fcc1e8fd6a26d756b/addons/hr_work_entry_contract/models/hr_work_entry.py#L110-L112

Will resolve this issue by calculating duration without employee

sentry-4514970596

closes odoo/odoo#138033

X-original-commit: cc3898ad109e9dfdb220a7245936693197ed79b1
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-10-10 01:59:46 +00:00
shy 5883843d83 [CLA] signature for PallaviSrivastavaa
closes odoo/odoo#138029

X-original-commit: 76302b888035c11aa7f860a15e1007260b52c23f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-10 01:59:45 +00:00
trungtuan88 257ed9040e [CLA] signature for trungtuan88
closes odoo/odoo#138027

X-original-commit: 4d4f11ff32edb7b510824abff0bf8d3ad3446b7b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-10 01:59:44 +00:00
Julien Van Roy 7b1956d19f [IMP] l10n_fr: add a SIRET to demo data
This SIRET is valid according to `stdnum` but does not correspond to any
existing company.

closes odoo/odoo#138008

X-original-commit: 283e12353008812787711a664c3bc700b6f8982d
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
2023-10-10 01:59:43 +00:00
Victor Piryns (pivi) a772936bad [PERF] sale_project: speed up reads on tasks_ids
Issue:
Reading on the field `tasks_ids` of the `sale.order` model in some
context can be slow, leading to really slow creation and duplication
of tasks on a medium sized database.

Analysis:
After creation of a task, when the ORM flushes the model, it
recomputes all the inverse dependencies that needs to be recomputed.
Currently `task_ids` doesn't implement a `search` routine on the
field, so `task_ids` needs to be recomputed for *all* sales orders,
since we don't know which sales order needs computation. So for
*all* sales orders, we trigger the compute `_compute_tasks_ids`,
which is badly implemented using the general performance anti-pattern
```py
for record in records:
    field = self.env['model'].search(domain)
```
which makes 1 query per record that we are computing.

Solution:
Correct the implementation of `_compute_tasks_ids`, which now uses a
`_read_group` instead so we do 1 query for the whole recordset.
And implement the `search` on the non-stored `tasks_ids` field,
which speeds up the context of re-computations. This allows the ORM
to know for which sales order the field `task_ids` needs re-computation.

Results:
In the context a mid-size database (less than 10k records for the
concerned models)

Task creation/duplication:

|             | Before | After |
|-------------|--------|-------|
| Time        | 1 min  | 1 sec |
| Query count | 40k    | 300   |

Reference:
opw-3445565

closes odoo/odoo#138007

X-original-commit: 81ae499ce975a96c12b6e379581ba40167d025db
Related: odoo/enterprise#48610
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-10 01:59:41 +00:00