Commit Graph
167937 Commits
Author SHA1 Message Date
Julien Castiaux e5cc17323d [FIX] http_routing: error occurs if the path is not "latin1" string
For multi language website, when request http:/localhost/en/something,
Odoo reroutes from the requested path /en/something to the new path
/something with lang=en_US in context.

If the new path is a unicode string like http:/localhost/vi/xin-chào,
http:/localhost/ru/привет, a error should occur at
werkzeug._compat.wsgi_decoding_dance() because the path was not latin1
string.

The utf-8 encoding followed by a latin-1 decoding is required by the
WSGI specification[^1]. latin-1 is used as an encoding passthrought:
that encoding has a representation for all the 256 bytes, i.e. it is
impossible that decoding a text will raise a ValueError. The WSGI spec
uses this trick to save values until the actual charset (present in
the Content-Type header) in known.

[^1]: https://peps.python.org/pep-3333/#a-note-on-string-types

closes odoo/odoo#143898

X-original-commit: 9b69b87c08b1d62b3581fe651bee692a4f217dff
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-12-01 15:51:55 +00:00
Julien Castiaux caf4da2544 [FIX] test_http: TestHttpStatic cases were run twice
Because the class was imported in this file, unittest was discovering
it again and was running the TestHttpStatic cases twice: once because
of its inclusion in the test_static.py file, once more because of its
inclusion in the test_web_server.py file.

Changing the import solved the problem, since it is a python module
object that is now exposed and not test case classes, unittest doesn't
discover the classes.

closes odoo/odoo#143840

X-original-commit: 8067d3bf3d9f73b95595a16100096aafff5c2075
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-12-01 15:51:53 +00:00
Rodolpho LimaandJinjiu Liu b8fe3ee779 [FIX] web_editor: colorPalette mount in mass_mailing
Since [1], the colorPalette component is mounted on a new App via the
attachComponent compatibility util. The new App is subject to target
validation, which fails in mass_mailing and raises a traceback.

This happens because the element for mounting the color palette is
created by the top window's document and later attached to the iframe's
DOM tree.  Unfortunately this holds true for the entire sidebar is
mass_mailing.

Commit [2] apparently added some flexibility to the attachComponent
util, temporarily disabling target validation when about to mount an
App. But, due to the asynchronous nature of mounting an App, this was
not enough for the present case, as the original App.validateTarget
function is restored before it gets called when mounting the
ColorPalette.

This commit fixes this localized issued, leaving a large-scale fix, in
which the snippets menu elements are properly created by the correct
document, for a future commit on master. This will have to take into
consideration the fact that the code for the snippets menu is shared
between mass_mailing and website, and that, in the latter, the snippets
menu sits outside the iframe, thus, it is part of the top document tree.
Alternatively, the snippets menu should be refactored and converted to
owl.

task-3605859

[1]: https://github.com/odoo/odoo/commit/36061a4ab017a463c1d5bf838334cb4c0fac25ee
[2]: https://github.com/odoo/odoo/commit/6a30ab13536a2dc0a8f23df32962cd1ceec71a5d

closes odoo/odoo#143340

Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Co-authored-by: Jinjiu Liu <jili@odoo.com>
2023-12-01 15:51:52 +00:00
Adrien Guilliams (adgu) fc1d293e70 [IMP] pos_restaurant: remove start category in demo data
Prior to this commit, the demo restaurant had a start category but
this is not wanted anymore. We thus remove this start category.

closes odoo/odoo#142212

Signed-off-by: David Monnom (moda) <moda@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-12-01 15:51:51 +00:00
Adrien Guilliams (adgu) 72d4e2e759 [FIX] pos*: fix test without demo data
pos*: pos_online_payment, pos_sale, pos_self_order

Prior to this commit, different tests were using the demo data
to run which was causing problems when the demo data were not installed.
In this commit, we add products, categories, floor, table, etc. at the
setup of the test so that the test can run without demo data.

X-original-commit: 6ef51b11f7f67a1f17225541cb2341a178a98aad
Part-of: odoo/odoo#142212
2023-12-01 15:51:51 +00:00
Louis (wil) 357cbb8bd0 [I18N] website_sale: update Russian translation
opw-3608438

closes odoo/odoo#144483

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-12-01 14:23:47 +00:00
Levi Siuzdak (sile) 4e8d835b80 [FIX] website_event: copy template question translations
Versions:
---------
- 15.0+

Steps to reproduce:
-------------------
1. Have multiple languages and Studio enabled;
2. create an event template;
3. add a question;
4. add translation to question;
5. use template to create event.

Issue:
------
Translation doesn't get copied from template to event.

