Commit Graph
158314 Commits
Author SHA1 Message Date
Aaron Bohy c4c7534c0b [REF] web: legacy relationalfields: stop using view dialogs
This commit aims at removing the last usecases of the legacy view
dialogs, which will then allow us to remove legacy basic views.
The last usecases were in legacy code, in FieldMany2Many and
FieldMany2ManyTags. As those fields are still used in client
actions, we adapted them to use the wowl view dialogs instead.

Part of task 3168640

Part-of: odoo/odoo#111809
2023-02-08 13:27:58 +01:00
Aaron Bohy b2e267872f [REM] web: remove legacy views benchmark page
Those views are no longer used and about to be removed. This
commit also removes the benchmark lib as it is no longer used.

Part of task 3168640

Part-of: odoo/odoo#111809
2023-02-08 13:27:57 +01:00
lejeune quentin 7ea2e6ce15 [FIX] hw_*: Modify the default user for iot in windows
currently there is an error in the configuration
of the default user for the iot windows
it is configured for "local service"
which is the French version of the local user.
Except if the pc window is not in French,
the user is not configured correctly.
We have to use the default local user name
of windows which is "LOCALSERVICE"

closes odoo/odoo#112181

X-original-commit: 36c03128e97379f361072f481450704ebc582e3b
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-02-08 12:26:11 +01:00
Romain Derie 9d1269dbc0 [FIX] website: add website field in ir_asset list view
For some reason the `website_id` field was added in the form view of the
`ir.asset` model in a website module overide but it was not done for the
list view where it matters equally (if not most regarding the flow).

Indeed, those views / this model is mainly accessed for debugging
purpose in which case you are most likely looking for a specific asset.
In the website case, it's most of the time to find the custom asset
that was created following a scss customization in the right panel of
the website builder.
In such a case, it will have a website_id and will be easy to find in
the list view.

It's also the case for all the records having a `website_id`, we show
that field in both form and list view, it's always important when
managing / debugging DBs in multi-website environment.

See [1] for introduction of `ir.asset`.

[1]: https://github.com/odoo/odoo/commit/8cc066173dfb61bd95b8e1f0716f71f4e251810a

closes odoo/odoo#112156

X-original-commit: 1e6ea1a1e38f9769b91b80c3fd1e2ecabae35bb6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-08 12:26:05 +01:00
Jordan D. (Joda) d021f52ec1 [FIX] point_of_sale: long floor name doesn't display properly
How to reproduce
=================

When entering a very long table name and / or a very long table name on
the point of sale application, the text displayed on the "go back" button of the interface will overflow,
making the name unreadable and not very pleasing to see.

How the fix works
=================

The fix just cut and hide the part of the text that is overflowing

opw-3102914

closes odoo/odoo#112036

X-original-commit: 298b3578127b477e4e0e0dfec3db1222863d037a
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-02-08 12:25:55 +01:00
Florian CharlierandJulien Castiaux beaae001f8 [FIX] web,onboarding: fix multiple progress records
and better handle progress requests.

In previous versions, it sometimes occurred that multiple
onboarding_progress records were created despite our measures
against that.

Two problems were identified and fixed here, together with a simple
mean to handle this error on the client-side.

1. `_sql_constraints` entry was not adequate to prevent multiple
  records from being created for onboardings which are not to be
  completed per-company but per database because in our version(s)
  of PostgreSQL `NULL` values cannot be considered `NOT DISTINCT`,
  i.e., all NULL values are different from one another so `UNIQUE`
  is respected when we wouldn't want it.
  Therefore, we implement here a `UNIQUE` index via the model's init,
  allowing to catch unique violations when company_id is not set.

2. While we search if a record exists before creating a new one, it
  could happen that another worker created a record between these
  steps. As the database is configured (`REPEATABLE_READ`, which
  applies until the end of the transaction, when we leave the
  controller), it is very difficult to retrieve the record created by
  the other process. See additional details in the testing part below.
  Therefore, we chose to ask the client to perform a new request if
  desirable.

Existing extra records are removed with the related UPG PR script.

### Tests

