Commit Graph
162395 Commits
Author SHA1 Message Date
pedrambiria 27ae8f73ac [FIX] point_of_sale: accept GS1 barcodes in PoS
This update enables PoS to handle GS1 barcodes, which was
previously not possible even though the GS1 nomenclature could
be selected. GS1 barcodes can now be used to extract product
identifiers, lot numbers, and serial numbers from the code.

opw-3204299

closes odoo/odoo#125906

X-original-commit: cd2061c02b6c7001558178ade025a1fc4917bf9e
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-06-22 08:35:01 +02:00
hote 8447c93ba2 [FIX] sale: currency conversions and rates
Before this commit the reports in sales and associated app suffered from a confusion between
multiplicative and divisive rates for currency conversion. After this commit this will no longer be
the case.

There are several models with their own currencies that are involved in computing the amount of a
sale order:
- the order's company currency `order.company_id.currency_id`
- the order's pricelist currency `order.pricelist_id.currency_id`
- the product's currency for each product in the sale order `product.currency_id`

In the case of a report we need also to take into account the current user's company currency:
`self.env.company.currency_id`.

The `sale_order.currency_rate` is the **multiplicative <u>rate</u>** to convert from the company
currency into the SO currency.

Any product added to a sale order follow the next conversion. Let `conversion_rate` be the conversion
rate between the product's currency and the order's company currency, then:
```python
product_amount_converted = product.list_price / conversion_rate

order.amount_total +=  product_amount_converted * order.currency_rate
```

The rates returned by `_get_query_currency_table()`, on the other hand, are computed as the
**multiplicative <u>ratio</u>** to convert from each company currency into the current user's
company currency.

Any order that is to be analysed on a *report* follow the next conversion. Let `current_company_currency_rate`
be the conversion rate between the order's company currency and the current user's company, then:
```python
order_amount_in_cmp_currency = order.amount_total / order.currency_rate

report.order_id.price_total = order_amount_in_cmp_currency * current_company_currency_rate
```

What follow is a numerical example. Suppose you have the following multi-company and
multi-currency environment.

|order.id|order.company  |line.subtotal|order.currency|order.currency_rate|
| ------ | -----------   | ----------- | ------------ | ----------------- |
|1      |BE Company (EUR)|1000         |INR           |89.46              |
|2      |BE Company (EUR)|2000         |USD           |1.09               |
|3      |BE Company (EUR)|3000         |EUR           |1.0                |
|4      |US Company (USD)|4000         |USD           |1.0                |

If we try to convert all of this for reporting in the US company, the currency table returned by
`_get_query_currency_table()` will give this (company currencies vs USD):

|currency_table.company|currency_table.rate|
| -------------------- | ------------------ |
|BE Company (EUR)      |1.09                |
|US Company (USD)      |1.0                 |

Finally, in order to convert each amount into USD, applying the formulae listed above should give
the following result:

|order.id|order.company|display_price_usd           |
| ------ | ----------- | -------------------------- |
|1       |BE Company   |1000 / 89.46 * 1.09 = 12.18 |
|2       |BE Company   |2000 / 1.09 * 1.09 = 2000.00|
|3       |BE Company   |3000 / 1.0 * 1.09 = 3270.00 |
|4       |US Company   |4000 / 1.0 * 1.0 = 4000.00  |
|Total (USD): 9282.18|

Task - 3277006

closes odoo/odoo#125402

X-original-commit: e8f7a692eaf6b87ccf4a8d95b7a46146b1199bf2
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
2023-06-22 08:34:58 +02:00
Julien Alardot (jual) 07a5d9b1ec [FIX] point_of_sale: half-up cash rounding issue
Steps to reproduce:
- Create a HALF-UP rounding method with 0.05 as the rounding
value rounding method
- Create an order with a product of the price of 1.97
- Pay the order and insert 2.00 as the amount to pay
=> the change is 0.0 which is incorrect and the change must be 0.05

opw-3223873

closes odoo/odoo#118590

