Commit Graph
165814 Commits
Author SHA1 Message Date
Géry Debongnie 601eb8f144 [REF] web: remove use of internal variable
In a previous commit, we temporarily used the `__OWL__DEVTOOLS__`
global variable to access the list of all apps. This was obviously not
something that we want to do, so we introduced a proper hook in Owl.

This commit changes the code to use the static apps object from the App
class.

closes odoo/odoo#137661

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-06 02:17:40 +00:00
Bruno Boi 5557853f4b [FIX] web: keep the searchbar dropdown in place
**Before this commit**
Open the SearchBarMenu dropdown, then add
numerous filters or groupbys.
When doing so the search bar may grow or shrink,
leading to the dropdown being repositioned while
you interact with it.
This gets really annoying when you are using your
mouse.

**After this commit**
The dropdown will stay in place while your
pointer is inside and get repositioned as
soon as your pointer leaves the dropdown.

**Implementation Notes**
- The usePosition hook now returns an object with functions
  that allow to lock/unlock the positioning updates.
- The "fixedPosition" usePosition's option has become
  obsolete with this new mechanism and has thus been replaced.

closes odoo/odoo#137449

X-original-commit: 3e883a2a1af07875efd7dea8de39cf9914d2a0de
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-10-06 00:55:54 +00:00
Bruno Boi 0c0a0d02a4 [FIX] web_tour: hide on tour pointer scroll
**Before**
When the scroller tour pointer is clicked,
it scrolls fine but if the mouse cursor is left
inside the pointer element, its position is
not updated until you leave it.

**After**
When the scroller tour pointer is clicked,
it directly goes away as soon as the scroll starts.

X-original-commit: 6d0d085a158777076bb58821b2fc83d020fe9b53
Part-of: odoo/odoo#137449
2023-10-06 00:55:54 +00:00
Lopes Marc (loma) 936f0d7914 [IMP] survey: improve results page
Purpose
=======

Improve the overall look of the page for screen and print media.
Display/hide questions, and alternate between pagination and full
display of user responses.

Specifications
==============

= HEADER AND OVERVIEW =

- remove waste space between Edit Survey button and survey title
- remove trophy cup or any icon on the right of the title
- put filters on the right of the title
- remove background
- replace the `Results overview pie chart` by the survey KPI's
- add a print button

= QUESTIONS =

- add a button for each question to toggle their visibility
- avoid breaking question into multiple lines, use all space available
- change info badges design so they are not mistaken for buttons
- remove question type from the info badges

= USER RESPONSES =

- add a `show all` button per question to display all responses,
whitout pager and scrollbar.
- for each response, push the filter icon to right side of the row
- use regular font and color for responses, remove response text from
the anchor tag

= PRINT MODE =

- hide the `webeditor/ back to backend` button
- visible questions: display all responses (no pagination or scrollbar)
- user responses: hide filter icons
- make sure elements like tables are properly cut between pages
- resize graphs to ensure they fit into A4 paper page

task-3424235

closes odoo/odoo#135683

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-05 18:35:30 +00:00
Zelong Lin 69fe16d42d [IMP] mail: make mentions in chatter full composer
Before this commit, it was not possible to send messages in
full composer containing user mentions. Even whe the mentions were
added in the small composer and then continuing composing the message
in the full composer.

With this commit, we can now make user and channel mentions in the
full composer, by typing `@` and `#` like in the small composer of
Discuss.

When composing a message in small composer and then switching to full
composer, the mentions are preserved.

task-3470060

closes odoo/odoo#132701

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-05 16:49:04 +00:00
Odoo's Mergebot f0b7838f95 [MOV] event_barcode: merge into event
This PR moves event_barcode module from enterprise to community. It is
now integrated directly with the base 'event' module. Using it is optional
and activated directly from settings, instead of having to install a
new module.

This PR also allows organizers to use QR codes without needing a barcode.

Some improvements are made in registration flow, notably improving barcode
display and usage in checkout process and outgoing emails.

Task-3411827 (Move event barcode to community)
Task-3470321 (Improve registration flow)

closes odoo/odoo#135153

Related: odoo/enterprise#45598
Related: odoo/upgrade#5183
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-05 16:49:01 +00:00
dane@odoo.com a98717b0e5 [IMP] event: refactor barcode
Commit is responsible for refactoring
code related to barcode.