Tests are included to make sure it is not possible to create multiple
onboarding_progress records for the same onboarding and company or
without any. This includes a non-standard (runbot will not run it)
and "database breaking" (we try to clean up our mess but we cannot
give any guarantee) concurrent test that reproduce the following
scenario:

The `/onboarding/<string:route_name>` is called twice in two different
workers for a same `route_name`. The corresponding onboarding exists
and has no corresponding `onboarding.progress` record yet. Python side,
the two workers are oblivious of what's happening in the transaction of
the other worker thus any python-side-only unicity constraint would
fail to detect any progress created by other workers. This would end up
with two progress records created for a single onboarding which is
illegal.

Task-3101666

closes odoo/odoo#109221

Related: odoo/upgrade#4142
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Julien Castiaux <juc@odoo.com>
2023-02-08 12:25:52 +01:00
Stefan-Calin Crainiciuc (stcc) d6bab31a94 [FIX] web: add DomainSelector debugValue default value
Steps to reproduce:

- Install Events
- Activate debug mode
- Events > Config > Lead generation > Create

Traceback is raised.

The `debugValue` prop added in a29691bfd8 should be a string but doesn't
have a default value, and it is evaluated as `false` at runtime.

Solution:

Add default value for `debugValue`.

opw-3056391

closes odoo/odoo#112149

X-original-commit: bec8da1dc250a40b77d02bd5f487f12f5a857dde
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-02-08 10:18:54 +01:00
Florian Vranckx 89709cb3a7 [FIX] website_event : check ticket id
There was previously no check that the ticket id belong to the selected event.

For better data integrity, this should be the case

closes odoo/odoo#112147

X-original-commit: ea645c9c9f301c340d95bd30260b3aa0cd255920
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-08 08:30:52 +01:00
asno-odoo 3293496bbf [FIX] l10n_fr_pos_cert: default timezone
When mocking views, if there is no timezone set in context and for user,
providing Boolean value to pytz.timezone() functions results in error.
It doesn't happen in UI as UI takes value from session timezone.

closes odoo/odoo#112151

X-original-commit: 694de9d94de105336398a259c77d7e5bb0e42438
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-07 23:16:52 +01:00
Adrien Minne (adrm) 329fc12c89 [FIX] mail: fix y overflow in chatter
For some font families, there was an y overflow and a scrollbar in the
chatter when inserting an @mention. This was because the font height +
the padding of `a.o_mail_redirect` was greater than the line height.

Added an `overflow-y: hidden;` in the css to fix the issue.

closes odoo/odoo#112153

X-original-commit: 3a40fa55919b5a4befc93beaf212521b61f15085
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-02-07 19:53:01 +01:00
Nicolas Bayet 82d9e8bf9f [FIX] web_editor: write with string in update_checklist
Before this commit, when the user tried to update a checklist, there
was a traceback in `handle_history_divergence` because the `value` is a
byte sequence instead of a string.

opw-3158660
task-3165844

closes odoo/odoo#112112

X-original-commit: e3900dfe51cb294ad139395cb402c9f13dd067c5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-07 16:38:42 +01:00
Sergey Shebanin fadcc369ad [IMP] mail: define title for full composer
Before this commit title for full composer dialog window is "Odoo".
It increases probability of mistake for user because it doesn't clear
that user do: sending email or logging note.

After this commit title matches dialog purpose.

closes odoo/odoo#112111

X-original-commit: c29dc28534f03ccec2e390c44b16525ee45a6b3b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-02-07 16:38:39 +01:00
Samuel Degueldre 0d537e58a9 [REF] pos*: move show(Temp)Screen, make number_buffer and popup services
*: l10n_fr_pos_cert, point_of_sale, pos_discount, pos_hr,
pos_hr_restaurant, pos_loyalty, pos_mercury, pos_restaurant, pos_sale,
pos_sale_product_configurator, pos_six, pos_stripe

Continuing to move things out of the Chrome god component, this commit
does the following things:

 - moves the showScreen and showTempScreen methods and the corresponding
closing methods into the pos store so that components that need them can
access them through the pos service in a more explicit way. To that end,
these methods have been removed from PosComponent and Gui.

 - introduces a popup service instead of using a bus in the env, this is
