Commit Graph
162759 Commits
Author SHA1 Message Date
Thanh Dodeur e8a883ff65 [FIX] mail: prevent crash when deleting a message
Since https://github.com/odoo/odoo/pull/126713, deleting a message
would crash as the `mail/message/update_content` route is called without
passing the `partner_ids` parameter.

This commit fixes the issue by making the parameter optional.

closes odoo/odoo#127284

X-original-commit: 34abd3dc1d159962a376b248134d0cd4977f3dcb
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-05 02:47:42 +02:00
Alexandre Kühn 74b9986b30 [FIX] mail: improve horizontal spacing between msg avatar and bubble
Before this commit, horizontal spacing in message between avatar
author and bubble was too big. This makes reading messages slightly
hard, because this small gap gives the impression that the message
and avatar are 2 distinct part of UI.

This commit fixes the issue by reducing the size of message sidebar,
so that avatar and bubble are much closer together.

Also the message avatar was too close to the border of chat windows.
This commit fixes the issue by slightly increasing the horizontal
padding of messages in chat window (`px-1` => `px-2`).

closes odoo/odoo#127341

X-original-commit: 226c6588a89bf21e8c0a47010bffb8c59cbb4e37
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 01:31:05 +02:00
Alexandre Kühn a6ae780078 [FIX] mail: show updated activity date on changing its deadline date
Before this commit, when making an activity set at a specific date,
and then changing its deadline, the activity in chatter still displays
the old date instead of new date.

Steps to reproduce:
- schedule an activity in chatter for today
- edit activity and change deadline for tomorrow
=> Activity in chatter shows "Today" instead of "Tomorrow"

This happens because the compute of date delay in activity component
is made locally and relies on a field in activity model, which itself
is a reactive (because the activities are stored in discuss store,
which itself is reactive). This compute is made at setup and on change
of props. However, when the `deadline_date` in activity model changes
then the model is still the same, therefore it doesn't trigger the
`onWillUpdateProps`.

This would work if this part of template was fully relying on
`deadline_date`. It was the case for the icon, so the icon is working
well. But the label was computed locally, so OWL could not detect that
`state.delay` needs to be recomputed.

This commit fixes the issue by replacing `state.delay` to a getter
that reads on `activity.deadline_date`, so that this is reactive
to changes on `deadline_date`.

Also fixing a memory leak of a `setTimeout` that was not cleared on
unmounting `Activity` component.

closes odoo/odoo#127319

X-original-commit: d7e314dde8d7bb20ed83ba821cdad1009c87e4c8
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 01:31:02 +02:00
Alexandre Kühn 496b74fe1b [FIX] mail: message res url should redirect to model
Before this commit, when opening the related thread of a
message from inbox with "Open Link in New Tab", it was not
redirecting to the thread.

This happens because the url was wrongly using message id rather
than thread id. As a result, it redirects to either bad model or
a non-existing model.

This commit fixes the issue by correctly using `resId` instead of
`id`, which is the thread id of message. Also renaming `url` field
of message to `resUrl`, to clarify this is the link of thread and
not a specific link to message.

closes odoo/odoo#127342

X-original-commit: 8270138aba7e31f5db7853fbf00be6922347a8c0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 00:19:37 +02:00
Alexandre Kühn 3b694fa179 [FIX] mail: message action list next to message in chatter
Before this commit, message action list in chatter were always
at the very right of chatter. On small messages, the gap can
be quite big, so it's not easy to tell which message is
related to the action clicked.

This commit fixes the issue by putting message action list
in chatter close to message content, similarly to how this is done
in Discuss app.

closes odoo/odoo#127334

X-original-commit: 06aa1a89ac23fb5705e6c588ff2c91193922d4ec
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-05 00:19:34 +02:00
Chrysanthe (chgo) 93c76dba6b [FIX] mrp: fix badge color
=== ISSUE ===

If you navigate to Inventory > Manufacturing > Kanban view, there is a
color contrast issue with some badges. The text inside is black
by default but sometimes the color is dark enough to not
meet WCAG contrasts.

=== AFTER ===

We use the `.text-bg-x` class instead, which handle both `color` and
`background-color` at the same time.

task-3397937
part of task-3326263

closes odoo/odoo#127333

