Commit Graph
155606 Commits
Author SHA1 Message Date
Walid HANNICHE (waha) bfe5268ba2 [FIX] web_editor: UI freeze on RTL languages
Steps to reprodue:
- enable any rtl language (arabic)
- move to the product page for exemple
- the page is frozen (dependecy loop in css)

Bug:
when the CSS gets minified the missing semicolon error spreads and
produce an invalid file

Fix:
added the missing semicolon

opw-3019173 3032064 3032250 3035077 3034712 3035077 3023730 3022962

closes odoo/odoo#103699

X-original-commit: 8048bdac4cec56edd92c68f7041b802376f9372c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2022-10-21 00:08:41 +02:00
John Laterre (jol) d3264389c9 [FIX] account_asset: fix move display name
Steps to reproduce:
- Install Accounting App.
- Go to the Accounting App.
- Click on 'Accounting' -> 'Assets'.
- Create a new asset and confirm it.
- Click on 'Modify Depreciation'.
- Select the 'Sell' action.
- Click on the empty 'Customer Invoice' field.

Observed behavior:
The invoices are listed based on their name, which is not very explicit/helpful.

Desired behavior:
In addition to the name, the partner and the date are also displayed in the list.

The search is also improved, in order to use the partner name
(in addition to the invoice name) to filter invoices.

closes odoo/odoo#103696

X-original-commit: 4075c4512cfb44cc3add8270b373f3a4e1e80419
Related: odoo/enterprise#33026
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-10-20 20:21:43 +02:00
Arthur Detroux (ard) da9b81f28d [FIX] website: fix snippet social media values cache
This `s_social_media` snippet option uses a variable defined in the
module's scope to store social media values. This
reduces the amount of RPCs needed to fetch the data as they will only be
done once per edition.

Prior to commit [1], this cache would only exist as long as the page
lived. Which means that switching website, switching page or going in
the backend would reset its value. Commit [1] moved the edition in the
backend which means that the cache would persist between pages but more
importantly, between websites, only resetting if the backend was
refreshed or left.

Steps to reproduce:
- Go on website 1
- Modify the URL for facebook in the footer
- Go on website 2
- The value is the same when it should still be facebook.com/Odoo

This commit fixes that by resetting the cache when the editor is
destroyed.

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

closes odoo/odoo#103689

X-original-commit: 3efb726575679f62f9ee2894193323bfe45d7938
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-20 19:09:57 +02:00
Aaron Bohy f912acbd9e [FIX] hr_recruitment: fix t-groups typo in arch
Typo introduced by [1] (t-groups has no effect).

[1] 8b91cab67f

closes odoo/odoo#103674

X-original-commit: a0dff6da8c0e3eca8d1b6210f6cc84f57150c408
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-20 18:12:50 +02:00
Valentin Vallaeys (vava) 034218a5dc [IMP] payment: prevent creating payment tokens
Payment tokens should not be created manually, as it is useless,
confusing and potentially harmful. They should only be created alongside
payment details of a customer payment method.

task-2848379

closes odoo/odoo#99915

Related: odoo/enterprise#31199
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-20 18:12:44 +02:00
Nemael 76d45c2d29 [FIX] mail: emoji search bar focused on mobile
The emoji search bar should not be automatically focused when using odoo
on mobile.

This commit re-introduce the auto-focus of the search bar, and also
cancel auto-focus if using odoo on mobile

Task-3015386

closes odoo/odoo#103672

X-original-commit: 282a09c5d62d32a35636c9357033b8f18631b85f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-20 17:17:20 +02:00
Bruno Boi d54bff857a [FIX] web,calendar: calendar and popovers design
Fix the hatching and striking effects for events
by moving some scss rules to the right place:
- o_event_hatched
- o_event_striked

Various fixes for the calendar popovers to display properly, such as:
- year scale popovers
  - proper popover body padding and font-size
  - style that depends on attendee status
- other scales popovers
  - inverse the condition when the popover footer must shrink

closes odoo/odoo#103661

X-original-commit: 917d8e4123517c73d8bd6a4bd83becf1b0ee1090
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-10-20 17:17:09 +02:00
Bruno Boi c9bec348db [REM] web: calendar unused design classes
This commit removes some style that is dead code, related to classes:
- o_cw_custom_hover
- o_cw_nobg
- o_calendar_hatched
- o_calendar_hatched_*
- o_calendar_striked
- o_calendar_striked_*

