Commit Graph
164380 Commits
Author SHA1 Message Date
Thomas Lefebvre (thle)andFeyensv f2975ccc34 [FIX] sale: prevent the sending of a zero price
Issue:
------
When a cart is created via ecommerce, an email is sent to the salesperson
(defined in Settings/Website/Assignment).
This email contains a subtitle with the amount of the sale order.
This price is always 0.00.

Cause:
------
The email is sent during the creation of the sale order
and not after it has been updated with the product information.

Solution:
---------
Use a key in the context to prevent sending the price of a sale order.

Remark:
The email sent in this case is an assignment email only.
Mentioning the price in this case would not be relevant
if the customer subsequently updates their cart.

opw-3329722

closes odoo/odoo#125378

X-original-commit: ea883e75343e50a1603b37c5f82f8e620418c883
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Co-authored-by: Feyensv <vfe@odoo.com>
2023-06-16 13:41:15 +02:00
Claire Bretton (clbr) 48158ce2d8 [FIX] account: fix account not defined in common tests
Fix a reference to an account that is not defined in
Common tests of accounting.

closes odoo/odoo#125345

X-original-commit: 13c97c3272be237381d1680116424a46e5e7cb03
Related: odoo/enterprise#42677
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2023-06-16 13:41:09 +02:00
Valentin Vallaeys (vava) aac8a14837 [IMP] website_sale_stock: force dependency to stock_delivery
This commit reinforces the dependency tree: as delivery is needed with
website_sale, stock_delivery is expected to be installed when
website_sale_stock is installed. This also prevent the deletion of a
dependency.

closes odoo/odoo#123854

Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-06-16 13:41:04 +02:00
Valentin Vallaeys (vava) 23ab823668 [IMP] stock_delivery: remove dependency to sale_management
The dependency to sale_management is required to handle sale orders. But
sale orders can be handled in the ecommerce backend.
With this commit, installing stock_delivery will install `sale_management`
only if `website_sale` is not installed.

Part-of: odoo/odoo#123854
2023-06-16 13:41:04 +02:00
niyasraphy aa0f3aa8e5 [FIX] l10n_in_{}: add missing dependency for module
* l10n_in_purchase_stock, l10n_in_sale_stock

before this commit, if sale_stock or purchase_stock
module was uninstalled from db manually, exception
will be shown for the users.

* create a db with selecting country as india

for l10n_in_sale_stock:

* install sale and stock module in the db

* sale_stock and l10_in_sale_stock will get installed
in the db

* now uninstall sale_stock module, user will receive
500 internal server error as the l10_in_sale_stock
didn't get uninstalled and depends on warehouse_id
field from sale_stock module

* in l10n_in_sale_stock module, _compute_l10n_in_journal_id function is depending on the field warehouse_id
which is added from the sale_stock module

Exception: ValueError: Wrong @Depends on _compute_l10n_in_journal_id (compute method of field sale.order.l10n_in_journal_id). Dependency field warehouse_id not found in model sale.order.

for l10n_in_purchase_stock:

* in fresh db, install purchase and stock module

* purchase_stock, l10n_in_purchase_stock will get installed
automatically

* now uninstall purchase_stock module and try to open
the purchase order form,user will get exception
* l10_in_purchase_stock module is still installed and
depending on a field picking_type_id from purchase_stock
module

* onchange function l10n_in_onchange_company_id isdepending and using field picking_type_id which is added from
purchase_stock module

Exception:AttributeError: purchase.order object has no attribute picking_type_id

after this commit, on uninstalling sale_stock or
purchase_stock module from the db will uninstall
l10_in_sale_stock, l10_in_purchase_stock
modules respectively.

closes odoo/odoo#123197

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-16 13:41:00 +02:00
Alexandre Kühn 6977b4c84e [FIX] mail: correct push notification content
Before this commit, push notificiation content
was not displayed correct.

When receiving message `&lt;`, it shows `<`.

This commit fixes the issue by not unescaping the content.

closes odoo/odoo#125314

X-original-commit: 4f8ba016e63cb9817d61705ce262d392f7704ef5
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 12:19:06 +02:00
Kartik Chavda d2e5e8b883 [FIX] hr_timesheet: fix visibility of My Timesheet menu for timesheet user
Steps:
- Install timesheet.
- Give user a `user: own timesheets` access.
- Open timesheet app.