X-original-commit: 75c58ef8265013b39a7a9ddd55e764b2b6ff138a
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-04 23:06:39 +02:00
Alexandre Kühn e1b85e79ee [FIX] mail: show tracking value changed messages on different lines
Before this commit, a tracking value message was displayed on a
single line instead of several lines. The parts of the content
of message with tracking values changes were wrapping on multiple
line.

This happens because the content of message had `d-flex`, which
affects notably tracking values that have this DOM shape:
```xml
<div class="o-mail-Message-content d-flex">
    <p>Stage changed</p>
    <ul>
        <li><span/><i/><span/></li>
    </ul>
</div>
```
Because of `d-flex`, `p` and `ul` were next to each other
horizontally, and the `span` in `li` were wrapping to take
responsive layout of `d-flex` into account.

This commit fixes the issue by removing the `d-flex`. This is
undesirable, as the content is HTMl and it should follow the
intended design of the content. `p` and `ul` next to each other,
without specifying custom `display`, should default to 2 `d-block`
next to each other, so they must be on top of each other.

closes odoo/odoo#127320

X-original-commit: c7df8a5fe0c3f785066800e77eef5a46246308dc
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-04 20:33:51 +02:00
Alexandre Kühn 2ac5ceb7ff [FIX] mail: keyboard navigation in chat window dropdown
Before this commit, dropdowns in chat window (chat window more menu,
message actions more menu) had no keyboard navigation support.

This happens because dropdown item navigation makes use of hotkey
service, and hotkey service intercepts keyboard in bubble phase on
window object. `ChatWindow` component had a `t-on-keydown.stop` on its
root node, which prevented the hotkey service to receive keyboard
navigation for the good working of dropdown keyboard navigation.

This commit removes the `.stop` modifier on this `t-on-keydown` root
node of `ChatWindow` template. `onKeydown` in dropdown inside chat
window have precedence over `onKeydown` on chat window: For example,
when dropdown is open, hotkey "Escape" closes the dropdown menu but
does not close the chat window.

closes odoo/odoo#127318

X-original-commit: 4b36b28bd9e426b115ffefbbc174fe2efa3dfbf3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 20:33:48 +02:00
Alexandre Kühn 4376cf80b9 [FIX] mail: rounded (not circle) avatar in activity and msg reaction
Before this commit, avatars in activity menu and in message reaction
menu were rounded circle, instead of rounded square.

All avatars were rounded-circle before MILK redesign in 16.3.
Since MILK in 16.3, almost all of avatars should be shown in a rounded
square. These 2 occurrences were using the old design of avatars.

closes odoo/odoo#127285

X-original-commit: ea83eb15b354470cbc104b4e0325280d5e349657
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 20:33:45 +02:00
Alexandre Kühn 25f0341a2d [FIX] mail: navigable list loading with gap between icon and label
Before this commit, when navigable list is loading data of
suggestions, the showing of "loading..." had label and icon
next to each other without any gap.

This commit adds a small gap between icon and label, so it looks
nicer.

closes odoo/odoo#127304

X-original-commit: 0aaab95cd39c50d9320dbec0417773497ebc0fcc
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 19:17:50 +02:00
Pedram (PEBR) 35d640a2ff [FIX] point_of_sale: prevent additional blank page in print receipt
Before this commit, when a user tried to print a receipt, sometimes
an additional blank page was being printed. This was due to the
printed content slightly exceeding the printable area of the page,
leading to an unintended second page.

To solve this issue, I set the height of all elements to 0 during
printing, and explicitly set the height of the receipt container
to auto.

opw-3376131

closes odoo/odoo#127278

X-original-commit: 81feb39aa937a13b69eeb401215f84a77b57ad08
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-07-04 17:59:51 +02:00
tsm-odoo 1e8a7cc89e [FIX] im_livechat: remove useless breaklines in rating
This PR fixes the display of the rating message for the livechat
sessions. Before, break lines were incorrectly inserted before and
after the reason.

closes odoo/odoo#127267

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-04 17:59:49 +02:00
flvr-odoo 729ec65d36 [FIX] account, hr_expense: removing forgotten 'TODO'
This commit remove the forgotten '#TODO: remove in master' that
were forgotten during the FW-port

