Commit Graph
160751 Commits
Author SHA1 Message Date
Claire Bretton (clbr) 23bb2eff38 [FIX] l10n_ch: fix de+it translations of QR codes
QR codes had different translations than the official ones.
That prevented the QR-bill to be submitted through Snailmail.

Reference of translations (p.58): https://www.six-group.com/dam/download/banking-services/standardization/qr-bill/ig-qr-bill-v2.2-en.pdf

closes odoo/odoo#120371

Opw: 3223714
X-original-commit: 351b4e4b69629624158bad590c39e7930b6ae75f
Signed-off-by: William André (wan) <wan@odoo.com>
2023-05-03 13:57:14 +02:00
Romain Derie 2391d0994a [FIX] website: prevent assets to be invalidated in multi domain
== Issue ==

A business code error was detected by the internal team on our
production. The cache and assets where invalidated !WAY! too often for
the past months.

It was hard to figure but finally the error was tracked down to be
located in the assets retrieval stack of our code when a database is
accessed through multiple different domains.

In our production use case, whenever one was accessing `odoo.com/web`
after someone accessed `accounts.odoo.com/web`, the assets would be
invalidated and recomputed, again and again, whenever someone accessed
the backend on a domain after someone else did with another domain.
Obviously, on our production, this could be occuring multiple time per
minute.

Technically, this is because the "assets retrieval stack" had a mismatch
in multiple endpoint when trying to find if a current website was
involved (serving for the frontend).
Some business method were using `env.context.get('website_id')` while
others were using `env['website'].get_current_website(fallback=False)`.
From there, when the code was called without a `website_id` in the
context, `get_current_website()` would still return a `website_id` when
called from `http://odoo.com` as there is a website having its domain
set to it. `get_current_website()` is then finding it and returning it.
But it would not when the user is on `http://accounts.odoo.com`.

Since we have a custom scss override (done through our website builder,
basically an ir.asset linked to a "url type" attachment:
`/website/static/src/scss/options/colors/user_color_palette.scss`) for
our website to define the website colors which is shadowing the scss
file from disk.

So, depending of the host/domain, either the real file disk for this URL
or the ir.asset linked to our website for this URL would be fetched to
generate the bundle hash (which is basically the last modification date
of the files/attachments).
Obviously, the file on disk and the ir.assets have a different last
modification date.

The system would then consider the assets as outdated and would
regenerate it.

You can see it in the logs where the attachment id of the assets URL
would get higher and higher everytime you access the DB through another
domain.

Using `get_current_website(fallback=False)`:
- `_get_related_assets()` https://github.com/odoo/odoo/blame/30d3b97b5ece379d9ddcbceda9d12c03dc7f4a48/addons/website/models/ir_asset.py#L14
- `filter_duplicate()` https://github.com/odoo/odoo/blame/30d3b97b5ece379d9ddcbceda9d12c03dc7f4a48/addons/website/models/ir_asset.py#L41
- ..

Using `get_current_website()`:
- `_get_custom_attachment()` https://github.com/odoo/odoo/blame/30d3b97b5ece379d9ddcbceda9d12c03dc7f4a48/addons/website/models/assets.py#L162
- ..

Using `context.get('website_id')`:
- `_get_asset_url_values()` https://github.com/odoo/odoo/blame/30d3b97b5ece379d9ddcbceda9d12c03dc7f4a48/addons/website/models/ir_qweb.py#L23
- ..

== Fix ==

A fix could have been to aligned those to use the same way of retrieving
the website but it would be too fragile (definitely some other places
where the same bug is involved but not yet found).
What is done in this commit is something we wanted to do for a long time
(see [1]) but was based purely on guess and feeling rather than concrete
bug / use case, but now that we found a real use case, we will do it:
- It doesn't seems to make sense to consider the request host/domain
  when we are in the backend
- Same for the forced session, those should only impact the frontend
  calls.
  But this seems to have too much impact in stable to be changed, as it
  would require to check every caller to also check for the session if
  it makes sense. This will be done in master as not really needed to
  prevent the critical bug fixed here.
- When something wants to alter the backend with a website, it should
  explicitely be passed in the context, which is still considered
  regardless if it's a backend/frontend call.
- If something needs to consider the forced website in session in the
  backend, it should explicitely check it, not relying on
  `get_current_website()`.

== Step to reproduce ==

- Start a db with website installed
- Enter the website builder in edit mode and change the "Theme Colors"'s
  first "Color Presets"'s background color (it is white by default).