Issue:
- `My Timesheet` menu is not visible and `Reporting` is visible
but timesheet user should be able to see `My Timesheet` menu not
`Reporting` menu.

Cause:
- Both `My Timesheet` menus are under that `Timesheets` menu which
has appover group set on it but one of then should be outside of
that menu and missing group on `Reporting` menu.

Fix:
- Move one of `My Timesheet` menu outside to display it for timesheet
user and add approver group on `Reporting` menu.

task-3369534

closes odoo/odoo#125303

X-original-commit: 065227b05a9666798b918fe26ae9c4828ba53a8f
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-16 12:18:55 +02:00
Andrea Grazioso (agr-odoo) f545db48b8 [FIX] point_of_sale: duplicate internal reference in invoice
Have a product with internal reference
Open POS session
Create an order with the product
Invoice

Issue: Internal reference is shown twice on the invoice line

opw-3343170

closes odoo/odoo#125293

X-original-commit: 4fbcbd2bb04b35635db7903648ba7c39c41c2dad
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-06-16 12:18:50 +02:00
Andrea Grazioso (agr-odoo) 1539462a34 [FIX] l10n_eg_edi_eta: rate warning due to float point error
Have an Egyptian company setup
Go to Currencies > USD
Add a new entry with Unit per EGP 0.03232062055591467

Issue: Warning will raise
"Please make sure that the EGP per unit is within 5 decimal accuracy.
Higher decimal accuracy might lead to inconsistency with the ETA
invoicing portal!"

Even if the shown EGP per Unit is 30.940000000000 it is actually
30.940000000000005 and it will fail the equal-to-rounding test

opw-3333395

closes odoo/odoo#125292

X-original-commit: 2867a68534212efd8549764a03c26e86c5109381
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-06-16 12:18:48 +02:00
arsi 90a5d04bf5 [FIX] point_of_sale: add outstanding accounts set in payment methods
For a `pos.payment.method`, it is possible to define an outstanding
account, but if this account is not defined as an outstanding account in
the company settings nor in the journal, the payment will not be
considered in the bank reconciliation, nor in the bank reconciliation
report.

Steps to reproduce (demo-data with POS and Accounting installed):
-go to 'Point of Sale/Configuration/Payment Methods'.
-click on the "Bank" payment method.
-add an 'Outstanding Account' which is not the default outstanding
 account of the company, nor an outstanding account of an
 `account.payment.method.line`.  So for example "Liquidity Transfer".
-then open a POS session, sell smth, pay with the Bank method, validate,
 then close the session.
-If you go to 'Accounting/Customers/Payments', you can see that an
 `account.payment` has been created, with the outstanding account being
 "Liquidity Transfer".
->It is not possible to reconcile that payment with a
 `account.bank.statement.line`. If you go to the accounting dashboard,
 then click the reconcile button of the journal "Bank", then on a
 statement line with no partner, you will not see the outstanding line
 of that payment.
->If you open the 'Reconciliation Report' of the journal "Bank"
 (accessible from the journal dashboard, by clicking the options of the
 journal), the line will not show in the 'Outstanding Receipts'
 category.

FIX:
Override the `_get_journal_inbound_outstanding_payment_accounts`
method of `account.journal`, to add the accounts from each
`pos.payment.method` linked to the journal.  Using the field
`pos_payment_method_ids` from `account.journal`.

opw-3271090

closes odoo/odoo#125238

X-original-commit: c002e6bfbb194b0d609956b36f23a5dbf7acffd4
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Arnaud-Sibille (arsi) <arsi@odoo.com>
2023-06-16 12:18:39 +02:00
Kamlesh Pathekar 3de84e9434 [IMP] project, web: modify calendar filter in project calendar view
In this commit, we renamed the calendar filter in task from
'Undefined' to 'Private' to be consistent with the terminology
used in the other views task.

task-3214107

closes odoo/odoo#115621

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-16 12:18:29 +02:00
Kamlesh Pathekar e72d95589d [IMP] project: hide fields when they don't have values
Purpose of this commit by making the popover look less cluttered by
hiding fields when they don't have any value and moving fields around
in task calendar popover.

task-3214107