closes odoo/odoo#125887

Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-07-04 17:59:42 +02:00
dise 51f8d2a7e8 [FIX] project: fix traceback when opening customer rating view
If a project had a single rating associated to its tasks, opening the
customer rating view would create a traceback. This happened because
both the mail.thread model and the rating.parent.mixin model have a
rating_ids field, and project inherits from both of them (mail.thread
on its own doesn't have it, but the rating mixin adds it).
In the action_view_all_rating method, we try to access the first element of the
rating_ids recordset, if the rating_count field is equal to 1. But since
the rating_ids field belonged to the mail.thread mixin, and not to
the rating.parent.mixin, there could be occurences where rating_count was equal
to 1 while the recordset was actually empty ; accessing the first element of the
recordset would then create a traceback.

To fix this, the rating.parent.mixin model was put before the
mail.thread model in the _inherit list, this way the rating_ids field
from rating.parent.mixin has the priority. A test was also added to check
if the rating_ids is working correctly.

task-3360029

closes odoo/odoo#127243

X-original-commit: 1039c80a8ff5e219e9c2679505015288c8d8dd35
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-04 16:41:08 +02:00
Mahdi Cheikh Rouhou (macr) 328f0ec84c [FIX] web : display currencty in correct place
This fix is a continuation of an old fix https://github.com/odoo/odoo/pull/121689
After fixing the display of numbers to be always on the right , The symbol also should be display the same as in english from ltr.
Also the headers and the footers are not placed well, they should be aligned with the numbers.

Steps to reproduce the issue :
1-install arabic language
2-go to accounting / customer invoices and you can see the placement of the symbol is reversed

opw-3295573

closes odoo/odoo#127231

X-original-commit: 8fcdc24abf4734d020cb41392a2e449a73433d3b
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
2023-07-04 15:18:23 +02:00
amdi-odoo 51fdad6ade [IMP] {hr_recruitment_}survey: improve survey test page
* Remove close button from the edit banner when
testing a survey so that users can't hide it anymore.
* Reduce height of the banner to align with the
website Home/Go-to-backend button.
* Open Test survey in a new tab

Task-3374928

closes odoo/odoo#127219

X-original-commit: e312a956af52fcd0627c8d169fc86bee035e2dea
Related: odoo/enterprise#43590
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Amélie Dieudonné (amdi) <amdi@odoo.com>
2023-07-04 15:18:20 +02:00
clesgow e26e11e59a [FIX] mrp: when changing bom, update MO as in form
Steps to reproduce (Manufacturing app):
- Configuration -> Settings -> Activate `Work Orders` and `By-products`.
- Products -> Bill of Materials
- Create 2 BoM for a single product (e.g. Product A), both with
operations and a byproduct each (e.g. BP A & BP B).
- Operations -> Manufacturing Orders.
- Create a MO for Product A and save it.
- Mo was created using the first BoM and has its operations & byproducts
set in their respective tabs.
- Update the MO from first to second BoM.
Adding another byproduct, deleting it or updating it before saving
won't persist after save (it will revert to what's defined in the BoM)

This is due to `move_finished_ids` holding the values defined in the
BoM in the call to `write()` while `move_byproduct_ids` holds the
correct (current) values. But since `move_byproduct_ids` is only a
subset of `move_finished_ids`, it's not used in the write operation.

Task-3277166

closes odoo/odoo#127143

X-original-commit: 0fb2cd02622c1670ee91df48ff22a320da1b02a0
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2023-07-04 15:18:15 +02:00
clesgow 0b88e0fa1a [FIX] mrp: unlink workorders from old bom when switching mo's bom
Steps to reproduce (Manufacturing app):
- Configuration -> Settings -> Activate `Work Orders`.
- Products -> Bill of Materials
- Create 2 BoM for a single product (e.g. Product A), both with
operations.
- Operations -> Manufacturing Orders.
- Create a MO for Product A and save it.
- MO was created using the first BoM and has its operations set in Work
Orders.
- Update the MO from first to second BoM.
- Components are switched but the new operations are added to the old
ones in Work Orders.

The only way for a workorder to be deleted automatically when updating a
manufacturing order is to change its product. There was no check whether
an operation was related to another bom or not.

As different BoM can have different operations (as well as components),
it makes sense to remove operations related to another BoM when
switching them.

Task-3277166