mechanically very similar but closer to what's done in web and hopefully
a first step to using the dialog service instead. It also removes the
showPopup method from the PosComponent and Gui, to make components
depending on the popup service explicit.

 - makes the number buffer into a service instead of being a directly
imported singleton, which will enable it to be used with hooks instead
at a later point, and allows easier dependency injection in tests.

 - removes showNotification from the PosComponent and Gui, the
notification system was already converted to a service in a previous
commit for the same reasons as showPopup and the end goal is to use the
notification service from web to reduce duplication.

closes odoo/odoo#111844

Related: odoo/enterprise#36668
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-02-07 16:38:34 +01:00
Pablo Montenegro 1c7c29eeab [FIX] l10n_ar: total invoice amount on printed invoice
Total amount on printed electronic invoice include taxes if the electronic invoice has argentinian vat and document type 'B', 'C', 'X', 'R'. Also if the invoice mentioned before have more than one tax and one of them is different than "IVA" (argentinian vat), then is necessary not to show in the printed invoice report the amount untaxed of the invoice.

closes odoo/odoo#111776

Task: 922
X-original-commit: f5c0552a2b2e975db8745219af044638449c3312
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-02-07 16:38:28 +01:00
Maximilien (malb) c2d486eeb4 [IMP] l10n_jp: translation
Before this PR, all this localisation was written in Japanese, but all the localisation have to be written in english and then translated back in the native language. This PR correct that.

closes odoo/odoo#111656

Task-id: 3166097
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-02-07 16:38:26 +01:00
Guillaume (gdi) 09b720eff1 [IMP] web_editor, website: initialize the editor's tooltips
The editor offers bootstrap tooltips, but these were not all initialized
and therefore appeared as standard HTML tooltips. This commit fixes that
by initializing all the tooltips so that they all have the same style.

Details:
- The bootstrap tooltips are now available in translate mode.
- With bootstrap 5, only one bootstrap component can be initialized on a
  HTML element. This is why the tooltips are now initialized on the
  first child when there is another bootstrap component.
- Some tests have been adapted.

task-2777738

closes odoo/odoo#85666

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-02-07 16:38:23 +01:00
fdardenne 1bfc3aa1cf [IMP] web: x2many list: deactivate modal when in editable
Before this commit, in a form view, it was possible to open a record in
a x2many list field when the list is editable (`editable="top|bottom"`)
and the form view or the field is in readonly.

We want to disable the opening of the record in this case to stay
consistant for a better UX:
- when in a editable x2many list, the record form view never opens (even
  if the form view or the field is in readonly)
- when not in editable, the form view always opens

This commit does not modify the behaviour of the x2many field kanban
view.

task-2964320

closes odoo/odoo#110838

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-07 15:35:49 +01:00
sofiagvaladze 14d97ec28a [IMP] base,auth_password_policy: add form view for changing password
Purpose: The form view is more intuitive then list view in case
user wants to change the password only for one user.

task - 3105178

closes odoo/odoo#109869

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-07 14:35:33 +01:00
oco-odoo 86377fd053 [FIX] l10n_be: tax report: fix wrong carryover for grids 82, 83, 86, 87 and 88
Those lines were badly configured. The proper setup is the one already used on grid 81. Without this, we're also considering entries from the previous periods (because of the date_scope), and just summing everything while we actually only want the last one.

closes odoo/odoo#112082

X-original-commit: 92fa3f28600590617fd644430873abd0f250db00
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-02-07 13:34:58 +01:00
Florent de Labarre caea280566 [FIX] account: can't get previous move
In case of a user have no access to all account.move (restrict by ir.rules). An exception can raise during move posting.

Add an index to speed up this function in large database.

OPW #3159258

closes odoo/odoo#112081

X-original-commit: 5b95336470efc7b92289936c29cf561ba5fb7f66
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-02-07 13:34:55 +01:00
pedrambiria 14cb5ef420 [FIX] pos_adyen: prevent having the same Adyen in multi-company
Before this commit: it was possible to create two PoS terminals in two
companies with the same `adyen_terminal_identifier`. So it's possible,
after each payment, it would add the response to the wrong payment
method's `adyen_latest_response`.

The solution is to bypass multi-company record rule in
`_check_adyen_terminal_identifier`.

opw-3131814

closes odoo/odoo#112080