Part-of: odoo/odoo#115621
2023-06-16 12:18:29 +02:00
Julien Carion (juca) 4efb32dc23 [FIX] account: fix vendor bills tax discard
This commit fixes the object reference issue which was linked to the
TaxTotals Component computations. The issue was that discarding changes
on the tax field of a vendor bill wouldn't roll back the field's value
visually while the record would still have correctly updated values.
This issue originates from the fact that operations were made to compute
the taxes in the component but these would affect the server data as
well since the object reference between the local data and the server
data was the same. This means that the discard operation would bring
the displayed value back to the server data's one which has been
modified by the computations so it would not work. The reference to the
server data is now separated from the local one so that the bug won't
appear anymore.

opw-3285209

closes odoo/odoo#125304

X-original-commit: 9178c96f5788989c38fbb335ea79fc6ea8698131
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Julien Carion (juca) <juca@odoo.com>
2023-06-16 10:52:51 +02:00
Joseph Caburnay 5da2e0c598 [FIX] web_tour: auto start unconsumed tours when server is no demo
After the refactoring of the web_tour
(https://github.com/odoo/odoo/commit/3a798039d6f200f8e28448ddb6a2d3c46654a203),
the unconsumed tours from server without demo are no longer automatically ran.
This commit restores that behaviour.

closes odoo/odoo#125262

Task-id: 3369617
X-original-commit: 95a7deb85fe36f258f071ca1d63d536640c12629
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-06-16 10:52:48 +02:00
Joseph Caburnay 47cea17703 [FIX] web_tour: do not reposition pointer if the anchor didn't move
Before this fix, the tour pointer is always repositioned and the animation is
behaving very poorly. Like it's suffering from epilepsy. This is because
`reposition` method relies on dom mutation to calculate the correct position
which is detected by the tour runner and the tour runner thinks that it needs to
check the current step which eventually calls the `reposition` method again,
being stuck in a loop.

In this commit, we introduce and additional check before calling `reposition`.
If the last x and y of the anchor (current step's element) changed by less than
a pixel, we consider it as static, and we don't call the `reposition` function.

Task-id: 3369617
X-original-commit: cf42ed86220a397f24fca497bf5a77e2b72ba4e2
Part-of: odoo/odoo#125262
2023-06-16 10:52:48 +02:00
abd-msyukyu-odoo 6958f719e8 [FIX] web_editor: loop non-editable in getNormalizedCursorPosition
There were two issues with the `getNormalizedCursorPosition`:

1. If the selection was in a non-editable element, the function called
`rightPos` only once, without ensuring that the new position was editable.
  -> The current implementation fixes that by making it loop while in a
  non-editable element, and also allows the normalized position to use `leftPos`
  if the offset of a position is 0.

2. When searching for the deepest leaf to the right, the `DOMPathGenerator` was
allowed to traverse non-editable elements, which is not correct since the result
should always be editable for a normalized position.
  -> This is fixed, and the name of the `DOMPathGenerator` utils is updated for
  clarity.

task-3280704

closes odoo/odoo#125204

X-original-commit: 3d44028a7722f61900b8669489ff929244b1a4b8
Related: odoo/enterprise#42615
Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
2023-06-16 09:34:55 +02:00
abd-msyukyu-odoo 9d2e33b3c6 [FIX] web_editor: allow fixes to protected non-editable selections
The previous iteration (394e4fe) prevented the editor to fix selections in
`contenteditable="false"` elements if they had a `data-oe-protected="true"`
parent. This caused undesirable side-effects such as being able to click in an
embedded view in Knowledge, then type `Backspace` and remove view elements.

The solution implemented in this commit allows the editor to fix such a
selection, only if it is not currently targetting a `<input>` or `<textarea>`
tag, as they are supposedly the only `isContentEditable === false` elements that
are editable by a user in an Odoo view.

task-3280704

X-original-commit: 98767b805fe26883cf851bac4f8d5382a3303eb4
Part-of: odoo/odoo#125204
2023-06-16 09:34:55 +02:00
abd-msyukyu-odoo 1ef69821e6 [FIX] web_editor: refine table selection exclusion for protected elements
Prevent custom editor selection of protected tables. The previous iteration
(394e4fe) did not take into account non-collapsed selections.

This iteration does not handle `data-oe-protected="true"` on `table` elements
below the `<table>` tag (i.e. `<tbody>, <tr>, <td>`...), because there is no
need for that currently and it would add further complexity to the code.

task-3280704

X-original-commit: 885d52c9b814d908438e8e424d17c4e4b6e9e731
Part-of: odoo/odoo#125204
2023-06-16 09:34:54 +02:00
abd-msyukyu-odoo c2683a7263 [FIX] web_editor: prevent edition of non editable content in selections
Some commands of the editor are able to modify non editable nodes in the editor,
notably those that use the `formatSelection` util. This commit intent is to
prevent such commands to have an effect on `contenteditable="false"` nodes.
Here is the list of impacted methods:
- setTag
- switchDirection
- unlink
- indentList
- toggleList
- applyColor
- every function using `formatSelection`:
  - bold
  - italic
  - underline
  - strikeThrough
  - setFontSize

In knowledge, `Behaviors` are OWL components that are used in the editor, and
they all have `contenteditable="false"` parts that are managed by OWL. Those
functions could modify those managed nodes and make OWL crash.

task-3280704

X-original-commit: 6d90274e0a21848d704cfd86d7a1d0c5860a9b18
Part-of: odoo/odoo#125204
2023-06-16 09:34:54 +02:00
vlst de25b48f95 [IMP] point_of_sale: Align dashboard buttons
When a `pos` is configured as `self order`, the dashboard buttons become misaligned.
This PR brings back the buttons into alignment.

Task 3357989

closes odoo/odoo#124255

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-06-16 09:34:50 +02:00
vlst 55c8840a44 [IMP] pos_restaurant: Enable Floor Plans Link
The link to the `Floor Plans` configuration is only visible in debug mode.
This makes for a bad user experience.
This PR makes it so the link is always visible to `pos users`, regardless of whether
or not the user is in debug mode.

Task: 3357989
Part-of: odoo/odoo#124255
2023-06-16 09:34:49 +02:00
niyasraphy 08f196cf8c [IMP] website_forum: add karma_user_bio field to view
before this commit, karma_user_bio was not added in the
forum forum view and the default value set for the field
was 750, this field decide whether the pop over has to
show or not when user places the mouse hover the author
box in the frontend forum post.

after this commit, as the field is added to the view
end user will be able to adjust the value as per the
need.

closes odoo/odoo#123638

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-16 09:34:46 +02:00
Stanislas Gueniffey be60a04aee [FIX] mass_mailing: no hover effect on buttons
Most e-mail clients do not support CSS rules for hover effects.
Previously, the mass_mailing application allowed to add buttons with
such effects. This was confusing to some and introduced discrepancies
between the editor preview and the actual e-mails.

This commit removes such hover effects from buttons in the context of
mass mailing.

Task-2936682

closes odoo/odoo#125298

X-original-commit: 55aff2dcdf5537e16bdaf01ee68d776510572171
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-06-16 07:54:51 +02:00
Jorge Pinna Puissant e2d28e269d [REF] web: translation button always save
- Be sure to have two languages installed;
- Open a record with translations (product, for instance);
- Modify the field with translation, from "apple" to "peach";
- Open the translation.
- Modify the English term, from "peach" to "apricot";
- Save;

Before this commit, the field on the record still shows "peach", you
need to revert the changes to came back to "apricot" (the last modified
term). This occurs because the record is not yet saved, but the
translation is. This can create confusing behaviors.

Note also, that there is a different behavior when clicking on a
translation button between new record and existing records. The first
one will ask to save the record before doing the translation,
contrariwise, the last one will let you modify the translation without
saving.

In this commit, to avoid all confusion, and to be coherent between new
record and existing record, and to be also coherent with the always save
policy. We will save the record automatically before opening the
translation dialog.

part-of task-id 3179751

closes odoo/odoo#125149

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-06-16 07:54:48 +02:00
Mohit Beniwal 57a89dd601 [FIX] website_sale: require a cart before submitting extra info
When user tries to enter extra info from Configure Form from 'settings' so
'website.sale_get_order' method does not get any order.

Steps to reproduce:
1) Install website_sale module.
2) Click on settings > activate 'Extra Step During Checkout' > click on 'Save'
   button.