Cause:
------
The `_compute_question_ids` method copied the questions by *manually*
recreating them. It didn't use the `copy_translations` method like the
regular `copy` methods does.

The reason the questions were recreated is because question records
cannot link directly from event template to event, as changes to the
event shouldn't affect the template.

Solution:
---------
Use the `copy` method instead while setting `event_type_id` to `False`
to satisfy the restriction.

opw-3572599

closes odoo/odoo#144451

X-original-commit: 73d603b65fca33773557012c4ba38da1bc98271d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
2023-12-01 14:23:45 +00:00
Levi Siuzdak (sile) 93bd62e445 [FIX] website_event: make non-sensical error make sense
Whether a question can belong to itself is too philosophical of a
question for an error pop-up.

opw-3572599

X-original-commit: c798bbbde6fc6e8e42e144f90c163a2ae40a49b8
Part-of: odoo/odoo#144451
2023-12-01 14:23:45 +00:00
Soam (sold) 7023540059 [FIX] l10n_it_edi: add flexible predictions
Odoo may allow prediction to occur when importing an EDI.
i.e. predicting the product, account and taxes of each line.
By default, those predictions will overwrite the actual value.

Though it may be helpful in some cases, there should be a way
to opt-out of the this automatic overwrite and to have a more
flexible way to do those predictions.

Here is how this is now possible:
1. With `disable_onchange_name_predictive` one can
indicate their desire to opt-out of the prediction overwrite
(i.e. the default behavior).
2. They can then use the `_predict_product`, `_predict_account`,
`_predict_taxes` methods to create their own way of prediction.
Placeholders for those were created to allow their use even if the
prediction module isn't present.

NB: As the module in charge of predictions (`account_accountant`)
is not always installed the `edi_prediction_enabled` context key is
used to indicate whether the prediction methods can be used or not.
In the case of this fix, the key is setup in the `l10n_it_reports`
module, as this module is always installed if `account_accountant`
and `l10n_it` are installed.

This way of predicting is useful for cases demanding a less generic
approach to prediction. e.g. For the Italian EDI module the account
of a line can be predicted without any limitation as it is not a value
imported by the EDI. Whereas, its product and taxes should be predicted
only if none were imported.

opw-3201391
opw-3172035

closes odoo/odoo#144437

X-original-commit: 9a87ec149a95239fbfceee60c2aecf4322fa964a
Related: odoo/enterprise#51901
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Soam Le Dortz (sold) <sold@odoo.com>
2023-12-01 14:23:42 +00:00
vishal padhiyar 52a0a0899e [FIX] web_editor: selection collapse on enter
Before this commit:

Pressing Enter after selecting text does not remove the selected text.

After this commit:

Now pressing enter after selecting text removes text.

task-3541359

closes odoo/odoo#144433

X-original-commit: bbd8b56ab1e91985b879c52af2a13517bf305127
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2023-12-01 14:23:41 +00:00
Mathieu WalravensandVictor Feyens 9d95e77a61 [FIX] product: prevent archived product variants from overshadowing active ones
This commit addresses an issue where archived product variants were
taking precedence over active variants with the same combination,
rendering the combination unusable in the sales app.

Steps to reproduce:
1. Install Sale & enable product variants
2. Create a product with two attributes, each having two values
3. Make a sale for each variant
4. Remove one of the attributes and save
5. Add back the same attribute with only one of the values
6. Make a new quote with the product; Option is not available.

After this commit:
Archived variants will no longer exclude a combination if an active
variant with the same combination exists.

opw-3538366

closes odoo/odoo#144431

X-original-commit: ceb540da0898cc27999c8ee30329051102e0f8f3
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Walravens Mathieu (wama) <wama@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
2023-12-01 14:23:40 +00:00
Yolann Sabaux e4390c224c [FIX] account: compute label according to payment ref
Steps to reproduce:
- create a bill
- add a product line
- add a payment reference
- save it
- change the payment ref
- confirm
- register a payment

Issue:
The memo is not the updated payment reference

Cause:
The memo is computed by taking in priority the `line.name`
https://github.com/odoo/odoo/blob/a39050e15195eb095b3480899cedb5cb458fa6cc/addons/account/wizard/account_payment_register.py#L139-L145

And whenever we change the payment reference, the line.name is not recomputed if it has already been set

opw-3476835

closes odoo/odoo#144362

X-original-commit: 367754e760e41eee605176f1a712190a0cc388a1
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-11-30 19:55:14 +00:00
Arnold Moyaux eedb56c18f [FIX] mrp: wrong consumption after merge
1) Create + Confirm two MO's for product
2) Merge Confirmed MO's together
3) Mark MO as Done
4) Press Apply on Immediate Production
4a) Stops consumption due to no Components being declared
4b) Would expect the Consumption Warning Wizard to be triggered here to allow use of "Validate & Set Quantities" button

