Commit Graph
159257 Commits
Author SHA1 Message Date
Ivan Yelizariev ffbc3be76f [FIX] sale_stock: make Warehouse field readonly in locked state
State `done` means *Locked*, which means that most of the fields should not be
editable.

However, the behavior for the field `warehouse_id` was changed during refactoring in
https://github.com/odoo/odoo/commit/f9f68adb2cdfdfd16bc24c82acae015ddfb9b83a

This commit restores Odoo 15 behavior in Odoo 16+

opw-3204896

closes odoo/odoo#114973

X-original-commit: 9efc8190565db160615f8a3e92f2e7f89edfca8b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-10 17:55:05 +01:00
Camille Spiritus abbdaf0562 [IMP] account: removed unused cash discount field in payment terms
The last_day_for_discount field was forgotten in the payment term/cash discount update : https://github.com/odoo/odoo/pull/110274

Fixed by removing the forgotten crumb.

closes odoo/odoo#114971

Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-10 17:55:00 +01:00
Romain Estievenart a041a5f2ee [IMP] project: display the widget m2o/m_avatar_user on user_id (kanban)
Remove the existing t-if on m2o_avatar_user/m2m_avatar_user widget
on user_id field in"project.project.kanban" view to allow quick-assign.

closes odoo/odoo#114400

Task-id: 3121207
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-10 17:54:57 +01:00
Romain Estievenart 74f9119300 [FIX] crm: domain on kanban_m2o_avatar_user to allow quick-assign
The Many2OneAvatarUser field now allows the edition, in particular to
add new record to the relation. This commit adds a domain on nodes using
this field to filter out share users, like already done in a lot of
form/list views[1].

Links:
1. https://github.com/odoo/odoo/commit/0edc854a8494eb475087d011efddc7e15b262127#diff-62eff7f830df5fbafad68abd5de0373654a620f6685cbcf3a4b8c20db64f0b7cR341

Part-of: odoo/odoo#114400
2023-03-10 17:54:57 +01:00
Romain Estievenart 74c3104b4c [IMP] web: add the avatar icon on m2o/m2m_avatar_field autocomplete
The goal of this commit is to add the avatar when a user use the
autocomplete m2o/m2m_autocomplete liked to a m2o/m2m_avatar_field.

Task-id: 3121207
Part-of: odoo/odoo#114400
2023-03-10 17:54:56 +01:00
Romain Estievenart 501b442340 [IMP] web,mail: many2one avatar quick assign
Purpose:

Allow quick assignation of records in the kanban views (and other places
by extension).

Currently, if you want to work in a board-like env (e.g. tasks in
kanban, crm in pipeline, that kind of thing), having the possibility to
quickly assign/unassign records without having to open them fullscreen
can be really useful => it should be possible to "quick edit" these
fields in kanban views easily, without switching to form views.

If you want to keep the field readonly don't forget to add the readonly
attribute.

Task-id: 3121207
Part-of: odoo/odoo#114400
2023-03-10 17:54:56 +01:00
Romain Estievenart 66321f76aa [IMP] web,mail: many2many avatar quick assign
Purpose:

Allow quick assignation of records in the kanban views (and other places
by extension).
Currently, if you want to work in a board-like env (e.g. tasks in
kanban, crm in pipeline, that kind of thing), having the possibility to
quickly assign/unassign records without having to open them fullscreen
can be really useful => it should be possible to "quick edit" these
fields in kanban views easily, without switching to form views.

If you want to keep the field readonly don't forget to add the readonly
attribute.

Task-id: 3121207
Part-of: odoo/odoo#114400
2023-03-10 17:54:56 +01:00
John Laterre (jol) 7bd93cc64b [IMP] sale: add confirmed SO to reveivable
The goal is to take into account the confirmed
and un-invoiced sales orders in the total receivable of a client.
It will be useful in the scope of the credit limit trigger.