3) Now in 'settings', click on 'Configure Form' under
  'Extra Step During Checkout'.
4) Now, click on 'Discard' button on top right of screen.
5) Enter something in textbox 'Give us your feedback' > click on 'Next' button
   and traceback will be generated in backend.

Error: ValueError: Expected singleton: sale.order() traceback will be generated
because in method '_message_log' it is expecting a record.

Sentry-4126876202

closes odoo/odoo#125259

X-original-commit: 43506c5934e50bc1b132a135466b405f1d1ebb20
Signed-off-by: Mohit Beniwal (mobe) <mobe@odoo.com>
2023-06-16 06:42:56 +02:00
Maryam Kia 651476db87 [FIX] mail: no insert message when delete attachment from composer
Before this commit, when deleting an attachment from composer,
an undefined message was inserted in the store.

closes odoo/odoo#125313

X-original-commit: ec814f14222509caa27d627a193e6eaebe9bbf60
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 01:40:35 +02:00
Alexandre Kühn 9b55c4565b [FIX] mail: linkify message content
closes odoo/odoo#125307

X-original-commit: 406ff4727e361588bded08c6719f932a8b800b35
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 01:40:32 +02:00
Aman Patel e0de62b5a3 [FIX] mail: message notification double escape issue
Before this commit:
In discuss when a user receives a message containing strings from any of
these '>,<,&' it gets converted to `>,<,&`  respectively.
For example, if a user sends '<abc>' , when the chat is out of focus,
the toaster  notification will show a notification with an escaped message
i.e.`<abc>`.