It happens due to #85301 the purpose was to avoid the rules from
stock.move. However for other functionalities of MO like manual
consumption. We would like to keep the standard behavior.

Call the classic action_confirm but after manualy updated the stock.move

opw-3577267

closes odoo/odoo#144350

X-original-commit: dcf13fd1127436abb3c6a5f225f8f99d571330a3
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-11-30 19:55:13 +00:00
Thomas Lefebvre (thle) 0ca72f89b6 [FIX] website_sale: not cached breadcrumb
Steps to reproduce:
-------------------
- go to ecommerce;
- click on "Product A";
    We see the breadcrumb: All Products / Product A
- go to shop page;
- go to the category of "Product A";
- click on "Product A";
    We see the breadcrumb: All Products / Product A
    instead of: All Products / Category / Product A

Cause:
------
The template used for the breadcrumb is cached.

Solution:
---------
Use the `t-nocache` attribute to re-evaluate this part
of the template each time it is rendered.

opw-3582971

closes odoo/odoo#144327

X-original-commit: b735269c390d2117336e29651193726ccf050636
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-11-30 19:55:11 +00:00
alsh-odoo 2347da9a6e [FIX] website_sale: fix traceback when selecting a product in website
This traceback arises when the user selects a product in website.

To reproduce this issue:

1) Install 'website_sale'
2) Open website and click on shop
3) Set duration and click on any product category(eg: desk)
4) A traceback appears

Error:'UnboundLocalError: local variable 'all_tags' referenced before assignment'

On 'shop' method 'all_tags' was referenced before assignment form here

https://github.com/odoo/odoo/blob/5ba7e9e16c45ba618bb728f336102454d844d144/addons/website_sale/controllers/main.py#L480-L481

sentry-4680583793

closes odoo/odoo#144297

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-11-30 19:55:10 +00:00
Julien Van Roy 7d7bc23a16 [FIX] account_edi_ubl_cii: no tax exemption reason for NO customers
Prevent error: "[BR-S-10]-A VAT breakdown (BG-23) with VAT Category code
(BT-118) "Standard rate" shall not have a VAT exemption reason code
(BT-121) or VAT exemption reason text (BT-120)."

We should not provide a tax exemption reason for standard rates when the
customer is Norvegian. It is not allowed in UBL Peppol Bis 3.

no task/no ticket (noticed the error in the IAP logs).

closes odoo/odoo#144287

X-original-commit: 5b62e301b91a3f39857c2c7f18729e10796ef194
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
2023-11-30 19:55:08 +00:00
Manushi Shah (mash) 489a972ac7 [FIX] sale_timesheet: rectify billable time in reporting by project/task
Steps:
- Open Timesheet
- Configuration > Time Encoding > Change Encoding Unit to Days
- Now select Reporting  > By Employee
- When you select Measures, you can see Billable Days and Non-Billable Days
- Now select Reporting  > By Project / By Task
- When you select Measures, you can see Billable Hours and Non-Billable Hours

Issue:
- Even after changing the Encoding Unit from Hours to Days, still we are able to
have Measures in Hours instead of Days

Cause:
- Records are not made for project and task which changes on the change of
encoding unit.

Fix:
- adding records in 'timesheet_analysis_views' for project and task for graph
and pivot views so that it updates when changed the encoding unit.

Technical Explanation:

'timesheet_uom' is used to define the unit of measure for time entries in a
timesheet. It represents the measurement unit that is used to record and track
time spent on specific tasks or activities. For example, it could be set to
'hours' or 'days' depending on the organization's requirements.

'float_time' is used for representing time durations or intervals. It allows
users to input and display time values in a decimal format, such as hours and
minutes. The float_time widget provides a convenient way to handle time
calculations and representations.

These two concepts serve different purposes but can be related in the context of
tracking time-related data. The timesheet_uom field determines the unit of
measure for time entries, while the float_time widget allows for inputting and
displaying time values in a convenient decimal format.

If we use 'timesheet_uom', the data on the server side will always be displayed
in hours or days, which could be confusing for the user. Another issue arises
when the work hours for a day are not 8 hours but rather 7.5 hours. The
conversion is not accurate since it assumes 8 hours per day in all cases.
Hence, by using 'float_time', the process of exporting the data can be
streamlined.

closes odoo/odoo#144274