X-original-commit: 07dc28e
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-06-22 08:34:55 +02:00
paso-odoo d98552c5c2 [FIX] mrp: confirm MO with deleted WO
If there are some dependencies between BoM's operations, a traceback
will appear when the user removes one WO.

Steps to produce:
- From Manufacturing > Configuration: Enable Work Orders.
- Open any Bills of Material.
- In 'Miscellaneous' tab tick the 'Operation Dependencies' boolean.
- Set 3 or more operations in the 'Operations' tab.
- After saving the BOM add 'Blocked By' in the operations.
- Now Create Manufacturing Order for that BOM.
- Delete the one or more workorder(s) from mrp order.
- Now click on the 'Confirm' button, and the error will be raised.

The loop is incorrect because we iterate on the BoM's operations but
the keys of the dict `workorder_per_operation` are based on the MO's
work orders. Therefore, if we remove one WO, the dict will not have
any key for the related operation, hence the traceback.

sentry-4146643254

closes odoo/odoo#125990

X-original-commit: 15366af1774a571548a9c35e7dd8acbdc16ba71f
Related: odoo/enterprise#42957
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: Parth Solanki (paso) <paso@odoo.com>
2023-06-22 06:50:45 +02:00
MerlinGuillaume 08e2409afe [FIX] web: reposition popover when image is loaded
When hovering over an employee's photo (without edit rights) and the
image hasn't been loaded in the cache, the popover is positioned to the
right of the image. With a big image, the popover can be outside of the
page.

Steps to reproduce:
1. Install Employees and set a 4k image to any employee
2. Remove all the rights of Marc Demo on Employees
3. Connect as Marc Demo
4. Open the form of the employee with the 4k image
5. Hover on the employee photo
6. The image position is off

Solution:
Update the position of the popover when the image is loaded and restrict
the image width in the popover to the popover width

Problem:
When we try to find the best position to display the popover and the
image is not loaded, we will find that there is some room for the
popover on the right because the image has no height or width

opw-3281649

closes odoo/odoo#125951

X-original-commit: 532c4cfa4e60bc95319b774794680eabc80b1219
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-06-21 20:10:31 +02:00
Brice bib Bartoletti 1704f0aa6f [IMP] account: make multivat great again
The aim of this commit is:
- to bring back a feature that was wiped out during the refactoring of the chart
of account instantiation in commit 5125748616
- add a test that will solidify the feature
- Improve the instantiation by installing the required l10n module
  directly instead of asking the user to install it manually

Previous to this commit:
The button instantiating the foreign taxes leads to a traceback.

After this commit:
The button instantiate the foreign taxes correctly

Note: To prevent xml_id collision on account, we prefix the xml_ids with their
module's name

closes odoo/odoo#118056

closes odoo/odoo#125950

Community-pr: https://github.com/odoo/odoo/pull/118056/
Task-id: 3196556
X-original-commit: b66ebb78ec750a4657a6de6726deb9eea7e0c7d1
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-21 20:10:29 +02:00
Brice bib Bartoletti 4e644746e9 [REF] account: centralize user creation in tests
X-original-commit: 84ffefed6deed59abb4df8627d5e3ebf970974b6
Part-of: odoo/odoo#125950
2023-06-21 20:10:29 +02:00
Brice bib Bartoletti b8a00bf9d4 [IMP] account: add company ir.rule for tax group
This commit aims to improve consistency.

Context:
- functionally:
    `account.tax.group` is company dependent and thus, it's weird to be able
    to access to other company tax group when those companies aren't
    selected.

- technically:
    In accounting apps, devs also expect company dependent field to not be
    retrieved by the `search` method and not having that ir.rule could cause
    bugs.

X-original-commit: 56f039f82afcf6c262bc5711cd28ae691cdf00e2
Part-of: odoo/odoo#125950
2023-06-21 20:10:28 +02:00
Alexandre Kühn bea3bb541a [FIX] hr: remove deadcode of KanbanView/openChat
OpenChat feature in `hr` is managed by the view widget
"hr_employee_chat", which is added in kanban template.
The override of Kanban View to add openChat feature is
not called at all, so this commit removes this dead code,
and the js_class, as its only purpose was adding openChat.