X-original-commit: 30044e5dc698e3b8822fa7094b34c28c83861d1d
Part-of: odoo/odoo#127143
2023-07-04 15:18:15 +02:00
smna-odoo bff6356585 [FIX] bus: handle traceback while uninstall the module
When user uninstalls the module from one system but in another system same
database was active then error occurs.

Error: A traceback appears: "UndefinedColumn column res_partner.debit_limit does
not exist"

sentry-4057868584

closes odoo/odoo#127230

X-original-commit: ce7c7df7633155bf15d588fadc34901d96f250d5
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-07-04 14:02:30 +02:00
Soukéina Bojabza b2bf8c62a1 [FIX] web_editor: re-allow hiding column count widget if specified class
When the `s_nb_column_fixed` class is present on the row, it should not
be possible to change the number of columns in the "Columns" option (the
option is supposed to be hidden).

However, since commit [1], this behavior is broken. It happened because
the "Columns" option needs to always be displayed in order to display
correctly the "Grid" option and this class was therefore ignored.

This commit restores this class behavior by hiding only the widget
changing the number of columns and not the complete "Columns" option, in
order to still be able to toggle between the grid and the normal modes.

[1]: https://github.com/odoo/odoo/commit/84d684d8bdf43d3db11defd8174dee44775085c2

task-3369847

closes odoo/odoo#127144

X-original-commit: 8148521f052268877f36947e0533843a25d17b83
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-07-04 14:02:25 +02:00
moerradi 838f764ef5 [FIX] l10n_in: Remove unwanted Indian fields from non-Indian companies
This commit removes the E-waybill tab in account.move for non-Indian
running companies. The E-waybill field is specific to Indian regulatory
requirements and is not applicable for companies operating outside of
India. By removing this tab, we provide a cleaner and more focused user
interface for our non-Indian users, enhancing their overall experience

closes odoo/odoo#127138

Task-id: 3208950
X-original-commit: 1a0b304a9ad006b54bec438fdc36319da21e08ec
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Mohamed Erradi (moer) <moer@odoo.com>
2023-07-04 14:02:22 +02:00
Benoit Socias 943944dd24 [IMP] web_editor, website_slides: keep data when adding URL attachments
When a URL is entered to add an attachment through the media dialog
a URL attachment is created. If the source material is removed the
attachment will not be reachable anymore.

This commit fetches the data and adds it as an uploaded file when
adding a URL image in website.
If the image binary cannot be fetched by the client (e.g. CORS), the
old approach is used instead.

This commit also adapts test tours which relied on the image's `src` to
verify if the entered URL had been taken into account by making them
rely on the image's `data-original-src` instead.

task-3129360

closes odoo/odoo#118877

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-07-04 14:02:20 +02:00
David (dafr) 343f6143d7 [FIX] purchase_stock: get_price_unit with manual valuation
layer.account_move_id may not be defined on 'manual' valuation.
Use layer.create_date instead which is equal to layer.account_move_id.date.

# HOW TO REPRODUCE:
- Create a product P, storable in AVCO !! MANUAL !!
- Set 'Control Policy' under Purchase to 'Ordered Quantity'
- Create a PO for 10 units of P with for $1 each.
- Create Vendor Bill -> Confirm
- Receive 5 unit of P: Create backorder
- Validate backorder
==>> Traceback

OPW-3383833

closes odoo/odoo#127218

X-original-commit: b1351ee348207283dcdf7118440b31c03f0d0b4b
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: David Fesquet (dafr) <dafr@odoo.com>
2023-07-04 12:47:12 +02:00
stefanorigano (SRI) b1d75b0134 [FIX] web: adjust formView and alerts spacing
This commit adapts several spacing issues related to the formView and
alerts.

task-3355091
Part of task-332626

closes odoo/odoo#127201

X-original-commit: a137b33dbbf0d18ac6909f958d126c7922d12a61
Related: odoo/enterprise#43579
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-04 12:47:07 +02:00
jadir-bs ab3f1633cd [FIX] account : fixes wrong domain of invoice and bill, uses 'in' operator to match move_type against a tuple instead of '=' operator.
closes odoo/odoo#127105