This is broken down in 3 steps:
1. Add the Remaining Amount to Invoice (RAI) in the
Invoice creation wizard of the Sales Order and store this data.
2. Add the RAI in the Total Receivable of the client.
3. The Remaining amount to invoice goes to optional="hide"
in the list view of "Orders to invoice" list view.

task-3122390

closes odoo/odoo#112905

Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-10 17:54:51 +01:00
Michael (mcm) f18e11d177 [FIX] mail: prevent displaying attachment preview in dialog
Before this commit, attachment preview could be displayed
in x2m dialogs. Now, the compiler removes the attachment preview
from the arch so it is never displayed in renderer.

closes odoo/odoo#114967

X-original-commit: 4938d27da71da1e30899bad80c9cad3cb96aa417
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-03-10 16:48:17 +01:00
Soukéina Bojabza 1dab4ffe28 [FIX] mass_mailing: fix wrong templates with shape images
Since [1], some mass_mailing snippet templates now have images with
shapes by default. However, the shapes were not added correctly:

- for the Blockquote snippet, the files specified are not correct (wrong
names and wrong extensions).
- for the Team snippet, the shapes are not present when dropping it.

This commit fixes that by properly adding the shape images as defined in
the commit [2]. It also removes the "circle images" files as they are
not necessary anymore. The basic shapes were also fixed by removing
their width and height, since the dropped snippets looked weird because
their images have a default width smaller than the shapes.

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

opw-3137732

closes odoo/odoo#114966

X-original-commit: b1a3a3b18370ad76280726298602815769dce1c2
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-03-10 16:48:15 +01:00
Julien Van Roy 78bce8c069 [ADD] l10n_lu_peppol_id: add peppol_identifier for Luxembourg
Some Luxembourg public institution do not have a VAT number but have
been assigned an arbitrary number (see:
https://pch.gouvernement.lu/fr/peppol.html).

This requires a new field: `l10n_lu_peppol_identifier`. For Luxembourg,
the flow is then as follows: when exporting an electronic invoice, if
the field exists and is set, we read it. Otherwise, we read the VAT.

opw-3186147

closes odoo/odoo#114960

X-original-commit: 4b1b9b497931ae3c27a6a980a49107abec5650ec
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
2023-03-10 16:48:12 +01:00
Anh Thao Pham (pta) 9be9407f3c [FIX] account: fix search on account for "=" and "!=" operators
Steps to reproduce:
- Create 2 accounts:
  1)
  * Code: 1000
  * Account Name: Test
  2)
  * Code 1000A
  * Account Name: TestA
- Create a journal item for each account
- Go to Accounting / Accounting / Journal Items (list view)
- Add custom filter: ("Account", "is equal to", "1000 Test")
Journal items from both the created accounts are retrieved.
As a strict equal is requested, it shouldn't find the journal item
linked to account "1000A TestA".

Cause:
When searching on an account, the first part of the search is used
to find a code that begins with that part (ilike operation), regardless
of the actual operator (i.e. "=" in this case).
It has been done that way because we suppose that most of the times
customer is starting his search with the beginning of the code of the
account he is searching, which is not incorrect.
But the case of the "=" operator has not been handled.

opw-3179681

closes odoo/odoo#114927

X-original-commit: dfd9bee8c07b927a97823eb8ede7dc2b2a4c435a
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Anh Thao PHAM <pta@odoo.com>
2023-03-10 15:40:45 +01:00
Antoine (ande) a46d798fdb [FIX] web: parse server version in url to doc
To reproduce the issue:
1. In settings, scroll to "Contacts"
2. Click on the "?" bubble next to "Send SMS"
3. The page that opens is 404

Error: In the url of the opened page, there is
"saas~16.1+e" instead of "saas-16.1"

Added parsing to the server version in url

OPW-3198672

closes odoo/odoo#114941

X-original-commit: 424ec17af513de0a55fd946e6494a425c9fff39e
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-10 14:39:13 +01:00
yhu-odoo b6dd4beea6 [FIX] mrp: cancelled workorder considered when plan workorder
when plan workorder, cancelled/done workorders are taken in to account
when they block current workorder. In this fix, we ignore then when plan
workorder.