Task: 3387850
X-original-commit: e344716716fc0fcd1f81fce5b00cc7a5996b1e85
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-11-30 19:55:06 +00:00
zel-odoo 0ae059848f [FIX] mail: traceback when switch nav list
When a nav list is open, if there is a new props provided, a error
could be thrown. Reproduce:
1. write "@aUser #ge" in the composer
2. click on the @aUser => traceback

The problem is because when NavigableList is open,
the `props.optionTemplate` will change before `state.options`,
leading to a mismatch between the template and the record.

This commit solves the issue by removing syncing
props.options and state.options altogether.
This felt needed to enrich options with id,
but this is unnecessary because the forged id
was simply the index of option in the list.

closes odoo/odoo#144260

X-original-commit: b41f25bc7b41799bd34e27e8e1013d7a85320bcc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-30 19:55:04 +00:00
Denis Ledoux 2270a38ef0 [IMP] mail: validate discuss member fields when creating a channel
closes odoo/odoo#144258

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-30 19:55:02 +00:00
visp-odoo 717300723d [FIX] web_editor: traceback on copy paste table in firefox
Before this commit:

Copy pasting table in firefox gives us traceback because the firefox does not
support :has() selector.

After this commit:

Now it will not give any traceback.

task-3591148

closes odoo/odoo#144256

X-original-commit: 224c42e4dedbb18b7f023756d652bb935d5d9829
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2023-11-30 19:55:01 +00:00
Aman Patel c457d0e401 [FIX] sms: component getting destroyed
Steps:
- Open field service
- Go to Calendar view
- Click on any data, so that the popover opens.
- Click on the SMS button to send a message.

Issue:
- When we try to send the message, the traceback comes with the message
'Component is destroyed'.

Cause:
- When we try to send the message using 'Send SMS', before that the popover
opened gets destroyed. The popover and wizard are different 2 components and
hence we aren't able to control them.

Fix:
- We are performing load and notify methods only if the status of the component
is not destroyed.

task-3386925

closes odoo/odoo#144255

X-original-commit: 49b5054d0d530c3935cf053ae994dbebc12f1e04
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-30 18:38:04 +00:00
sesn-odoo 9519eec339 [FIX] website_sale_loyalty: correct taxcloud taxes on 'shop/payment'
Summary
-------
Taxcloud taxes are always 0 on payment page.

Steps to reproduce
------------------
* install `website_sale_loyalty` and `website_sale_account_taxcloud`
* configure taxcloud
* enable 'Detect Automatically' on the 'Automatic Tax Mapping
  (TaxCloud)' fiscal position
* go to ecommerce, and add a product to cart
* go to cart
* proceed to checkout

You should see that the taxes are still 0 on the payment page

Cause
-----
The issue comes from the `shop_payment()` override in
`website_sale_loyalty`.  The taxcloud taxes are computed with
`res = super(WebsiteSale, self).shop_payment(**post)`,
but they are immediately cleared with
`order._update_programs_and_rewards()`

opw-3539027

closes odoo/odoo#144250

X-original-commit: 051470a16f3a76689eaeb6db57ac3d98a60c1f4d
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2023-11-30 18:38:03 +00:00
nda 68611eef02 [FIX] board: allow to save comparison
Comparison feature had been lost in the OWL refactoring.

steps to reproduce:
- go to sale report, set a filter to current month
- enable comparison to previous period
- save to dashboard

before this commit:
- dashboard did not use the comparison filter

after this commit:
- dashboard uses the comparison filter

opw-3584559

closes odoo/odoo#144239

X-original-commit: f7caee48c7c11ed601d49cf31ddd14b564f9b896
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-30 18:38:02 +00:00
Sébastien Theys e8ce14fcd7 [FIX] mail: avoid loading more messages than intended
The IntersectionObserver was sometimes started and called its callback
before the scroll was restored, in which case the load more button was
always visible, leading to loading more messages than intended.

To fix, delay the starting of the visible until the scroll is restored.

runbot-35533

closes odoo/odoo#144228

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-30 18:38:01 +00:00
sesn-odoo 04157311cb [FIX] account: prevent currency rounding change through multi-company
Currently, increasing the rounding factor for a currency is not allowed
if accounting entries have already been generated in that currency.
However, the restriction currently only applies to the current company.
And since currency records are shared between multiple companies, a user
can create a new company with no accounting entries and then change the
currency's rounding factor, affecting all companies.

This commit checks for the restriction on all companies, and fixes a few
tests that were broken by this change.

opw-3586785

closes odoo/odoo#144226

X-original-commit: 7f8b76ac7ad3730a662203aa88a03d067c1230cb
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2023-11-30 18:38:00 +00:00
vifo d769aba6c5 [FIX] iot: change imports order websocket_client
The order of the imports have been changed in websocket_client.py to
follow odoo guidelines