Part-of: odoo/odoo#135153
2023-10-05 16:49:01 +00:00
dane@odoo.com a653d22aeb [IMP] event: hide barcode
When barcode/QR code isn't available '123456789' placeholder
is inserted which might be misleading. The change makes sure
to show barcode/QR code only when they are available.

task-3411827

Part-of: odoo/odoo#135153
2023-10-05 16:49:01 +00:00
dane@odoo.com 9476597594 [IMP] event: Event registration config
Add QR code on top left corner of the confirmation mail.
It also modifies confirmation page
by showing phone number of organizer and contact mail.

Part-of: odoo/odoo#135153
2023-10-05 16:49:01 +00:00
dane@odoo.com 0e9a9aff46 [MOV] event_barcode: integrate into community event module
event_barcode is moved to community and integrated directly into
event module

task-3411827

Part-of: odoo/odoo#135153
2023-10-05 16:49:01 +00:00
Pierre Pulinckx (pipu) 99730d7ae4 [FIX] web: fix color property in calendar status
Problem : From the sales order, if we go to the calendar view, it shows
status like "sales order", "quotation",... when we check the style in
the console, span style has nonsensical values for
background-color and border-color.
Ex : style="background-color:state; border-color:state;"

Correction : The styles are already applied by
t-att-class="getFilterColor(filter)"
used on the div.o_calendar_filter_item.
Then the utilisation of t-att-style is no more useful.

taskId : 3512867

closes odoo/odoo#137656

Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-10-05 15:36:27 +00:00
Touati Djamel (otd) 6af53f5f48 [FIX] purchase_requisition: convert purchase price to current currency
Bug introduced in:
https://github.com/odoo/odoo/pull/128327/commits/8f96e08985ebac3309745f1036a5e83d287e6382

Steps to reproduce the bug:
- Activate 2 currencies (assume EUR and USD, conversion
   rate: 0.65 EUR = 1 USD)
- Create new product “P1”:
    - Purchase tab:
        - add two vendors:
- Vendor_USD, currency = USD, price = 100
- Vendor_EUR, currency = EUR, price = 80
 - Create PO:
    - vendor = vendor_EUR
    - Currency = Eur
    - Add P1, Unit price should be 80

- Alternative tab > Create alternative > Vendor = Vendor_EUR
- Compare product lines Issue: The line with price = 100 USD is
 highlighted as being the cheapest option, but if we apply conversion
 rules, 80 EUR = 123,07 USD > 100 USD.

Solution:
Before selecting the cheapest line, we convert the prices of the
purchase order lines that are in a currency other than the current
currency of the company.

opw-3378253

closes odoo/odoo#137642

X-original-commit: c45272828ee85bc23dd97dc93dc741f8f59a5305
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-10-05 15:36:26 +00:00
Gabriel de Paula Felix (gdpf) a0d4c62108 [FIX] google_calendar: do not spam while updating recurrent events
Before this task, lots of mails were sent after updating or deleting recurrent event in 'All events' or 'This and future events' update type. This was happening because updating these recurrent events was triggering patch calls event by event, when they should be handled in batch.

After this commit, updating or deleting recurrent events should trigger at most two mails for Google users.

closes odoo/odoo#137607

Task-id: 3163695
X-original-commit: ad2106babda61446bce13283d570dc723418b630
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Gabriel de Paula Felix (gdpf) <gdpf@odoo.com>
2023-10-05 15:36:25 +00:00
Julien Alardot (jual) 11a0f8fab7 [FIX] hr_expense: Fix currency_rate handling
The desired flow of currency rate in expense is as followed:
- (default) Use Odoo currency rate
- Allow the user to set a custom rate (to include fees) when changing
  the total amount in company currency
- Revert to the default behaviour when the currency is changed
  or the amount in foreign currency is changed

This aims to fix how currency rate is computed and overridden
- Reorganize all currency rate computation, so it doesn't revert to Odoo rate
  at every compute call
- Deals with a bug where a "total_amount_currency", when changed
  just before calling "action_submit_expenses" would not trigger
  the computation of unit_amount
- Force save when changing currency on expense form view to prevent a bug
  where the first modification of "total_amount_company" would be canceled
  (due to the new behaviour of currency rate computation)
- Removes unit_amount_display from views as it should be removed
  in later versions and is deprecated since 16.0

task-3476569

closes odoo/odoo#137598

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-05 15:36:24 +00:00
Julien Alardot (jual) 471d8301b5 [IMP] project_sale_expense: change bad tests flows
Previous test flow:
 - Re-invoice a multi-currency expense with a product having a cost
   with a "unit_amount" override