X-original-commit: 4a19e031ae70a44369970147dd1735da66a9ea64
Part-of: odoo/odoo#103661
2022-10-20 17:17:09 +02:00
Alexandre Kühn 00b4da36bb [IMP] mail: introduce Chatter/shouldReloadParentFromFileChanged
This commit introduce a field to determine condition for
reloading chatter parent view when a file has changed.

This allow patching the field so that more conditions
could trigger a view reload.

Task-2886634

closes odoo/odoo#103660

X-original-commit: 3e097db1c92a316fb7c5de0ce6124ce5ea7e07be
Related: odoo/enterprise#33005
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-20 17:17:03 +02:00
Younn Olivier 86e5ae7954 [FIX] website: fix wrong selector creation in clickOnSnippet tour util
Since [1], there would be a traceback due to a wrong DOM selector in the
`configurator_tour`.
Indeed, completing the configurator will activate the configurator_tour
asset which is calling a broken clickOnSnippet tour util to generate an
appropriate homepage tour.
It would end up with the following selector:
`o_website_preview[data-view-xmlid='website.homepage'] iframe #wrapwrap .#wrap > section:nth-child(2)`
See the `.#wrap` which is incorrect and make jQuery crash.

This is because [1] adapted the tour utils to the new WebsitePreview
client action, but the clickOnSnippet function was wrongly changed and
could now be generating wrong triggers selector.
It was creating invalid selectors as it was concatenating a `.` with the
provided string parameter which was basically a class without the `.`,
like `s_popup`, but not in all cases. A whole valid selector could also
be provided, meaning that concatenating it with a leading `.` would
result in incorrect selector.

Basically, this commit revert the change made on [1] in `clickOnSnippet`
to restore the code of [2] that was preventing the wrong selector
creation.

[1]: https://github.com/odoo/odoo/commit/99b50d18e220aedf14de806f4bf1b2d35c32de35
[2]: https://github.com/odoo/odoo/commit/e8a5af2e28a4724f86783746706cb59175f086bf

opw-3026167

closes odoo/odoo#103651

X-original-commit: 26c4e4a13b642e2856495a8c1f5a36afe3996c02
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-20 17:17:00 +02:00
Arthur (goa) a9702cee39 [FIX] snailmail: dont resend without credits
We are spammed by some accounts that don't have credits anymore.

With this commit, when we try to send letters from the cron, whenever we
meet the CREDIT_ERROR error_code, we stop trying to send the letter.

task-2930455

closes odoo/odoo#103530

X-original-commit: f1fed40e2f853ecd9e5c24e0882c67f9505155c2
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
2022-10-20 17:16:58 +02:00
tsm-odoo c79016fbc6 [FIX] website_livechat: access error when closing empty chat window
Before this commit, closing an empty chat window with a non admin user
would have led to an access error popup.

Indeed, the `website_livechat` modules overrides the `_execute_channel_pin`
method of the `mail.channel` model in order to unlink the channel if no
messages were sent. The issue is that only the administrator is allowed
to delete channels.

This commit fixes this issue.

task-3028153

closes odoo/odoo#103656

X-original-commit: ece201874a75256c2286f85d1657c518b3a55ddb
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2022-10-20 16:15:59 +02:00
Victor Feyens e731876890 [IMP] product: do not compute pricelist price when not needed
For the sale scope, we added a new 'pricelist_item_id' field, caching
the pricelist rule used for the price_unit and discount computation.

This feature uses the new `_get_pricelist_rule` method, which only returns
the pricelist rule matching the SOline values.

But the `_get_pricelist_rule` method still does all the price computation
for 'nothing'.

This commit skips the price computation (and the search of sub-rules if
the rule found is based on another pricelist).

closes odoo/odoo#103629

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-10-20 16:15:57 +02:00
Antoine Vandevenne (anv) 107de3fceb [FIX] payment: various fixes related to payment tokens
- The name of the field `provider_id` on `payment.token` should not be
  "provider Account" but "Provider".
- The computation of the display name of tokens crashed when the field
  `payment_details` was empty.
- The form view of tokens missed a <group/> element to better display
  the fields.

closes odoo/odoo#103621

X-original-commit: ae4079807d29996f4edfd295dcfa194973ada8db
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-20 16:15:54 +02:00
Aaron Bohy b7dfc7f71c [FIX] web: SearchPanel: fix race condition with sections
This commit fixes a race condition spotted by the click all test,
in the Lunch application. To reproduce, go to Lunch > Configuration
> Products, in the list view, toggle filter "Archived" s.t. there's
no record matching the domain (and nothing displayed in the search
panel anymore), then switch to kanban view, and remove the filter.
On a multi-build, this scenario fails ~4 times out of 10.