closes odoo/odoo#144188

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-11-30 18:37:57 +00:00
Dhrumil Shah b4a269d695 [FIX] web: fix alignment issue for feature names
Issue:
- Before this commit when we see helpdesk team form view some of the features
   names are not aligned with checkbox

Cause:
- Issue was caused because of the icon size is large and so it features names
   were not aligned

FIX:
- we have removed the font size of the icon so that text get aligned with the checkbox

task-3463622

closes odoo/odoo#144184

X-original-commit: 9b52a265056d9ee1e82537d1e8bd93b00911d127
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-11-30 18:37:55 +00:00
vifo 65a5a12c7b [FIX] iot: Remove the useless function start_client
Previously, there was a function called 'start_client' that was invoked
by the 'run' function. As 'start_client' was solely invoked within 'run'
and served no additional purpose, its functionality has been incorporated
directly into the 'run' function.

closes odoo/odoo#144134

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-11-30 18:37:54 +00:00
Ritika Shekhawat 140c2ef6e1 [FIX] project,sale_timesheet: fix profitability section visibility
Steps:
- Install project & accounting
- Open project
- Open project.update
- There is profitability section
- Go to accounting module configuration,settings
- Analytic accounting field true or false

Issue:
- Analytic accounting feature true or false the profitability section always
visible in project.update

Cause:
- There is no condition for profitability section visibility

Fix:
- Added  required conditions for profitability section visibility

Task-3484413

closes odoo/odoo#135108

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-11-30 18:37:49 +00:00
Walid 2219e0dd39 [FIX] purchase_requisition: Create purchase order
Steps to reproduce (V 17.0):
- Create a new blanket order with agreement type "Call for bids":
    - Select only one RFQ
    - Use line of agreement
    - use quantities of agreement
- Add a product and confirm
- Create a New quotation
- Traceback!

Bug:
typo in the onchange makes it so instead of setting payment_term_id to
false it's a False, which is actually a tupple (False,) meaning payment terms
will be a record set containg one value with Id False instead of an empty
record set (it's wrong but it doesn't really make a difference in this case)
until commit[1] in web_read clean up is used to get the Id from origin Id
for inherited fields ´not vals['id']´ is expected to be true if the value
has an origin Id but in this case it is true because Id is false
(co_records wasn't expected to contains values with Id False if Id is False
it should be empty)

commit[1]:https://github.com/odoo/odoo/pull/128878

closes odoo/odoo#144111

X-original-commit: 7c5106a46bc269f2ed4cbeb18f2172b274dd27a5
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-11-30 17:30:22 +00:00
Louis Baudoux 06a6e7667d [FIX] account,hr_recruitment: disable OCR on demo documents
Previously, the demo documents were automatically sent to the OCR when
opened in form view. It's not what we want, those demo documents should
only be sent manually.

This happened because, in the demo data, the main attachment isn't set.
When reading the document, the attachment previewer would select  an
attachment as main attachment and, as the OCR relies on the
`register_as_main_attachment` hook, it would be sent for digitization.

Now, the main attachment is explicitly set in the demo data definition.

closes odoo/odoo#144040

Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
2023-11-30 17:30:19 +00:00
JF Aubert cb3887be78 [FIX] mrp: fix show mass produce backend/shopfloor
Shop Floor introduces a restriction on how the show_serial_mass_produce
flag is computed :
the components cannot consist of more than 1 lot/serial.

However, this has a side effect on backend views where it is still
required to have full 'Mass Produce' functionalities.

closes odoo/odoo#143286

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-11-30 16:12:41 +00:00
“Your 63e8624b01 [FIX] hr_work_entry_contract: don't recompute work entries without employee_id
Currently, the error occurs while updating a work contract without
selecting any  employee.

Steps to reproduce:
- Install a 'Work Entries - Contract' module.
- Go to Employees> Employees> Contracts, And create a new contract without
  selecting any employee and also the 'Contract Start Date ' and
  'Contract End Date' fields  should be after or before the current date.
- Then save it .
- Then change 'Working Schedule' field of the created contract and save it.
- The error is generated.

Error: DatatypeMismatch : column 'hr_employee_id' is of type integer but
expression is of type boolean
LINE 1: ...neration_wizard_id', 'hr_employee_id') VALUES (1, false) ON ...

There's an issue while updating the contract without selecting any employee; As
the system is trying to recompute work entries without employee_id [1].

This commit solves this issue by adding a condition which states that
recompute the work entries; if employee_id is available.

[1]-https://github.com/odoo/odoo/blob/1b504038ce270540ddab28db4ab995d22f2ab2a7/addons/hr_work_entry_contract/models/hr_contract.py#L448-L452

