Commit Graph
165780 Commits
Author SHA1 Message Date
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
Michael (mcm) c925ada7da [IMP] *: replace some odoo classes by native ones
This commit replaces some odoo classes by native ones. They are simple
classes with no big extensions or not at all.

task 3439226

closes odoo/odoo#137116

Related: odoo/enterprise#48154
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-04 13:01:23 +00:00
Michael (mcm) 9c1f704e59 [IMP] *: remove action service mapper
This commit removes the event `do-action` listened on `core.bus`
and adpats the place where it was triggered.

task 3439226

closes odoo/odoo#137088

Related: odoo/enterprise#48144
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-04 13:01:21 +00:00
Tiffany Chang (tic) dfdaa9e5fe [FIX] repair: avoid running test without necessary module
Previous fix odoo/odoo#135784 added a test to repair that references
a sale_order_line field that only exists when the sale_margin module is
installed. Unfortunately there isn't already a common module that
requires both repair + sale_margin and runbot doesn't do single module
app tests so this test slipped through the cracks.

To avoid the error when the nightly single module tests occur, we avoid
running the test when sale_margin is installed since it will still run
during standard runbot tests and ensure that the bug doesn't return.

closes odoo/odoo#137490

X-original-commit: 6343e2f3125bb48b01bf5b1ef7be36d86ae35f86
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-10-04 08:39:20 +00:00
Xavier Luyckx (xlu) 2650d402af [FIX] mass_mailing: alert margin issue
Before this commit, in a Email Marketing form sheet, there was a
margin-left spacing on alerts and unnecessary old CSS rules.

This commit addresses and corrects that spacing issue.

task-3488229

closes odoo/odoo#137469

X-original-commit: 390fbed6b4c978de076887f755427d0f7c538c64
Signed-off-by: Xavier Luyckx (xlu) <xlu@odoo.com>
2023-10-04 08:39:17 +00:00
FrancoisGe c3e6f4d8a6 [IMP] web: Adds dynamicProps to Widget
As with fields, dynamicProps will be accessible to widgets from extractProps.
This commit will make readonly accessible as the first dynamicProps.
We'll be able to add more when we need them.

DynamicInfo.readonly is true iff the expression given as readonly
attrs in the arch is evaluated to true with the current record.

closes odoo/odoo#137414

Related: odoo/enterprise#48309
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-04 08:39:15 +00:00
Yaroslav Soroko (yaso) 8b885efa03 [ADD] hw_posbox_homepage: adapted Six fields
This PR adds the verification for user input fields related to Six
terminals on the IoT box homepage.
Since we are moving Six to IoT it can be dangerous to call C functions
with wrong arguments (this can lead to leaks, errors and crashes)

task-3031744

closes odoo/odoo#137319

X-original-commit: 733a95fc3ef7ae244e3eecb6a880c7034b452cc7
Related: odoo/enterprise#48256
Signed-off-by: Yaroslav Soroko (yaso) <yaso@odoo.com>
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-10-04 08:39:13 +00:00
Aaron Bohy cc3a3a328d [REF] web,*: simplify arch manipulation and parsing logic
*board,mail,project

This commit aims to simplify the XMLParser logic and the way archs
are manipulated in views, motivated by [1] where we had to
modify the arch in View to insert access right information.

First, the xml utils have been reworked. The XMLParser class has
been removed. The xml utils module already exported a parseXML and
a serializeXML functions, this commit adds visitXML, s.t. the whole
XMLParser feature is fully replaced by the 3 functions.

Second, concrete views now receive the arch in props as an
XMLDocument, as the arch is parsed once for all in View. With this,
we were able to remove serializing/parsing back and forth at several
places, where we needed to extract information for sub-parts of an
arch individually (e.g. View, x2many subviews, list view groupby).

Third, even though this change has been driven by the one above and
wasn't initally wanted, the view compiler cache and API have been
simplified. The cache is now flat, there's an entry in the cache for
each template that has been compiled. Moreover, the useViewCompiler
hook no longer takes the cache key in params, as it can directly
compute it itself (the key being the outerHTML of the template).

[1] odoo/odoo#135145

closes odoo/odoo#136376

Related: odoo/enterprise#47808
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-10-04 08:39:12 +00:00
Loukas Wets (lowe) 344896ab04 [FIX] point_of_sale: branch company tax
Prior to this commit, when closing the pos, if an order
contained a product with a tax present in the parent company, the tax
would not be found.

Steps to reproduce:
- create a tax in pos of company
- create a branch company
- set a product in pos of branch company with tax from parent company
- sell that product in pos
- close pos, error close popup will show up