The issue occurs because a re-rendering of the search panel is
triggered by its parent (because of the filter change), but the
search panel didn't compute its active sections yet (this is done
when the "update" event is triggered on the search model). The
exact situation is hard to reproduce, but if there are non empty
sections in the model, and the active sections haven't been computed
yet in the search panel, it crashes. For instance, it happens all
the time by delaying the promise returned by "_fetchSections".

This commit doesn't introduce a qunit test because we didn't manage
to reproduce the exact same situation in a test. This makes the
Lunch click all test pass all the time though.

closes odoo/odoo#103638

X-original-commit: b84df7e08b4d413de2e8a0b1df6cb8d6ad4b08cf
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-20 14:14:56 +02:00
maximilien(malb) 5c57230536 [FIX] base: Missing colspan
Since the recent css change the text of the description field was no taking all the place he could, so it was impossible to read, thanks to the colspan it's now the way it was intended

closes odoo/odoo#103634

X-original-commit: 93d29540ff6a6756a84d904047d4e9554d6d9ad7
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2022-10-20 14:14:54 +02:00
maximilien(malb) 2ed62effd2 [FIX] project: improvement on the config view
Before this commit a content-group was useless it is now removed, moreover the setting for the default plan needed to be changed to look like the other setting of the page.

closes odoo/odoo#103633

Task-id: 2992668
X-original-commit: 8245ad33217531ab046d463d8fb91c8aa91066b7
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2022-10-20 14:14:51 +02:00
Yannick Tivisse f312fb02ef [FIX] hr_holidays: Allow creating time off in the past
Purpose
=======

In the case a time off is created:
- In the past
- Using support documents

An invalid user error is raised in the interface, because the webclient
is sending values for the field 'supported_attachment_ids' (Example: [(6, 0, [])])
which is writing by inverse relationship on the field 'attachment_ids'.

On the other hand, it should be possible for an employee to add attachment
on the time off after it has begun.

closes odoo/odoo#103626

Taskid: 3032232
X-original-commit: c32c22ec267626322aebb7af4ee36b573c71760d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-10-20 14:14:48 +02:00
Noe Antoine dac9c6101d [IMP] crm: add lead tags to the activity reporting
Allows more granularity on the activity reports by adding
a column to the tree view of crm activity reporting. Those
are the tags of the lead of the activity. Remove useless 'api'
import.

Also, make them available in the search bar and default show in
the tree view of activities. Improve the view with an avatar
widget on the author and default hide on the description.

Task-2991375

closes odoo/odoo#101245

Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
2022-10-20 14:14:46 +02:00
Victor Feyens 40683c85f7 [REM] sale: unused field
The price_reduce field is not shown to the users, and was not useful for
business computations because of its digits specification (losing decimal data
when we only want to round the total amounts, not the price before taxes).

This commit removes the field to reduce the table size, remove useless computation,
avoid misuses of the field and clean code.

Task-3018371

closes odoo/odoo#103611

Related: odoo/upgrade#3977
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-10-20 13:17:55 +02:00
Andro Gvivradze 0211ac1321 [FIX] Website_slide: course_publisher_standard
When choosing an image url from non-odoo pages, there is an access token
sent at the end of url. Because of this, slide_course_publisher_standard
didn't work as it expected jpg image name at the end. Now it will simply
find a match for said jpg image and won't fail. Also, before this
commit, default image was not editable with website editor.

Task-2908029

closes odoo/odoo#103620

X-original-commit: 00f9fca584f39d028108762dccef11447747b591
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-20 12:19:30 +02:00
Mountain Tran beeb1143d0 [IMP] account: Consistent in terms of UX
In Product Category, income/expense Account only select accounts with Internal Group is income/expense.
But in Product, income/expense Account don't have that domain (although the domain above is not wrong).
=> This in my opinion causes confusion for users when using
The way to handle it, I will remove the domain part in the income/expense account to match the experience

closes odoo/odoo#103588

X-original-commit: f736f50548438cf144c7882651043fbccad72c98
Signed-off-by: Laurent Smet <las@odoo.com>
2022-10-20 12:19:28 +02:00
Younn Olivier 7b36c29417 [FIX] web_editor, *: fix link popover position in mobile edition
*: website, test_website

Before this commit, the LinkPopoverWidget element was not positioned
correctly in mobile edition.