sentry-4654142515

closes odoo/odoo#144180

X-original-commit: 8fc11c9c9be7a654de49664da44d5ba68d23cbd3
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-11-30 14:48:20 +00:00
luvi 65e1ffb34d [FIX] web_editor: fix reset when triggering scroll
This commit fixes the behavior hiding the select element when scrolling has
happened. Instead of the 'scroll' event, 'mousewheel' was used, which isn't
triggered when scrolling on a touch device.

Now, the correct event is used, and the listener is given to the actual document
element, instead of being globally listening on window (in case of iframes).

This fix is part of a bug happening in the report editor of Studio, since the
select element wouldn't be reset when scrolling, but kept visible at the same
outdated position.

ticket-3496665

closes odoo/odoo#144178

X-original-commit: f53f8b2f2cba5e586dd376ddd7ec39a16741f66a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-30 14:48:19 +00:00
Pedram (PEBR) 6a50519890 [FIX] point_of_sale: filter journals by currency during PoS setup
Before this commit, installing the Point of Sale module in a
multi-currency environment could lead to errors. Specifically, if there
were Bank or Cash journals in a currency different from the company's
default, they could inadvertently be selected to create a payment
method for a PoS configuration. This mismatch between the PoS
configuration currency and the payment method's currency resulted in
errors.

This commit resolves the issue by implementing a currency filter when
selecting Bank and Cash journals during the PoS setup. Now, only
journals matching the company's default currency are considered for
creating payment methods.

opw-3606856

closes odoo/odoo#144138

X-original-commit: 22545be292c27870cb3c4694567a45cfe9649971
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-11-30 14:48:18 +00:00
Nishant Jain 1e4c53871d [IMP] l10n_in_edi(_ewaybill): e-invoice bydefault set to false in journal
Before This Commit:
Currently, the e-invoice is bydefault set to true in journal.
Also there is an option to enable e-waybill in journal.

After This Commit:
Now, the e-invoice will be bydefault set to false in journal.
Also there is no need to have option of e-waybill in journal as we have separate
button to submit the e-waybill.

Task - 3617047

closes odoo/odoo#144128

Related: odoo/enterprise#51737
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-11-30 14:48:15 +00:00
vifo 391eac2447 [FIX] iot: Build the url of iot_channel with dumps
Before, the url was built with string comprehension.
Now json.dumps is use to ensure that the JSON sent is
valid

closes odoo/odoo#144125

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-11-30 14:48:13 +00:00
shsa-odoo 836151f38c [FIX] web_editor: add and update link test cases
Before this commit:

No test cases were there for dialog box based link creation.

After thi commit:

Added Qunit test cases for various scenarios

Cases Covered:

* Making links with hotkeys.
* Typing valid url + space should make link.
* Making link with powerbox.
* Selecting text and link button on the toolbar.

task-3087957

closes odoo/odoo#144120

Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
2023-11-30 14:48:12 +00:00
Romain Derie 88a4146f7a [FIX] web: prevent browser print to be limited to what's above the fold
Commit [1] moved page scrollbar to #wrapwrap, which introduced some
issues. This was needed to not have a double scrollbar when the builder
edition panel was moved from left to right.
One of the issue if that the browser print was not working anymore.

A workaround has been found with this commit to make it work again. It
is just reverting the mentioned commit when inside the browser print
preview, which can be achieved through css directly.

Note that in the future, this PR [2] should revert the fact that the
scrollable element is the #wrapwrap.

Also note that while this fix allow printing pages again, there is still
the same behavior as in Odoo 13 and before (where you can print pages
too): the printing preview will not be in desktop size but display the
pages as on tablet size.

[1]: https://github.com/odoo/odoo/commit/4e7be69825163c0a0ff41c882a196fc7f3158fb3
[2]: https://github.com/odoo/odoo/pull/98429

opw-3557672

closes odoo/odoo#144107

X-original-commit: eb0a05319789ebc3732ef623a3811b5bc8b43daf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-11-30 11:44:59 +00:00
Lucas Lefèvre (lul) 2b46bf26be [FIX] spreadsheet_dashboard: copy dashboard
This commit is the communitiy counter-part to allow copying a dashboard.

Yet another 'copy' overrride to add the same postfix!

closes odoo/odoo#144091

Task: 3588237
X-original-commit: b39f63b1509e6dc2149b1a09da5a877d45e36be3
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-11-30 11:44:59 +00:00
xO-Tx b4ee432d11 [FIX] website: fix animated text selection
The goal of this commit is to prevent the text animation overlay from
blocking small text content selection.