Task-3126569

closes odoo/odoo#114940

X-original-commit: 1b629659cb651c62fdd2c880ae591f9a9bb2e1eb
Related: odoo/enterprise#38020
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-10 14:39:05 +01:00
clesgow c43e39ce92 [FIX] mrp: fix missing uom for operations/byproducts in BoM Overview
Wrong key was used to display the unit of measure in the BoM Overview,
leaving the cells empty.

closes odoo/odoo#114934

X-original-commit: a6eba909a8f2ab07ddb239b4b64e82d51f724e66
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2023-03-10 14:39:02 +01:00
Rahul Prajapati d8a18a9d16 [FIX] mail: channel partner avatar response for public user
This issue was caught in Sentry.
The return type of the partner avatar for public users is `odoo.http.Stream`,
but the `route_wrapper` expects it to be `Response streamed`.

sentry-3929988311

closes odoo/odoo#114933

X-original-commit: 62ddfe0badf54375bc458bdb50cbcdbe4da5bbcd
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-10 14:38:59 +01:00
Romain Derie c58f26f524 [FIX] website: rename the font "Muli" to "Mulish"
This commit will rename the font "Muli" to "Mulish" as it has been
renamed in Google Fonts.

closes odoo/odoo#114932

X-original-commit: c24602e882f87c361866a739459a9d6e3f4fc6ef
Related: odoo/design-themes#638
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-03-10 14:38:53 +01:00
gawa-odoo 66a4d0b4d5 [FIX] analytic: Add (copy) to name of analytic account's copy
When duplicating an analytic account, we want to make more explicit
which account is the duplicate and which one existed before.

task-3202027

closes odoo/odoo#114931

X-original-commit: d499b9da8ba1b46db0671f14658a55095c68921d
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-10 14:38:51 +01:00
William Henrotin 92a49e8aea [FIX] purchase: long product description
- Create a product with a very long product description
- Add in a PO and print the RFQ

The description overlaps with the table header on the second page.

This is a known issue of wkhtmltopdf (see issues 1770 and 1524 for
example), and there is no known workaround. It can be avoided by
preventing the repetition of the header.

closes odoo/odoo#114916

Opw: 3208347
X-original-commit: cc5be8a907b2c3f33c6a62c5693726d757ffd113
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-10 14:38:45 +01:00
Lucas Lefèvre 2a24e7ae52 [IMP] sale, spreadsheet_dashboard_sale: display amount currency
Amounts in the spredsheet Sales dashboards are displayed without their currency
even though the amounts are all correctly converted to the current
company's currency.

With this commit, amounts are displayed with their currency in the
dashboard, list view and default form view.

The hardcoded number format is removed on the dashboard cells to let
the automatic format do the job

Task 3167343

closes odoo/odoo#111702

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-03-10 14:38:43 +01:00
Aaron Bohy 8fc4c6f2d8 [REF] *: remove legacy views support
The last view in the odoo codebase has just been converted to owl,
meaning that we no longer have legacy views. This allows us to
remove a lot of legacy view related code: the abstract elements on
which the legacy views were built, the compatibility layers that
allowed to deal with both owl and legacy views uniformly, legacy
widgets that were only used in those legacy views...

closes odoo/odoo#114893

Related: odoo/upgrade#4420
Related: odoo/enterprise#38005
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-03-10 13:33:04 +01:00
Jorge Pinna PuissantandAaron Bohy 59395d6d9a [REF] web: change function isInvisible visibility to private on the record
This commit changes the function isInvisible visibility to private on
the record, this means that outside the record, the modifiers need to be
evaluated.

Part-of task-id 3179751

closes odoo/odoo#114891

Related: odoo/enterprise#38009
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2023-03-10 13:32:56 +01:00
flvr-odoo 156ba71747 [FIX] survey: format description properly
This commit addresses a bug where the "description" field on the user
screen was not displaying properly. This fixes the formatting issue,
ensuring that the field is now properly displayed with appropriate line
breaks and spacing. Users can now view their description information as
intended.

