Commit Graph
157303 Commits
Author SHA1 Message Date
Antoine Guenet 759d6972c2 [FIX] web_editor: prevent selection in root after insert
The insert command ends with setting the selection to the "right" of the
last inserted node. However, it did this without checking if that
position was valid for the selection, so we could end up with the
selection directly within the root of the editor. This corrects it if
such is the case.

X-original-commit: 722cf3bf11fcc9839677837018c1389d65b3f4fa
Part-of: odoo/odoo#109208
2023-01-05 16:52:10 +01:00
Guillaume (gdi) 2efece9884 [FIX] portal: fix portal title for the salesperson data
Before this commit, if the helpdesk module was installed, the title of
the salesperson data was changed from "Your contact" to "Salesperson"
for portal users. This did not add any value and the title of the tab
also became "Salesperson" which we do not want. This commit allows to
keep the title "Your contact" above the salesperson information and to
not change the tab title.

Steps to reproduce the problem fixed by this commit:
- Run Odoo enterprise with helpdesk and sales installed.
- As the admin, create a helpdesk ticket with Joel Willis (portal user)
as the customer and save.
- Click on Joel Willis, select the "Sales & Purchases" tab and set a
salesperson.

=> Log in as Joel Willis and on /my, you will have "Salesperson" as the
title of the tab. This bad behavior is due to [this commit] that added a
title above the salesperson information. But with this change the title
of the tab was also impacted. Then [this other commit] added a default
title above the salesperson information. We can be satisfied with this
default title which does not alter the title of the tab.

[this commit]: https://github.com/odoo/enterprise/commit/700e9dec4a5c9fca354e063d6a85b0514832c84c
[this other commit]: https://github.com/odoo/odoo/commit/d5c66ca1fa5d0f364241636bd502342c1d4ee9ac

opw-3103718

closes odoo/odoo#109138

X-original-commit: 1ebeec9dc2ea9c4a2051b06118f47a440dd5e470
Related: odoo/enterprise#35444
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-01-05 16:52:04 +01:00
Valentin Vallaeys (vava) 90af85c2e4 [IMP] payment(_*): show available currencies for payment providers
Before this commit, the lists of supported currencies by payment
provider were hard-coded in the Python scripts, which made them
unavailable to the users.

With this commit, the implemented initial lists of supported currencies
are displayed on the form view and are editable, because Odoo lists may
not be up-to-date. Empty lists do not trigger any filtering on the
payment providers to access payment methods.

For Authorize.net and Asiapay payment providers, the specific
`(authorize,asiapay)_currency_id` are removed and the generic payment
provider field `available_currency_ids` is restricted to a single-item
list when one of those providers is enabled.

task-2926016

closes odoo/odoo#101018

Related: odoo/enterprise#34158
Related: odoo/documentation#2788
Related: odoo/upgrade#4069
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-05 16:51:56 +01:00
Ricardo Gomes Rodrigues (rigr) 8726fcf822 [FIX] account: preview not displayed when uploading a pdf
Steps to reproduce:
1. Customer invoices
2. Upload button
3. Choose a PDF
4. The created invoice does not display the pdf preview

Related commits: a644766 and 0ab0a92

closes odoo/odoo#109166

X-original-commit: 7cf3f11d5072c2655802e38757b63293a9cf9d48
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
2023-01-05 15:37:37 +01:00
Guillaume (gdi) bc1b242021 [FIX] web_editor, website: debounce we-range events
This commit allows to debounce the events of the RangeUserValueWidget so
that the user can use this widget with the left and right arrows without
having a lag effect (especially on the image quality option).
In addition, steps were added in the website_gray_color_palette tour to
let the time for the debounce to trigger the changes.

task-2601533

closes odoo/odoo#109165

X-original-commit: dddec7489f5cb4e48368684a8783015517c394ee
Signed-off-by: Bojabza Soukéina (sobo) <sobo@odoo.com>
2023-01-05 15:37:34 +01:00
niyasraphy 619042a23a [FIX] hr_expense: reason field too compact in refuse expense form
currently in the expense refuse form view the reason field is too compact to enter a reason in the field.

Expenses -> My Expenses -> My Reports , open any submitted expenses and click Refuse button.

closes odoo/odoo#109157