X-original-commit: 8300c4a59c5654d8fc4e22c5b6848d4dcae04ff2
Signed-off-by: William André (wan) <wan@odoo.com>
2023-07-04 12:46:58 +02:00
jadir-bs ea33e1e9d8 [CLA] : adds CLA
X-original-commit: 700c64b87eab799369756f209c5264224779fb3d
Part-of: odoo/odoo#127105
2023-07-04 12:46:58 +02:00
Damien Bouvy c2d4feeada [IMP] website_hr_recruitment: use a fictitious number
Stop using an actual phone number as demo. 555-01XX number
are considered fictitious by the NA Numbering Plan and
should be favoured instead.

Task-3391390

See https://en.wikipedia.org/wiki/North_American_Numbering_Plan#Fictional_telephone_numbers

closes odoo/odoo#127173

X-original-commit: 3c69077d506727d3fadde57c84d4185986d70a60
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-07-04 11:35:11 +02:00
Kevin Baptiste af9fde8292 [FIX] hr_contract: allow employees to read own contract in unusual days
`_get_unusual_days()` does a search for the employee's own contract,
which was not allowed for "simple" employees, thus they got a traceback
when accessing their Time Off Dashboard.

closes odoo/odoo#126946

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-07-04 11:35:05 +02:00
rhe-odoo 1d706d50b2 [FIX] l10n_fr_pos_cert: do not allow order deletion
In the pos french module, it's not allowed to delete orders.

closes odoo/odoo#126537

X-original-commit: 971460830ac317a6b40f552556c5ed6cc23feb3a
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-07-04 11:35:02 +02:00
Valeriya(vchu) c360a6e047 [IMP] base, payment: prevent changing currencies' rounding precision
- discourage users from changing the currency's rounding precision by
  making it editable only before the currency is saved;
- remove the hard-coded dict of minor units that util functions rely on.

task-3076355

closes odoo/odoo#119308

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-07-04 11:35:00 +02:00
Guillaume (gdi) 65cae53535 [FIX] website: disable products carousel slide in edit mode
We have a public widget that disables automatic slides on carousels when
the user is in edit mode (see `registry.slider`). Unfortunately, since
[this commit], the automatic slide of the carousel in the "Products"
block was not disabled in edit mode. This was because a
`widget_start_request` was made without specifying whether the user is
in edit mode. When it's not specify, we consider that we are not in edit
mode. As a result, the public widget no longer stopped the carousel
because it considered that it was not in edit mode. This commit fixes
this problem by correcting `widget_start_request`.

Steps to reproduce the bug fixed by this commit:
- Have an ecommerce
- Edit a page
- Drop the "Products" block

=> If you wait a few seconds, the carousel moves, even though it
shouldn't as long as you're editing your site.

[this commit]: https://github.com/odoo/odoo/commit/7af099ccf1e5892513c1b0827553fe93614f2f07

task-3356629

closes odoo/odoo#127185

X-original-commit: 4231aca9665829673e29a027469471743dab16c4
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
2023-07-04 10:16:29 +02:00
Aurélien Warnon d353e91c26 [FIX] website_slides: failsafe when sharing content without a template
This commit implements a failsafe when trying to share a slide.slide by email
using the "Share" button in the course view.

Instead of a traceback, the user will now receive a clear error message.

Complementary to odoo/odoo#117952 that only handled sharing courses.

Task-3343052

closes odoo/odoo#127172

X-original-commit: 67a43047a0f81036abeae44c44ab05dd781238bb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-07-04 10:16:23 +02:00
Matheus Leal Viana (malv) f69a6f3749 [FIX] point_of_sale: filter not invoiced orders in pos reporting
Versions:
---------
- 14.0+

Steps to reproduce:
-------------------
1. Go to POS -> Start a new session
2. Sell some orders and make some of them not invoiced and invoice the others
3. Go to POS -> Reporting -> Orders
4. Filter by not invoiced -> the chart becomes empty

Issue:
------
The filter for not invoiced orders in POS reporting is not working properly

Cause:
------
The filter not_invoiced is only filtering the orders with state paid, but it is
ignoring all the orders with state done

Solution:
---------
Add the state ‘done’ in the not_invoiced filter

OPW-3349139

closes odoo/odoo#127155

X-original-commit: 6546597fc63771951b28dd819896ea54de16b9da
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-07-04 10:16:15 +02:00
Mathieu (mano) 0e8e7935aa [FIX] *: onboarding reduce the darkness of the grey
Issue: the onboarding background is too dark and the view could breath
more on large screens