After this commit:
The message will be shown as it is, in the toaster notification.

Task-3284244

closes odoo/odoo#125306

X-original-commit: bbc9966198eb644c220d98452e0ef53c8424f5ea
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 01:40:30 +02:00
Alexandre Kühn 8a885bb5ba [FIX] mail: play sound effect from new message with push notif
When odoo tab is out-of-focus and user receives a new message,
it should play a sound effect. This works when showing notification
in Odoo, but when push notifications were enabled it did not play
the audio.

This commit fixes the issue by playing audio when receiving push
notification of new message while out-of-focusing the tab.

closes odoo/odoo#125305

X-original-commit: b0b4f300705595df31588e747e1b12ad99f6d8d0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 01:40:27 +02:00
Laurent Smet 6af55b6afb [FIX] account_peppol: commit after updating the move
When using the Send & Print wizard in invoice_single, the error is raised if any
making all changes rollbacked including the update of the 'peppol_move_state'.

closes odoo/odoo#125302

X-original-commit: ec1209c2853ead82bcf27728612d1a7efc6dc97a
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-16 01:40:25 +02:00
Laurent Smet 3ee1ef2fb5 [FIX] account: Buttons display relying on PDF instead of is_move_sent
- Create an invoice
- Sent it using the Send & Print wizard
- Remove the PDF manually
=> The Send & Print button is still secondary instead of primary

X-original-commit: ef9e266c86cbc4abc24e2a6f597a2014e6e3439a
Part-of: odoo/odoo#125302
2023-06-16 01:40:25 +02:00
Laurent Smet 6dd54ebb79 [FIX] account: Create new attachments for mail message in send & print
When creating the attachments for the mail.message, copy the attachments
instead of linking the existing ones.
That way, even if the user deletes the PDF or another business documents,
the history remains the same and can be retrieved easily.

X-original-commit: 7434cbe47ec58695a2dde40bcf4bd3bdaf6f1964
Part-of: odoo/odoo#125302
2023-06-16 01:40:24 +02:00
Valentin Vallaeys (vava) fdf864021c [FIX] payment: fallback on transaction partner parent name
In a Sale Order, it is possible to select an invoice address without a
name. The partner of the transaction does not have a name, which leads
to a traceback when trying to split the name.

The idea is to force the name to be filled, with a fallback on the
partner' parent name.

OPW-3338406

closes odoo/odoo#125282

X-original-commit: 505109d4111208aaf934a31373e9abec2bb38ad7
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-06-16 01:40:18 +02:00
Andrea Grazioso (agr-odoo) 669ee5be2f [FIX] account_edi: missing edi xml attachment
With an mx company setup
Create Invoice
Validate CFDI
Click "Send & Print"

Issue: xml not in attachments

In e9e90811aeee46989a83b21f9b59071a9c7bc362 the name of method responsible
for loading attachment was changed from
`_get_default_mail_attachments_data`
to
`_get_default_email_attachment_data`
But the account_edi override wasn't changed so no xml was attached

opw-3370272

closes odoo/odoo#125275

X-original-commit: 0bf8296d74002ab691b809c484d38c3ead2c090b
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-06-16 01:40:15 +02:00
Alexandre Kühn e82a35b588 [FIX] mail: thread content with few content should be at bottom
closes odoo/odoo#125163

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-16 01:40:10 +02:00
yhu-odoo 9955064415 [FIX] purchase_stock: valuation layer wrong when different currency
To reproduce:
1. Create a storable product with ordered quantities policy for purchase and with a category set as FIFO automated
2. Create a purchase order in a different currency and set quantities for partial deliveries
3. Create a partial delivery
4. Fully invoice the purchase order
5. Create the delivery of the complementary units
6. Check the stock valuation layer
The valuation of backorder is wrong.