X-original-commit: 5fda586cc9f738471c6b34fd982bb80e5dd259d3
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-01-05 15:37:27 +01:00
Rémy Voet (ryv) 2f5eaedd2e [REM] purchase_stock: remove avg_receipt_delay field
Since https://github.com/odoo/enterprise/pull/31641, this field
is not used anymore. Then remove it and remove
the override of read_group linked to.

odoo/upgrade#4162

closes odoo/odoo#108977

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-05 15:37:25 +01:00
Rémy Voet (ryv) 81d3c982fa [REM] purchase: remove avg_days_to_purchase field
Since https://github.com/odoo/enterprise/pull/31641, this field
is not used anymore. Then remove it and remove
the override of read_group linked to.

odoo/upgrade#4162

Part-of: odoo/odoo#108977
2023-01-05 15:37:24 +01:00
maximilien(malb) 84be7372de [IMP] l10n_mx: Translation
All the localisation should be written in english and then translated to the native language of the country. In this case, the mexican localisation was written is spanish, this PR translate all the module in english and add the corresponding PO file in spanish.

closes odoo/odoo#108725

Task-id: 3089239
Related: odoo/enterprise#35247
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-05 15:37:18 +01:00
Jorge Pinna Puissant 5b68871097 [IMP] * : kanban, unify dropdown definition in archs
This commit separate the templates, one for the card and another one for
the menu (the ellipsis dropdown).

The new template, called 'kanban-menu', will only contain the dropdown.
Note that, this behaviour is the same as the one used for the kanban
tooltips.

closes odoo/odoo#107589

Task-id: 3096776
Related: odoo/documentation#3284
Related: odoo/enterprise#34962
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-05 15:37:04 +01:00
niyasraphy 1d77762c19 [IMP] stock: add documentation links in stock settings
add documentation link for batch transfers, quality control and expiration dates in stock settings

closes odoo/odoo#107190

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-05 15:37:02 +01:00
maximilien(malb) 8eed1e6c63 [IMP] l10n_de: Tax report translation
The module l10n_de contains the Tax report for the germany, it needed to be translated in english and then back in german thanks to a PO file. This Pr does exactly that.

closes odoo/odoo#106324

Task-id: 3059115
Related: odoo/enterprise#34323
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-05 15:36:56 +01:00
maximilien(malb) 91da549809 [FIX] l10n_de_skr03: translation
Ideally, we develop in English any localization (then translate to the domestic language, in this case German) All the module has been translated in english and then a .po file has been create to translate back in German

+ correction of a test not working anymore cause it was searching for the name in german

Task-id: 3059115
Part-of: odoo/odoo#106324
2023-01-05 15:36:56 +01:00
Renaud Thiry f039f57eb8 [IMP] Add more detailed default email subjects from chatter
All emails sent from the chatter start with "Re:" followed
by the name of the record. The name of the record alone is sometimes not enough for
the followers to understand what the mail is about.
Additionally, "Re:" does not make sense when starting a conversation.

This commit gives better default subject
for event registrations and allows thread models
to override the default subject of messages.

This also removes "Re:" from default mail subjects.

Task-2833215

closes odoo/odoo#95817

Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-01-05 15:36:53 +01:00
Samuel Degueldre 86e2cc1167 [REF] point_of_sale: move DebugWidget out of Chrome
Continuing the work of making Chrome a less bloated component with no
clearly defined responsibilities, this commit extracts the DebugWidget
out of the Chrome component and registers it as a main component
instead.

closes odoo/odoo#108891

Related: odoo/enterprise#35406
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-01-05 14:32:48 +01:00
Samuel Degueldre ca7b48ea89 [REF] point_of_sale: get rid of useless util functions
The getFileAsText function can be replaced with the now well supported
Blob.text() function, the nextFrame function is used in precisely one
place and is needlessly complicated.

Part-of: odoo/odoo#108891
2023-01-05 14:32:48 +01:00
Samuel Degueldre 6a7459c1c0 [REF] point_of_sale, *: refactor error handling
Previously, the error handling was done inside of Chrome. This is
unecessary as none of the error handling code needs access to the Chrome
instance. Instead, this commit moves the error handling to standard
error handlers.