- Set the website domain to `http://127.0.0.1:8069/`
- Go to `http://127.0.0.1:8069/web` and login
- Go to `http://127.0.0.2:8069/web` and login
- Now start refreshing those 2 pages one after each other.

Everytime you will refresh the page, it will take a very long time
(~5-10 seconds) before loading the page, and monitoring the logs will
show something about invalidating the cache and huge query count.

== Benchmark ==

For the explained "multiple domain access" case, the backend /web will
now be loaded in less than 10ms and with ~10 SQL Queries when website is
installed, while it was taking ~4 seconds and ~200 Sql Queries before
the fix.

Before the fix:
```
odoo.modules.registry: At least one model cache has been invalidated, signaling through the database
GET host1.com/web HTTP/1.1 200 - 222 0.135 3.840  <-- 222 Queries, ~4s
odoo.modules.registry: At least one model cache has been invalidated, signaling through the database
GET host2.com/web HTTP/1.1 200 - 181 0.101 3.692  <-- 181 Queries, ~4s
odoo.modules.registry: At least one model cache has been invalidated, signaling through the database
GET host1.com/web HTTP/1.1 200 - 215 0.121 3.704  <-- 215 Queries, ~4s
odoo.modules.registry: At least one model cache has been invalidated, signaling through the database
GET host2.com/web HTTP/1.1 200 - 181 0.100 3.616  <-- 181 Queries, ~4s
```
After the fix:
```
odoo.modules.registry: At least one model cache has been invalidated, signaling through the database
GET host1.com/web HTTP/1.1 200 - 101 0.043 0.353  <-- 101 Queries, ~0.3s
GET host2.com/web HTTP/1.1 200 - 11 0.004 0.007   <--  11 Queries, ~10ms
GET host1.com/web HTTP/1.1 200 - 11 0.003 0.005   <--  11 Queries, ~10ms
GET host2.com/web HTTP/1.1 200 - 11 0.003 0.008   <--  11 Queries, ~10ms
```

[1]: https://github.com/odoo/odoo/pull/94161#discussion_r904780031 (Also other PR/task but couldn't find those.)

closes odoo/odoo#120364

X-original-commit: 28dd35eb3c681b630f0b3c109a7d8209f9fa42d8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-03 13:57:11 +02:00
Romain Derie 8577abc4c1 [FIX] website: cache deprecated, use ormcache
`cache` is an alias to `ormcache`

X-original-commit: 1b3348b8b1a6f710ea89c90eb13f668d58b9ea92
Part-of: odoo/odoo#120364
2023-05-03 13:57:11 +02:00
xO-Tx c99cd92c14 [FIX] website, tools: make select options translatable
Steps to reproduce:

- Go to a website page > Add a 'Form' block > Add a new 'Selection'
field.
- Go to the page (in 'edit_translations' mode) > The selection field
options are not translatable.

The goal of this commit is to make the select options translatable
by adding an intermediate `.o_translation_select` element.

This element will handle option's text translations from the linked
`<select/>`. The final values are copied to the original element
right before save.

opw-3233360

closes odoo/odoo#120363

X-original-commit: 5ff53d7f289ec531f8369a47d02bd58252bb98a5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-05-03 13:57:08 +02:00
Evgeniia Kotova b521624e66 [FIX] website: correct the link for plausible documentation
Current link in settings leads to 404 error page,
changing the path to the right one
opw-3279614

closes odoo/odoo#120356

X-original-commit: beffb2fcab99439c9bf9b398e500e2437e38f9f9
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-03 13:57:05 +02:00
Jeremy Kersten 1a57492c7e [FIX] sales_team: search own sale team if not user_id set
In case you write user_id = False on the sale order,
It will match the first sale team without sale team manager.
It is because False != None.

After this fix, we check if user_id is Falsy instead of None.

closes odoo/odoo#120346

X-original-commit: 8adde86c719b2dc76e21e440c32de1307e5c4da3
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-05-03 13:56:59 +02:00
PNO fc08507ad4 [FIX] spreadsheet_dashboard_stock_account: domain includes consumables
Stock valuation layers are generated for storable and consumable products. However, given that we don't keep track of its quants we hide those layers by default.
by adding a domain [('product_id.type', '=', 'product')].
On the dashboard, such domain is currently not present. As a result, our inventory valuation value is not the same if we look at it though the dashboard.
This commit adds the same domain so that the value of the inventory shown is always the same (which means not including consumable products).

OPW-3275521

closes odoo/odoo#120267