closes odoo/odoo#125753

Related: odoo/enterprise#42897
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-21 20:10:11 +02:00
Pierrot (prro) 7fd43d915c [IMP] l10n_nl: add triangular tax
The Dutch localization was not using any mean by default to know if a
transaction was triangular or not. Similar to the Belgian localization,
the Dutch one can now use the new 0% "ABC-levering binnen EU" tax.
The tax report can will now also display that additionnal information
(without modifying the existing ones).

task-3281024

closes odoo/odoo#125649

X-original-commit: 62a2cecd3acb9fb0b2e9e7d01fef0aef6681cda7
Related: odoo/enterprise#42800
Signed-off-by: Pierre-Rodéric Roose (prro) <prro@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-06-21 20:10:03 +02:00
Maximilien (malb) 51b3b5b360 [IMP] account_edi: change banner
Goal of this pr is to improve the banner on top of all e-invoicing by shorten
the text and make it one line

task:3374897

closes odoo/odoo#125574

Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-06-21 20:10:01 +02:00
Benoit Socias b016843753 [FIX] website: avoid failing switching mode while image is selected
Since [1] an error is raised when switching the Mode of an Images Wall
from Float to Grid or Masonry while an image is selected.
The display of the size of the image is being updated while its option
panel is not there anymore.

This commit prevents this error from happening by setting up the grid
layout with clones of the images instead of the images themselves.
This leads to the construction of a new editor for the new image.

Steps to reproduce:
- Drop an Images Wall snippet.
- Switch Mode to Float.
- Select an image.
- Switch Mode to Grid.

=> Traceback.

[1]: https://github.com/odoo/odoo/commit/2cbb691a84ce186ddd34a2a4c76d95671ed6e834

task-2990053

closes odoo/odoo#125436

X-original-commit: c532bc6c3b861a68e8381f39efaa22201ae253cb
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2023-06-21 20:09:58 +02:00
Maitri Patel 3df2d227cf [FIX] point_of_sale: prevent traceback while open session with the portal user
when the user allows multi employee per session and the portal user tries to
access the pos with the URL /pos/ui?config_id=1 then the error will be generated.

steps to reproduce:

- Installed point_of_sale module.
- In Configuration > Point of Sale > activate Multi Employees per Session option
  and save it.
- In another window, do log in as a demo user and start the pos session.
- From the Admin user, make Marc Demo as a portal user.
- Then refresh the demo user session.
- Traceback will be generated

Applying these changes will resolve this issue.

sentry - 3958755602

closes odoo/odoo#124662

X-original-commit: 49447781b95f18a87491e47c19e4e8a6167ccf1d
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
2023-06-21 20:09:49 +02:00
dasz f9bc67fbcd [IMP] survey: adapt survey inherited views to appraisal
change print action's target to new for all surveys.
see odoo/enterprise#37387
task 3127424

closes odoo/odoo#121283

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-21 20:09:26 +02:00
Hubert Van de Walle (huvw) 75bc86c817 [FIX] mail: usable ListActivity widget in many2many subview
Steps to reproduce
==================

- With studio, create a model
- In the form view, add a many2many pointing to res.partner
- Close studio
- Create a record
- Add a line by selecting a partner

-> `Cannot read properties of undefined (reading 'find')`

Cause of the issue
==================

The res.partner uses a custom widget for the activity field `ListActivity`.
The fieldDependencies selection fields are not properly defined.

opw-3360436

closes odoo/odoo#125907

X-original-commit: 69019fd51aa4d157b95dd44c9f359b967c67a23d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-06-21 19:04:17 +02:00
Kevin Baptiste 29ad9e881e [REM] hr,hr_holidays: remove deprecated code
Remove deprecated code from odoo/odoo#96545