X-original-commit: 8a9d7ddf0739b3f7c3224f53f7593be40be0b15a
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-02-07 13:34:53 +01:00
Jorge Pinna Puissant 9e14de9491 [FIX] web: update moment.js to 2.19.3
This version of moment.js is required to avoid CVE-2017-18214

task-2291793

closes odoo/odoo#112079

X-original-commit: 11f3e7351a899848ec4df0107c3f6e2a627807ba
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-02-07 13:34:50 +01:00
Thomas Lefebvre (thle) e7a953d0e3 [FIX] auth_signup: send confirmation email when registering
Steps to reproduce:
- In settings, activate "Free sign up" option;
- Go to "Sign in" page;
- Click on "Don't have an account?";
- Create an account.

Issue:
No confirmation email is sent.

Cause:
The `qcontext.get('token')` variable does not exist
in the case of a "Free sign up".
And therefore, we do not respect the condition to send an email.

opw-3103867

closes odoo/odoo#112078

X-original-commit: 6711a0ca362763fa641f0e855e4a3c283fe633ec
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-02-07 13:34:47 +01:00
FrancoisGe 97a641a750 [FIX] web: client action reload
This commit aims to solve two problems:
1. Keeping the hash if no action_id or menu_id is passed as a parameter.
2. Always force a reload of the page.

Description of the issues:
1. When reloading from an action, we just want to force a reload of the
page while staying on the same action. We only want to modify the hash
if we want to reload the page by opening another action.

2. When installing the website module, an error dialog is displayed and
the page is not reloaded because location.assign(...) only causes
a reload when the url has changed (path or search, it ignores the hash).
The error comes from trying to access a client action that is not yet
in the assets. It will be added when the page is reloaded.

Solution:
1. Modify the hash only when you have action_id or menu_id in the action params

2. We have thought of two solutions:
- Do a location.reload(...) when the url has not changed. The error
  appears during the reload time because location.assign(...) modifies
  the hash. The service action will then try to execute the client action
  which does not yet exist. (legacy solution)
- Always have a different url so that location.assign(...) causes a reload.
  So we decided to add/remove the reload key in the url search. This will
  always force a reload. We will opt for this solution because it avoids
  displaying a crash.

closes odoo/odoo#112077

Taskid: 3144132
X-original-commit: 77772c0e73d9f561fed63847175e2dbc9b809fa1
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-07 13:34:45 +01:00
hote c1f8c4abda [IMP] web: add disabled props to CopyButton and CopyClipboard field
The CopyClipboardButton Component acts as a button. As such it is
interesting to add the possibility to make it disabled when needed.
This commit adds the possibility to add the attribute `disabled="1"`
to the xml code and let it function as one should expect.

See task 2672713 for a practical use.

closes odoo/odoo#111724

Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-02-07 12:36:45 +01:00
Abdelouahab (abla) ba5eb671af [FIX] point_of_sale: rouding half up gives wrong value
To Reproduce
============
- set cash rounding method to half-up with a value (1 for example)
- create a product available on pos with price (1.61$ in my example)
- on pos select this product and proceed to payment with cash
- with 2$ cash the total will be 1$ and change 1$ which is wrong

Problem
=======
- the function responsible on applying the rounding method doesn't take into
account the rounding method `"HALF-UP"`

Solution
========
- update the function to apply `"HALF-UP"` correctly

opw-3143698

closes odoo/odoo#111930

X-original-commit: 092b3d5637a02786baa75255eb29b554a5d9f8b8
Signed-off-by: abla001 <abla@odoo.com>
2023-02-07 11:41:34 +01:00
Michael (mcm) 2309fda2d7 [IMP] web: move calendar filter panel to left
This commit moves the filter panel of the calendar view
to the left of the view to make it more coherent with
other views.

closes odoo/odoo#111666

Task: 3164391
Related: odoo/enterprise#36606
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-07 11:41:31 +01:00
Martin Trigaux 8872acaede [IMP] base: clarify groups_id label
Using the word "Security" as a label may bring some wrong expectations
on what the value does.
Only on server action does this value is actually enforced at run
time. For window actions and menu, it is only for UX purpose.