X-original-commit: d392087941367d93ef63fd0ccdb0b988b338218c
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-05-03 13:56:54 +02:00
Valeriya(vchu) 1743d07bb3 [IMP] payment(_asiapay): add var for view required currences
avoid overriding payment views by creating new computed field in the payment provider property and override it if needed in inherited payment models
task-3120983

closes odoo/odoo#116573

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-05-03 13:56:52 +02:00
Florian Damhaut e17aef8896 [IMP] calendar: Make calendar edit more restricted
This task change the people who can edit a calendar event.
This calendar event currently allow every user to modify every
event in the calendar. This cause issue where one user can
modify the time-off event for other employees.

This PR change the right to modify an event from the calendar
view in the calendar app. With these changes, only the people
attending an event will be able to modify it from the calendar
view.

task-id : 3185743

closes odoo/odoo#112964

Signed-off-by: Arnaud Joset <arj@odoo.com>
2023-05-03 13:56:49 +02:00
aliya 463e567438 [FIX] account_edi_ubl_cii: fix selection labels, compute
This commit fixes a few things in the UI:
- The format selection labels could be confusing to users, for example the word "billing" is not necessary here. Now the labels are clearer and structured in a similar way.
- `peppol_endpoint` is recomputed whenever there is a change in the vat but we do not want to make changes if there is already some value in this field. This commit adds a check for whether `peppol_endpoint`is already filled in.
- Same for the `peppol_eas` field - should not be changed if it's already there.
- Both of these fields should be logged in the chatter when changed

closes odoo/odoo#120344

X-original-commit: f749033466c674d91722a2ac753645955da04bad
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-05-03 12:39:58 +02:00
John Wilson bb1d9e7b26 [FIX] tests/common: Fix tests on Windows and with Debian release
closes odoo/odoo#120297

X-original-commit: 26c6997d8de5679307485cd8efb6b2ce5662f34c
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-03 12:39:53 +02:00
Touati Djamel (otd) b7af38b6ec [FIX] mrp: use product unit of measure precision in BoM overview
Steps to reproduce the bug:
- Go to Decimal accuracy:
    - Select the “Product Unit of Measure”
    - Set the Value to “4”

- Create a storable product with BoM:
    - add any product as component
    - save
    - Click on the BoM overview widget

Problem:
The “Product UoM” precision is not used

opw-3288403

closes odoo/odoo#120296

X-original-commit: 837a6ca90d6944f9faf4b28e69703f5310c6ec6a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-05-03 12:39:50 +02:00
Didier (did) be311dfc7c [IMP] mail: remove useless t-set
closes odoo/odoo#120242

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-05-03 12:39:48 +02:00
Didier (did) 0cb19acd04 [FIX] mail: guard an optional props
Before this PR, using the message component wihtout a thread could crash because
props.thread could be undefined (as thread is an optional props).
This PR just add the guard.

closes odoo/odoo#120233

Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2023-05-03 12:39:45 +02:00
Joseph Caburnay 60775b0f62 [REF] barcodes,*: convert BarcodeParser to js class
*: barcodes_gs1_nomenclature,point_of_sale

In this commit, we are converting the `BarcodeParser` to js class. As a
consequence, instead of having 2 options of instantiating the parser -- via
nomenclature_id or via nomenclature -- we are removing the first option.
Instantiating the parser will now only require the built nomenclature object.
This is possible because in all the pathways where the parser is instantiated,
the web services are ready, meaning `rpc` and/or `orm` services are ready. As a
result, the consumer of the parser can just build the nomenclature object itself
by fetching the nomenclature details from the server. A helper static method
called `fetchNomenclature` is introduced in the `BarcodeParser` class to aid in
building the nomenclature object it needed.

Furthermore, the methods that return the required nomenclature and rule fields
are converted to static fields which can still be patched (check
barcodes_gs1_nomenclature in enterprise).

closes odoo/odoo#120228

Related: odoo/enterprise#40582
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-05-03 12:39:40 +02:00
Benjamin Vray 69a11fdab4 [FIX] website_blog: fix read next article block
Before this commit, on a blog page with the "regular cover" and "read
next article" options enabled, the image in the "read next article"
block would shrink when the text was too long.

Steps to reproduce the bug:

- Go to a blog page (e.g. "Sierra Tarahumara").
- Enable the "regular cover" and "read next article" options.
- Enter edit mode.
- Scroll down the page.
- Enter a lot of text as the title of the "read next article" block.
- Bug: As the text increases, the width of the image decreases.

opw-3267842

closes odoo/odoo#120025