closes odoo/odoo#125894

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-21 19:04:14 +02:00
Saurabh Choraria 2a9d0ce128 [FIX] base_geolocalize: update log when request to openstreetmap fails
When the user will not get an HTTP response as 200 while retrieving the location
using OpenStreetMap Nominatim service, the logger error will occur.

The logger is updated to use the 'warning' level instead of the 'error' level.
This change reflects a less severe logging level for cases where a request to
OpenStreetMap fails.

sentry-4151622143

closes odoo/odoo#125835

X-original-commit: a73a65efc0daa702b6a3fd40ad63d2ef39ace302
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-06-21 15:53:15 +02:00
Maitri Patel 5a47fdc2f8 [FIX] stock: prevent traceback when lots is empty in import serial/lots
When the user click on the 'import' button without lots in the import
serial/lots wizard in stock then this issue is generated.

Steps to reproduce:

- Install Inventory.
- Inventory >> Operations >> Receipts >> create the new Receipt
- Add product to the receipt which has tracking 'by lots',
  Save the Receipts
- Click on the button in a tree view which opens the detailed operation wizard,
  And click on Import Serial/Lots in it
- In Import Serial/ Lots wizard click on the import button without passing any
  value in the lots field
- Traceback will be generated

Applying these changes will resolve this issue.

sentry-4244975188

closes odoo/odoo#125786

X-original-commit: a45aeea3335a96390de0b4b5760683e3081852df
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-21 13:46:05 +02:00
Hubert Van de Walle (huvw) f15807b787 [FIX] web: refocus date field in editable list
Since [0], when a cell is already focused, we do not refocus again.
But we forgot to set the lastEditedCell to the current one.

The test "editable list view, should refocus date field" has also been
fixed to reflect the actual behaviour. We set the focus on the picker
cell. Before, in the test, it was on the body. This means that in [1],
`this.activeRowId` would be set to null, thus, the test was not failing.

[0]: 437edce313
[1]: https://github.com/odoo/odoo/blob/1ecfd4ee9529a3cd21a925c1e850e10fe05f2097/addons/web/static/src/views/list/list_renderer.js#L116-L117

opw-3332809

closes odoo/odoo#125301

X-original-commit: 5ee1532bdbdde0062a13e75d85f7342eb2447415
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2023-06-21 13:46:00 +02:00
vlst 42087c6fa1 [IMP] point_of_sale: Allow products to be part of multiple pos categories
Currently, a product can only be part of one `pos_category`.
This PR changes the relationship between the `product` and the `pos_category` from a `One2many` to a `Many2many`.

closes odoo/odoo#122907

Task: 3138825
Related: odoo/enterprise#41791
Related: odoo/upgrade#4739
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-06-21 13:45:50 +02:00
Valeriya(vchu) c6405e3f3a [IMP] website_payment: filter payment providers in portal
Before from the portal the user could see all the payment providers
even if the payment provider was not available from the website
where the order was made. Now the payment providers are filtered if
the order has website_id.
task-3284582

closes odoo/odoo#120679

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-06-21 13:45:47 +02:00
Julien Alardot (jual) d92c71a657 [FIX] l10n_es_edi_facturae: Fix Send & Print
978d0905 forgot to implement some changes in the module,
making it unusable
This finishes the implementation

closes odoo/odoo#125865

X-original-commit: 4faab0536f6f86d5d78fc9d94af8fd2a7f97a858
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2023-06-21 11:50:22 +02:00
William Henrotin 16d5e43996 [FIX] point_of_sale: apply cogs on delivery picking only
Commit 1e82e27 adds cogs account move lines for 'ship later'
config at the picking validation. The issue appears if the delivery flow
is in multiple steps. The account move lines will be created for each
pickings.

This commit ensure the last one actually create the aml only

closes odoo/odoo#125850

Opw: 3324972
X-original-commit: 3a987253dc81da1f2b4f746ff446bbf8fc008e98
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-21 11:50:19 +02:00
William Henrotin 7df2c48d5d [FIX] point_of_sale: use correct account in ship later pickings
Commit 1e82e27 makes ship later option create additionnal account
move line for Cogs at delivery validation. The issue is the accounts was
not correct. The desire result should be the following for a product of
cost 10, sale price 11 and 15% taxes.

 At PoS Closing                             | Debit | Credit