The value on valuation layer is in company's currency, while the value
on invoice line is in the PO's currency. When create valuation line for
backorder, we didn't convert them to same currency.

opw-3300266

closes odoo/odoo#125206

X-original-commit: c2de679fcba7f153201dde5b3aa989eb3f329910
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2023-06-15 19:59:18 +02:00
Julien Castiaux 7d1959febc [FIX] core: reset current_thread.dbname/uid between requests
In [HTTPocalypse] the `odoo/service/wsgi_server.py` file has been
removed and its features has been spread to other files. One of the
feature was reseting those few thread-local variables[^1] before
processing any new request:

    if hasattr(threading.current_thread(), 'uid'):
        del threading.current_thread().uid
    if hasattr(threading.current_thread(), 'dbname'):
        del threading.current_thread().dbname
    if hasattr(threading.current_thread(), 'url'):
        del threading.current_thread().url

In [HTTPocalypse] the `url`[^2] is correctly set at its definitive value
at the beginning of the request so there is no need to delete it before
processing.

On the other hand, `dbname`[^3][^4] and `uid`[^5] are only set when the
request is processed by `_serve_db`, i.e. that the user is connected to
a database already. Those values weren't reset at the begining of the
next request so in case that next request was processed by `_serve_nodb`
or `_serve_static`, the dbname and uid of the previous request would
still be present.

This commit restores both `del uid` and `del dbname` at the beginning of
the http stack, before the request is processed.

[HTTPocalypse]: odoo/odoo#78857
[^1]: https://github.com/odoo/odoo/blob/a1361d6629a829fd622f2a1a1b3e5b025050eaf9/odoo/service/wsgi_server.py#L80-L85
[^2]: https://github.com/odoo/odoo/blob/0e629cd2a1fc3623b579a38ae534fbdfae9b38a3/odoo/http.py#L1987
[^3]: https://github.com/odoo/odoo/blob/0e629cd2a1fc3623b579a38ae534fbdfae9b38a3/odoo/http.py#L1563
[^4]: https://github.com/odoo/odoo/blob/0e629cd2a1fc3623b579a38ae534fbdfae9b38a3/odoo/modules/registry.py#L70
[^5]: https://github.com/odoo/odoo/blob/0e629cd2a1fc3623b579a38ae534fbdfae9b38a3/odoo/http.py#L1582

closes odoo/odoo#125205

X-original-commit: c327c4586243430751100c8980169ae067383b1c
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-06-15 19:59:13 +02:00
Xavier ALT a2d74e14a6 [FIX] website_hr_recruitment: fix filters links after choosing "Other" department
Fix wrongly generated link when "Other" department filter is active
(introduced by odoo/odoo@54f246f9c)

To reproduce (on runbot):
- Log-in as 'admin'
- Go to the website /jobs page
- Edit page and enable both 'Country' and 'Department' search filters
  then save changes
- Choose "Others" in the departments filter
- Choose any country in the countries filter

=> traceback with:
`ValueError: invalid literal for int() with base 10: '233is_other_department=1'`

closes odoo/odoo#125203

X-original-commit: 12085c9b653412b976279495804f672f3307764b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-06-15 19:59:10 +02:00
Julien Castiaux 3160c376bc [IMP] core: --db_maxconn_gevent
The Gevent worker has specifc needs in term of maximum concurrent
connections to the database and those needs are not compatible with the
default limit that is primerly set for http workers.

This PR makes it possible to supply a configuration dedicated to the
gevent worker.

task-id-3193565
task-id-2146565

closes odoo/odoo#125190

Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-06-15 19:59:08 +02:00
Jurgen (jugj) 62827e29f5 [IMP] web : Display the full text when hovering the search panel
Following an FP-Request, this PR aims to ease the life of the user
by indicating the full name of the elements that are truncated due
to their length as a tooltip.
task-3332648

closes odoo/odoo#125186