X-original-commit: 06a6e78b0f41188dd4c7c45c26f6038ecbd5b311
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-05-03 12:39:38 +02:00
Deependra Solanki 36b5757dcd [FIX] web_editor: fix line merge on color change
Before this commit:

When using shift+enter to move to a new line, now applying bold, italics,
underline, etc and then trying to add a color to both lines would result in
lines merging.

After this commit:

Now when the both lines are bold and then applying a color to both the lines
would no longer merge.

closes odoo/odoo#119701

Task: 3269922
X-original-commit: 0473dbd0090dd7b2fb1ff59a83a38df941303681
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-05-03 12:39:35 +02:00
Michael (mcm) 517d3258f2 [REF] web,*: add dependencies param to odoo.define
This commit makes the `dependencies` param of
`odoo.define` mandatory. It was optional and when
omitted, a regexp read the function to find the
dependencies. We can simplify it now almost all js
modules have been converted to esm.
The transpiler already adds the param for the es
modules except if the module has an alias.

task id: 3271352

closes odoo/odoo#119145

Related: odoo/enterprise#40040
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-05-03 12:39:30 +02:00
sofiagvaladze 2332624ca4 [IMP] hr_holidays: allow quick approval on dashboard
Purpose: HR can view employee leave records from the calendar but can
not approve, validate or refuse it from there.
In case they want to make action, they have to go through
menu < time off < approvals < time off < find the employee
< find the requested time off < open it < approve.

In this commit the action buttons are added on the dashboard.

task - 3175495

closes odoo/odoo#116342

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-03 12:39:22 +02:00
David Monnom (moda) 73aae73f1b [IMP] point_of_sale,*: move kitchen printer logic to point_of_sale
*:pos_epson_printer,pos_epson_printer_restaurant,point_of_sale,
pos_restaurant,pos_hr_restaurant

Before the printers only worked in the pos_restaurant and not in the
point_of_sale. Indeed, the methods managing the printers were located
in the pos_restaurant.

Now all these methods have been moved.
For the community part here are the affected modules:
- The methods in pos_epson_printer_restaurant have been moved to
pos_epson_printer.
- The methods in pos_restaurant have been moved to point_of_sale.
- The module pos_epson_printer_restaurant has been removed as it only
handled printers.

Some of these methods have been adapted/renamed to better suit
the needs.

This branch the first part of the following task: 3224508

closes odoo/odoo#114655

Related: odoo/upgrade#4414
Related: odoo/enterprise#37901
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-05-03 12:39:17 +02:00
Anita (anko) 8e4e8eb81a [IMP] account_payment: add payment onboarding step
To improve onboarding experience, configuring Stripe
has been added in Invoice onboarding process.
For db with other apps(ecommerce or sales) if onboarding is
done in one place it is considered done in other places with
exclusion of Sales, unless it was done in Sales.

task-3208045

closes odoo/odoo#114131

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-05-03 12:39:08 +02:00
Antoine Vandevenne (anv) 1ac7b728cb [FIX] payment_stripe: prevent crash if the payment intent can't be created
When the payment method was detached from the customer, trying to pay
with the linked payment token would end up with a crash because Stripe
failed to send us the payment intent, as it could not create it.

With this commit, we test for the existence of the returned payment
intent and prematurely return in `_send_payment_request` to prevent a
cursor rollback. The transaction is set in 'error' and the error
message is logged in the stdout and on the transaction's state message
field.

closes odoo/odoo#120348

X-original-commit: 4ebf0efc16ef78ca568ef93fb2c36ce404cb0c12
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-05-03 11:16:43 +02:00
std-odoo ded123b65f [FIX] web: properties, respect prettier standard
Purpose
=======
All the properties field file respect prettier rules defined in
/web/tooling (like normal field), during odoo/odoo#118929 we forgot
to apply those rules.

Task-3188915

closes odoo/odoo#119811

Related: odoo/enterprise#40363
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-03 10:11:54 +02:00
std-odoo abf487fcd7 [FIX] web: properties, close popover with 1 click instead of 2
Purpose
=======
When the focus is inside the label of the property, if we click
outside of the popover we need to click a second time to close the
popover.

Before that code was used to solve a bug where the definition popover
was closed when you select the text inside the property label. It
seems not necessary anymore, and it causes the issue above.

Task-3188915

Part-of: odoo/odoo#119811
2023-05-03 10:11:54 +02:00
std-odoo c706ae6e4f [IMP] web: use the and syntax instead of &amp;&amp; for properties
Purpose
=======
Most of the template in web use the `and` syntax instead of `&amp;&amp;`,
use this syntax for consistency.