Expected test flow:
  - Re-invoice a multi-currency expense with a product having no cost
    and a "total_amount" override

In the past it was feasible (but wrong) in the back-end to set a product
with price in a multi-currency expense.
Setting an expense amount through the unit_amount is also not reflecting
the actual flow

task-3476569

Part-of: odoo/odoo#137598
2023-10-05 15:36:24 +00:00
Brieuc-brd cfd1eb439d [FIX] web_editor: display read-only handles
Prior to this commit, read-only handles were hidden, which created a
layout issue (eg. the header was no longer highlighted when we clicked
on it).

This commit adapts read-only handles to make them visible by using a
border around the selected element.
It also adapts the common borders of all handles to place it
inside the element to avoid being partially hidden when the element is
on the edge of the container (eg. the header or the footer).

task-3537616

closes odoo/odoo#137569

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-10-05 15:36:23 +00:00
Brieuc-brdandqsm-odoo c16428cf39 [FIX] web_editor, website: adapt dropzone transparency
Since the introduction of the new dropzone design at [1], the dropzones
were not transparent enough anymore and the inline content behind them
was not readable.

This commit adapts the layout of dropzones to make the content behind
them more readable.

[1]: https://github.com/odoo/odoo/commit/8ca644252e2d3a1f836735454c1f936529a7914e

task-3537616

Part-of: odoo/odoo#137569
Co-authored-by: qsm-odoo <qsm@odoo.com>
2023-10-05 15:36:22 +00:00
Romain Derie 58607d1cf7 [REV] pos_self_order, product, website_sale: add product info popup
This reverts commit 3b9401c354.

It shouldn't have been merged in the first place. The PR was `r-` but it
seems like the mergebot bugged and still merged it because there was an
occurence of `r+` in the sentence which asked robodoo to `r-`.

> robodoo r- just to be sure, since there was a random r+ not [...]

Rationale of the revert:
- Bad field name:
  - "ecommerce" in product module
  - "ecommerce" but used in POS
- Arguably very low value to share the field -> This field is used in
  ecommerce to add info exactly between the price and the name of a
  product. There is low chance that you want to share that exact
  information with the POS.
- Technically, it couldn't work. What you design in website builder on
  the product page is related to website assets JS and CSS, which are
  not loaded neither in the backend and neither in the POS.
  It was leading to multiple critical issues, mainly:
  - Losing the whole style of the content (CSS)
  - Breaking completly the snippets (visually and design wise) (CSS/JS)
  - Not even show (JS is in charge of showing the content eg)