X-original-commit: 8512402d803e788347aa5f7012c4380c3dd34fae
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-15 19:59:05 +02:00
Merel Geens (mege) 0e2bacfd51 [FIX] stock_account: don't create 0 amount COGS lines
After creating a sales order for a product with cost 0, automatic
inventory valuation and AVCO, and validating the delivery, no account
move is created for the stock move. If an invoice is then created from
the sales order, it will create 0 amount COGS lines. Automatic
reconciliation of the invoice with the corresponding stock account move
will fail because no such entry exists, resulting in unreconciled lines
remaining in the invoices.

This issue can be prevented by either creating a 0 amount journal entry
for the stock move, or preventing the creation of the 0 amount COGS
lines on the invoice. Not creating unnecessary COGS lines is preferable
and this was also the solution used for the same problem with purchase
order invoices: https://github.com/odoo/odoo/pull/106785 .

So this fix does the same for sales order invoices.

opw-3000320

closes odoo/odoo#125185

X-original-commit: 999451e6ea0b2b1591a3644725b5313c6e062b39
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Merel Geens <mege@odoo.com>
2023-06-15 19:59:03 +02:00
Robin Lejeune (role) 6e60016037 [FIX] web_editor: adapt options' icons in RTL
The triangle pointing towards an option in the editor is pointing
right and the symbol └ is used to show a sub option in the editor panel.
In a RTL setting, this does not make sense and should be mirrored.

task-3284274

closes odoo/odoo#125153

X-original-commit: a66ff40b28717617e28387b22bdfe9e468242907
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-06-15 19:58:56 +02:00
arsi 9f5578289a [FIX] account: compute bills to pay sum based on amount_residual_signed
In case the journal currency is set on the company currency, we should
compute the 'Bills to Pay' sum on amount_residual_signed as it is
the residual amount in the company currency.
In the current state, you can have differences between the sum in the
dashboard and the sum showed in the list view from the 'Bills To Pay'
button.

Steps to reproduce (clean db with accounting):
-Set a foreign currency with 2 different rates (significant if you want
 to see the issue clearly).
-Create an invoice in a sale/purchase journal which has no currency set
 (like Vendor Bills), with the foreign currency and with an invoice_date
  corresponding to one of the rate.
-Register a payment for that invoice, with a date corresponding to the
 other rate and having an amount lower (like half) than the invoice, so
 the invoice is partially reconciled.
-> Go to the accounting dashboard, the amount next to 'Bills to Pay' is
different than the amount (the sum of the column 'Amount Due') in the
list view generated after clicking that button.

These two values should be the same.  They are currently different
because the dashboard takes the amount_residual, which is expressed in
the invoice currency, and apply the exchange rate to get the residual in
the journal currency.
But if the target currency is the company currency, the field
amount_residual_signed is already the residual amount in the company
currency. Unfortunately, in case of partial reconciliation, it is not
always equal to amount_residual expressed in the company currency
anymore. Because amount_residual and amount_residual_signed are
substracted by the payment amount, expressed in each currency, using the
payment date exchange rate.

opw-3184567

closes odoo/odoo#125150

X-original-commit: d71d8e90667ccc9c5428cc15b927747b4b3556cd
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Arnaud-Sibille (arsi) <arsi@odoo.com>
2023-06-15 19:58:53 +02:00
Pierre Rousseau 2fa42767c7 [IMP] web, point_of_sale: add reactive helpers
This commit adds a new module in web that contains a few helpers to
make it easier to use reactive in Odoo.

closes odoo/odoo#125136

Related: odoo/enterprise#42588
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-15 18:52:00 +02:00
Alexandre Kühn 5276ed23e6 [FIX] mail: show typing in chat window
closes odoo/odoo#125135

X-original-commit: c9a94488381abef016a28a4bda0b23423e8217ee
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-15 18:51:55 +02:00
qsm-odoo c8016d8c80 [FIX] web_editor: properly allow to reset bg/fg text colors
Steps to reproduce:
- Go on a backend HTML field (project task description for instance)
- Write and select some text
- Open the text background color colorpicker
- Hit the "reset" button (the trash icon)
=> The text becomes black (or white in dark mode)

This was because of [1] which indirectly removed the CSS variables
`--black` and `--white`, on which the colorpalette relies.

Note: the test update made by the original commit was lost in the
forward-port because [2] removed the test. It will be restored at some
point thanks to task-3177674.

[1]: https://github.com/odoo/odoo/commit/28444a5792b9929f5250e38f3f864694e22e9370
[2]: https://github.com/odoo/odoo/commit/49297bc7bba75541ca139e6c84e0d3b311765145