closes odoo/odoo#114881

X-original-commit: 52858350a78856e7da444617dc2779a2f19688a0
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-03-10 13:32:50 +01:00
paso-odoo 5a3a566034 [FIX] website_mass_mailing: 'list_ids' Keyrror in newsletter form
If applied, this commit will solve the KeyError of 'list_ids'.

Before this commit
=======================
When there are no Mailing Lists available and add the snippet 'Newsletter block'
in the website with the template 'Form Subscription' and any user tries to
Subscribe to that form. It will raise an error like KeyError: 'list_ids'.

After this commit
========================
In this commit, checking keyword arguments which have list_ids in this or not if
list_ids not in that returns the error like 'Mailing List(s) not found!'

see - https://tinyurl.com/2n3o7s58
sentry - 3949183926

closes odoo/odoo#114871

X-original-commit: 360579977634c38c1cd6287c03e7c06796b408b1
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-03-10 13:32:47 +01:00
bat-odoo 0fbf65c66d [IMP] account,l10n_*: added new field in UoM to hide/unhide fields in Localizations
Currently, all localizations of UoM fields are visible in all countries.

So in this commit, I have added a new compute field in UoM models, the field
contains comma-separated company's country codes, and I have used this field
for the hide/unhide fields.

closes odoo/odoo#112604

Related: odoo/enterprise#36572
Related: odoo/upgrade#4284
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-03-10 13:32:41 +01:00
william-andre 1d8be6517f [FIX] account: set payment sequence correctly
Before the fix, the compute function is set as a string in the `default`
parameter. Meaning that it will always be True because a non empty
string is truthy.
Fix by converting the field to be compute-editable, like the function
was designed to be.

closes odoo/odoo#114904

X-original-commit: 11121120b13fc7500ee720f10964de6b9a0373af
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-10 12:31:14 +01:00
Mathieu (mano) d8958a45ba [FIX] web: checkboxes design & consistency
The main objective of this commit is to make checkboxes consistent
and fix their spacing issues.

Prior to these changes, the checkboxes on the `product_view` were
too close to their neighboring option labels, making it difficult to
know which checkbox to tick.

The new changes fixes inconsistencies in general such as undesired
hovering effects and the cursor behaviors on disabled inputs.

This commit also removes the margin in the checkbox template since the
padding from the checkbox wrapper compensates for the spacing between
the checkboxes and their respective labels.

Tweaking the selector in `settings_form_view.scss` to ignore boolean
field inputs allows us to get rid of max-width and margin overrides
introduced in commit b90059e936.

Most checkboxes were already falling under their labels on mobile, but
this change impacted those that were not. To address this issue, we
decided to consistently change the position of the checkboxes left to
their labels for small devices in form view.
This required slight adjustments to the `form_group.xml` template.

Still in form_view, for some of the specific checkboxes such as
`o_checkbox_optional_field` the changes in `form_controller.scss` are
made to mimic the new behavior for mobile sized screen.

However, if they are using the form_group template, their behavior
is unchanged at the moment.

Finally, even if these changes makes it better for most of them, some
checkboxes in `settings` still require some minor adjustments and will
be addressed in task-3113372.

task-3094083

closes odoo/odoo#114612

X-original-commit: ddb7574f97f11e69f0304c8bd8d55c2c53ab53fd
Related: odoo/enterprise#37887
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-03-10 12:31:11 +01:00
qsm-odoo ddd976f551 [FIX] website: review t-cache of the <head> in website.layout
The `t-cache` used on the `<head>` of website.layout was wrong: it
depended on the use of debug=assets or not (added by [1]) while it
should at least also depend on debug=tests. This commit chooses to fix
the issue by not using the caching system in case any value of debug
is used.

This commit also comments this `t-cache` value.

Steps to reproduce:
- As a visitor, first visit the homepage without debug mode
- Now reach the homepage with ?debug=tests
=> You still don't have the tests assets