Remark: This behavior was already fixed on 17.0 (by [1]) for text
animations and highlights and was backported here for text animation
options.

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

Related to task-3285817

closes odoo/odoo#144086

X-original-commit: b69e105149e5f0dc6a469068ab037b717e017144
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-11-30 11:44:58 +00:00
Soukéina Bojabza f0e3682b80 [FIX] website: consider <span> icons in Social Media snippet
In the Social Media snippet options, only icons with a `<i>` tag are
considered when updating the social media classes (when adding a new
social network by copying the first one and when replacing the icon by
another one matching the URL). However, there are cases where the icon
is a `<span>` element (with a `fa` class) and not a `<i>`.

For example:
- Replace a social network icon by a real image.
- Re-replace this image by an icon.
=> the icon element tag is `<span>` and not `<i>`.

In this case, after setting its style correctly (e.g. adding the round
shape) to make it look like the other icons, we notice that it does not
behave like the other ones:
- It is not aligned with the other icons, because the CSS rule aligning
them only targets `<i>`.
- Its icon is not replaced by a matching one when changing the URL with
a "relevant" one (e.g. google, facebook).

This commit considers `<span>` icons in the Social Media options, in
addition to `<i>` icons, in order for them to all behave the same way.

opw-3538230

closes odoo/odoo#144076

X-original-commit: a8b5c3045bea0227304306e19ed9d50cf497f518
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2023-11-30 11:44:56 +00:00
Soukéina Bojabza 4ff2e3252e [FIX] website: consider other media types for Social Media snippet icons
When using the "Social Media" snippet, there are two situations leading
to a traceback. Here are the steps:

1) First issue
- In edit mode, drop the "Social Media" snippet.
- Add a new social network.
- Replace the icon by a real image (so not by an other icon).
- Set the URL of the new social network to a "relevant" one (e.g.
google, facebook).
=> traceback

2) Second issue
- Drop "Social Media" and change the list in order to have the first
social network with a real image as icon: either replace the first icon
with an image, or add a custom one with an image an move it to the top.
- Add a new social network.
=> traceback

Both issues happen because only icons set as `<i>` elements are taken
into account when modifying a social network (`querySelector('i')`) and
this element may not exist if the icon had another tag (like an image or
a span or even a video (as the media dialog allows to upload them)). As
there is no check ensuring that the element exists before changing the
different social media classes, there is a traceback when the `<i>` is
not found.

For the first issue, it happens because when changing the URL, we first
check if it matches with relevant ones or if an icon matching it exists.
If it is the case, we then update the social media classes to set the
matching icon => it can only work if the icon is a `<i>`.

The second issue happens because when adding a new social network, it
actually copies the style of the first one (unless there are none, a new
one is created in that case). If the first one is an image, it fails
when updating the classes because it is not a `<i>`.

This commit fixes these issues by simply adding checks ensuring the icon
element exists before trying to modify it. It also adds tests, ensuring
these use cases work as expected.

opw-3538230

X-original-commit: 0132fa38baee6501f4257dad718359400f1369ad
Part-of: odoo/odoo#144076
2023-11-30 11:44:56 +00:00
guva-odoo 3ea508afea [FIX] l10n_it_edi: partner_info_xml_import
When uploading an invoice/bill from an xml,
if the partner is not found, the useful informations
from the xml file should be displayed in the chatter.

opw-3563769

closes odoo/odoo#144073

X-original-commit: 7f00f6e372b91f0a8927805bf4b92b7247ef8db8
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-11-30 11:44:55 +00:00
Sven Fuehr 1f4cc0f57a [FIX] account: workaround for mixed currencies on invoice report
The values in the "Total" measure are all displayed in the move currency.
Due to this amounts in different currencies are added together.

As a workaround we introduce the possibility to group by move currency.
Thus the user can choose to seperate the values by currency.
The "Total" column was renamed to "Total in Currency" to avoid confusion

There is a remaining problem.
The totals of the individual groups are still added up to form a total.

Previously it was tried to convert the values from the move currency
to the move company currency and then to the active company currency.
The problem is that there is no efficient way to do it correctly.

task-3613358

closes odoo/odoo#144065

X-original-commit: 6d7d86cd0d8335f192112129ee92077f1f25e55b
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Sven Führ (svfu) <svfu@odoo.com>
2023-11-30 11:44:53 +00:00
Sven Fuehr c1d1721b5d [REV] account: "Total" in company currency on invoice analysis
Due to performance reasons a previous commit was reverted.

This reverts commit 28004b7e92f22cf0f0078d4512f8a5f59c82122c.

The reverted commit i.e. converted the "Total" measure to company currency (at the time of the invoice).
The query to do this (correctly) had performance issues.