Note that the same issues were already existing in that field in the
backend (it's shown in the product form view). The ecommerce team was
looking for a solution to make it work, but it's impossible as to work,
it would need the website / frontend assets, which can't be loaded in
the backend / POS.

The cancel of this PR was validated with PO of POS and ecommerce
following those explanation, which they weren't aware of.

Apart from this revert, further PR will be done to:
1. Remove the field from the product form view (ecommerce app)
2. Create a new field for POS

Revert of https://github.com/odoo/odoo/pull/136906

task-3524272

closes odoo/odoo#137514

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-05 15:36:21 +00:00
Michael (mcm) 89693faebb [FIX] web: fix http.post array params
Since [1] an error was thrown when giving multiple files to http.post.
This commit reverts changes in the function but the function now also
allows to give a FormData instead of pojo.

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

closes odoo/odoo#137421

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-05 15:36:19 +00:00
Didier (did) e3d68312fa [IMP] mail: improve escape key usage in discuss app
This PR introduce multiple usage of the escape key:

- Channel selector can now be closed using the escape key
- Using the escape key will focus the composer automatically

Task-3456518

closes odoo/odoo#135031

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-05 13:37:50 +00:00
rupa-odoo a1949ca541 [IMP] hr_holidays: improve reports ux
Before this commit if we go to the Time off and go to reporting in that select
the to employee  there are graph , calendar, pivot views and there are two
default filter active employee , Employee > Type .

And After that when we go to  to type there are list, pivot view  and by default
there are 4 filter to the list view of the to type and in list view there is
button.

Improvements :

To Employee :
Add the List view and make it default.
And make Current year by  default.

To Type :
Add the graph view and make it default.
Made changes in the filter add Time off, Allocations in that filter.
Remove that button and use action method to the record.

task-3389174

closes odoo/odoo#127034

Related: odoo/upgrade#4907
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-10-05 11:42:43 +00:00
tsm-odoo ae6f6e3e5b [IMP] im_livechat: improve livechat statistics
task-3471332

closes odoo/odoo#137548

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-10-05 10:21:56 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Lucas Lefèvre (lul) b86ab422a1 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/c46de914 [REL] 16.5.0-alpha.9
https://github.com/odoo/o-spreadsheet/commit/1438e657 [FIX] side panels: fix link button style Task: /
https://github.com/odoo/o-spreadsheet/commit/f66c9ab4 [FIX] components: fix some button styles Task: /
https://github.com/odoo/o-spreadsheet/commit/62718580 [IMP] CF: reorder preview list with drag and drop Task: 3504521
https://github.com/odoo/o-spreadsheet/commit/d214df23 [REF] CF: split side panel into multiple components Task: 3504521
https://github.com/odoo/o-spreadsheet/commit/f954de50 [IMP] PieChart: percentage visualization for tooltip
https://github.com/odoo/o-spreadsheet/commit/6bc519e0 [IMP] SidePanel: remove unused css rule
https://github.com/odoo/o-spreadsheet/commit/6b9927b6 [MOV] side panel: rename `SidePanelErrors` to `ValidationMessages`
https://github.com/odoo/o-spreadsheet/commit/adcda849 [IMP] grid: add specific # of rows at the end of sheet
https://github.com/odoo/o-spreadsheet/commit/c8289169 [FIX] sheetview: performance issue for too many rows/cols Task: /
https://github.com/odoo/o-spreadsheet/commit/36d3a47e [IMP] spreadsheet: Add Data Validation feature Task: 3422042
https://github.com/odoo/o-spreadsheet/commit/d701460b [REF] filter: create GridCellIcon component Task: 3422042
https://github.com/odoo/o-spreadsheet/commit/953ad1d2 [MOV] error_tooltip: add dedicated test file Task: 3422042
https://github.com/odoo/o-spreadsheet/commit/d61cbee2 [IMP] edition: add CANCEL_EDITION command Task: 3422042
https://github.com/odoo/o-spreadsheet/commit/aad55661 [FIX] Find & Replace: Clear search debounce at unmount Task: /
https://github.com/odoo/o-spreadsheet/commit/f91bf8b6 [IMP] SelectionInput: remove useless ternary expression Task: /
https://github.com/odoo/o-spreadsheet/commit/a5be6827 [IMP] SelectionInput: add missing release on selectionProcessor Task: /
https://github.com/odoo/o-spreadsheet/commit/f94eed58 [FIX] filters: hide sort buttons in readonly mode Task: 3475613
https://github.com/odoo/o-spreadsheet/commit/02436b16 [FIX] locale: string dates in CF aren't (un)localized Task: 3481670
https://github.com/odoo/o-spreadsheet/commit/f7b9b9a5 [FIX] clipboard: cut/paste filter table in another sheet Task: 3498592
https://github.com/odoo/o-spreadsheet/commit/0c8782bd [IMP] EventStream: Observers register only once Task: 3142006
https://github.com/odoo/o-spreadsheet/commit/e008fe2b [FIX] test: undeterministic test in spreadsheet.test.ts
https://github.com/odoo/o-spreadsheet/commit/f2cd5abf [REV] find & replace: shorten the debounce on find search Task: 3510813
https://github.com/odoo/o-spreadsheet/commit/549142d4 [FIX] Find&Replace: purge duplicated handler Task: /

closes odoo/odoo#137440

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-10-05 08:08:59 +00:00
Damien Bouvy ae62a08cbc [IMP] web: fetch raw data for record in debug
This commit introduces a new debug menu item in form view that allows to
read all the raw fields data of the current record in JSON format.

task-3509462

closes odoo/odoo#137260

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-05 08:08:58 +00:00
Joren Van Onder 9444a3e0c4 [FIX] account: auto-install account_avatax in Canada not Brazil
Small issue in 7032917771. account_avatax supports the US and
Canada. l10n_br_avatax supports Brazil.

closes odoo/odoo#136893

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-10-05 08:08:57 +00:00
Sanket Brahmbhatt d615c5bfaa [FIX] base_import: prevent trackback while upload unidentified image URL
This issue occurs when a customer imports or uploads a file, and that file
 contains an image that is attached to the URL as text or HTML. then,
 The error would be generated.

  Step to Produce:-
 - import CSV file (Ex.'product.product' model)
    > that CSV file must have one URL Image(In that URL has content of text or
      Html form)
 - Click On the 'Test' Button.

  Applying these changes will resolve this issue.

  sentry:-4046190590

closes odoo/odoo#137611

X-original-commit: acbb5af7ee96cdc579850427bc2bca6d7bf184e4
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2023-10-05 05:16:52 +00:00
Walid 3f8a891eac [FIX] l10n_it_stock_ddt: report language
Steps to reproduce:
- Set up an Italian language company with Italian localisation.
- Set up an English language customer.
- Set up an Italian language supplier.
- Set up a product with dropshipping options.
- Set up a sales order for the product to be dropshipped direct
 from the Italian supplier to the English customer.
- Print the DDT report.

Bug:
The report will be printed in Italian.

Fix:
same as delivery slip reuse _get_report_lang

opw-3526633

closes odoo/odoo#137638

X-original-commit: 10283d926f8e4d542ca0ae8b0d25710e650c9574
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-10-04 20:52:49 +00:00
clesgow f2f8ff6c99 [FIX] mrp: fold the MO after a replenishment
Steps to reproduce:
- Create a two-layers Bill of Material (BoM and child BoM).
- Create a Manufacturing Order with the top-level BoM and open the
Overview.
- Click 'Unfold', then hit the 'Replenish' button on the component.
- Select 'Manufacture' as preferred route and confirm.

Issue:
The newly created Manufacturing Order is correctly added in the report
but already unfolded, which can greatly change the visibility of the
report if it has lots of components.
This is due to an `undefined` value in the ComponentsBlock fold indexes
as they were not updated after the new props update.

closes odoo/odoo#137613

X-original-commit: 9dc2425dc69c1797cb85ecd794019ea44c541334
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2023-10-04 20:52:48 +00:00
Claire Bretton (clbr) 3a18482f63 [FIX] account: is_being_sent banner is displayed on error
When sending a single invoice, if an error was raised in the middle of the
process we wrongly displayed the banner "This invoice is being sent
in the background".

task-id:3515915

closes odoo/odoo#137571

X-original-commit: 844f9b672b91c50affd783253b2b8ee4b816cef7
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2023-10-04 20:52:45 +00:00
Arnold Moyaux b761a873f0 [FIX] stock: align widget inline for availability
On stock.move, the icon next to the reservation to open the forecast view is
not align with the text.

closes odoo/odoo#137560

Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2023-10-04 20:52:44 +00:00
Saurabh Choraria 2cf99aa452 [FIX] web: groupby date for pivot view
When user tries to apply any Group By as date or datetime in the pivot
view and the column value of pivot view is also a date or dateime, the
traceback will be generated.

To reproduce the issue:
- Install Point of Sale
- Go to 'Reporting' and click on 'Orders'
- Select pivot view
- Go to Group By and select 'Order Date' same as column value
- Issue can be produce in the same way in other modules, such as - 'sale',
'sale_subscription', 'crm', 'planning', 'hr_expense' etc.

Error: TypeError: can only concatenate str (not "relativedelta") to str

The issue is occurring because we are getting duplicate values in
groupby like ['date:month', 'date:month'] while calling orm method over here -
https://github.com/odoo/odoo/blob/6cf3b617d8082df5820283d07e6623b7684cefdd/addons/web/static/src/core/orm_service.js#L143

To solve this issue groupby has been passed into a Set so that no
duplicate values occurs in groupby.

sentry-4262719543

closes odoo/odoo#137550

X-original-commit: de8e6a901b780d8c10484edae5ec1fe6b9fc7d3c
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-10-04 20:52:42 +00:00
Alexandre Kühn 6ffea84866 [FIX] mail: make call invitation work from recent discuss model REF
Discuss model data that had commands have been simplified by [1].
Notably some `unlink` were replaced by `False` and or `DELETE`.

Some code in Discuss calls was still expecting receiving command data
in of `DELETE` while data received has become `false`. As a result,
the state of ringing threads and showing call invitation card was not
working.

This commit fixes the issue by relying on recent improvements that
commands can be passed immediately as data to relational fields [2].

Code in Discuss call still have some coupling between fields whenever
some records are either added to or removed from a field. Hooks
`onAdd` and `onDelete` on relational fields are added to support
these cases.

[1]: https://github.com/odoo/odoo/pull/136308
[2]: https://github.com/odoo/odoo/pull/137341

closes odoo/odoo#137540

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-04 20:52:41 +00:00
tsm-odoo 3abc5100ad [FIX] im_livechat: clean session even when leave rpc fails
Before this PR, if an error occurred when leaving the session,
the state of the livechat was not properly reset. This is an
issue since this could lead to a visitor being stuck with an
outdated session. This commit ensures the session state is reset
even if an error occurs during the session leave rpc.

This PR also fixes an issue where two `init_messaging` rpc were
sent when restoring a live chat session.

closes odoo/odoo#137518

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-04 20:52:40 +00:00
Mathieu Walravens c46ed8af92 [FIX] stock_account: correct accounts for dropship return
Before this commit:
When returning a dropshipping, the valuation layers created do not have
the correct accounts on it:
 - Valuation -> Input   for the first SVL
 - Output -> Valuation  for the second SVL

After this commit:
For a dropshipped move, valuation layers have the following chain
of accounts:
 - Input -> Valuation   for the first SVL
 - Valuation -> Output  for the second SVL
Therefore, the return should have it reversed:
 - Output -> Valuation  for the first SVL
 - Valuation -> Input   for the second SVL

Steps to reproduce:
1. Create a dropship product with automated inventory valuation
2. Create a Sales Order, go on the PO and confirm it
3. Set quantities and validate dropshipping
4. Return delivered product (dropship return)

opw-3391174

closes odoo/odoo#137497

X-original-commit: 3e2421982c229af44aa0f46dfd91bcff3fd729a0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walravens Mathieu (wama) <wama@odoo.com>
2023-10-04 19:40:26 +00:00
kva 490915effe [FIX] crm: fixing the domain to have last 12 month's data
- Before fix:
  only select activities done today or in the future so
  it does not reflect the expected behavior of the filter.

- After fix:
  have an expected data with suitable filter name

- OPW: 3504670

closes odoo/odoo#137468

X-original-commit: acb27f6cd225571ae919c5a50a6bba504cd75589
Signed-off-by: Jérémy Hennecart (jeh) <jeh@odoo.com>
2023-10-04 19:40:25 +00:00
William Henrotin b9955b5088 [FIX] stock: prevent creating negative move line
Choosing a negative quant to create a new move line in the detailled
operation should not take the negative quantity.
This commit set 0 instead.

closes odoo/odoo#137407

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-04 19:40:23 +00:00
Benjamin Vray c6ec2c5e04 [FIX] web_editor, website: fix colorpicker issues related to color names
This commit fixes two bugs with the colorpicker that occur since [1].

Steps to reproduce the 3rd bug:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Change the color of the header by picking a color in the "Background"
sub option (below the "Header Position" selector).
- Save and Edit.
- Go with your mouse over the different colors of the colorpicker (at
least 2).
- Bug: an infinite loader appears on the iframe and prevents from
editing the background color.

Steps to reproduce the color combinations bug:
- Go to Website edit mode.
- Drop a Call to action snippet.
- Change the background color and try to select another preset.
- Bug: the color of the text and buttons is updated, but not the
background color.

Both of these 2 bugs happen after commit [1] because the colorpicker
widget is started before the ColorPalette component is attached to the
DOM (which only happens once the user opens the picker). However, the
colorNames are only set after the setup() of the ColorPalette.
Initializing the colorNames with possible default values is thus
necessary to avoid bugs on `_computeWidgetState()`.

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

task-3440939

closes odoo/odoo#137306

X-original-commit: https://github.com/odoo/odoo/commit/2ccc01175080ddb549660713d6101dd936e0d304
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-10-04 19:40:20 +00:00
Benjamin Vray 15bfd72116 [FIX] web_editor: fix color suggestions for the transparent header
Steps to reproduce:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Open the colorpicker (below the "Header Position" selector).
- Bug: we shouldn't be able to choose anything other than a gray.

This bug occurs since [1] because, before the conversion to owl, the
colorpicker widget was added conditionally in JavaScript (so the widget
was not included if the option "custom" color was excluded). However, in
the current version, the color picker is inside the
'web_editor.ColorPalette' XML without any condition to display it or
not.

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

task-3440939

X-original-commit: https://github.com/odoo/odoo/commit/7919e243427899ca7c09666fbdf8453bc2defa1d
Part-of: odoo/odoo#137306
2023-10-04 19:40:20 +00:00
Alexandre Kühn b1edee9a84 [REF] mail: simplify discuss model insert code
1. simplify message reaction formatter (personas)

Data was formatted to have "partners" and "guests" entries, both
of which contribute to personas.

To avoid some post-processing of data in JS, it's best to format
data to immediately include type of persona.

2. include "guestAuthor" in "author" data of message

Discuss models in JS group partners and guests into a single model
Persona, to make feature works regardless on whether user is
authenticated or not.

This commit simplifies code by removing data guestAuthor in message
formatted data, and instead author contains author data in all cases,
whether the author is a partner or guest.

3. simplify insert (remove id, redundant with preinsert)

Also rename Follower.isActive to Follower.is_active, for
even simpler Follower.insert()

closes odoo/odoo#137276

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-04 19:40:19 +00:00
Andrzej(pian) 878f1198c3 [FIX] account : Deprecated accounts shall not appear in suggestions
[Genesis]
while forward-porting tests for an issue (not present in the master
anymore), found changes causing the following error:
    ValueError: not enough values to unpack (expected 4, got 3)
in line:
    kind, rhs_table, condition, condition_params = query._joins['account_move_line__account_id']

Follow orginal PR (#135884) to learn more.

[Problem]
To reproduce:
- run odoo master with module: account_accountant
- go to: invoicing app -> Vendors -> Bills -> New
- pick a vendor -> add a line -> click on dropdown in the Account column
- upload and observe an ERROR

[Solution]
- Since query._join will always return 3-element tuple, I'm removing additional variable "condition_params"
- query._joins can't be filled with Strings, it needs SQL instances; replacing strings with odoo.tools.sql.SQL objects
- forwarding tests checking for deprecated accounts

[Testing]
Created test in test_account_account:
It runs function with modified sql query twice:
- with certain account not deprecated -> extected that this account appears in the results
- with the same account deprecated    -> extected that this account won't appears in the results

opw-3485768

closes odoo/odoo#137110

X-original-commit: da9583be8c1fb3cd4d4dfcf6932d4e8debcc0b42
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
Signed-off-by: Andrzej Pietrusiak (pian) <pian@odoo.com>
2023-10-04 19:40:18 +00:00
vlst db565a3d8d [REF] point_of_sale: remove identifyError
After the the POS refactoring, there are no more errors
of type `legacy`, so the function `identifyError`, whose objective
was to identify the `legacy` errrors, is now completely useless.
We thus remove it.

closes odoo/odoo#136833

Task: 3524670
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
2023-10-04 19:40:17 +00:00
Michael (mcm) 2fbc08a197 [IMP] *: remove legacy service mappers
This commit removes the legacy service mappers which are useless now.

closes odoo/odoo#136807

Task: 3439226
Related: odoo/enterprise#48015
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-04 19:40:16 +00:00
Didier (did) f29a09d7d3 [IMP] mail: send channel update to the client
Before this PR, channel update were not sent via bus notifications.

Part of task-2821415

closes odoo/odoo#136623

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-04 19:40:14 +00:00
Miquel Raïch 2129dcb288 [IMP] stock_delivery: don't require partner_id if not integration_level == 'rate_and_ship'
The requirement of partner_id was put long ago because send_to_shipper() method requires it. But if you look into the python code, you see in _send_confirmation_email() method that the requirement to enter into send_to_shipper() is `integration_level == 'rate_and_ship'` instead of `delivery_type not in ['fixed', 'base_on_rule']`. It means that, with this change, if we have a `delivery_type not in ['fixed', 'base_on_rule']`, we should be able to validate the picking without partner if we have `integration_level == 'rate'`.

closes odoo/odoo#136149

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-10-04 19:40:13 +00:00
Mathias Mathy (MAMA) a57b3e9872 [IMP] repair: inventory kanban view repair improvements
1. Add Confirmed and Under Repair section to repair kanban cards.
2. Modify default filters for repair orders.
3. Modify the repair's location_id field's name
4. Following recent changes on stock.picking.type, adapt return option
   creation on repair operation type defined as return.
5. Only return transfers are proposed on the repair orders.
6. Filter product_id selection based on set picking_id and vice-versa

Task : 3369400
Upgrade : odoo/upgrade#5108

closes odoo/odoo#133932

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-10-04 19:40:09 +00:00
Louis (loco) 94b55d913b [FIX] web_editor, *: store the correct mimetype of an image with a shape
*: tools

Steps to reproduce the bug:
- Add an image on the website.
- Replace it by a "jpeg". Note that the mimetype of the image is
"image/webp" at the upload since [1].
- Add a shape on the image.
- Save and Edit.

-> If you check on the available "Format", the mimetype of the
"original" is "webp" but it should be "jpeg".

Before this commit, there were two types of mimetype data attribute:
- `mimetype`: the current mimetype of the image.
- `originalMimetype`: the mimetype of the image without a shape.
Before [1], it was also the mimetype of the original image. However,
since [1], the user has the possibility to change the mimetype of the
image so the "originalMimetype" attribute does not always refer to the
mimetype of the original image anymore.

To resolve the problem, another data attribute has to be introduced.
Here is a summary of the mimetype related attribute:
- `mimetype`: the current mimetype of an image.
- `originalMimetype`: the mimetype of the image before a shape has
been applied. It is needed when removing a shape to recover the correct
mimetype.
- `mimetypeBeforeConversion`: the mimetype of the original image. It is
needed in order to be able to change the format of an image and come
back to the original one.

In the case of an uploaded "jpeg" image on which a shape has been
applied, `mimetypeBeforeConversion` is "image/jpeg", `originalMimetype`
is "image/webp" (since [1]) and `mimetype` is "image/svg+xml".

The `loadImageInfo()` has been adapted to also handle the case of an
image that has already been loaded but that does not have the
`mimetypeBeforeConversion` attribute (for example all the images that
were uploaded on the website before this commit). In this case, the
mimetype attribute is kept and not set to the original one as the user
could have changed it.

[1]: https://github.com/odoo/odoo/commit/0449fe85cb0e1d639a4e1aeba26e90906f79254d

task-3449866

closes odoo/odoo#137424

X-original-commit: 730588b802506844e6ca54df312333bfd8df1d52
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-10-04 18:27:03 +00:00
Joseph Caburnay 8be280c572 [FIX] pos_self_order: pay after each setting require enterprise
After merging of the mobile and kiosk app for self order
(https://github.com/odoo/odoo/pull/136051), the pay after selection that
requires the "upgrade to enterprise" label was misplace. This fix restores the
misplaced label.

closes odoo/odoo#137413

Signed-off-by: David Monnom (moda) <moda@odoo.com>
2023-10-04 17:25:21 +00:00
Josse Colpaert 032519fffb [FIX] l10n_es_edi_sii: exportation of services is no_sujeto_loc
Exportation of services should be No Sujeto por reglas de
Localisacion and not No Sujeto for 7,14.

closes odoo/odoo#137459

X-original-commit: 06a984c8d4e4b12b2ac52a9a3c1fb0d8637ec530
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-10-04 14:54:12 +00:00
David Monnom (moda) 61954a4fca [IMP] pos_self_order: global improvements following review
List of improvements:
- Product list button is now configurable and not hardcoded. Demo data
is updated accordingly. When a new `pos_config` is created the button is
created with the default value "Order Now".
- Fix error 403 error when `pos_session` is not in opened state.
- The `order_widget` display now the number of items to order when all
items are not ordered yet and the total amount to pay and the count when
all items are ordered.
- The `order_widget` button no longer displays the order price.

Mobile mode:
State of order_widget button on `product_list_page`...
..when configured in meal mode, no online payment:
- With new orderlines: "Order"
- Witout new orderlines: "Order"

..when configured in meal mode with online payment:
- With new orderlines: "Order"
- Without new orderlines: "Order"

..when configured in each mode with online payment:
- With new orderlines: "Order"
- Without new orderlines: "Order"

State of order_widget button on `cart_page`...
..when configured in meal mode, no online payment:
- With new orderlines: "Order"
- Witout new orderlines: "Pay at Cashier"

..when configured in meal mode with online payment:
- With new orderlines: "Order"
- Without new orderlines: "Pay"

..when configured in each mode with online payment:
- With new orderlines: "Pay"
- Without new orderlines: "Pay"

Kiosk mode:
State of order_widget button on `product_list_page`...
..when no payment methode:
- Without new orderline: "Pay at Cashier" (disabled)
- With new orderline: "Pay at Cashier" (active)

..when payment methode:
- Without new orderline: "Order" (disabled)
- With new orderline: "Order" (active)

State of order_widget button on `cart_page`...
..when no payment methode:
- Without new orderline: "Pay at Cashier" (disabled)
- With new orderline: "Pay at Cashier" (active)

..when payment methode:
- Without new orderline: "Pay" (disabled)
- With new orderline: "Pay" (active)

closes odoo/odoo#137387

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-04 13:01:25 +00:00