-------------------------------------------------------------
215000 Taxes 15%                            |  0.00 |   1.50
200000 Pos account                          |  0.00 |  11.00
600000 Expenses                             |  0.00 |   0.00
101200 Account Receivable                   | 11.50 |   0.00
110300 Stock interim (delivered)            |  0.00 |   0.00
-------------------------------------------------------------
                                            |       |
 At delivery validation (manually created)  |       |
-------------------------------------------------------------
110300 Stock interim (delivered)            |  0.00 |  10.00
600000 Expenses                             | 10.00 |   0.00
-------------------------------------------------------------
                                            |       |
 At delivery validation (from stock layers) |       |
-------------------------------------------------------------
110100 Stock valuation                      |  0.00 |  10.00
110300 Stock interim (delivered)            | 10.00 |   0.00

Opw: 3324972
X-original-commit: 471e4c6e9c9aa396060a29725aca88360e781960
Part-of: odoo/odoo#125850
2023-06-21 11:50:19 +02:00
Ahmed Khalaf da6fcc9ae6 [FIX] stock{_dropshipping}: dropship tracked product
To reproduce:

1- Activate dropshipping from settings
2- Create lot tracked product and enable dropship route
3- Add a vendor in product purchase tab
4- Create a SO with the product and confirm
5- Go to generated PO and confirm
6- Go to generated dropship transfer linked to SO /PO
7- Enter a lot name for the product move line validate
8- Go to 'Inventory>Products>Lots/Serial Numbers'
9- Expand the dropshipped product, find the serial number used in dropship
10- Show the 'Transfer To' field if not visible, you will find it empty

Expected:
The 'Transfer To' field should have the last partner the serial was delivered to
in this case the customer in the SO

This commit fixes the issue and adds a test (also imporves the test class)

opw-3225342

closes odoo/odoo#125842

X-original-commit: 27356b1046ab534fec9b5d5fa3380cb7a5eafed5
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-21 11:50:16 +02:00
Antoine Guenet ed3a213b04 [FIX] web_editor: properly convert svg shapes
When converting inline svg shapes to images, we checked if the source
ended with ".svg", which is not enough, as it can include query
parameters (eg, .svg?color=red). We now simply check if it includes
".svg" instead.

We also need to make sure we didn't make a clone of the image in an mso
before converting it, as the source wouldn't get converted in the mso.

closes odoo/odoo#125839

X-original-commit: 3e9fa219ce612875aa034d95080f9cca1f972d27
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-06-21 11:50:13 +02:00
Antoine Guenet 7d70122ac6 [FIX] mass_mailing: update iframe size on pick template
When picking a mailing template, the size of the contents of the iframe
changes but we failed to signal it so the iframe could resize as well.

closes odoo/odoo#125820

X-original-commit: 387c4fb815a802e6138671a22864dac97a490365
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-06-21 10:37:11 +02:00
Arnold Moyaux 9a01c6a29c [FIX] mrp_subcontracting: only import needed files
Follow the same behavior than project. Only import the code for the
views. It's not a good idea to import all the backend since it's not
needed and it could cause issue with extra features

closes odoo/odoo#121669

closes odoo/odoo#119040

X-original-commit: 8f3f10731545f32d283772fc009733c1b43f536b
Related: odoo/enterprise#41188
Related: odoo/enterprise#39987
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-21 10:37:04 +02:00
Arthur Detroux (ard) bd98ef5944 [FIX] website: Fix footer Slide Hover glitching on Safari
Prior to this commit, when using the "Slide Hover" reveal effect on the
footer, Safari would glitch it scrolls and could result in unreadable
content.

This commit fixes this by a weird hack that seems to work. Adding an
element with a background-image and a background-attachment set to
fixed seems to resolve the issue.

task-3302302

closes odoo/odoo#125346