Fix: Use a slight linear gradient to reduce the darkness feeling and
add responsive spacing

task-3378939

part of: task-3326263

closes odoo/odoo#127152

X-original-commit: bcffa4145b9fcc7200784088f858ff4147a00e49
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-04 10:16:13 +02:00
tsm-odoo 00be461524 [IMP] im_livechat: improve operator assignation
This PR improves operator assignation for livechat channels
by first trying to match an operator with the same lang than
the visitor then an operator of the same country.

part of task-3332872

closes odoo/odoo#125911

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-07-04 10:16:07 +02:00
hupo-odoo 51468d3484 [IMP] account: days of sales outstanding per customer
Add a read only field which enables to visualize the DSO ratio (days of sales outstanding) when determining a credit limit for a specific customer on the partner page. This helps the user to know in how many days its customers pay their invoices. In our case, we needed to adapt the computation of the DSO for a single customer. The computation is therefore: DSO = [(Total Receivable/Total Revenue) * number of days since the first account move] for this customer. The amounts used are tax included. If this number is large, it means this customer takes a large number of days to pay the invoices, while a short number means it pays fast.

task : 3196659

closes odoo/odoo#113296

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-07-04 10:16:05 +02:00
Chrysanthe (chgo) 404d8532c4 [FIX] stock: modal buttons spacing
=== BEFORE ===

Buttons inside the modal were missing a gap in-between. There are also
two other buttons on the right side of the modal but these don't need a
gap because they have no background.

=== AFTER ===

We add a combination of `d-flex` and `gap-1` class to space the button
consistently with other modules

task-3389116
part of task-3326263

closes odoo/odoo#127153

X-original-commit: e1a3d599acafe55bd4b432bf9495ebbd4eee33c7
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-04 09:04:52 +02:00
Benoit Socias 2b7cbddd9b [IMP] website: avoid fetching page dependencies with each key press
The `PageDependencies` obtains the page dependencies from the server
during its `onWillStart`. If the parent component state changes before
the component is mounted, Owl destroys and creates a new one.
This is the case if the server response is not obtained before the
value of the URL field is modified again.
Because of this, if the user types quickly in the URL field, an RPC
is sent for each key press.

This commit obtains the dependencies in a `useEffect` that is run only
once (instead of inside the `onWillStart`), and only after the
component is mounted. It stores them in the `state` so that they are
rendered once they are obtained.

Steps to reproduce:
- Open Website > Site > This page > Properties.
- Type quickly in the URL field.

=> One RPC was sent per key press.

task-3169376

closes odoo/odoo#127125

X-original-commit: a65d8811119f4d1a044be3e140fd0c27ad1cf823
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-07-04 09:04:47 +02:00
Mohit Beniwal e7fd1d43ba [FIX] base: prevent json decoder error for default values
JSONDecoderError occurs when users enters invalid JSON format data in
'Default Value' field inside 'User-defined Defaults' and wherever this field is
being accessed to get default value this traceback will be generated.

Steps to reproduce:
1) Install 'Contacts' module.
2) Open 'Settings' > 'Technical' > 'User-defined Defaults'.
3) Click on record 'Language' > 'EDIT' button > in 'Default Value' field enter
   any improper JSON format data (e.g 'Maa' : FI ) .
4) Now, open 'Contacts' module > click on 'CREATE' button and traceback would be
   generated.

By applying this, it will check for proper JSON format.

Sentry-4169062951

closes odoo/odoo#126932

X-original-commit: 71b32d9ea892c8a79c8eac51b9f394c92c44f45d
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-07-04 09:04:44 +02:00
bve-odoo 5a7885dd8d [FIX] base: context propagation make archived mail server usable
In 15.4 (with a226bd983b94a11af9b9785b753634213141127f)
was introduced the from_filter on the system param
and mail servers that would determine which
mail server should be use to send emails out.

In 15.5 (with dbb62515bc1772a79d336e8c2fc0bd1653f1f7ca)
was implemented a fix to prevent the usage of the
archived mail servers.
An email that is going out using an archived outgoing
mail server will be blocked with a specific error msg.