Worse (but unlikely in production of course):
- Create a fresh DB and first reach the homepage with debug=tests
=> Now all your visitors are damned to load the tests tours for no
   reason (and you likely have lots of errors shown in your console).

[1]: https://github.com/odoo/odoo/commit/3061a484168ff21e3ae7e40ce691d299b63484a4

opw-3203912

closes odoo/odoo#114875

X-original-commit: 5efb637d880f82ea81bb64a0d091ffa7bdf7635b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-10 11:23:59 +01:00
qsm-odoo 087857e0a9 [FIX] web_editor: display websites in "desktop" mode on common screens
Many of our users have a default OS/browser zoom of 150% when using a
1920x1080 (Full HD) screen. One cause is that this is the recommended
zoom when using Windows. Whatever the reason: many users have a
1920x1080 screen combined with a 150% zoom... and in that case, entering
edit mode would display the website as it would be on "mobile" devices.

This is because since [1], the website is actually reduced in size when
entering edit mode since an iframe is used, whose size is reduced by
the size of the right panel. Before [1], the right panel would be
*included* in the website which would appear reduced but using CSS rules
according to the full screen width (which also led to other issues but
this is in the past now).

The sidebar was actually 3px too wide. Reducing it from 291px to 288px
solves the issue (at least if the OS task bar is not anchored to the
left/right). Indeed 288px is 1920px / 150% - 992px, where 992px is the
current minimum width the screen must have for our websites to be in
"desktop" mode (below, columns break over multiple lines).

Notice that 1920px / 150% = 1280px which gives the minimum size of the
screen that will display the website in "desktop" mode in the editor if
no zoom is used, which seems like an acceptable value.

Note: reducing the sidebar width even further to support more devices or
more zoom / OS task bar configuration would be problematic as the
sidebar would become too small. It is currently kinda at both its
maximum and minimum authorized value.

We tried solutions to virtually "de-zoom" the website iframe to display
the website in "desktop" mode no matter what but this did not give great
results. On problematic devices, the user still has the possibility to
de-zoom its browser by himself.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

closes odoo/odoo#114873

X-original-commit: e3ab91188173a47bdc827d8f0e45efcf7b246a4a
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-10 11:23:57 +01:00
Samuel Degueldre 54058db0ab [REF] point_of_sale, pos*: replace use of legacy rpc with orm service
*: l10n_co_pos, l10n_fr_pos_cert, point_of_sale, pos_loyalty,
pos_mercury, pos_restaurant, pos_sale, pos_sale_product_configurator

This is a step in the direction of making the pos no longer depend on
the legacy environment.

closes odoo/odoo#114668

Related: odoo/enterprise#37906
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-03-10 11:23:51 +01:00
Arthur Detroux (ard) aa16405009 [FIX] website: adapt website navbar when iframe is loaded
Prior to this commit, if the window was big enough to not be in mobile,
it could still be small enough so that the menu items overlap with the
systray item when the website client action was first mounted.

Steps to reproduce:
- Choose a language with long words (such as Slovak) or translate one of
website app menu terms to a word with more than 12 characters
- With the browser's dev tools set screen size to be responsive with a
resolution of 847 x 867
- Start odoo and go in the website app
- The menu items overlap with the systray items

This commit fixes that by not only re-rendering the navbar when the
website content is properly loaded (which was already done before) but
also by adapting it afterwards. However, to do so it copies the code
already present in the "web" navbar.

task-2687506

closes odoo/odoo#114869

X-original-commit: 690f420ceae799ed991f49afa405c917b3c101d2
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-03-10 10:18:23 +01:00
William Henrotin 0c301855ea [FIX] stock: prevent updating picking locations with move lines
Since #91640, the locations on stock picking are editable except in `done` state. This can leads to misunderstanding if some stock move lines
are already created. The locations on stock picking act as default
values for stock move/ stock move lines. Validating a picking will
always use the location set on stock move lines even if those ones
differ from the picking. This commit adds a simple error message in
to address this situation.