task-3613358

X-original-commit: a0121dcc72eb99519ae291e48e4e03a091b234df
Part-of: odoo/odoo#144065
2023-11-30 11:44:53 +00:00
Thomas Lefebvre (thle) 75374ad17d [FIX] calendar: trigger activity according to timezone
Steps to reproduce:
-------------------
- be in UTC -5 (America/Lima for example)
    on the system (and so browser) and the user profile;
- create an event from 4pm to 5pm the next day;
- be at 2pm today;

Issue:
------
We have a notification in activities for this
event today, which is one day too soon.

Cause:
------
To find the events that need to be notified to the user, we use a domain which, in this case,
can be expressed as follows:
```
(
the `start` of the event must be after "now" (the event has not yet passed)
OR
the event `stop` must be after now (the event is in progress)
)
AND
the `start` of the event must be less than the end of the day (the event must be today)
```

The end of the day must be determined, but taking into account the user's timezone.
As the domain has to work with UTC values (because the `start` and `stop` values of the event are in UTC in DB),
in order to determine the end of the current day, we first need to determine which day the user is in UTC.

Logic before this commit (using the example):
```py
start_dt = datetime.datetime.utcnow() # 19:00 (because 14h in America/Lima -5)
start_date = timezone(tz).localize(start_dt).astimezone(UTC).date() # 00:00 next day
end_dt = datetime.datetime.combine(start_date, datetime.time.max) # 23:59 next day
end_dt = timezone(tz).localize(end_dt).astimezone(UTC) # 4:59 second next day
```
The result (for an America/Lima timezone) is that if the event has its `start`
in UTC before 4:59 two days later, the event will be notified.

Solution:
---------
Correct the values used to construct the domain.

Logic after this commit (using the example):
```py
start_dt_utc = now_utc.replace(tzinfo=UTC) # 19:00 (because 14h in America/Lima -5)
start_dt = start_dt_utc.astimezone(user_tz) # 14:00 (because 14h in America/Lima -5)
stop_dt = datetime.datetime.combine(start_dt.date(), datetime.time.max).replace(tzinfo=user_tz).astimezone(UTC) # 4:59 next day
```
Because 23:59 today using user timezone and then converted to UTC gives 4:59 next day.
In fact, the day of a user in the America/Lima (UTC -5) timezone ends in UTC at 4:59 the next day.

If this same user creates an event that starts at midnight (and therefore tomorrow),
the activity must not be displayed before midnight and therefore 5:00 the next day in UTC.

opw-3523558

closes odoo/odoo#144064

X-original-commit: 5a997d34f53d4b00e230b4a9d3131a015b190548
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-11-30 11:44:51 +00:00
alsh-odoo 7157423cb2 [FIX] product: compute with current date when write date is false
This traceback arises when 'write_date' is 'False' in 'max()' function

https://github.com/odoo/odoo/blob/a5ace6fc50df06a30805e639e0e81d35e20d9f3e/addons/product/models/product_product.py#L136-L138

Error:-
TypeError: '>' not supported between instances of 'datetime.datetime' and 'bool'

On the '_compute_write_date' when the 'write_date' is 'False' in 'max()'
function, It leads to the above traceback.

After applying this commit will resolve the issue by computingthe current date,
when 'write_date' is 'False'.

sentry-4398163501

closes odoo/odoo#144051

X-original-commit: de01d9ae7272c80361c53341d681f259cdda4823
Signed-off-by: Altaf Shaik (alsh) <alsh@odoo.com>
2023-11-30 11:44:49 +00:00
Pedram (PEBR) 8b10116410 [FIX] point_of_sale: maintain manual quantity for lot-tracked refunds
Before this commit, refunding a lot-tracked product with a quantity
greater than one in the POS  would reset the quantity to one. This
occurred even if the user manually set a higher quantity.

This commit fixes the issue by ensuring the manually set quantity for
lot-tracked products is kept during refunds. This enhancement allows
for accurate quantity retention, improving the POS refund functionality.

opw-3568867

closes odoo/odoo#144050

X-original-commit: e5989cee1cea150b86e6f3d5ae5f2fcdb108fd51
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-11-30 11:44:47 +00:00
Guillaume-gdi e190faa8ba [FIX] web_editor: make new font size classes responsive
Since [this other commit], we use classes to change the font size of
text. Unfortunately, we forgot to make them responsive. This commit
fixes that.

[this other commit]: https://github.com/odoo/odoo/commit/194f73a9bbad8c3c3fb5c378e7bdfa704aaacdc0

task-3615976

closes odoo/odoo#144047

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-11-30 11:44:46 +00:00