Task-3188915

Part-of: odoo/odoo#119811
2023-05-03 10:11:53 +02:00
std-odoo 1f80810e39 [IMP] web,crm,project: add an option to hide the "Add a Property" button
Purpose
=======
When this option is enabled, the button to create new properties
is invisible. We create a client action instead, and when the user
executes client action for the first time, the button becomes visible
until the user refreshes the page.

This is useful because most of the time, the user will create the
properties and then won't change them. So this button uses space
unnecessarily in the form view (for the most of the use cases).

Task-3188915

Part-of: odoo/odoo#119811
2023-05-03 10:11:53 +02:00
Marc Durepos c999f1ec14 [FIX] hr_attendance: prevent error caused by pre-fetching non-public employee fields
Fixes a situation where users who are part of the Attendances Officer (or Manager) group but
  without access to private employee data would see the following error when trying to book time
  off.

  `ValueError: Invalid field 'last_check_in' on model 'hr.employee.public'`

  Other instances of the same ValueError were observed by managers trying to approve employee leave
  and employee expenses.

  As per hr/models/hr_employee.py:22-26 fields not available on hr.employee.public should have
  groups='hr.group_hr_user' and this was not the case in hr_attendance.

closes odoo/odoo#120324

X-original-commit: ff4e7d6a414097d000e62825cf43425ea14bd77e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-03 08:38:13 +02:00
Jonathan 07df81ebe9 [FIX] base_setup, calendar, point_of_sale, stock: update doc URLs
This commit updates the documentation URLs to the current URLs, although
there are already redirect rules in place as fallback.

Related odoo/documentation pull requests:

Calendar:
https://github.com/odoo/documentation/pull/4032
task-3217827

POS
https://github.com/odoo/documentation/pull/4226
task-3284514

Inventory
https://github.com/odoo/documentation/pull/2556

closes odoo/odoo#120345

Related: odoo/enterprise#40623
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Castillo Jonathan (jcs) <jcs@odoo.com>
2023-05-03 07:20:55 +02:00
Sébastien Theys f9ca72dca9 [REF] mail: move CallSettings code to discuss folder
Part of task-3265211

closes odoo/odoo#120314

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-05-02 22:26:44 +02:00
Sébastien Theys 197d9a7dc6 [REF] mail: move ChannelMemberList code to discuss folder
Part of task-3265211

Part-of: odoo/odoo#120314
2023-05-02 22:26:43 +02:00
Sébastien Theys a843eb776f [REF] mail: move ChannelInvitation code to discuss folder
Part of task-3265211

Part-of: odoo/odoo#120314
2023-05-02 22:26:43 +02:00
roen-odoo 546ba05e5b [FIX] loyalty: make sure demo user can open pos
Current behavior:
When you try to open the pos as a demo user, you get an error message.

Steps to reproduce:
- Install pos and loyalty modules
- Log in as demo user
- Try to open the pos
- You get an error message

opw-3297341

closes odoo/odoo#120334

X-original-commit: 5f6a1df7eda6909df302bc6cfa3ba02d8a2de3d7
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-05-02 20:01:41 +02:00
can-odoo 044a3cfdb3 [IMP] web_editor: set default values for repeat-pattern background size
Description of the issue/feature this PR addresses:
---

When a user chooses "Repeat Pattern" as the background image position,
nothing happens.

Current behavior before PR:
---

As the background size is set to auto, for background-position
`repeat-pattern` no effect[1] can be seen in the
background size.

[1]: https://bit.ly/3MM31Ac

Desired behavior after PR is merged:
---
Not a bug but can be considered an improvement in features by setting
some default[2] width or height for a repeat-pattern option for all
relevant snippets.

[2]: https://bit.ly/3GbGIBo

task- 2862510

closes odoo/odoo#102995

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-05-02 20:01:39 +02:00
Lucas Lefèvre 91f4b4a2e1 [FIX] spreadsheet_dashboard_account: count individual invoices
In the Invoicing dashboard, the "Average Invoice" scorecoard displays
the wrong amount of invoices. It displays the number of
"account.invoice.report" lines.

This commit fixes the issue by displaying the count_unique measure
of "move_id"

task 3180524

closes odoo/odoo#120322

X-original-commit: 6232896fe06640de6d461e645811673fe27481aa
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-05-02 19:07:09 +02:00
Adrien Widart (awt) d540767350 [FIX] mrp_account: avoid deleting a BoM in use
Deleting a kit BoM will lead to an error if the kit is in the middle
of a sale process