X-original-commit: 5766aefcd354e89094c8e650b29529301e39d49d
Signed-off-by: Dieleman Guillaume (gdi) <gdi@odoo.com>
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
2023-06-21 08:51:56 +02:00
Saurabh Choraria 93b7463113 [FIX] event_sms: check model of sms template
When notification type is set as sms we need to check whether the template
which is referenced is coming from a correct model or not.

Applying this commit will fix this issue.

sentry-4195133685

closes odoo/odoo#125831

X-original-commit: 745bcab5ee524ae1c42e5773a86b15ef3a7019d3
Related: odoo/enterprise#42882
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-06-21 06:57:53 +02:00
qdp-odoo a4baafa761 [IMP] account: prevent the deletion of tag when set on tax/account
Because if a tag is still linked to a tax or an account, then it's probably also still referenced in a report line, and it makes no sense allowing to delete such a tag.

closes odoo/odoo#125843

X-original-commit: 3b71689954a941b12d8eda1d08c3ad58aca320d8
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-21 01:24:28 +02:00
Jeremy Kersten 939b61822e [IMP] http_routing: server_redirect in case of 404
It is a tradeoff since we will add extra requests in case of 404 to
check if a redirect exists. But it will allow to redirect old unlinked
record to a new record.

Until now, if you delete e.g. a product instead to archive it, you have
no way to redirect old url to the new product.

closes odoo/odoo#125828

X-original-commit: 95dd21c4d69a06b56b908e138f7746ef3d131d82
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-06-21 01:24:20 +02:00
Atul Patel 7eca27ffc5 [FIX] account: fixed account group with same granularity
Upgrading the chart template will point or create xmlid
to existing records to avoid duplicate account group
for `code_prefix_start` which will raise validationError
account groups are never referenced elsewhere by xml_id,
so we don't really care about that reference
so will do this :
IF: there are account groups on the company
THEN: do not create or update new account groups

```
Account Groups with the same granularity can\'t overlap
```

closes odoo/odoo#125827

X-original-commit: e3f83dce9afe56cb43890fe0671a8d8fdce58f17
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-21 01:24:18 +02:00
xO-Tx 5b211a29a2 [FIX] web_editor: keep the observer active while adding link hint class
After preventing "async" code on link tools update in [1], the
`'link_tools'` test is still failing because of another race condition
issue:

The click on "save" after setting the link style to secondary triggers
an event handler that destroys the link tools widget (see `Wysiwyg` >
`destroyLinkTools()`), leading to calling the `_removeHintClasses()`
method first (both `_addHintClasses()` and `_removeHintClasses()` will
disable the editor observer while adding / removing the link hint
class to prevent their mutations to be recorded...).

Since the observer is inactive, the changes made to the link using the
link tools will not be processed, and the block will not be set as
`.o_dirty`.

As mentioned previously, (and starting from [2]) the editor observer is
inactive (while handling the `.oe_edited_link` class) in order to
prevent recording the mutations... But since [3], the editor had the
ability to prevent some classes (including `.oe_edited_link`) from being
taken into consideration in the `filterMutationRecords()` method...

The goal of this commit is to fix this race condition issue by simply
keeping the observer activated while handling the link hint class...

Remarks:

- These changes are supposed to fix the `link_tools` test that fails on
16.0+, but 15.0 was targeted here since the `.oe_edited_link` class is
ignored by the editor starting from 15.0 and also to prevent any future
issue linked to disabling the observer...

- Adding and removing the `active` class should not affect the history,
since it targets the `linktTools` toolbar button...

[1]: https://github.com/odoo/odoo/pull/109250/commits/f42715fdc89a6a88446c5f88ecec29e6a9c96fe1
[2]: https://github.com/odoo/odoo/pull/90064/commits/26377710a6e3ad61a8c266e9f7c0b8ade98f657d
[3]: https://github.com/odoo/odoo/commit/1c25ddb42393b136cac2a0ee0b9b7280fd803e7d

runbot-18747

closes odoo/odoo#125793