This commit also removes a bunch of ad-hoc error handling code that was
doing try/catch around some RPCs, only to catch the error that happens
when the client is offline. In a lot of those cases the code would
display any other type of error as an unknown error instead of letting
the error service do its job and in almost all cases the only difference
with the default handler is that the offline message was slightly
customized to tell the user more precisely which operation failed, which
doesn't seem necessary.

Part-of: odoo/odoo#108891
2023-01-05 14:32:48 +01:00
Samuel Degueldre 43529c8573 [REF] point_of_sale, *: extract navbar and remove ChromeAdapter
*: pos_hr, pos_restaurant, pos_six

The Chrome component a bloated "god component" that coordinates entirely
too many things which makes it hard to reason about, navigate, and
debug.

This commit extracts the navbar section of the chrome component into its
own component, and makes the sound player into its own self-contained
service.

This commit also merges the ChromeAdapter component into the Chrome
component, there is no reason for these to be two separate components.

Part-of: odoo/odoo#108891
2023-01-05 14:32:47 +01:00
ノウラ 64780b824b [FIX] delivery: speed up delivery costs installation
Due to hefty data the RAM limit gets exhausted.
The process gets killed due to the computed field weight on
- stock.move
- stock.picking
When installing the delivery costs module.

To solve the problem:

We add the column weight to the DB schema.

Ticket ids:
- 3013955
- 2628251
- 3028081

closes odoo/odoo#109164

Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-01-05 13:09:17 +01:00
Nicolas Bayet 3ce4e7f9aa [FIX] website: convert bootstrap modal option
Before this commit, the popup snippets were configuring the modal option
for bootstrap 4 rather than 5.
The `data-focus` in bootstrap 4 becomes `data-bs-focus` in bootstap 5.

Without `data-bs-focus` option, the Newsletter popup snippet became
uneditable because any click inside popup changed the selection to be
inside the first focusable element within the modal.

The reason of the input being focused is: upon click inside the modal,
the target of the focusin event is the parent of the modal because that
parent is contenteditable="true". Because that target is outside the
modal, `_handleFocusin` correct the selection by focusing the text
input.

task-3102155

closes odoo/odoo#109148

X-original-commit: bc99f3cdb5c2fca59a24dc4970c9ca6e69721838
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-01-05 11:35:58 +01:00
Julien Castiaux 145b44fa57 [FIX] core: cannot read country geoip on city db
Start odoo-bin shell with `--geoip_country_db='/i/dont/exist'` and type
the following code:

    from odoo.http import GeoIP
    GeoIP('8.8.8.8').country_code

TypeError: The country method cannot be used with the GeoLite2-City
database

There are two "things" here: the raw country and city entries in the
databases and the rich python country and city objects returned when an
entry was found and parsed.

Then there are two "readers", a reader capable of reading and parsing
entries from the city database and **another** reader for the country.
The two readers are **only** compatible with their specific database:
the city reader cannot read or parse information from the country
database and vis-versa. That's the bug reported by the TypeError that
this commit fixes.

But, the two python instances created from parsing the entries of
respecting databases with respecting parsers **do** share a same API:
the city record class inherits from the country record class.

    # Valid
    city_db = geoip2.database.Reader(config['geoip_city_db'])
    city_record = city_db.city('8.8.8.8')
    city_record.country.name  # works, a city record also
                              # holds country attributes

    # Invalid
    city_db = geoip2.database.Reader(config['geoip_city_db'])
    country_record = city_db.country('8.8.8.8')  # TypeError

closes odoo/odoo#109095

Signed-off-by: Julien Castiaux <juc@odoo.com>
2023-01-05 11:35:55 +01:00
Benoit Socias 6657a54d10 [FIX] web_editor: support scientific notation in styles
When a big number is entered in an option field with units, it gets
automatically converted to scientific notation (1e+10) by Chrome.
This makes the unit conversion code fail because it mistakenly
interprets the 'e' as the unit.

This commit adapts the used regular expressions in order to include
the complete number in the number part even if it is written in
scientific notation.

Steps to reproduce:
- Use Chrome.
- Drop a "Banner" block.
- Set the "Position" to "Repeat Pattern".
- Type a long number in the "Width" option.
=> Error popup.

task-2853161

closes odoo/odoo#109078