closes odoo/odoo#111954

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-02-07 10:39:42 +01:00
Thibault Delavallée 18a549b6e7 [REF] snailmail(_account): remove unused snailmail.confirm wizard
Snailmail holds an abstract model 'snailmail.confirm' that implements some
kind of generic confirmation flow. It is nowadays used in a single case
that is the 'snailmail.confirm.invoice' wizard that inherits of it in
snailmail_account.

In this commit we remove the base abstract model, as it is defined once
and does not really add value. This kind of generic model actually adds
more noise than solves issues.

The invoice confirmation wizard is now completely defined in snailmail
account bridge, easing understanding of models.

Task-3046371 (Mail: Better Language Support in Composer)

closes odoo/odoo#111901

Related: odoo/upgrade#4299
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-07 09:42:05 +01:00
Arthur Detroux (ard) d7c7823d8c [FIX] website: fix entering edit mode after canceling a beforeunload
The website now being displayed in the backend of Odoo (since [1])
within an iframe. To be able to send events inside this iframe, the
`PublicRoot` widget from within the iframe is "captured" (using the
`OdooFrameContentLoaded` event). This is used to send events to Public
Widgets such as notifying them that the edition is about to start, so
they need to reload in edit mode.

Prior to this commit, the WebsiteRootInstance would be set to
`undefined` when the page was about to be unloaded (`beforeunload`
event). This is useful as this prevents the editor to start in an
inconsistent state if a user clicks on a link or changes page and clicks
edit too soon.

Unfortunately, the beforeunload event can be canceled.

Two ways this can be noticed:

- On firefox, enter edit mode and edit the page
- Try to close the tab
- A browser dialog is displayed asking the user to confirm if they want
to leave the page
- This is done using the beforeunload event
- It is triggered in both the iframe and the top window on firefox when
trying to close a tab
- Clicking on cancel won't allow you to resume the edition as the
`websiteRootInstance` was set to `undefined`

- On any browser, enter edit mode
- Upload a document using the media dialog
- Save
- Click to download the document
- Try to enter edit mode

Clicking on the link triggers a `beforeunload` as the browser is about
to leave the page. The browser somehow detects a download and cancels
the beforeunload. But the `websiteRootInstance` was already set to
undefined.

This commit fixes that by only setting the websiteRootInstance to
undefined in some context:

- When clicking on a link that will result in navigating inside the
iframe
- When changing website
- When the `WebsitePreview` component is asked to reload the iframe
- Doing it again when a `pagehide` event is triggered.

This last one is only for safety (e.g. if a widget within the iframe
triggers navigation which leads to a pagehide). Though using this event
is often too late, as the editor has time to start but often not fully,
and destroying it so early can lead to tracebacks.

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

task-3046473

closes odoo/odoo#112048

X-original-commit: e47a9900e4a7842774d33a332b325e1f08c3ca45
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
2023-02-07 08:41:00 +01:00
David Monjoie d2d1c01971 [FIX] web_editor: remove double click popup from links
It is wrong in 15.0 since double clicking on the link does nothing
anymore, as edition of the link is done via the popover. Having both
tooltips at the same time created a race condition that ended up
inserting the second tooltip in the DOM, where it obviously couldn't
function properly anymore.

opw-3147108

closes odoo/odoo#112035

X-original-commit: 35cc6049a8bcc3c80cb4eb2468f85d09734814b8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-07 08:40:57 +01:00
Shawcker c4f0158506 [FIX] account: restrict display of 'reconciled entries' button on moves
When resetting a payment/move to draft, the related entries are unreconciled. The 'reconciled entries' button raises an error since there isn't any.

This is due to the field `has_reconciled_entries` being wrongly computed since the `_reconciled_lines()` method doesn't actually filter on lines that are reconciled.

Fixing this removes the button when there is no reconciled lines, and avoids the errors raised.

task id=3120327

closes odoo/odoo#112033

X-original-commit: 85a0ca21a3d35088e247618016196f44637eb3d2
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Popeler Antoine (anpp) <anpp@odoo.com>
2023-02-07 08:40:55 +01:00
Florent de Labarre fdaae9f101 [FIX] account: prevent change restrict mode hash
In case of an user can edit account.journal and have no access of all account.move of this journal, the user can set to false this field : restrict_mode_hash_table.