X-original-commit: 6a15cbe7b320989866ce143610dbea9ac00caa5e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-06-21 01:24:15 +02:00
Martin Maes c7fede7f44 [FIX] stock,mrp: formatting numbers >= 1000 is wrong
In https://github.com/odoo/odoo/pull/123074, the fix done did not take the formatting of numbers
bigger (or equal) than 1000 into account.
For example, 1000 become "1.000,00" and parsing it again will return a 1.

To fix this, simply modified the thousandsSep to an empty array

closes odoo/odoo#125784

X-original-commit: c8a738610778d110734ca5b9b9cfe8723f70f8ce
Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-06-21 00:13:59 +02:00
Guillaume (gdi) b493516aa3 [FIX] website_sale: remove useless code
Before [this other commit], every we-many2X had to specify the current
website in the domain, which is useless since [this other commit] which
does it automatically.

[this other commit]: https://github.com/odoo/odoo/commit/081ce53120e652bf07106d5982e26048f2b843e6

Related to task-3316278

closes odoo/odoo#125669

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-06-21 00:13:54 +02:00
stefanorigano (SRI) b0baac6fc4 [FIX] web, mail: Dropdown and PopoverWowl, increase contrast
This commit adapt several components and utility-classes in order to
increase visual contrast.

In the case of `o-mail-ActivityGroup` and `o-mail-NotificationItem`
templates, these has been reworked in order to use default BS components
and consequently automatically inheriting the improved design.

task-3338419

closes odoo/odoo#124903

Part-of: task-3326263
X-original-commit: 190ec1c947e17b2b4aa8614e9e0a04d00cb38d90
Related: odoo/enterprise#42507
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-21 00:13:49 +02:00
stefanorigano (SRI) 3168ae5fcc [FIX] web: Dropdown, adjust menu position
task-3338419

X-original-commit: 37dfaf8fa19746e90974b21b3f9dfae1f2be2233
Part-of: odoo/odoo#124903
2023-06-21 00:13:49 +02:00
Maryam Kia 896a69cc30 [IMP] mail: disable escape on composer wizard
task #2793003
- rename Cancel to Discard on composer wizard
- disable escape on composer wizard to prevent closing the composer accidentally

closes odoo/odoo#120427

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-21 00:13:46 +02:00
Dossogne Bertrand d9b1b470b8 [IMP] hr_holidays: improve stress days display
Before this commit stress days were displayed as colored rectangles
on the calendar which made it ambiguous compared to leaves.
After this commit the stress day have the number colored and in bold
instead and the signification has been added to the legend on the side.
Moreover, clicking the event displays a popover giving a short
description of the stress day instead of opening a time off creation
modal.
This commit also adds `web/static/src/views/calendar/util.js` which
exports a method generating a datespan expression given two dates.

task-3226525

closes odoo/odoo#125749