X-original-commit: a554e102a7f9ca2a0b7f64573adffa4b26a0b813
Signed-off-by: Bojabza Soukéina (sobo) <sobo@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-01-05 11:35:52 +01:00
Benoit Socias 55b9e4c588 [FIX] web_editor: compare size CSS properties
When CSS properties are updated, a check is made to verify whether the
new value is different from the old one. This process sometimes involves
unit conversions.
Since [1] when a CSS property is updated, it is also set before the
check, in order to verify whether it should be set as `!important`.
When the CSS property is a size, such as the `background-size` CSS
property, it is made of two dimensions. However the verification does
not handle that situation: it handles `15px auto` as being a single
number with the unit `px auto`, which is wrong.
The full comparison is made because the strings do not fully match:
when a size property is set to a measure followed by `auto`, it is
returned without `auto` when reading the computed style.
E.g. after setting `15px auto`, it is read as `15px`.

This commit adapts the CSS properties comparison mechanism by splitting
the size properties into their parts and comparing each part separately.

This commit also introduces a few tests about the already existing
CSS properties comparisons.

Steps to reproduce:
- Drop a "Banner" block.
- Set "Position" as "Repeat Pattern".
- Type "5" in the "Width".
=> It raised an error.

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

task-2853161

X-original-commit: 07e471b9398e042c45182f1e8ca33e74dd8087a3
Part-of: odoo/odoo#109078
2023-01-05 11:35:52 +01:00
maximilien(malb) 068e47363a [FIX] l10n_de_skr04: translation
Ideally, we  develop in English any localization (then translate to the domestic language, in this case German)
All the module has been translated in english and then a .po file has been create to translate back in German

closes odoo/odoo#105919

Task-id: 3059115
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-05 11:35:46 +01:00
hiroh-odoo 01c8727ff4 [FIX] sale_project : fix the SOL click on project update
Currently, when we click on SOL and having one record of stock.move
or timesheet then it was not going to display the form view of that
particular record and also not showing that single record on list view
too due to the invalid view_type passed in doActionButton.

So in this commit, if res_id exist then open the form view of particular
record.

PS: we can not pass the options inside the doActionButton so we can not
change the viewType from that method. second we have only action_id instead
of whole action data so we can not directly switch the views without rpc call.

task-2992368

closes odoo/odoo#109111

X-original-commit: 2cda1de1a924b7e81278f01ee0fd693be930a47f
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-05 10:31:03 +01:00
hiroh-odoo c02c3d5dc1 [FIX] sale_project: fix the display of non-service product
Before this commit, non-service SOl was not displayed on
project update right-side panel view but non-SOLs products
contribute to the project's profitability,
e.g. you install a new kitchen -> you sell the installation service
and the furniture for the kitchen.

So in this commit include the non-service SOLs to the project
update panel.

task-2992368

X-original-commit: 49558c2f15d38bee870766421d237e5228f02718
Part-of: odoo/odoo#109111
2023-01-05 10:31:02 +01:00
Lucas Lefèvre 195dcdacb8 [REM] base: remove useless board menus
`menu_board_root` is not used anymore since 37f16fb

`menu_reporting_dashboard` and `menu_reporting_config` seem ununsed
since a long time.

Task 3119613

closes odoo/odoo#109041

Related: odoo/upgrade#4172
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2023-01-05 10:30:56 +01:00
Lucas Lefèvre 0390d76506 [FIX] spreadsheet: fix concurrency issues in data sources
1. Insert a pivot in a spreadsheet
2. Create a global filter on a field of the pivot
3. With a slow network, change the value of the global filter quickly
   twice.

Two concurrent requests are sent to the server.
When the first one resolves, it marks the data source as loaded.
However, at this point, the model (`this._model`) is no longer the one
created by the first request. It's the one created by the second request
which is still loading and has no data.

We end up with a data source which is marked as loaded but has no data.

Task 3120203

closes odoo/odoo#109118

X-original-commit: 7cf02cedac189729af732faae02ec6195af26e5c
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-05 09:30:20 +01:00
Benoit Socias d34c1e027b [FIX] web_editor: fix handling of the CSS !important marker
Since [1] the mechanism that was introduced in [2] is broken because a
snapshot of the property value is used instead of the dynamically
computed property value to determine whether the `!important` marker
should be set on the modified property.

This commit makes sure the value is obtained for each comparison
instead of relying on a snapshot across all comparisons.