Since a company is allowed to access the taxes of its parent, the filter
has been changed to check the taxes of the parent companies of the company.

Task-3502993

closes odoo/odoo#137380

X-original-commit: 7f0216e1b33885bc5c3787121911b632f4737abb
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Loukas Wets (lowe) <lowe@odoo.com>
2023-10-04 07:11:56 +00:00
vishal padhiyar 45db6775eb [FIX] web_editor: remove unwanted styles and tags
Before this commit:

When pasting text from outside odoo, it often includes additional tags
such as <b> and <P>, along with unwanted styles.

After this commit:

When pasting text from outside odoo, those extra tags and styles are now
removed.

task-3378093

closes odoo/odoo#137236

X-original-commit: 5485824654179981cc7562e643123a6decbb02a2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-10-04 07:11:55 +00:00
Arnaud Joset 2023d5f683 [IMP] calendar: allow to open document action in calendar popover
Before this commit, it was not possible to display a link to the linked
document in the calendar popover.

closes odoo/odoo#135061

Taskid: 3380101
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-10-04 07:11:54 +00:00
Thomas Becquevort (thbe) 9556813ff9 [IMP] base_vat: Allow T as country code for JP companies Tax ID
Description of the issue/feature this commit addresses:

As of the first October 2023, some Japanese companies will start using "T" as
country code in their Tax ID. The current vat check only allows the country
code to be used in the Tax ID which means that "T" is refused.

Desired behavior after the commit is merged :

This commit makes it possible for Japanese companies to use "T" as a
country code in their Tax ID.

task-3515786

closes odoo/odoo#137455

X-original-commit: 114e31521beb1d00f85f8a19959006dfe62708a0
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Thomas Becquevort (thbe) <thbe@odoo.com>
2023-10-04 06:12:49 +00:00
Jinjiu Liu 09736d81c8 [FIX] web_editor: patch for null selection in condition
Reproduction:

1. Go to any record with a chatter
2. Open full composer
3. Enter a special case for the text using shortcuts (CTRL+I for italic,
CTRL+B for bold, etc)
4. exit the special case with the same shortcut
5. JS error

Reason:
A selection is not null check is missing in the condition

Related PR: https://github.com/odoo/odoo/pull/136777

closes odoo/odoo#137499

X-original-commit: db0325503576d06521ab65a64d3c9cce837e66bc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Jinjiu Liu (jili) <jili@odoo.com>
2023-10-04 05:05:47 +00:00
Florian Charlier 875ba9d810 [FIX] sms: send outgoing sms only
This is not the way to retry, so we can avoid duplicate sending etc.

Task-3535981

closes odoo/odoo#137503

X-original-commit: c94c8f7f5c52e31b99a6a5717a4d93d0cdeca3b0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-03 22:11:53 +00:00
Alexandre Kühn e4b7217fc3 [FIX] mail: remove message reaction was not working
Follow-up PR of https://github.com/odoo/odoo/pull/136308

Commit above simplified code in discuss models so code applies
on records than properties on records. For example, instead of
juggling between persona local id and persona, some code can simply
keep logic on persona without leaking local id.

However the improvements are iterative, and more improvements are
needed to stop using local id. Some code still need local ids.
Commit above mistakenly converts a local id to persona on some code
that still work in terms of local id. As a result, message reactions
were not working properly, notably when adding a new reaction using
click on an existing message reaction of someone else.

There was also a bug in implementation in mock server which made the
test not working. This commit fixes this issue too.

Task-3523101

closes odoo/odoo#136940

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-03 22:11:52 +00:00
Thibault Delavallée 83c7d8179a [FIX] mail: fix author browse in web push payload computation
There is a double list encoding, probably not required. Coming from mail
enterprise code move.

closes odoo/odoo#137451

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-03 21:14:46 +00:00
maad-odoo 83d7846fc3 [FIX] web_editor: p tag not added when new row or column in inserted.
Before this commit:
When we inserted a new row or column into a table, a <p> tag was not
inserted within it, resulting in the placeholder not being displayed.

After this commit:
When a new row or column is inserted into the table, a <p> tag is inserted
within the <td>.

task-3344668

closes odoo/odoo#137429

X-original-commit: a3e09ed84451f8a7c5cbc82648a02565ef63072f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-10-03 21:14:45 +00:00
Odoo c3eee7c6b8 [IMP] web_editor: add button to reset table size to auto
Purpose of this commit:

Added a button to the sidebar and the column dropdown menu
for resizing the table's height and width, so that if we
want to reset the modified size of the table, we will be
able to do so