closes odoo/odoo#112028

X-original-commit: c1bcf20a4c58516e484417885f47e32a8c192dc1
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-02-07 08:40:49 +01:00
Tommy (tong) 30926d94e8 [FIX] hr_holidays: end of year accrual calculation issue for yearly accrual plan
Steps to reproduce:

- Setup an accrual plan with yealy first of Jan granting 15 leaves and it will pospone maximum 7
leaves to the next year.
- Setup an allocation with date started 2 years ago on first of Jan.
- Run scheduled action "Accrual Time: Updates the number of time off" after current year first of
Jan.

Current behaviour:
Only granted 7 days leaves.

Expected behaviour:
It should grant 22 days leaves as it should combined the postpone 7 days leaves and the leaves
granted on first of Jan of the current year.

Explanation:
With this modifiation there are two changes:

1) The lastcall and nextcall in the _end_of_year_accrual method should not skipped the
_process_accrual_plans methods in the _update_accrual method for all the allocations that using
pospone action_with_unused_accruals. It should keep the lastcall as previous date of current
level or the lastcall of the allocation depending with one is latest. Also the nextcall should be
the upcoming nextcall. Therefore after the postpone_max_days caluclated. The _update_accrual
method can compute the leaves again for yearly first of Jan accrual plan.

2) The prorata amount accrual plan calculation should be date_to first_date_this_year. Otherwise
one day is missing in the prorata calculation and the leaves count will be incorrect.

closes odoo/odoo#112004

X-original-commit: ea53b57a890412714a3d6f5d6946705bf3391e90
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-07 08:40:45 +01:00
Antoine Guenet 4ce0664f6a [FIX] web_editor: prevent merging table with other element on paste
When we paste content in the editor, we merge the first and/or the last
element(s) from the clipboard with the element(s) before/after the
selection (eg, pasting `<p>b</p>` at `<p>a[]c</p>` (where `[]` is the
selection) should result in `<p>ab[]c</p>` rather than
`<p>a</p><p>b</p><p>c</p>`). If the element we try to merge is a table
though, we may end up pasting a `<tbody>` without its parent table,
which leads to unexpected results. In any case we don't ever want to
merge a table with another element, so we prevent that.

Steps to reproduce the issue (in the `note` module):
* Type "a" then hit the ENTER key.
* Add a table (using the /table command) and write in each of its cells.
* Make a selection that starts before "a", and ends after the last
  character of the last cell of the table.
* Copy the selection.
* Paste the selection in the paragraph after the table.
What you see before this commit is the text you copied, without the
table.

Everything above is also true of lists (just replace the table with a
list in the text above) and these cases are fixed here in the same way.

task-3165836

closes odoo/odoo#112042

X-original-commit: 07604f2505d9cc32ebb3cf3f09192472f0bf30c4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2023-02-07 07:43:50 +01:00
william-andre 82be3c8441 [FIX] account: handle writing just tax_ids on an aml
The `_disable_recursion` wasn't working properly because it didn't
disable recursive calls if they used the context of a recordset that is
not in the container. It is really easy to do if we use `self` for
instance.
In order to avoid this, we just temporarily change the context of all
environments while inside of the context manager.

opw-3016530

closes odoo/odoo#112049

X-original-commit: b3d60185aba865905d7d91c3e1edfae1123b03b9
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-06 23:04:43 +01:00
william-andre 11ddbf3617 [FIX] account: update balance when changing amount in currency
Before it wasn't done for simplicity, but turns out it is actually quite
simple to do.

task-3167055

closes odoo/odoo#112043

X-original-commit: 21cb20a284a98a59bf5885ad56d231ae337105e1
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-06 22:11:02 +01:00
Ivan Yelizariev 4862bec68e [FIX] web: fix overlapping of Add, Expand buttons in export wizard
Some html structures are not well mirrored in RTL directions.
Fix it by changing it to rtl frienldy structure.

STEPS:
* switch to any RTL language
* open list view for any model
* click Action -> Export

opw-3063763

closes odoo/odoo#112034