Steps to reproduce:
- Drop a Banner block in a website page.
- Select the box.
- Set the background to a custom solid color.
=> The `background-color` style has the `!important` marker on it, while
it should not.

[1]: https://github.com/odoo/odoo/commit/815d1f775c13ad9d4463c2d571dffc4691e81a35
[2]: https://github.com/odoo/odoo/commit/d3c3dab8950abc25b29937605091d8ce32305fa4

closes odoo/odoo#109117

X-original-commit: fff46efc04cbce3ff5bff1ded501197fbd5dca84
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-01-05 09:30:17 +01:00
Lucas Lefèvre 165358be9e [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/f88b16b0 [FIX] charts: render only if needed
https://github.com/odoo/o-spreadsheet/commit/db2d96ac [FIX] filters: compute borders for visible cells only
https://github.com/odoo/o-spreadsheet/commit/2646c3cb [IMP] Edition: composer selection set to the saved activated sheet selection rather than reset to (0,0)
https://github.com/odoo/o-spreadsheet/commit/620ae580 [IMP] popover: Fix `usePopoverContainer`
https://github.com/odoo/o-spreadsheet/commit/d472793e [FIX] Composer: select headers when composer open
https://github.com/odoo/o-spreadsheet/commit/2fbe3ede [IMP] grid: hit esc to clean clipboard selection
https://github.com/odoo/o-spreadsheet/commit/71a9c8c2 [IMP] tests: Improve helpers to reflect real life events
https://github.com/odoo/o-spreadsheet/commit/314d11a1 [IMP] renderer: Long centered contents overflowing and overlapping on neighoring cells
https://github.com/odoo/o-spreadsheet/commit/556e8c44 [FIX] Range: prevent crash with sheetname containing an exclamation mark
https://github.com/odoo/o-spreadsheet/commit/31b847e9 [IMP] selection_input: consistent range colors

closes odoo/odoo#109110

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-05 09:30:15 +01:00
hupo-odoo 6927dec29b [IMP] account: import bank statement files in xls and xlsx format
Modified the description of bank statement import in accounting settings. As it is now possible to import in xls and xlsx format and this feature has been adopted with the already existing module account_bank_statement_import_csv, the description to import CSV files has been improved to make the user understand that he is also able to import in xls and xlsx formats as well.

task-3086543
PR:107737
related PR (enterprise): #34700

closes odoo/odoo#107737

Related: odoo/enterprise#34700
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-05 09:30:09 +01:00
aliya 85de8a8f9c [ADD] l10n_kz: add l10n_kz accounting localization
Adds a Chart of Accounts, taxes, and a demo company for Kazakhstan.
- The Chart of Accounts is added according to the official documentation:
  https://adilet.zan.kz/rus/docs/V070004771_
- The Tax report is added according to this documentation:
  https://adilet.zan.kz/rus/docs/V14E0010156

task-2693102

closes odoo/odoo#105399

Related: odoo/enterprise#33941
Signed-off-by: William André (wan) <wan@odoo.com>
2023-01-05 09:30:04 +01:00
Camille Spiritus 1d34699aa9 [FIX] account: prevent tax info from being shown on invoice if only one tax
Because of a faulty float comparison, additional taxes information would sometimes be uselessly displayed on invoices,
specifically when only one tax was applied.

Fixed said float comparison.

Modified usage of built-in 'round' since check_style doesn't allow this anymore.

closes odoo/odoo#109084

X-original-commit: 23a12c496cd7688b0021083bce2c84ce7ea2a3fb
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-05 08:27:50 +01:00
Lucas Lefèvre 8642a85b4e [REV] spreadsheet_dashboard_hr_expense: restore global filters
Partial revert of #109033

The global filters were removed in 16.0 because the pivot "9" does
not exists in this dashboard.
But it exists in master.
See #104125

closes odoo/odoo#109099

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-01-04 18:49:46 +01:00
Achraf 0c49994ea8 [FIX] mail: Escape translated emoji strings
Steps:
- Install knowledge on a fresh db
- Install and set fr_BE language
- Open knowldge
- Traceback

The traceback occurs because `emoji_registry.js` fails to load `emoji_data.js`
because of some translated string that contains non-escaped characters for JSON

opw-3110823

closes odoo/odoo#109086

X-original-commit: 455b335ae773ae4c8f5197c2a6f517947e6a7009
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-04 18:49:43 +01:00
Lucas Lefèvre 0fad8837f4 [FIX] spreadsheet: improve performance of clickable cells
Rendering the clickable cells is not a negligeable operation.
And it happens at every rendering (every scroll operation).

Especially, detecting which functions the cell contains.
The slow operation is parsing formula.

On the "CRM Leads" dashboard, depending on the visible cells:

closes odoo/odoo#109085

Before: 10+ms (almost the full 16ms allowed to reach 60fps)
After: ~2-3ms
X-original-commit: f132145c941ca79960aa697d6e98e4ee5193150d
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-04 17:50:53 +01:00
Jinjiu Liu cf0a878e69 [FIX] l10n_gcc_invoice: language context lost in template rendering
Reproduction:
1. Install Accounting, l10n_sa
2. Create/Switch to a company located in Saudi Arabia
3. Go to Accounting -> Customer Invoice, and create a new invoice with a
customer with language preference set to Arabic
4. Choose any product, and set the Payment terms as Immediate Payment
5. Confirm the invoice and print it, the payment term on the left end of
the invoice is in Arabic, which should be in English

Reason: in Odoo 16, the rendering of “t-field” loses the provided
context because the values are rendered with the env context instead.
The change is introduced by https://github.com/odoo/odoo/commit/880954ebfc1106411b7f7a7d60aee05dfae60893
here: https://github.com/odoo/odoo/blob/810a1d29bfa7c497627a37e0cec64df51b75bb4b/odoo/addons/base/models/ir_qweb_fields.py#L120

Fix: Using “t-out” instead of “t-field” for html fields in the template
to keep the forced context of en-US. Similar fixes are done for other
html fields in this template, e.g. fiscal_position_id.note, narration.
These fields’ types were changed from Char to Html here: https://github.com/odoo-dev/odoo/commit/23483865b1508346f5a5e178f4a436fe1a9d9f55

Related commit:
Change in ir_qweb_fields.py : https://github.com/odoo/odoo/commit/880954ebfc1106411b7f7a7d60aee05dfae60893
Change of field type: https://github.com/odoo-dev/odoo/commit/23483865b1508346f5a5e178f4a436fe1a9d9f55

opw-3085284

closes odoo/odoo#109083

X-original-commit: 3351aa4b36b3d2e6f42ec9acd1b11121d0cfedc0
Signed-off-by: Liu Jinjiu (jili) <jili@odoo.com>
2023-01-04 17:50:50 +01:00
Xavier BOL (xbo) 1695850504 [IMP] hr_org_chart: know if employee is subordinate of current one
Before this commit, in the search view, it is not possible to filter the
employees to only have those ones who is a subordinate of the current
user. That is, if Pierre is the current employee/user and he is the
manager of Paul and Paul is the manager of Jacques. Pierre could want to
see his subordinates in his view of so Paul and Jacques instead of just
Paul.

This commit adds a new boolean field called `is_subordinate` in
`hr.employee` and `hr.employee.public` models. This field will be True
if the employee is a subordinate of the current user.

task-3061362

closes odoo/odoo#108060

Related: odoo/enterprise#34181
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-04 17:50:45 +01:00
Guillaume (gdi) 2c239dec00 [FIX] web_editor: allow multiple autoplay vimeo videos
Before this commit, it was not possible to have two vimeo videos playing
at the same time on the same page.
Steps to reproduce the bug:
- Drop two blocks containing an image
- Replace the two images with vimeo videos
- For each of these videos, enable the autoplay feature

=> Only one of these videos is played automatically. When you play the
other one, the first one is paused and vice versa. It is impossible to
have both videos running at the same time. This commit allows to correct
this by allowing to play several vimeo videos at the same time when they
have the autoplay feature activated. Note that if the option is not
enabled, the behavior remains similar to before, only one video can be
played at a time.

opw-3107447

closes odoo/odoo#108945

X-original-commit: 9e9d8691826d5504f613f529ee998a22d1bf3888
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
2023-01-04 15:48:07 +01:00
Romain Derie d652fcb830 [FIX] website: restore the redirect after lang install
Since 2013 we have a kind of a URL hack that allows to redirect to the
initial URL after installing a lang through the website, see [1].

It was even tested in python unit test with [2] but sadly it was still
broken by a combination of [3] and [4] which actually broke it at the
javascript level: the python view was correctly still outputting the
correct URL and the python part was correctly handling that return URL
when passed, but the javascript was not actually passing the URL from
the view/href to the python side as the lang install wizard was now
called through JS instead of a normal backend URL redirect (since the
website frontend > backend imp at [4]).

Step to reproduce:
- Go to any page other than the homepage
- Click on footer > add a language
- Add a language
- You are redirected to the homepage always instead of the URL you came
  from

Note that this is only true if done through the backend / iframe preview
as clicking on the "Add a language" from the frontend will work as it
should. Indeed, when clicking on it from the frontend, it's a simple
link redirect but when click in the iframe preview, the click is
preventend to let the JS open the action in the top window instead.

[1]: https://github.com/odoo/odoo/commit/5cfbcc3aff5a28022b397ec7a28ebaca6db43673
[2]: https://github.com/odoo/odoo/commit/269aa594111a152ad4b7714856ea745bfef57155
[3]: https://github.com/odoo/odoo/commit/11429329b8dea2dd0b2496dc8c1c8627751cccff
[4]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

closes odoo/odoo#108869

X-original-commit: 05caf6e697461176326ee61beeccb1193472267c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-01-04 15:48:05 +01:00
maximilien(malb) 8bee46f117 [IMP] l10n_fr: Translation
The French localisation was written in french which was wrong, all the localisation have to be written in english and then translated back to the native language thanks to PO files.

Thanks to this PR, all the french localisation has been translated.

closes odoo/odoo#108816

Task-id: 3112366
Related: odoo/enterprise#35296
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-01-04 15:47:59 +01:00
Alexandre Kühn 2bc10b5328 [FIX] mail: load emoji data on focusing composer
Before this commit, typing an emoji source in composer like
emoticon `:)`, it may not substitute to the corresponding emoji.

This happens because the emoji substitution requires loading
emoji data. It was only loaded when opening the emoji picker.

This commit fixes the issue by lazy loading emoji data when
focusing the composer.

closes odoo/odoo#109035

X-original-commit: 066e8029c0d66974c59bfe9e430affb4bf0604b9
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-04 14:45:00 +01:00
Alexandre Kühn 524e214b3a [FIX] mail: support same emoji emoticons as in 15.0
X-original-commit: 53af21ec8f538da14b5df5ea6a512b9a51d3c9fa
Part-of: odoo/odoo#109035
2023-01-04 14:45:00 +01:00
Mathieu Duckerts-Antoine d22928b7ed [FIX] web: sample server: populate groups
When some true groups have been fetched, the sample server use them to
construct the value returned by _mockWebReadGroup, i.e. construct some
fake groups. It also populate those groups by assigning them some
previously created fake records. It turns out that those fake records did
not have the right type when the first group by is a date/datetime field.
The record values created (during the group assignation) for that field
were luxon.DateTime instances instead of strings like "2022-12-15".

This was the root cause of the following problem.

Have a kanban view in sample mode and grouped on a date field, then
switch to a pivot view grouped on the same date field. A crash occures.

That crash is linked to the above mentionned problem in the following
way:

- open the kanban view (with sample="1" in its arch)
- some existing groups are fetched by the relation model but no records
  exist
- the kanban view switches to sample mode and some fake invalid records
  are created in the sample server (the invalidity of records do not
  cause visible problems at that time)
- switch to the pivot view
- the sample server is reused but existingGroups is set to be null, so
  that _mockWebReadGroup uses the invalid records to create the groups
  it needs. The crash occures at that step.

Forward-Port-Of:: cdd583f74f51086c8d5f243a2a761622229ccc26

closes odoo/odoo#109031

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-01-04 14:44:57 +01:00
Mathieu Duckerts-Antoine 7dd9943336 [FIX] web: sample server: _mockWebReadGroup API
When some true groups have been fetched, the sample server use them to
construct the value returned by _mockWebReadGroup. It turns out that
this construction was invalid: the value returned for the first group by
in each group had the wrong type in many cases. For instance, when the
first group by is a date field, the value returned could be an array
with a luxon.Datetime instance as first element and a description as
second element while it should be a description only (e.g. "December 2022).
We fix that problem.

Forward-port-of: 59c7c8c9adcad468ad9d985113a2b88e745b7414
Part-of: odoo/odoo#109031
2023-01-04 14:44:56 +01:00
Lucas Lefèvre c4948dcf1b [FIX] documents_spreadsheet: localize date pivot values
Steps to reproduce the issue

-Go to Document and create a spreadsheet document SD (for example Sales Commission)
-Display SD and notice that there is some data in it
-Add lang Czech and set it on your profile
-Display SD

Bug:
There is no data in SD

The issue arise because `read_group` values are already translated to
the user's language.

e.g. let's we group by `create_date:month`, in Czech, we get
`"create_date:month": "září 2022"` (september 2022).

The previous strategy to map the `read_group` result to the PIVOT functions[1]
was to let momentJS parse the result, then format it to the PIVOT function format.
However, we can't realistically assume momentJS can parse any date in any language.

About the adapted tests:
The tests were actually wrong because the mock server is also wrong.
The mock implementation of `read_group` returns days formatted as "2022-09-08" ("yyyy-MM-dd")
instead of "08 Sept 2022". Because the business code didn't expect this format,
it resulted with wrong values.
See odoo/odoo#105546

[1] PIVOT function argument is "09/2022" for september 2022

opw-3052858

closes odoo/odoo#109026

X-original-commit: efb59010e3029ff4d5c77c0b2402093c8df4c44e
Related: odoo/enterprise#35395
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-04 14:44:51 +01:00
Adrien Dieudonné 87cb5f8e9d [IMP] web: remove autocomplete scss dead code
Autocomplete is not used on mobile since we open the kanban view
in a modal for all x2many fields.

This code was copied from enterprise to have the responsiveness
in community.

Related PR: https://github.com/odoo/enterprise/pull/28946

closes odoo/odoo#109050

Related: odoo/enterprise#28946
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2023-01-04 13:42:54 +01:00
Lucas Lefèvre 14700c9e96 [FIX] spreadsheet_dashboard: unskip expense dashboard test
The test was skipped because the expense dashboard was broken when
the test was merged.
See https://github.com/odoo/odoo/commit/17afe2987e4146b85187b31a34caf7146d5a7cf2

closes odoo/odoo#109033

X-original-commit: 4d4c192e0994ff7849641499b728fe228ae66a4d
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-04 11:35:52 +01:00
roen-odoo c8497e024e [FIX] product_margin: product margin use partial/reversed payment
Current behavior:
Partial and reversed payment were not taken into account for the
product margin calculation.

Steps to reproduce:
1. Create a product with an common avco setup.
2. Go to purchase 1 unit at 10 dollars.
3. Upon confirming the invoice your cost is updated in the product margin
   report.
4. Create a partial payment on the bill. This creates issues as the
   product margin report is looking for paid or open not partially
   paid so it won't show up in the cost calculation.
5. Once the bill is fully paid then it shows up in the cost section
   of the product margin report again as its payment status moves to
   Paid.
6. Create a sales order for the unit at 100 dollars.
7. Invoice for the full amount then cancel it by creating a full credit
   note to put the original invoice in reversed status. This will have
   only the credit note show up in the turnover calculation as it is in
   paid status while the original invoice doesn't have a paid or open
   status so it isn't taken into account.

opw-2887240

closes odoo/odoo#108992

X-original-commit: ddca80ebee20f75ee9b9da2828de5a9170ea683e
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-01-04 11:35:49 +01:00
Achraf (abz) ee538763df [FIX] hr_expense: Fix IndexError in create_expense_from_attachments
An `IndexError` traceback that occurs in `hr_expense_predict_product/HrExpense:_onchange_predict_product` was caught by Sentry

This tuple index out of range happens because we are trying to access the first record of a recordset returned by `records.filtered()` without checking that it actually contains records.

since https://github.com/odoo/enterprise/pull/34994

opw-3111577

closes odoo/odoo#108720

Enterprise: https://github.com/odoo/enterprise/pull/35232
X-original-commit: 0a74cc1175377826a0adfb52ac68286b17630894
Related: odoo/enterprise#35245
Signed-off-by: Achraf <abz@odoo.com>
2023-01-04 11:35:44 +01:00