Taskid: 3344668
X-original-commit: 8740310ec845b020db0d31d3be5dfc2969665994
Part-of: odoo/odoo#137429
2023-10-03 21:14:45 +00:00
Julien Mougenot eb3f18ff5e [FIX] web: patch date in object test
Before this commit, a test in the "objects" test suite failed because
it used native dates without patching them, resulting in a low chance of
the generated dates to vary by 1 millisecond and failing the assertions.

This commit patches dates in that test to avoid this issue.

RunBot task 23058

closes odoo/odoo#137426

X-original-commit: aebbbaf942b85cb4d141975a617d8bcadfe9a719
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-03 20:17:57 +00:00
Victor Piryns (pivi) a4c750ac52 [FIX] account: correct _compute_days_sales_outstanding decorator
Add the `@` on the compute decorator of
`_compute_days_sales_outstanding`, it was probably due to a typo.

closes odoo/odoo#137425

X-original-commit: cb9bdd717f1ceacaecc29eaf8e7a1898405f2c1d
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-10-03 20:17:56 +00:00
Eteil Djoumatchoua(etdj) 6b521066c2 [FIX] website_sale: Don't get error when selecting shipping method after refresh
Steps:
- Publish Standard method and Mondial relay shipping methods.
- Empty rules and countries on mondial relay shipping method.
- Go to shop, add a product and checkout.
- On the final checkout page, click on mondial relay and cancel the popup without choosing the location.
- Refresh the page.
- Click on Standard delivery then click on Mondial relay.

Issue:
We get an error(Null value of a variable) or the popup doesn't pop.