However, when doing specific flows, the context
active_test would be propagate and the function,
doing the search of the mail server to use,
would take into consideration an archived mail server
(the best matching depending on the from_filter param
-- see _find_mail_server fonction).

In order to reproduce this bug, here is one of the way
to do so (on runbot, local needs to add the CLI SMTP
args):
1/ Install sale_management and crm (including contacts).
2/ Add an outgoing email server and archive it.
3/ Go through a contact to an opportunity,
4/ Convert the opportunity to a new quotation,
5/ Send it by email (should be in quotation sent state)

Email will be failed with an error msg
"Connection failed (outgoing mail server problem)".
On the technical > Emails:
The server "<OMS name>" cannot be used because it is archived.

opw-3349593
opw-3341324

closes odoo/odoo#127187

X-original-commit: 716d07b49597ca2583a8e6587f1f530cca5ee8a7
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-07-04 07:55:39 +02:00
Dylan Kiss (dyki) 0d189590cd [FIX] account: keep modified tax amount
Currently when saving a miscellaneous journal entry, we always recompute
the taxes and modify them to be exactly as calculated by us.
However a user could also modify taxes based on a document he got from
a supplier, where the tax might be 1 cent off.

Before this change: On save, we recompute the taxes and override the
user's modification.

After this change: If the user manually modified the taxes, we don't
touch them anymore on save.

task-3262448

closes odoo/odoo#127166

X-original-commit: 8752013127160334c1690518586531fabd6d3f18
Signed-off-by: William André (wan) <wan@odoo.com>
2023-07-04 07:55:36 +02:00
Carsten Wolff (cawo) 0778891cc9 [FIX] account: avoid unneeded updates during chart data reload
During upgrade, l10n migration scripts that call `try_loading()` can cause an
exception _You cannot switch an account to prevent the reconciliation_ in
`_toggle_reconcile_to_false()` of model `account.account`.

This is caused by new chart template data containing a _False_ value for the
_reconcile_ field, while the already existing record has this field set to
_True_. Under this constellation, the code path leads into
`_toggle_reconcile_to_false()`, which checks for partial reconciliation and
throws the exception when the record is under partial reconciliation.
Also, the update of existing account.account data from the default data
triggers a lot of superfluous re-computes.

To avoid both the update of the reconcile field as well as other unnecessary
updates that trigger superfluous re-computes, filter the default data in the
update case to only update `tag_ids`. This is done after the code that fixes
XMLIDs to be sure about whether the record is being updated or created.

closes odoo/odoo#127099

X-original-commit: 2a8100e9ee8d49a957c1aab21a5a533a28dc2060
Signed-off-by: Carsten Wolff (cawo) <cawo@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-07-04 07:55:21 +02:00
flvr-odoo 960eb211f0 [FIX] auth_signup: added a check for internal_user
add a write permission check on internal user to quietly dismiss the
error upon landing on the user page

closes odoo/odoo#127094

X-original-commit: ec85785b4629b474d96d070a5a8b44b9ba5f9dcb
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-07-04 07:55:16 +02:00
Brieuc-brd 33b051ac79 [FIX] web: fixed width for icons in view_button
Since the introduction of Milk design[1], the fixed width for icons has
been removed in `view_button`.
This creates alignment issues when we have several buttons with icons
displayed in a grid or list (eg. status buttons).

This commit fixes this issue.

[1] commit 824024f

task-3387198
Part of task-3326263

closes odoo/odoo#127090

X-original-commit: a801dc6c74031e5593063ccac0245b2fe32c8ef3
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-07-04 07:55:13 +02:00
Lucas Lefèvre e136b43e9b [FIX] spreadsheet: use localized week start
Steps to reproduce:
Go to CRM pivot view, group create_date by week, insert into spreadsheet.
=> week numbers are offset by one (W23 instead of W24)

Since 3a177c448, `read_group` returns week aggregates according to the
user's language first day (e.g Sunday for en_US, Monday for fr_FR).

Before the commit, it was always Monday (ISO week start).
This commit changes the moment formats from "W" (Week of Year (ISO)) to
"w" which is the localized week of year*.

Note there can still be some inconsistencies if the browser language is
different than the user's language. This hasn't changed and is a regular
known issue.

* https://momentjscom.readthedocs.io/en/latest/moment/04-displaying/01-format/