Close #113486
opw-3148993

closes odoo/odoo#114868

X-original-commit: 3eeab703f4e36723eae6005cf4b966f20f1e62dd
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-10 10:18:20 +01:00
Victor Piryns (pivi) b896b35dd2 [FIX] {sale,purchase}_stock: propagate package type to stock moves
Current behaviour:
If you have a confirmed SO, with a `sale.order.line` that has a
`product_packaging_id`, and you write a new `product_packaging_id`,
the "Delivery Order" has 2 lines, 1 move with the old qty and the old
packaging, and another line with the difference of qty and the new packaging.
Same behaviour is present on purchase side.

Expected behaviour:
If you have multiple `stock.move.line` from the same `sale.order.line`,
they should be able to merge, when you changed the `product_packaging_id`.
Ex: If you edit an SOL from 1 pack of 10 to 1 pack of 20, we should have
1 move line with qty 20 in packs of 20, instead of 2 lines, one with qty 10
in packs of 10, and another line with qty 10 in packs of 20.
Same behaviour is expected on purchase side.

Steps to reproduce:
- Install Sales and Inventory
- Activate "Product Packaging" in Settings
- Create a new product with 2 types of packaging
  - PackOf10 with quantity of 10
  - PackOf20 with quantity of 20
- Create a SO with a new line that product, quantity 10
- Confirm the SO
- Edit the SOL with 1 pack of 20 (`product_uom_qty`=20)
- The "Delivery Order" has 2 lines, instead of 1 with the new packaging

Reason for the problem:
When saving the SO/PO, a new `procurement` is created which will create
a new `stock.move.line` with the new packaging. This will prevent the
lines to merge correctly, because they have different packaging.

Fix:
When writing the `product_packaging_id` on a `sale.order.line`/`purchase.order.line`,
we directly write the package on the `stock.move.line`,
before any `procurements` are created, so the generate move lines
can correctly be merged.

Affected versions:
- 15.0
- saas-15.2
- saas-15.3
- 16.0
- master

opw-3002612

closes odoo/odoo#114866

X-original-commit: 87ed4b2f6c9c36202a1a4f3de143f638cf38d047
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-03-10 08:17:08 +01:00
Rodolpho Lima bcec057e90 [FIX] web_editor: hide toolbar for fields with no HTML support
Before this commit, only the immediate parent of a selected node was
checked for HTML content support in order to determine the toolbar's
visibility. This led to incorrectly displaying the toolbar for fields
like the 'list-price' on an e-commerce product page, whose text content
is wrapped in an extra 'span' element inside the field's span element.

This commit fixes it by checking all of the node's ancestors up to the
editable root for the attributes that determine if a field supports HTML
content.