Reason:
When selecting the mondial relay method without location info, the ``SaleOrder.carrier_id`` of the order is set
but ``SaleOrder.delivery_rating_sucess`` is set to False(we didn't enter the location information). Because of that
when refreshing and calling ``_get_shop_payment_values()``, delivery line is removed from the order. Here we just
add the default delivery method.

opw-3468202

closes odoo/odoo#137418

X-original-commit: 686244ded63748196bbbea5773e55585015782f2
Signed-off-by: Eteil Junior Djoumatchoua (etdj) <etdj@odoo.com>
2023-10-03 20:17:55 +00:00
Walid 7a1c7870a9 [FIX] mrp_account: correct component price unbuild
Steps to reproduce:
- Create a component C (automated/FIFO)
- Create and confirm two PO for C
qty: 1, price: 10
qty: 1, price: 20
- Make an MO with C as a component
- Unbuild that MO

Bug:
The valuation of the new component C is wrong, the new move in is valued
at the current product cost instead of its original value.

Fix:
create moves as a return to get the correct value

opw-3379457

closes odoo/odoo#137353

X-original-commit: d42238cc75fe6621c1eb893395856870c8bfbafb
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-10-03 20:17:49 +00:00
Nasreddin Boulif (bon) 33d46b8c99 [FIX] digest: redirect to digest form page
Step to reproduce:

  - Install `digest` module and configure mail setup
  - Sent the digest mail
  - Go to inbox and open mail
  - Click on the link of `Choose the metrics you care about`

Issue:

  Redirected to main menu on Odoo.

Cause:

  The link is broken because we escape `&` twice: escaped directly in
  the URL string, then with `Markup`.

Solution:

  Use only Markup to escape `&`.

opw-3470958

closes odoo/odoo#137352

X-original-commit: e3e6d1970df192e6629b9a9caf2d6cf36c64723b
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-10-03 20:17:48 +00:00
Alexandre Kühn 9a70545913 [REF] mail: support passing commands as data of relational field
This significantly eases processing command data on relational field
received from server.

closes odoo/odoo#137341

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-03 20:17:47 +00:00
Alexandre Kühn 3b251d6d66 [REF] mail: turn Composer.rawMentions into relational fields
This field contained 2 sets with partner and channel ids.
It's easier and safer to reason in terms of records rather
than properties on records.

Part-of: odoo/odoo#137341
2023-10-03 20:17:47 +00:00
Xavier Luyckx (xlu) a4f84ad996 [IMP] pos_online_payment: improve UI of self order payment portal
Prior to this commit, the online payment portal was using the default
Odoo checkout layout when a user tried to pay for their order on the POS
self-order.

This commit enhances the UI and layout of the payment page (excluding
the o_payment_checkout form) as well as the confirmation page.

task-3433949

closes odoo/odoo#137090

X-original-commit: 046295b4a1651ba9ad3bfd8a9184154bde0ae1e2
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-03 20:17:44 +00:00
Claire Bretton (clbr) d333eb2668 [FIX] account: exchange diff date when reconcile
We align how the date is computed on exchange differences on
how it already works when unreconciling. See _get_accounting_date().

closes odoo/odoo#136911

Task-id: 3516687
Related: odoo/enterprise#48058
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-03 20:17:42 +00:00
Adrien Guilliams (adgu) 3b9401c354 [IMP] pos_self_order, product, website_sale: add product info popup
This commit adds a popup to show product information when clicking on an
info button in the product card in the self order app. The popup shows
the ecommerce description and the name of the product.

The ecommerce description field has thus been moved from website_sale to
the product module so that the pos_self_order module can use it.

closes odoo/odoo#136906

Task-id: 3524272
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-03 20:17:41 +00:00
Jorge Pinna Puissant 006ee1fc47 [REF] web, *: remove legacy cookie utils and cookie service
The cookie service was replaced by a utils file in core. This was done
to be able to use the cookies without the need of environment.

"Om Nom Nom Nom" - Cookie Monster

part-of task-id 3439226

closes odoo/odoo#136782

Related: odoo/enterprise#48005
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-03 20:17:40 +00:00
Samuel Degueldre 30733c8f3c [REF] web: remove useless rpc/fetch patching code
Previously, when creating the public root, we would patch the rpc
service and the browser.fetch function so that they would rewrite the
relative URLs that they fetched to target the Odoo server. This is
useful when the public root is mounted on pages that are hosted on a
different server than the Odoo server, in particular, this was
historically useful for embeding the livechat widget in a website not
hosted by Odoo.

In odoo/odoo#122834 the livechat was refactored and got its own boot
code that does the same thing, making this code no longer useful. In
addition, in odoo/odoo#133153 the baseUrl we use no longer refers to the
session prefix which was configured by the livechat previously, but
simply refers to the origin of the page where the code is hosted, making
it a no-op.

These factors mean that the code removed by this commit is now
completely useless, which is why this commit removes it.

closes odoo/odoo#136672

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-03 20:17:38 +00:00
tsm-odoo bd4e418fc1 [IMP] im_livechat, mail: allow CORS livechat actions
This PR makes several actions available for the embed livechat
such as:
- calls
- message edition
- message reactions
- link previews

task-3523930

closes odoo/odoo#136618

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-03 19:20:10 +00:00
Rodolpho Lima 49277b5950 [IMP] web_editor: unify http regexes
Before this commit there were two regexes for matching http(s) URLs,
being the only difference between them the presence of a capturing group
for the protocol/scheme. The need for a nearly duplicated version of the
same regex was its use in `_onPaste` as delimiter for String.split(), in
which capturing groups are returned in the resulting array, and the
protocol/scheme was not desired.

This commmit removes the need for two different regexes to match http(s)
URLs, adapting `_onPaste`'s code to work with the presence of the
referred capturing group.

task-3520513

closes odoo/odoo#136497

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-10-03 19:20:09 +00:00
Rodolpho Lima 4da0608f7c [IMP] web_editor: remove global flag from URL regex
A Regex object with the 'g' flag is stateful [1]. As the URL_REGEX and
URL_REGEX_WITH_INFOS objects are exported, code that calls  their `exec`
method would be changing their `lastIndex` property, affecting future
`exec` calls in different code sections.

This commit removes the 'g' flag from the URL regexes, in order to allow
us to:
- avoid side effects of one call to `exec` to subsequent calls,
- remove the `getUrlsInfosInString` utility function,
- use `match` instead of `exec` for having results containing the
  capturing groups (see [2]).

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex#avoiding_side_effects
[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@match#return_value

task-3520513

Part-of: odoo/odoo#136497
2023-10-03 19:20:09 +00:00
Adrien Guilliams (adgu) 707d76eec1 [IMP] pos*: Remove info button and add self ordering availability
pos*: point_of_sale, pos_sale_product_configurator, pos_self_order

This commit removes the product info button and put a button on each
product card to open the product info popup.

The commit also adds a new field on the product template model to
track the availability of a product to the self ordering mode. This
field can be changed from the product form view or from the product
info popup directly in the POS. If the field is set to false,
the product will not be shown in the self ordering mode.

The commit also adds new filter and search fields on the product
list view in the backend.

closes odoo/odoo#136467

Task-id: 3515881
Signed-off-by: David Monnom (moda) <moda@odoo.com>
2023-10-03 19:20:08 +00:00
Romain Estievenart adba68440b [IMP] *: remove jQuery.nested_sortable
task-3439226

closes odoo/odoo#136375

Related: odoo/enterprise#47807
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-03 19:20:06 +00:00