To reproduce the issue:
1. In Settings, enable UoM
2. Create a product category PC:
   - AVCO
   - Auto
3. Create three storable products P_kit, P_01, P_02
   - UoM of P_01: `m`
   - UoM of P_02: `kg`
4. Create a BoM:
   - Product: P_kit
   - Type: kit
   - Components:
     - 1 x P_01
     - 1 x P_02
5. Create and confirm a SO with 1 x P_kit
6. Force the delivery
7. Delete the BoM
8. Create and confirm the SO's invoice

Error: a traceback appears "ValueError: Expected singleton: uom.uom..."

Because of the configuration, when posting the invoice, we compute
the COGS. During that process, we need the average price of P_kit
https://github.com/odoo/odoo/blob/640907ec1852c4e477957c865549a87d3ae840dd/addons/sale_stock/models/account_move.py#L133
We give to that method the components' SMs. In
`_compute_average_price`, since we don't find a BoM, we will bypass
the mrp override
https://github.com/odoo/odoo/blob/419e42132d9526e9d98c2126158d4f88716d17c4/addons/mrp_account/models/product.py#L48-L50
As a result, it leads to
https://github.com/odoo/odoo/blob/640907ec1852c4e477957c865549a87d3ae840dd/addons/stock_account/models/product.py#L680-L684
Where we will have the candidates of all components (i.e., several
different products). But that method is not designed for such a
situation. This is the reason why, when calling `_consume_all`, it
will fail:
https://github.com/odoo/odoo/blob/858d24a611c4c8af0dcae82a6eb4077e391398ed/addons/stock_account/models/stock_valuation_layer.py#L85
We try to get the rounding of the product, but there are actually
two of them (the two components) -> singleton error

OPW-3218141

closes odoo/odoo#120321

X-original-commit: 980c8380cbd1cad514d96ea682074e3787f10c1a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-05-02 19:07:06 +02:00
Rémi Rahir (rar) afc9593204 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/77c8f5f1 [REL] 16.3.0-alpha.7
https://github.com/odoo/o-spreadsheet/commit/1a2c6bec [FIX] xlsx: force the use of formatAttributes
https://github.com/odoo/o-spreadsheet/commit/2ab92bfa [FIX] xlsx: export computed format
https://github.com/odoo/o-spreadsheet/commit/2e3bb1fb [FIX] xlsx: Always export value of unsupported formulas Task: 3276929
https://github.com/odoo/o-spreadsheet/commit/a5eab554 [REF] import: don't deepcopy imported data
https://github.com/odoo/o-spreadsheet/commit/f6e5d06a [REF] misc: faster zone conversion
https://github.com/odoo/o-spreadsheet/commit/31251cdb [REF] import: don't uselessly import borders
https://github.com/odoo/o-spreadsheet/commit/da4cf9e6 [REF] model: don't copy command payload twice
https://github.com/odoo/o-spreadsheet/commit/9f24f7a8 [REF] misc: avoid regex in `toCartesian`
https://github.com/odoo/o-spreadsheet/commit/2d9534a4 [REF] *: improve regex processing time
https://github.com/odoo/o-spreadsheet/commit/72bdba14 [REF] tokenizer: improve computation time
https://github.com/odoo/o-spreadsheet/commit/1b667755 [REF] helper coordinate: ref lettersToNumber
https://github.com/odoo/o-spreadsheet/commit/9aed9a49 [REF] helper date format: improve performances
https://github.com/odoo/o-spreadsheet/commit/7ad727c0 [FIX] tests: allow es2022
https://github.com/odoo/o-spreadsheet/commit/8181824f [FIX] tests: Use only faketimers in find&replace Task: 3293232
https://github.com/odoo/o-spreadsheet/commit/8fcf6068 [REL] 16.3.0-alpha.6
https://github.com/odoo/o-spreadsheet/commit/27ee983d [IMP] menus: add menu icons Task: 3145722
https://github.com/odoo/o-spreadsheet/commit/0a3e7829 [FIX] tests: Use only faketimers in autofill tests Task: 3293232
https://github.com/odoo/o-spreadsheet/commit/3f1c9b61 [FIX] chart: don't open side panel readonly when double clicking Task: 3293322
https://github.com/odoo/o-spreadsheet/commit/25f2ffc5 [IMP] tsconfig: allow es2022
https://github.com/odoo/o-spreadsheet/commit/7edf96b0 [REV] test: make test tsconfig work in vscode
https://github.com/odoo/o-spreadsheet/commit/752033ee [IMP] spreadsheet: add split to columns feature
https://github.com/odoo/o-spreadsheet/commit/82e0f699 [FIX] demo: fix topbar file menu
https://github.com/odoo/o-spreadsheet/commit/88eaeacc [FIX] components: add ActionButton props schema
https://github.com/odoo/o-spreadsheet/commit/ea19c8bc [IMP] XLSX: export text wrapping
https://github.com/odoo/o-spreadsheet/commit/9d38d1ed [IMP] XLSX: import text wrapping modes
https://github.com/odoo/o-spreadsheet/commit/691e0a47 [FIX] sheet: add allowDispatch on ADD_COLUMNS_ROWS Task: 3272589
https://github.com/odoo/o-spreadsheet/commit/db981f0b [FIX] core: Prevent dispatch of invalid command payloads Task: 3272589
https://github.com/odoo/o-spreadsheet/commit/b395a240 [IMP] tests: speed up menu items tests
https://github.com/odoo/o-spreadsheet/commit/94051d5f [IMP] XLSX: export text vertical alignment
https://github.com/odoo/o-spreadsheet/commit/bc319199 [IMP] Grid: add keyboard shortcuts
https://github.com/odoo/o-spreadsheet/commit/980448dc [FIX] menu: separator for last visible item Task: 3276939
https://github.com/odoo/o-spreadsheet/commit/d376bc5f [IMP] XLSX: import text vertical alignment Task: 3249030
https://github.com/odoo/o-spreadsheet/commit/9b650cd7 [REF] collaborative: move getters to plugins
https://github.com/odoo/o-spreadsheet/commit/07cfb8a6 [FIX] menu: dynamically update visible menu items
https://github.com/odoo/o-spreadsheet/commit/189b7db8 [FIX] header_overlay: select col when there is a single row
https://github.com/odoo/o-spreadsheet/commit/f18f137c [FIX] sheet: prevent deleting all visible columns/rows