closes odoo/odoo#125131

X-original-commit: 907c5b6cc24e0b86c219cda1299a87b7901f4e76
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-06-15 18:51:52 +02:00
qsm-odoo 81b3a37dbf [FIX] web_editor, *: fix wrong color retrieval in website color palettes
*: website

Commit [1] (and [2]) from the "website in backend" refactoring adapted
the colorpalette to read color information on the right document (as
the right document could now be the one of an iframe which is inside the
editor environment). Unfortunately, it did not do that correctly, making
an inconsistent API relying on the fact the colorpalette should receive
an "editable" param... while a jQuery version "$editable" param of the
same thing already existed. Doing so, it forgot to give that important
"editable" param in two cases:
- For editor toolbar colorpickers (text foreground/background edition)
- For colorpickers inside another UserValueWidget (like we-multi).

This commit solves the inconsistency by removing the need of that
"editable" params and relying on the previously existing "$editable". In
the future, this should be refactored anyway.

Steps to see the issue (A):
- Enter edit mode of one of your website page
- Select some text
- Hit the "reset" (trash button) of the text background colorpicker
=> The text becomes black for no apparent reason.

Steps to see the issue (B):
- Enter edit mode of one of your website page
- Choose a new main color for your website via the theme tab
- Select some text
- Open the colorpicker for the foreground color
- Go to the solid tab and input explicitly the main color of the website
=> The color is hardcoded on the selected text instead of using the
   text-o-color-1 class.
=> A test has been added to check this usecase. Making a test for (A)
   is less robust as it also requires the backend color names not being
   the same as the frontend ones to have the bug (otherwise it works by
   chance)... and that will be solved by the next commit of this PR
   (another test will be added by that commit too) **.

Note:
- After this commit, following (A), a bug remains: the text receives a
  strange padding (as a "inherit" background is actually applied).
  Another PR will be made to solve that (see task for more info).
- ** After this commit, (A) done in backend HTML fields instead of a
  website page leads to the same bug still. This is because of another
  problem that the following commit of this PR will solve.

[1]: https://github.com/odoo/odoo/commit/212a8bfdd21269b18054200b9e2585e1c95540d6
[2]: https://github.com/odoo/odoo/commit/03c552690b15cbf2e7d6b7812386ac64042219af

task-3237693

X-original-commit: a30206606423af9e6c8e0313c74fd6200247437e
Part-of: odoo/odoo#125131
2023-06-15 18:51:52 +02:00
Alexandre Kühn af21d99a36 [FIX] mail: pass props to thread actions
Since [1] thread actions are stored in a specific registry.
Some of those actions require props to be passed to their
component.

Those props are not correctly passed as the `componentProps`
key is in fact a function that returns the props but is
treated as the props themselves.

This commit fixes this issue by transforming `componentProps`
into a getter, so that `action` is internally passed to
`componentProps` definition. The templates using thread
actions can still use `t-props="componentProps"` as getter,
as the active action is deduced by transform automatically.

[1]: odoo#123454

closes odoo/odoo#125120

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-15 18:51:48 +02:00
Kishan Gajjar 91ba1c211a [FIX] website: properly toggle hoverable dropdown
Steps to reproduce the bug (in 16.0):
- Create a hoverable mega menu
- Drop inline Search snippet inside the menu
- Search for something.
- Hover on the search result and move the cursor outside of the search result.
=> Result Error.

Since [1], is having a fix to the overflows of the page. In that fix
we are triggering hide(), and show() events on a 'dropdown-toggle' element
without checking whether the element is exist in the target or not.
this commit will make sure that element should be present in the target
before triggering the event.

[1]: odoo@5846a05

closes odoo/odoo#125083

Closes: odoo#118803
X-original-commit: 4fba98dbe9a82cf0fec9080bea147f5d4d088b53
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-06-15 18:51:46 +02:00
Alexandre Kühn 57a6a995c9 [FIX] mail: correct seen indicator alignment in squashed message
Before this commit, the seen indicator in squashed messages was
not centered. This is especially noticeable in comparison to
shorten date when hovering on this squashed message in chat window.

This commit centers the sidebar in squashed messages.

closes odoo/odoo#125082

X-original-commit: 1c342c1c5c14add563bba07fe5e5b6e6fbe9fdb3
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-15 18:51:43 +02:00