X-original-commit: f10a4886d2c2bfc0d4643e0e4597e62c2ba4f94e
Signed-off-by: Luca Vitali <luvi@odoo.com>
2023-02-06 20:39:42 +01:00
Antoine Vandevenne (anv) 6457145837 [FIX] paypal_paypal: log processing errors in the chatter
opw-3097856

closes odoo/odoo#112012

X-original-commit: c45e6c670bfa7c9223854d8d7863377fab255b4d
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-06 18:35:30 +01:00
qsm-odoo 506d88ea48 [REM] website: delete data-oe-company-name
The `<html>` element of websites had a `data-oe-company-name` attribute
which was dead code since a long time. This commit removes it.

Some history:

- [1] introduced the SEO dialog which suggested the company name as
  keyword value. That value was retrieved through a `<meta>` which was
  added in the DOM at the time.

- [2] converted the `<meta>` tag into valid HTML code, by introducing
  `data-oe-company-name`.

- [3] suddenly stopped caring about the company name value... but left
  `data-oe-company-name` as dead code, alongside a JS method reading
  it (in the SEO dialog class).

- [4] removed the JS method dead code by refactoring the whole SEO
  dialog during the website-in-backend refactoring... but still left the
  `data-oe-company-name` dead code.

This commit finally cleans it. It was judged that not using the company
name value (as step [3] decided) is ok.

[1]: https://github.com/odoo/odoo/commit/f50b273ae12493e227806670d9a866b6be162551
[2]: https://github.com/odoo/odoo/commit/e28c8101232d527c2d3ea2e619013ca70602d957
[3]: https://github.com/odoo/odoo/commit/d52ec7fc42cbeecafea921ea30d1d0723a59078a
[4]: https://github.com/odoo/odoo/commit/ac55f2bb113ecf7c774fe6e96d28e716184a97d1

closes odoo/odoo#112007

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-06 16:28:50 +01:00
pedrambiria 5cec1fc94d [FIX] pos_stripe: capture payment with non-admin user
Before this commit: if a non-admin user captured a payment with
PoS Stripe, an error occurred in UI. The problem is that only the
"Administration / Settings" group can have access to the payment
provider.

The solution is to use super user mode.

opw-3120441

closes odoo/odoo#112006

X-original-commit: de096c08f5766f3fb2b2438730295195cdd9af16
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-02-06 16:28:47 +01:00
Paolo Gatti 89f12d66b9 [FIX] l10n_it_edi: Fixing the template trimmings
Strings must be trimmed in the XML output because
the Tax Agency has requisites on the length.

Specs: https://www.fatturapa.gov.it/export/documenti/fatturapa/v1.2.2/RappresentazioneTabellareFattOrdinaria.pdf
Ticket link: https://www.odoo.com/web#id=3044072&model=project.task

opw-3044072

closes odoo/odoo#111944

X-original-commit: 3bd90997b7f06883d595c4c573a11b426efd8de6
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2023-02-06 16:28:41 +01:00
niyasraphy d6f3fcfee7 [FIX] account: translatable action name
before this commit, the action name was not translatable into user language and always displayed in english.

after this commit, the action name will be translatable and will be showing the value based on user language preference.

closes odoo/odoo#111991

X-original-commit: 6aa80ca670476494b10115f61805324811b73a58
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-02-06 15:27:07 +01:00
niyasraphy 0dad393206 [FIX] account: traceback on accrued revenue entry when no order line
before this commit, traceback is raised when trying to create accrued revenue entry without entering the order lines.

open a sale order, enter customer and save it, from the action button, click Accrued Revenue Entry and enter an amount in the amount field, exception will be raised.

after this commit, no exception will be raised.

closes odoo/odoo#111976

X-original-commit: d68eafd5c06fef77ba669df0e0ca6cd7217b08b5
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-02-06 14:16:52 +01:00
Paolo Gatti (pgi) 1d3f4a73ac [IMP] l10n_it_edi_*: Withholding, pension fund
Withholding
-------------------------------

Italian invoices may have a special fiscal feature which is "Ritenuta"
It means "withholding" and we implement it as a tax. The Withholding's
main use case is for professional consultants who can ask their
services' buyer to pay their income taxes on their behalf. This way, the
invoice lines will have a negative tax, and the buyer will not all the
money that is billed. The withheld amount will be sent to the tax
collector by the buyer at a later time. Professionals have any threshold
of how much money can be withhold in an year.