closes odoo/odoo#120306

Related: odoo/enterprise#40604
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-05-02 19:06:57 +02:00
Victor Feyens e20cbfafa6 [CLN] sale_loyalty: python fields definition
* Indentation
* Explicit field attributes
* Double quoted strings for strings shown to users (single quoted ones for the rest)

closes odoo/odoo#120245

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-05-02 18:06:52 +02:00
Victor Feyens 3f51b29f6a [CLN] sale_loyalty: xml & files cleanup
* Files ordering
* Indentation
* Simplified xpath when possible
* Menus in specific file
* Clear file names

Part-of: odoo/odoo#120245
2023-05-02 18:06:52 +02:00
Christophe SimonisandAlvaro Fuentes 6c2a487ef9 [FIX] core: consider x.y.z upgrade scripts as majorless
Also warn about invalid version numbers in upgrade scripts.

closes odoo/odoo#118420

Related: odoo/enterprise#39698
Related: odoo/upgrade#4554
Signed-off-by: Christophe Simonis <chs@odoo.com>
Co-authored-by: Alvaro Fuentes <afu@odoo.com>
2023-05-02 18:06:44 +02:00
Christophe Simonis 653ec8cf60 [IMP] core: enforce format of module versions
As module versions can be single digit, an upgrade script for version
`x.y.z`, is currently parsed as an upgrade script for module
version `z` in Odoo `x.y`.
However 3-digits module versions are more common than single-digit ones
and developers may expect the `x.y.x` upgrade scripts to be major-less
scripts.
This ambiguity can lift off if we accept module versions to be **only**
2-digits or 3-digits. This however make the `x.y.z` upgrade script
major-less. This can be fixed by renaming the script to `x.y.z.0`.

Part-of: odoo/odoo#118420
2023-05-02 18:06:44 +02:00
remi-filament 56d87dc792 [CLA] corporate le-filament
closes odoo/odoo#120284

X-original-commit: 44458824c6a7f8df34074b19a3b8d6fef248863a
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-02 15:59:23 +02:00
Asta f9d45393fd [CLA] signature for Qlasta
closes odoo/odoo#120283

X-original-commit: d32c551e386ea2ac5ba7efeca9b70ac7ea6b79a9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-02 15:59:21 +02:00
David Monnom (moda) bed0002f20 [FIX] pos_mercury: Wrong use of popup method
Fixed the popup call. The call was made with the old method showPopup.

The call is now made with the new .add method on the popup service.

closes odoo/odoo#120274