This commit also prevents a server error if the user somehow styles the
product's price (with ctrl+B for example. It's worth noting that such
style would not be kept in the saved version of the page).
lxml.HtmlElement's `text` property has `None` value if the span element
does not contain any text before its first child element
(see https://lxml.de/apidoc/lxml.html.html).
Therefore an element like `<span><strong>42.00</strong></span>` would result
in `None` when reading its `text` property.
The `text_content` method is more suitable for such task as it returns the
text content of an element and its children.

task-3188550
opw-3171669

closes odoo/odoo#114867

X-original-commit: 524ba7f89286aa03ed6a4da30177c9ce7018c59a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-09 23:41:41 +01:00
Xavier BOL (xbo) 87bdb372bc [REM] hr_timesheet: remove legacy code
This commit removes the legacy code in hr_timesheet module since
everything is converted to OWL.

task-2702636

closes odoo/odoo#108605

Related: odoo/upgrade#4410
Related: odoo/enterprise#35217
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-09 20:52:52 +01:00
Laurent Stukkens (LTU) b4448d35a8 [IMP] hr_timesheet: add timesheet_uom service
This commit adds a new service called "timesheet_uom", this service will
help to find the right component to use for the `timesheet_uom` widget
sicne this widget could be float, float_factor, float_toggle or
float_time widget. This service also adds the right formatter to use for
this widget to correctly format the value when the formatter is used
instead of mounting the component.

task-2702636

Part-of: odoo/odoo#108605
2023-03-09 20:52:52 +01:00
Xavier BOL (xbo) dd9ee7e493 [FIX] hr_timesheet: create timesheet with default employee in context
Before this commit, the default employee set in the context to create a
timesheet is unused in the create method.

This commit uses the context to set the employee when no user and no
employee are given in the vals parameter.

task-2702636

Part-of: odoo/odoo#108605
2023-03-09 20:52:52 +01:00
Xavier Bol (xbo) cec042e8f9 [IMP] web: allow to import getRawValue util
Before this commit, the `getRawValue` function was just used in the
kanban_record file and not exported and so it is impossible to use it
in another JS file. This function could be useful if the rawValue is
needed for just a subset of activeFields or just for one field and so
it is a bit overkill to use getFormattedRecord util for that.

This commit exports `getRawValue` function to be able to use it in
another JS file.

task-2702636

Part-of: odoo/odoo#108605
2023-03-09 20:52:51 +01:00
Xavier BOL (xbo) 9ae4a0d647 [IMP] web: manage bool_or and bool_and for boolean in mockServer
Before this commit, the `bool_or` and `bool_and` aggregations are not
managed in the mockServer.

This commit allows to use the `bool_or` and `bool_and` aggregators for
boolean fields in the read_group mock rpc.

task-2702636

Part-of: odoo/odoo#108605
2023-03-09 20:52:51 +01:00
Xavier BOL (xbo) fc67391f5b [IMP] web: use formatFloatFactor for float_toggle widget
Before this commit, the formatter used for `float_toggle` widget is
`formatFloat` function, but the `value` parameter should be computed
with the factor set on the widget. This calculation is also done in
`formatFloatFactor` function before calling the formatFloat function.

This commit uses the `formatFloatFactor` to uniform the code instead of
doing the calculation in 2 different sides (one in the widget and one
in the `formatFloatFactor`).

task-2702636

Part-of: odoo/odoo#108605
2023-03-09 20:52:51 +01:00
Laurent Stukkens (LTU) 4d760b9e8c [IMP] web: improve sample server
Before this commit, the aggregate function must be defined to be able
to correctly aggregate the sample data.

This commit searches the aggregate function in the fields definition
when no aggregate function is defined to a field in `fields` parameter
of the `read_group` method.

task-2702636

Part-of: odoo/odoo#108605
2023-03-09 20:52:51 +01:00
Laurent Stukkens (LTU) 16cf4f4106 [MOV] web: move removeDomainLeaf from web_gantt to web
This commit moves `removeDomainLeaf` in domain.js to be able to use
the method everywhere in the JS Code and not only in the gantt view.

task-2702636

Part-of: odoo/odoo#108605
2023-03-09 20:52:50 +01:00
Xavier BOL (xbo)andLaurent Stukkens 34ebf7f4cf [FIX] mail: use relation getter defined in parent component
Before this commit, the relation is found in the fields of the record
of the component but the relation could also be in the props of the
component.

This commit uses the getter `relation` defined in the parent component
(Many2OneAvatarField) to search the relation in the props first and
then in the fields of the record is the relation is not defined in the
props.

task-2702636

Part-of: odoo/odoo#108605
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
2023-03-09 20:52:50 +01:00
Arnold Moyaux 7f4e274c03 [FIX] stock_account: wrong label after invoice modification
Usecase to reproduce:
-2 products setup as Periodic valuation
- Create a PO to buy both products
- Receipt and create the bill
- Modify the price unit on both invoice line to create correction layers

The label on the journal items have the same label relative to only one
of the products. It should keep the same label than before the
confirmation.

closes odoo/odoo#114792

X-original-commit: 226ae25b5f93164f14c1e68ed8bc2ea8a48b4e27
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-09 17:02:04 +01:00
Kevin Baptiste 2b50079ae5 [FIX] hr_holidays: adapt stress days color to dark mode
The colors of the stress days in the calendar were not adapted for the
dark mode, they were too bright and thus unreadable.

task-3216055

closes odoo/odoo#114796

X-original-commit: 0f60e0ac2c24998c2f792a55ae282d62df6b5f42
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-09 15:55:15 +01:00
niyasraphy 1eee49d00f [FIX] account,sale: traceback field used in domain missing in view
before this commit, enabling the mass editing for the
invoice and sale order tree view using the studio,
 throws exception.

* install studio
* open sale order tree
* enable mass editing for the tree using studio app
* exception will be shown

after this commit, on enabling mass editing on this tree view, exception will not be shown.

closes odoo/odoo#114795

X-original-commit: 105cdc773f6673661d3fdf766084cbc85c97c589
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-03-09 15:55:13 +01:00
flvr-odoo 9fe7c94c06 [FIX] mail: check translation
This commit adds a check to prevent saving a translation in a language that was not installed.

Upon adding a translation, the field "language" in the request was not checker,
allowing to add translation for language (or any strings as key) for a given field

This is not ideal and we want to prevent that, it can bloat the database for no reason.

opw-3208305

closes odoo/odoo#114793

X-original-commit: 89cd5ce88a0c666e811410e264e3cb474f9851c0
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-03-09 15:55:10 +01:00
Adrien Widart (awt) 1a0787062d [FIX] {sale_,}stock: decrease SOL qty with existing backorders
2-steps delivery. If there is already a backorder for the picking
out->customer, when decreasing the SOL qty, an unexpected picking
will be created

To reproduce the error:
1. In Settings, enable "Multi-Step Routes"
2. Edit the warehouse:
   - Outgoing: 2 steps
3. Create a storable product P
4. Update the on hand qty:
   - 10 x P at WH/Stock
5. Create and confirm a SO with 10 x P
6. Process the pickings with 6 x P (with backorders)
   - There should be 4 pickings
7. On the SO, decrease the quantity to 7

Error: an unexpected picking (customer -> out) is created for 3 x P

Step 6, when creating a backorder for 4 x P from out to customer,
we split the initial SM, and we force the `procure_method` to
`make_to_stock`
Step 7, when decreasing the qty, we create a negative procurement
and run the rules' system. Because of warehouse configuration, the
rule that links output location and customer one is based on an MTO
logic: the SM for -3 x P has the `procure_method` set to
`make_to_order`. As a result, that move will not be merged with the
one created during the split (step 6) and we will create the
unexpected picking for the move.

The SM generated by the split should keep the same procure method
logic as the initial one.

OPW-3141387

closes odoo/odoo#114787

X-original-commit: 920924e963d389ab2f962e0fe45ef229641d00c4
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-03-09 15:55:07 +01:00
FrancoisGe 4ba49c93ec [FIX] *: field shouldn't use props.value
We forget to remove few 'props.value' in 688986f888.
We should replace it by 'props.record.data[props.name]'.

closes odoo/odoo#114785

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-03-09 15:55:04 +01:00
Jacky (trj) ba8bba2add [FIX] point_of_sale, pos_*: improve Markup
pos_*: pos_adyen, pos_six

The use of the Markup was meant to keep the formatting (mostly the line breaks) of the data
given by the payment terminals. The data was stored on the `ticket` attribute of the `Payment`
model. A security issue arose from the fact that it is possible to import orders from a file
via the debug widget.
The `ticket` attribute was initialized in the `init_from_json` method and could be injected
with some malicious code.

Solution:
Instead of replacing all line breaks by the `<br/>` tag whenever terminal data is retrieved,
we can simply store this as it is in the `ticket` attribute. We then escape the value before
replacing the line breaks when exporting the data as a Markup. With this, only our `<br/>` tags
are trusted.

closes odoo/odoo#114770

X-original-commit: 7194506648c3512dc6a80d4a92a986643e60c5d2
Related: odoo/enterprise#37962
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-03-09 15:54:58 +01:00