X-original-commit: eb2b6068a998812890c8d37330c986fd3fc30d4f
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-20 20:32:48 +02:00
Rodolpho Lima e76459bc0e [FIX] web_editor: link with @ open new window option
Before this commit, when using the LinkTools (website, mass_mailing),
if an http URL contained a "@" (ex: https://www.youtube.com/@iRopes),
it got incorrectly recognized as an e-mail URL and the option to open
the link in a new windown was hidden from the UI.

This commit fixes the issue by making the test for e-mail URL slightly
more robust than just checking for the presence of a "@".

task-3356685
opw-3349704

closes odoo/odoo#125742

X-original-commit: 3f1db2397e50b26e2658d270cbb7ce908d5c05cd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-06-20 20:32:44 +02:00
vlst 5aaee3af66 [IMP] point_of_sale: Allow contact deletion
Currently, deleting contacts (partners) while a pos session is
open is not allowed.
(Even if the respective partner isn't part of any POS sessions)

This creates a bad experience in Contacts, with too many
unnecessary User Errors.

This PR fixes this issue, by allowing the deletion of contacts
even when a pos session is open, by introducing logic that
handles the cases where a contact might be deleted during an i
active pos session.

closes odoo/odoo#124152

Task: 3349851
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-06-20 19:09:08 +02:00
Dhrumil Shah a3a05a5a89 [IMP] project: set project as analytic plan in the project config setting
In this commit we change following points:
  - changed string of analytic_plan_id field in res setting.
  - project set as default in the analytic plan of the project setting

task-3251642

closes odoo/odoo#120522

Related: odoo/enterprise#40702
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-06-20 19:09:03 +02:00
Tejas Modi 169ea1ce0c [IMP] stock: added/updated labels, actions and setting
In this commit:
================
- Added action to 'set to 0' to declare all uncounted quantities to
  0 and works like the 'set' action.
- Moved Unreserve, Scrap and Lock/Unlock buttons in action menu.
- Added Better tooltip for status and hide unnecessary status.
- Updated button and field labels.
- Changeed stat button forecast icon.
- Added Dropship setting.
- Added conflict filter in Inventory adjustment tree view.

TaskID - 3150983

closes odoo/odoo#116799

Related: odoo/enterprise#38872
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-06-20 19:08:57 +02:00
Tejas Modi 50b9dfe351 [IMP] purchase: prevent to display purchase tab to every user
Currently, the Purchase tab is visible to every user in Product form view.

In this commit, I have make Purchase tab only visible to admin access.

TaskID - 3150983

Part-of: odoo/odoo#116799
2023-06-20 19:08:57 +02:00
Tejas Modi 4d9da8b9eb [IMP] product: rename labels in product list view
In this commit, I have make responsible optional hidden and rename some labels
in product list view.

TaskID - 3150983

Part-of: odoo/odoo#116799
2023-06-20 19:08:56 +02:00
Tejas Modi 812af37275 [IMP] mrp: make fields float to Integer
In this commit, I have changed `produce_delay`, `days_to_prepare_mo` and
`sale_delay` fields into Integer because it's the number of days.

TaskID - 3150983

Part-of: odoo/odoo#116799
2023-06-20 19:08:56 +02:00
Tejas Modi 4ef1f8e052 [IMP] barcodes: removed the barcode name field size
Due to GS1, now the barcode contains a lot more than a single identifier for
an object (e.g. product, location,etc). Sometimes it contains a combination of
multiple information. It's common now to have a size greater than 32 that
we remove the parameter.

TaskID - 3150983

Part-of: odoo/odoo#116799
2023-06-20 19:08:56 +02:00
Arnold Moyaux d301cbfb64 [FIX] mrp: merge moves in pick before manufacturing
Use case:
It happens that a product is consumed in different operations.
So it needs two distinct BoM lines. Since commit [1] the stock.move
in pbm are not merged. However [1] was design for kit.
In our case we would like to have only one stock.move for all the
quantities.

The fix is not perfect because it won't work if we confirm at the
same time a move with a kit and without it. But at least it will let
people using MO without kit has the correct behavior

+ remove a duplicate of the function

[1] commit 741d2fe9ef

closes odoo/odoo#125778

X-original-commit: f74149017ca41720a69179e3f5068f530b037341
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-20 18:02:05 +02:00
Saurabh Choraria 8e93e0e6e3 [FIX] base: prevent traceback when Portal User Template is not found
When user deletes 'Portal User Template' record from 'res.users' model and when
'action_open_template_user' function is executed at that time traceback is
generated on the user side as well as in the log.

Steps to reproduce:
    1. Install Website module.
    2. Go to settings > Users&Companies > Users.
    3. Remove Internal Users from default filter.
    4. Add Inactive Users in filter and delete Portal User Template.
    5. Go to Website Settings > Privacy > Customer Account.
    6. Click on Free sign up and then on Save button.
    7. Now in Website Settings click on Default Access Rights button.
    8. The error will occur.

Applying this commit will fix this issue.

sentry-4184456381

closes odoo/odoo#125761

X-original-commit: f1906f4bb21a88e0c8008393557a16b098dea3c2
Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-06-20 18:01:56 +02:00