We added two fields to account.tax, l10n_it_withholding_type and
l10n_it_withholding_reason, for EDI import/export purposes. New taxes
with those fields filled out and a tax group have been added. The view
has been updated, to see the fields, the tax amount must be negative.

In the EDI import, the new DatiRitenuta tag is now read and handled. The
correct l10n_it_withholding_type tax must be found, or a message is
logged to the invoice chatter.

Pension fund
-------------------------------

Under Italian fiscal rules, there are cases in which professionals may
ask the buyer of their services to pay income taxes on the invoice
itself, and that's managed withholding taxes. In addition to that, the
buyer may also be asked to pay for the seller's national pension fund,
as a percentage of the invoice's total. This information needs to be
imported/exported through the EDI

Ticket link: https://www.odoo.com/web#id=2936606&model=project.task
Task link:   https://www.odoo.com/web#id=2903280&model=project.task
v14 Community PR: https://github.com/odoo/odoo/pull/96930
v14 Enterprise PR: https://github.com/odoo/enterprise/pull/33083

task-2903280
opw-2936606

closes odoo/odoo#111800

Forward-port-of: odoo/odoo#102527
X-original-commit: 2525103f200b8bb13ea78eaa28f2135ed5bba755
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2023-02-06 14:16:42 +01:00
jbw-odoo 25f26acc05 [FIX] account: accrual date fix
SO/PO accrued entries date should be the last day of the previous month since it necessarily concerns a bygone period.

closes odoo/odoo#111535

Task: 3045028
X-original-commit: 1dacb28a3f2a3f66572e693dfda81ceaf87696c9
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-02-06 14:16:39 +01:00
jbw-odoo 4c909c9715 [FIX] web: gray out sample data group lines in list view
Group lines in a list view of sample date should not be clickable.

Before :
Create a new partner and make an invoice for him in 2020. Post it, and open the partner ledger for 2023. The partner appears. If you unfold his line, you'll see the initial balance amount. So far, so good. Now, click on the "journal items" button on the partner line. Since there is no aml in period for him, it shouldn't show any. Indeed, nothing is shown, and the mockup data are displayed ... However, the "group by partner" filter applied on the list view make is so that group lines are displayed for mockup data ... and they are not greyed and not-clickable as they should.

closes odoo/odoo#111467

Task: 3126138
X-original-commit: ca3c9988422dc29ec193af380177e19c8c4f69c1
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-02-06 14:16:37 +01:00
Mathias Mathy (MAMA) 0a43740481 [REF] Stock: report_stock_forecasted to owl
Refactoring of report_stock_forecasted to owl
Since it wasn't really a report (no print action),
it changed from a report to a client action.
Task: 2885757
See Upgrade : odoo/upgrade#3926
See Enterprise : odoo/enterprise#32116

closes odoo/odoo#101247

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-06 14:16:26 +01:00
Touati Djamel (otd) a8398234cb [FIX] stock_account: fix remaining qty in svl
Steps to reproduce the bug:
- Create a product category “Fifo”:
    - set the costing method to Fifo
- Create a storable product “P1”:
    - category: All (costing method = standard)
    - Update the qty to 10 units

- Go to inventory → Product variant → “P1”
- Change the category from “All” to “Fifo”
- Go to inventory → Reporting → stock valuation
- Add “reaming_qty” field in the list view

Problem:
The empty_stock layer (the layer created to empty the product) has `remaining_qty` of -10 instead of 0 whereas we change from standard to Fifo

The write method of `product.product` is triggered,  leading to Product Variant having another category than Product Template when the write method of `product.template` is triggered

opw-3138061

closes odoo/odoo#111911

X-original-commit: f6f5d4a27af5bad42c3c6c11ce681be631f43248
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-06 13:15:45 +01:00
Géry Debongnie a5036864b1 [IMP] web: add a memoized checkAccessRight method on user service
This prevents the property field from calling repeteadly the server for
an information that (almost) never changes. Note that all checks should
probably go through this services for the rest of the codebase.

closes odoo/odoo#111571

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-02-06 12:09:51 +01:00