opw-3372581

closes odoo/odoo#127089

X-original-commit: c5738479dc1c1879a9ac0169e1ec87eb5098c525
Related: odoo/enterprise#43516
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-07-04 07:55:08 +02:00
Guillaume (guva) c373be77b6 [FIX] account: date on cash basis move
When having lock date for non advisor
set before all user lock date, reconiling
lines between the two lock dates leads
to a wrong calculation of the cash basis
move, even for user with advisor rights.

Steps:

- With a company having cash basis activated
- Set a period_lock_date to a specific date
- Set a fiscalyear_lock_date one month later
  than period_lock_date
- With user having Advisor rights, create
  an invoice between the two lock dates
- Register a payment in the same period
-> Cash Basis move is created with date == today,
   it should be the date of the payment.

opw-3245409

closes odoo/odoo#127060

X-original-commit: ffb9230afbfb5b0f76148e102463e37a55b42f64
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-07-04 04:54:42 +02:00
Alexandre Kühn 987eeef710 [FIX] mail: debounce suggestion (and channel selector) searches
Before this commit, fetching suggestions (e.g. channel selector
in discuss sidebar "Find or create a channel", or `@`-mentions)
were performing RPCs on each user input, resulting in wasted
network and server load.

This commit fixes the issue by debouncing the fetching of
suggestions to 0.5 sec.

closes odoo/odoo#126952

X-original-commit: 6770ac3
Related: odoo/enterprise#43502
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-04 03:43:48 +02:00
Hugo Carlier (Huca) 9c338783af [FIX] project: avoid invalid subtask when customer is required (FSM)
Steps
=====
- Install module industry_fsm
- Create a task from the kanban view
- In the form view, add a title but no customer
- Open the subtasks tab of the notebook
- Add a subtask and add a title to it
- Save the created parent task
- A pop-up indicate that the customer is missing
- Add a customer and save the task

Issue
=====
A pop-up indicate that the subtasks field is invalid and there is no way
to save the current task with its subtask.

Cause
=====
the module industry_fsm introduces a required=True for the field
"partner_id" when edited from a view in the app Field Service. When a
parent task is created without a "partner_id" id set, it can not be
saved, but subtasks can still be created from it. Those child tasks
should have the "partner_id" set to the same value as the one of their
parent. As it is not set in the parent task, its value will be False for
the child task, and changing it in the parent task (by adding a
customer) will not update the child task. As this field is required when
a task is edited from the app Field Service, the task can not be saved.

Fix
===
A dependency to "parent_id.partner_id" is added to the method
"_compute_partner_id" of model project.task allowing to updating it if
needed when a "partner_id" is set on the parent task.

task-3343423

closes odoo/odoo#127088

X-original-commit: 7f8da6a4148c86b61d994bf692725378f8dafc52
Related: odoo/enterprise#43515
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-04 00:51:56 +02:00
Louis Wicket (wil) ce07b37111 [IMP] mail: make channel_info private
Make `channel_info` private so that it is no longer exposed to RPCs.

closes odoo/odoo#127078

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-07-04 00:51:54 +02:00
Thomas Lefebvre (thle)andFeyensv 0d0546c455 [FIX] website_sale_loyalty: set price_subtotal for reward
Steps to reproduce:
-------------------
- create a product that costs 100 with 10% tax excluded;
- create a discount program to obtain 10% discount on the order;
- configure website to display tax excluded;
- go to ecommerce and create a cart with the product;
- apply the discount program.

Issue:
------
The price shown for the discount is tax included (i.e. 11)
and not tax excluded (i.e. 10).

Cause:
------
Set the field `price_unit` during `new` will trigger
a chain of compute methods that will falsely modify
the value of `price_reduce_taxexcl`
(because will modify `price_subtotal`).

Solution:
---------
Set the value of `price_subtotal`,
to compute the `price_reduce_taxexcl` field.
In this way, `price_reduce_taxexcl` and `price_reduce_taxinc`
can be used if the website displays tax included or not.

opw-3302488

closes odoo/odoo#127072

X-original-commit: dd6c01f07c3bf1caa9545108429bf6537a7fef32
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
Co-authored-by: Feyensv <vfe@odoo.com>
2023-07-04 00:51:51 +02:00