With [1] that introduced the website edition using an iframe, the
element was appended on the global document, outside of the iframe, so
that it was not overlapped by the snippets manipulators (that were also
in the global document).

But Bootstrap popovers are not meant to be used "on top" of iframes.
Bootstrap uses the container's ownerDocument to compute placements, and
does not take into account whether or not the target is located inside
an iframe (therefore, skipping the iframe's offset and dimensions in the
placements computations).

This was leading to a visual bug in mobile edition: the iframe top, left
values were not computed by the popover, and it was not positioned
correctly.

Since [2] moved the manipulators inside the iframe, the popover can be
initialised using its target ownerDocument body, without being
overlapped by the manipulators.

Styles are adapted so that the popover stays consistent in the frontend
and the backend, and a container option is added to the widget so that
the element can be placed with other snippets manipulators from the
website builder.

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

task-2687506

closes odoo/odoo#103562

X-original-commit: 931d488af0d4dce529e4ea4ab3c8b827bda0d699
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Younn Olivier (yol) <yol@odoo.com>
2022-10-20 12:19:25 +02:00
Younn Olivier c9364aedd1 [FIX] website: adapt "Edit" and "Translate" systray items to dark mode
When the dark mode feature was merged with [1], it adapted the
EditWebsiteSystray item with the 'text-reset' class.

But this class was not removed if the website was translatable, and it
was not added on the TranslateWebsiteSystray item, which was leading to
wrongly colored systray items on a translatable website.

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

X-original-commit: 9bc4987d8a4a3d1e5ff31d6e2fd3ea4b453fe21c
Part-of: odoo/odoo#103562
2022-10-20 12:19:25 +02:00
Younn Olivier 2f0aac8586 [FIX] web_editor: correctly position loading element
In the Website Builder, when clicking on the THEME tab, and clicking on
the "Switch theme" button, the loader behind the dialog was not placed
correctly.

After [1] moved the manipulators inside the iframe, the css rule for the
loading elements was not updated to remove its right value, used to
position the loading element next to the right panel.

[1]: https://github.com/odoo/odoo/commit/872bb20b3ac08cf82613e15e6634a2e7593ccf7a

X-original-commit: 106a5a56a96090ae4adfd9e7b3ea2f93d69dca22
Part-of: odoo/odoo#103562
2022-10-20 12:19:24 +02:00
lejeune quentin e032acc44e [IMP] point_of_sale: Add the possiblity to enable auto validate order
Actually if the customer pay with a electronic payment method the order
is automatically validated.

With this commit we add the possibility to activate or not this functionality

closes odoo/odoo#103569

Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-10-20 11:18:45 +02:00
Aaron Bohy 3f12de691b [FIX] web: ConfirmationDialog: do not call confirm twice
Before this commit, multi clicking quickly on the "Ok" or "Cancel"
buttons of a ConfirmationDialog would call the confirm/cancel
callbacks multiple times. For instance, in "Mass mailing", create
a new mailing and click "Send". In the confirm dialog, clicking
quickly multiple times on "Ok" would call the "Send" button action
multiple times.

This commit also ensures that we wait for the promise of the
confirm callback before closing the dialog. This highlighted an
issue in the ORMBatcher, as we didn't reject the promise when
the batched rpc failed. As a consequence, the confirmation dialog
never closed itself. This has been spotted by an existing test.

Fixing #74647 (from 16.0 to master)

closes odoo/odoo#103572

X-original-commit: 95f8266a5b84f5faa59a713019ab713392b3ef78
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-10-20 10:19:58 +02:00
mafo-odoo e9234fd52c [FIX] payment_stripe: add idempotency key to prevent multiple payments
Video 1 (Issue): https://drive.google.com/file/d/1oXYcDJgaT9gmhkjE08yJlXwIL1qPwS1Y/view?usp=sharing

Issue:
When using the register payment with a token with any of the payment acquirers,
if there is a concurrent access error during the reconciliation process,
the payment intent is sent multiple times to the acquirer, making the card charged multiple times.

Steps to reproduce:

-Have a V14 database (only tested this version) with sale_mmanagement, payment_stripe and invoicing
-Configure Stripe with your public and secret key (2FA is now enforced for Stripe accounts, therefore,
 we don't have a generic test account anymore. You have to create your own.It is quite fast and easy to do)
-Have a portal user PU with an already registered payment token PT
-Go to Invoicing
-Create a new invoice I:
-Customer PU
-Add anything in invoice lines
-Confirm I
-Register a payment for I:
-Journal: Stripe
-Saved Payment token: PT
AT THIS STEP, YOU MUST ENSURE A CONCURRENT ACCESS ERROR WILL RAISE DURING THE RECONCILIATION
-Create Payment

Log analysis:
A first payment intent is sent to Stripe. The card is charged and Stripe answers that all went as expected.
We try to process the payment, but a concurrent access error occurs.
A retry is done.
A payment intent is sent again to Stripe, The card is charged AGAIN and Stripe answers that all went as expected.
We try to process the payment, but a concurrent access error occurs.

For each retry, the intent is sent and the card is charged.

If the first retry succeeds, then Odoo can finish the process. There will be only 1 payment transaction on Odoo's side
(others have been rollbacked) but there will be 3 on Stripe's side and the card will be charged 3 times.

This PR mitigate this behaviour.
It doesn't address the root cause but by adding the idempotency key to the headers with the hash of the transaction
reference and the database UUID, we prevent mutliple payments to happen.

OPW-2662964

closes odoo/odoo#103515

X-original-commit: 5fe1c1bbba4d754eed7e8927b82752969d6f563d
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-20 10:19:55 +02:00
Audric Onockx (auon) 7501bf3b8e [FIX] sale_timesheet: correct timesheet_revenues calculation
This fix corrects the measure 'timesheet_revenues' calculation
in the Timesheet report.
It is now billable_time * aal.sol.price_unit.

task-3007122

closes odoo/odoo#103513

X-original-commit: 3729c024a4a76b453d21d56805b7f5d4390cf9f3
Related: odoo/enterprise#32937
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Audric Onockx (auon) <auon@odoo.com>
2022-10-20 10:19:52 +02:00
FrancoisGe 70a80d4cd1 [FIX] web: click on wrong options in autocomplete
The purpose of this commit is to fix an indeterminate error in
the test_03_sale_quote_tour.

Error: UncaughtTypeError: Cannot read properties of undefined (reading
'unselectable')

Why:
In the autocomplete component, it is possible to replace the sources
without it being rerender. It is therefore possible to click on a option
that no longer exists in the component's internal state, which causes
the crash.

Solution:
We wait that all the sources are loaded before replacing them.

closes odoo/odoo#103497

X-original-commit: f25df0be75082caf9e8ed62c581a13fe82a27546
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-10-20 10:19:47 +02:00
Goffin Simon af6178e628 [FIX] point_of_sale: Payment term 30% Now, Balance 60 Days not supported in POS
Steps to reproduce the bug:

- Let's consider a customer C with default sale payment term 30% Now, Balance 60 Days
- Go to the POS and open a session
- Select a product and set C as customer
- Click on Payment and select Cash and check Invoice

Bug:

A traceback was raised because several account move lines are created.

opw:3009062

closes odoo/odoo#103589

X-original-commit: 15f586b3dec5c951b10a7eea5aca219ad466da9b
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-10-20 09:21:03 +02:00
Touati Djamel (otd) baea953d24 [FIX] mrp: incorrect computation of the on-hand qty of a kit
Steps to reproduce the bug:
- Create a storable product “P1” with BOM:
    - Type: Kit
    - Quantity: 3
    - Components:
        - product “C1”, QTY: 5

- Update the quantity of “C1” to have 10 in stock
- Go to “P1” product form

Problem:
- The on-hand quantity is 2 instead of 6 →
  10 (available qty of c1) / (5 / 3) = 6

In the `_compute_quantities_dict` function, the `explode` function is
called to have the qty of the component necessary:
https://github.com/odoo/odoo/blob/ef4ae7f62d6b690b4745b4145ce25ff02b6b29f6/addons/mrp/models/product.py#L151
but it is the qty necessary for 3 kit according to what is indicated
in the BOM, so we will have 5 qty needed of “C1” as a result:
https://github.com/odoo/odoo/blob/49234be3418169c8f3c928493b86a1a67ab55914/addons/mrp/models/mrp_bom.py#L289
Then the quantity available in stock of the “C1” (10) is reduced by
the quantity needed (5), so 2:
https://github.com/odoo/odoo/blob/ef4ae7f62d6b690b4745b4145ce25ff02b6b29f6/addons/mrp/models/product.py#L188
But this result must be multiplied at
the end by the quantity set in the BOM (3), to get the quantity per kit
→ (10/5)* 3 = 6

opw-3010175

closes odoo/odoo#103584

X-original-commit: 8ede8a758a92c4b61fe48d820464783e21ee7847
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2022-10-20 09:20:57 +02:00
lejeune quentin abc5a5c1d6 [FIX] pos_adyen: Fix cancel button after refresh POS
If the credential of Adyen are not correct and refresh POS after a payment
The cashier are unable to cancel or remove the payment line
Because the longpollong continue to reach Adyen to try to get a response.
This issue come from the last on POS_adyen commit:
262e50e2b2fb70d882fef536deb8ba253833639b

With this commit we stop the polling if we can't reach Adyen server
So the correct status is setted at the payment line and the cashier
can delete it.

closes odoo/odoo#103582

X-original-commit: 3a649dddb6d13bc96d281becc6387953c053223a
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-10-20 09:20:54 +02:00
Sébastien Geelen (sge) d183f0cb09 [FIX] web_editor: fix incorrect condition
closes odoo/odoo#103574

X-original-commit: e571fca0d9b4518eec950710a6cadcb678acb8cf
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2022-10-20 09:20:52 +02:00
niyasraphy c9ba639017 [FIX] base: button label
The Owl web client does not suppress GTK-style mnemonics, so these
should be removed, as otherwise they are explicitly displayed.

Following GTK rules, the old GTK client would use the `_` letter
prefix in labels to underline the letter and use the corresponding
character as accelerator/mnemonic for activating the
control (https://docs.gtk.org/gtk4/ctor.Label.new_with_mnemonic.html).

The web client "supported" this feature by just ignoring and dropping
the `_` it found in labels, even after it gained support for keyboard
accelerators (= hotkeys).

The new Owl form just ignores GTK-style mnemonics entirely, not
performing that preprocessing on widget labels. As a result, the
mnemonic marker (`_`) now appears literally in some labels, and needs
to be removed.

closes odoo/odoo#103563

X-original-commit: ca80632a1045b26927f72d93f4ec58e7a58b5654
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-10-20 08:23:54 +02:00
Nicolas (vin) 418a0c734d [FIX] account: fix the label for due date
The label for due date was targeting invoice_payment_term_id
instead of due date, thus not profiting from the readonly rules
and being muted when it should not.

closes odoo/odoo#103344

X-original-commit: 9da25683e918838609ffdac87c979f883d11d027
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-10-20 08:23:49 +02:00
Alexandre Kühn 70723fb938 [IMP] mail: Move code from components to models (step 3)
Move code from components to models, so that eventually all the
business logic is in models.

The benefit of business code in models is to ease proper modelling
of whole state of the discuss features, which is highly desireable
for easily maitainable code or to implement sophisticated features
in a robust way.

[IMP] mail: move code to models (AttachmentViewer)
Task-2996277

[IMP] mail: Move code from components to models (DropZone)
Task-3004211

[IMP] mail: move code from components to models (ChatWindow)
Task-3004259

[IMP] mail: Move code from components to models (ChatWindowHiddenMenu)
Task-3014736

[IMP] mail: Move code from components to models (ChatWindowHiddenMenuItem)
Task-3004253

[IMP] mail: pass only record as props (ChatWindowHeader)
Task-3001202

[IMP] mail: Move code from components to models (MessageList)
Task-3004204

closes odoo/odoo#103591

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-20 07:31:44 +02:00
tsm-odoo 60a15b0072 [FIX] website_livechat: fix livechat request tour
Before this PR, the website_livechat request tour would fail
in an indeterministic fashion. This was due to the fact that
the message that was supposed to be sent through the bus was
directly given to the message notification handler.

The second message could or could not be received according to
the timing of the channel subscription. Indeed, the listen/notify
mechanism is not activated during test, but the subscribe method
directly fetches notifications from database and return them through
the bus.

In order to solve this issue, let's rely solely on the bus instead
of directly calling the message notification handler.

closes odoo/odoo#103590

X-original-commit: 8964453597fb01161791b2b2064f45efa42277a6
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-19 21:46:55 +02:00
Mathieu Duckerts-Antoine 6aac153473 [FIX] web: py.js: offset in to_utc
Take a (py.extras) datetime representing the moment "2022-10-17 00:00:00"
in the timezone of Brussels. Trying to get the related utc moment through
to_utc gives wrongly "2022-10-16 23:00:00". This happens because the
months are not numbered in the same way in Date or datetime, so that in
October for example, the offset applied was that of November which is
-60 instead of -120 (summer/winter change). We fix that problem.

closes odoo/odoo#103579

X-original-commit: ee1a8d26f241f2f7bea6880afcc946119b0e6bd8
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 20:47:54 +02:00
Denis Ledoux 59a78b344a [FIX] base, crm: format address mixin _get_view override
The same override of `_get_view` was done in `res.partner` and `crm.lead`
in order to call `_view_get_address`, to change the address format
of the partner and lead form.

The definition of `_view_get_address` was already shared between these
two models through the `format.address.mixin` mixin.
So, why not share the override of `_get_view` also in this mixin,
so only one override needs to be written, instead of two.

In addition to merge the code of the `_get_view` override
in `format.address.mixin`, also set the `_get_view_cache_key`,
so the partner and lead form are correctly cached by company,
in case multiple companies in a same db use different address views.

Before this revision, this wasn't the case for `crm.lead`,
which therefore leaded to a bug when two companies where
using different address view, and one company accessed the lead
form before the other, therefore caching its own view version
in the cache, re-used later by the second company when fetching
its own lead form.

This revision takes the opportunity to add a unit test for crm.lead,
to assert the expected form according to the company address.
There was already a test for res.partner, but not for crm.lead.
To avoid copy/pasting the unit for both models,
a common test class is created, re-used to test both res.partner
and crm.lead.

closes odoo/odoo#103438

X-original-commit: 7e4a8b77024af663c5555c6d56557e2c6136b24b
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-10-19 20:47:51 +02:00
Denis Ledoux af24e05429 [FIX] crm: remove no longer used code.
The code removed by this revision was initally introduced in
odoo/odoo@126ba0a9a8

The `_get_view` override introduced relied
on the context key `opportunity_id`,
which was set in the crm.phonecall form view with
```xml
<field name="opportunity_id" on_change="on_change_opportunity(opportunity_id)" context="{'opportunity_id': opportunity_id}"/>
```
as you can see in the above mentioned revision.

This above node was removed 7 years ago in revision
https://github.com/odoo/odoo/commit/ff2b14d4c3c5aaa62418b527585d0a19e98a23de#diff-892062d6151c1e1c1cb5f6c09035df1d5ae6d5a71f7558aacfdc8cf62627bf5fL138
Therefore making pointless the code about it in the `_get_view`
override.

In addition to this clue to make sure the override is pointless,
checking the code, we can see it relies on `get_formview_action`
to set a different view according to the result of `get_formview_action`.

Since revision
https://github.com/odoo/odoo/commit/e28d3aa4d3851d72deba08c236072d002f83216a#diff-595d3dbbabdc4f766a380a320c1c1a43b143385bc7487c7275e80f76a9fbabc2L1224
the override of `get_formview_id` is removed,
therefore making `get_formview_action` of `crm.lead` completely default
(as there is no override of `get_formview_action` either in crm.lead,
nor any dependent method)

We can therefore assume this code was useless,
at least in standard odoo,
and can therefore be removed.

X-original-commit: 82c2f4b13034c16ca5546afd777150ecb4d8ad9b
Part-of: odoo/odoo#103438
2022-10-19 20:47:51 +02:00
Alexandre Kühn 9c8a987e0f [FIX] mail: no write on read-only SuggestedRecipientInfo/isSelected
Before this commit, when a recipient is suggested in composer header
and current user click on checkbox, there was the following warning
in the console:

```
read-only SuggestedRecipientInfo/isSelected on record(SuggestedRecipientInfo_1) was updated
```

The state of a selected suggested recipient is determined by being
manually selected on UI, but also that there's a partner related
to this recipient. `isSelected` is a computed field with itself
as dependency, and it was also imperatively set. We don't want
any computed field to be set imperatively, hence the warning in
the console.

This commit fixes the issue by introducing another field that
is specific to selection on UI by current user. This field does
not depend on whether there's a partner. This field is imperatively
set, and then `isSelected` is fully declarative as a computed field
with no self dependency and no imperative update.

Task-3032869

closes odoo/odoo#103573

X-original-commit: 8e2980e1e871a8046f09d3d0affb6400ee030eeb
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-19 19:54:04 +02:00
Mathieu Duckerts-Antoine e0b852bc6e [FIX] web: core: offset in to_utc
Take a PyDateTime representing the moment "2022-10-17 00:00:00" in
the timezone of Brussels. Trying to get the related utc moment through
to_utc gives wrongly "2022-10-16 23:00:00". This happens because the
months are not numbered in the same way in Date or PyDateTime, so that
in October for example, the offset applied was that of November which is
-60 instead of -120 (summer/winter change). We fix that problem.

closes odoo/odoo#103561

X-original-commit: a11e1fb5f702400fe51938362fe3f24570977ba9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-19 18:06:59 +02:00
Victor Piryns (pivi) 44d4c65560 [FIX] point_of_sale: open POS sessions with restricted categories
Current behaviour:
We get a traceback when opening a POS session with restricted categories

Expected behaviour:
We should be able to start a POS session with restricted categories.

Steps to reproduce:
- Install POS
- In POS global settings add any category in the restricted categories
- Try opening a new POS session

Reason for the problem:
Incorrect domain right leaf, the reference field that is a pos.category
is not de-referenced.

Fix:
Add `.ids` at the tail end of the record reference

Affected versions:
- 16.0
- master

opw-3021490

closes odoo/odoo#103548

X-original-commit: 8c76afc161133b78239cf91d746a159d67f67c4e
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2022-10-19 18:06:53 +02:00
tsm-odoo 7277275d06 [FIX] bus: restore current partner in pyEnv
Since [1], `pyEnv.currentPartner` has been removed. This was
a mistake since this information is still used during tests.

This PR restores it.

[1]: https://github.com/odoo/odoo/pull/98374

closes odoo/odoo#103544

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-19 18:06:50 +02:00
maximilien(malb) c3638cef9b [FIX] l10n_de_*: datev codes
Change datev codes in l10n_de_skr03 and 04 for some lines and allow 4 digit codes.

closes odoo/odoo#103533

Doc: https://apps.datev.de/help-center/documents/0907043
Task-id: 2977383
X-original-commit: 32931d0efdff5245d71d633682615ba1bdc74326
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2022-10-19 16:09:55 +02:00
Jacky (trj) 2b4a060b96 [FIX] point_of_sale: hidden product search bar
The search bar could be hidden when there was no categories in the PoS. This
was due to the new design where the search bar has been moved to the categories bar.

closes odoo/odoo#103514

X-original-commit: eadaa267c689415eeaacaeba23c663b95a1d12d2
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-10-19 15:12:49 +02:00
Stéphane Bidoul 8e040df274 [IMP] core: add odoo.__main__
This allows launching Odoo with "python -m odoo".

This manner of launching python applications is now widespread.
In particular it makes it easier to configure an IDE debugger to run with the correct python version.

closes odoo/odoo#81864

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2022-10-19 15:12:44 +02:00
Thomas Lefebvre (thle) 16219df38e [FIX] account: overwrite journal accounts of a payment
Steps to reproduce:
	- create two journals, A and B, which have the default accounts defined in the payment method manual in "outstanding receipts accounts".
    - create a payment with a journal A;
    - duplicate the draft of the payment (because it is not possible to change a journal if it was posted before);
    - select the journal B and save (or confirm)
    - The journal is changed, but the default journal B accounts are not applied.

Issue:
   Despite the payment is in draft and has not been posted before, move_line accounts do not change with the journal selected for the move.

Cause:
   When a payment is duplicate, records are save in the database.
   Modify the journal en then save will trigger the write method of the payment model (and not the create).
   During this method, we begin to find the move lines which correspond to liquidity, counterpart and writeoff lines.
   Unfortunately, the line corresponding to the old journal will be detected as a writeoff and not as a liquidity line (because the journal has changed).
   This fault will cause a balance error in the rest of the procedure.

Solution:
	Take into account the case where writeoffs are detected when there is no liquidity line (and no counterpart line).
	In this case, force the no writeoff line.
	Generate the correct ORM commands taking in consideration if the line exist (1: update) or not (0: create).

opw-2998031

closes odoo/odoo#103496

X-original-commit: cf277b2685a72e0a8ca44c4a59331136a722fbed
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2022-10-19 13:11:50 +02:00
Joseph CaburnayandBruno Boi 390955b751 [FIX] web: fix traceback when shift-tab on list field
**Before**

A traceback is raised when pressing shift-tab on the first column of
the first row in a focused list field as shown in the vid:
https://youtu.be/g97ZTp1QdBE

**After**

shift-tab on the first column of first row will now unselect the list field
and immediately focuses on the previous field.

**Additional change**

We now allow skipping focus on the dropdown toggler by introducing new
props.

closes odoo/odoo#103485

X-original-commit: 9ba9977e42d201035b5299bc13ba03211cddbc1f
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2022-10-19 12:10:41 +02:00