X-original-commit: d174e6cdacfdde6973e4ced931bb7572b6bd0511
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Monnom David (moda) <moda@odoo.com>
2023-05-02 15:59:18 +02:00
tsm-odoo 0c919774ea [FIX] mail: fix non-deterministic message test
Before this PR, the `Updating the parent message of a reply also
updates the visual of the reply` test was failing in a non-deterministic
fashion.

This PR fixes this issue by replacing the `nextTick` by a  specific
`waitUntil` in order to ensure the DOM is properly updated before
asserting.

Fixes 20829 runbot issue.

closes odoo/odoo#120273

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-02 15:59:13 +02:00
Fabien Pinckaers 6d102d4ee4 [IMP] base: better copywriting for 'neutralized'
closes odoo/odoo#120263

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-05-02 15:59:10 +02:00
Pulinckx Pierre (PIPU) 126da95642 [FIX] *: replace %d by %s when using sprintf
*: web, web_editor, payment
Before this commit, templates with %d was given to sprintf but it was not interpreted by the function
After the commit, %d are replaced by %s in templates for sprintf
Also this commit converts a last _.str.sprintf into sprintf

PR#120143

closes odoo/odoo#120143

Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-05-02 15:59:04 +02:00
damr f481475879 [FIX] stock: allow multi-picking validation w/show reception report
Steps to reproduce:
- activate `group_stock_reception_report` in settings
- activate `auto_show_reception_report` for the "Receipts" operation type
- create a receipt w/ any product + confirm
- create a return w/any product + confirm
- select both the receipt + return in the (Operations > Transfers) list
  view > action > Validate

Expected result: both pickings are validated
Actual result: stacktrace due to expected singleton ValueError

enterprise PR : https://github.com/odoo/enterprise/pull/37518
task-3204596

closes odoo/odoo#120190

X-original-commit: b2ac4b2f30e15c4b8a50628798b2fc39d7d43331
Related: odoo/enterprise#40570
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-02 14:47:39 +02:00
Thomas Lefebvre (thle) 6ff0506658 [FIX] website_sale, website_sale_stock: prevent out of stock
Steps to reproduce:
- create a product;
- disable the continue selling option for the out-of-stock;
- do not have a stock quantity for this product.
- go to ecommerce;
- without click on the product, add it in the cart with the cart icon (on the picture).

Issue:
It is possible to add the product to the cart.
If we repeat this several times, we will create quotations.

Solution:
Hide the button if the product is a storable product
and we don't want to sell it if we have no stock.
We also check the quantity available.

opw-3148069

closes odoo/odoo#120176

X-original-commit: bf4b5962c396101f242822058b5ddf815408e3f8
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-05-02 14:47:34 +02:00
Alexandre Kühn 9cfb6fe471 [FIX] mail: no scroll on small chatter
Before this commit, when chatter message list was lower
than 2500px, the message-list had scrollable of 2500px
of height.

This happens because the area detecting present time was
always 2500px. thus making the content have this value as
scrollheight.

This commit fixes the issue by making presence area not
go above the conversation height. So if message list is
250px of height, then presence area is 250px, not 2500px.

closes odoo/odoo#120173

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-05-02 14:47:31 +02:00
David MonjoieandJinjiu Liu d0e14f6064 [FIX] web_editor: fix ClipboardJS traceback in Firefox 109
Starting with Firefox 109, a widget element prototype that is put
inside an iframe will not be instanceof its original constructor.
See: https://github.com/webcompat/web-bugs/issues/118350

This is because a node that is adopted by an iframe will have its
prototype changed to match the constructor from within the iframe
instead of its original one. This has been the case for a long time.
See: https://bugzilla.mozilla.org/show_bug.cgi?id=1470017

It largely went unnoticed because of another quirk of Firefox related
to the use of instanceof which was fixed in version 109.
See: https://bugzilla.mozilla.org/show_bug.cgi?id=1360715

Since this bug was fixed it became apparent, in the form of a
traceback, that the wrong instance of ClipboardJS was being used
in the case of Firefox, due to the forced prototype change.

This commit could be reverted once Firefox is fixed.

Steps to reproduce the issue in Firefox > 109:
- Create a new mass mailing.
- Choose the third template with "Thank you for joining us!".
- Click on the "LOGIN" button link inside the email.
- Get a traceback about a paremeter not being the right type.

Task-3186513
OPW-3172914

closes odoo/odoo#120171

X-original-commit: c0da01c716716f9d35abe9d90dad27cce1452ebb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Jinjiu Liu <jili@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2023-05-02 14:47:28 +02:00