Commit Graph
156166 Commits
Author SHA1 Message Date
Julien Castiaux 2755af8fac [IMP] base: test cases for ir_cron
The cron subsystem is the system responsible of running background task
at regular interval, it runs in multiple dedicated threads or workers
that are independent of the regular HTTP threads/workers.

There was a major overhaul of the system in v15 (4b28f1162a) to
introduce cron triggers, a way to run a task at a given moment in
addition to the regular configured interval. Although the cron system
was not extensively tested before that v15 refactor, no new test were
introduced with that refactor leaving the system mostly untested.

Since then we had to fix multiple subtle concurrency bugs such as
b940d1c25f and c06cee44fe. Due to the lack of an existing test suite,
no regression tests were added next to those fixes.

With this commit we introduce the missing cron test suite. The test
suite is separated in two different test cases:

- A standard pre-install TransactionCase to test everything that can be
  tested with a single cursor. This case can be run the usual way with
  `--test-tags :TestIrCron`.
- A non-standard post-install **database breaking** test case to run
  concurrency tests that often require multiple SQL transactions. This
  case requires the special `--test-tags database_breaking` to be
  executed. You MUST backup your current database before running that
  test or you'll loose data.

closes odoo/odoo#97087

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-11-14 14:20:25 +01:00
yhu-odoo ba4e24b932 [FIX] mrp_account: missing employee cost when calculate bom cost
Adapt community to make it possible to add employee cost when calculate
bom cost.

closes odoo/odoo#105645

X-original-commit: a239802249b2af2cc3fc2b3bb9fdfd0a408d887a
Related: odoo/enterprise#33898
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2022-11-14 13:01:57 +01:00
Viktors Lipskis (vili) 29789fb732 [FIX] web: fix smooth-scroll-on-drag behavior
Smooth-scroll-on-drag offset is eliminated, resulting in correct placement of scroll-sensitive areas.

task-2979060

closes odoo/odoo#105574

X-original-commit: 0ed6d65d903f8c52b664ab711f6918211e41b6d6
Related: odoo/enterprise#33876
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-11-14 13:01:51 +01:00
Camille Spiritus 2aff77efe0 [FIX] account: fix l10n_ch qr & din5008 display
Germany and Switzerland both use the DIN5008 paper layout and encoutered some issues while printing an invoice's pdf.

In Germany, the display of pdf invoices changed with v16.0. The header and footer would always display borders, which would mess up the rest of the display.

Adding the 'table-borderless' class solved this problem.

In l10n_ch, this issue was also encountered, and the general display of the qr bill page was set off. This is problematic since this display is highly rigid.

Those changes seem to be linked to wkhtmltopdf unability to process some of the Bootstrap5 changes.

While waiting for a more long term solution regarding wkhtmltopdf and BS5 compatibility, calling directly the adequate external_layout allows us to get back a correct QR Bill.

task-3037921

closes odoo/odoo#105464

X-original-commit: 627b0f581801705f8e2d2f2bead5176e9af884f8
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
2022-11-14 13:01:49 +01:00
Adesh Jolhe (adjo) c90b2f7c46 [FIX] analytic: fixed name_get of analytic account model
Currently, In account.analytic.account model due to the extra
space in name field string formatting. which generates the issue while
searching on accounts.

This commit fixes this issue by removing extra space and seperator.

closes odoo/odoo#105391

X-original-commit: bff34e0e8a8b2d211ef90ffea4f43c514e8cad28
Related: odoo/enterprise#33781
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-14 12:04:04 +01:00
Kartik Chavda b80c01de11 [IMP] hr_timesheet: add employee delete wizard for employee
Before this commit user can directly delete employees even though
employees have timesheets that make employee field in timesheet
black which is not right behavior because in timesheet employee
field is required.

This commit adds a delete wizard for employee delete action
if employees have any timesheet then user cannot delete that
employees without deleting timesheets instead user can archive
that employees.

task-2938632

closes odoo/odoo#98233

Related: odoo/enterprise#30481
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-14 12:03:54 +01:00
Jacky (trj) d0f89b3478 [IMP] point_of_sale,pos_*: back to basics
Overall improvement and simplification (along with some minor re-alignment)
for the point of sale.

POS Dashboard:
- added a new check for companies that hasn't installed any chart of account,
this gives them a better understanding of the real problem.
- added a new `menuitem` in the configuration tab that list all the pos configs,
this gives the user a way to access the sub-config of a pos (and indirectly give
access to its whole settings)

Opening/closing control:
- the `MoneyDetailsPopup` is now opened through the `showPopup` method, we're
no longer using the css to show/hide.
- the details of the money (if it exists) is now given to the `MoneyDetailsPopup`
component, this allows to have a record data usable of the details and
the user doesn't have to start from scratch if he just wants to modify
one thing
- opening the `MoneyDetailsPopup` no longer resets the cash input, that way the
user can just quickly check if everything is correct again without having
to recount everything and this won't reset the outcome

Customer display:
- added "Powered by" before the Odoo logo in order to accentuate that
it's from the software used is from Odoo

Product screen:
- visual improvement of the `EditListInput` component which is mostly
used by the lot/serial number, it gives more information to the user
and better UX
- "Cash out" is now automatically selected upon opening the
`CashMovePopup`. No more minus sign (-) in the input amount. This
should give better intuitiveness and one less click to do
- no more clear search button shown if the search input is empty
- removed the hover and clickable effect on `CashierName` component
in the normal point_of_sale since nothing happens when we click on it
- increased the width of the click zone with a label in the
`ProductConfiguratorPopup` which makes it easier to select a radio input
- the `PrintBillButton`, `SplitBillButton`, `RewardButton` and
`ResetProgramsButton` are now disabled when nothing happens
- the `textarea` of the `TextAreaPopup` component has been fixed
and is no longer resizable

Partner list screen:
- fixed phone, mobile and mail icons the contact area
- increased details button size

Floor screen:
- when idle, no longer redirect to the floor screen if there's
an open error popup. An error popup is opened for a specific
reason, we shouldn't redirect while having this open or
automatically close it. Other kinds of popup will be
closed since those are issued by the user that went away.

task-2916197

closes odoo/odoo#97803

Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-11-14 12:03:51 +01:00
PNO c5c9d9d0c7 [FIX] stock: block product type change if sales count
Steps to reproduce:
- Create a product and complete a sales order.
- Then try to change the product type.
- The following message is shown:
"You cannot change the products type because it is already used in sales orders."
However, we can close the message and save.

Problem:
If some sales were already made, it should not be possible to change the product type.
There is a warning message on the onchange but it's not blocking.
This causes inconsistencies between the quantities and value shown in the quants and in the valuation layers.

Solution:
Raise an user error when trying to save the changes.

opw-3000886

closes odoo/odoo#105496

X-original-commit: 1b468ad100960cbd6940a24fbfaeeae4f01994de
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-14 10:24:42 +01:00
Hubert Van de Walle (huvw) 94392f8947 [FIX] purchase: Uom should not be displayed when disabled
Steps to reproduce
==================

- Use a mobile phone / mobile view in devtools
- Go to Purchase > Purchase Orders
- Click on one item
-> A traceback occurs, the uom is missing

Cause of the issue
==================

The field is declared as
  `<field name="product_uom" groups="uom.group_uom"/>`

The raw value is accessed with
  `<t t-esc="record.product_uom.value"/>`

Solution
========

Add the missing group

opw-3033650

closes odoo/odoo#105487

X-original-commit: bc6c2d8d15e22f6af720db6a28e21739defede94
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-11-14 09:28:36 +01:00
lejeune quentin 0055e3cda0 [FIX] pos_six: Fix the use_strict in the timapi.js library
In V16.0 it is currently no longer possible to use the POS
if the pos_six module is installed
This bug is a combination of 3 factors

1. the new assets: a single file contains all the JS files, concatenated.

2. one of these files contains the instruction "use strict",
which stiffens the code of the function in which this is mentioned,
and which prevents certain syntactic approximations
(like calling a variable without seeing it declared, this case)

3. We added Sha1, in its file of course, but not in its own function,
the use strict then applies to the entire asset file

This reverts commit e08858e5ed02fe74160dabd6a91e1de88640956f.

closes odoo/odoo#105582

X-original-commit: 2426c26a0fbbb2d5e50203922cb64f9001ac73e0
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2022-11-13 21:54:40 +01:00
Jinjiu Liu 7225301213 [FIX] sale_stock: lot number not shown in refund invoices
This commit is to compute correct lot number for serial/lot tracked
products on refund invoices

Reproduction:
1. Install Sale, Accounting, Inventor. In setting of Inventory, enable
Lots & Serial Numbers, Display Lots & Serial Numbers on Invoices,
Display Lots & Serial Numbers on Delivery Slips.
2. Create a product with lot/serial number
3. Create a order of this product, confirm. Click the delivery and
validate it.
4. Back to the SO, create an invoice, confirm and print it, the serial
number shows.
5. At the invoice, click “Add credit note”, choose “Full refund” (2
invoices for the SO) or “Full refund and new draft invoice” (3 invoices
for the SO), the lot number doesn’t show in new draft invoice or the
refund invoice

Reason: the current lot number tracking workflow focused on invoicing
different numbers of products and making sure it gets the correct
lot/serial number. It doesn’t include the refund invoice case.

Fix: since the current working logic works great with invoicing products
which are delivered from the warehouse to the customer, we can reuse
this logic for refund invoices for products which are returned from the
customer to the warehouse. In the refund and return case, we switch the
calculation of warehouse and customer. Thus, a return can be seen as a
delivery from the customer to the warehouse.
In the code, we set a new variable, return_source_usage, to check if the
account move type is a delivery or a return. If it’s an invoice for
return, we take the opposite of the previous invoiced product quantity.
Because in a refund, previous invoiced is now considered as refunded.
In the original workflow, when sml.location_id.usage is “customer”, it’s
a return and we update the returned_qty and the related quantities. In
the new workflow, if the invoice is a refund one, we do the same steps
when sml.location_id.usage is “internal”, e.g. when the stock move line
is a delivery, we consider it a return.

For refund invoices. There are two choices of refunding:
1. refund and a refunding invoice: 2 invoices for the order, one is the
original one, another is the refund
2. refund and create a new draft invoice: 3 invoices for the order,
original one, a new draft one and the refund.

In the second case, we will create a new draft invoice. If we simply
apply the original work logic, the lot number will not be printed on the
draft invoice. This is because the previous amls list includes its
original invoice. We have to filter out the duplication of the same
invoice to print the right lot number for the new draft invoice.

Added the report test for two refund cases, one for cancel (Full refund)
and another for modify (Full refund and new draft invoice)

opw-2879714

closes odoo/odoo#105602

X-original-commit: 15194cec233332e787b9f546e39c6127301ff9aa
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Liu Jinjiu (jili) <jili@odoo.com>
2022-11-13 00:28:43 +01:00
niyasraphy 4959d3c707 [IMP] improve module names and unify module author names
closes odoo/odoo#105616

Signed-off-by: William André (wan) <wan@odoo.com>
2022-11-11 17:54:39 +01:00
Pierre Paridans bb26532e02 [IMP] test_main_flows: enable mobile main flow in community
Since Odoo 16 is also responsive in community, we can activate
the mobile main flow tour.

closes odoo/odoo#105606

X-original-commit: 453882a17e27b89b87e2573732d17d96970d4a96
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-11-11 12:59:00 +01:00
luvi 608eb01907 [FIX] web: fix popover animation style
This commit fixes the styles applied to the popover in left/right
direction. Since start/end are used as the classname of the popover,
the element was no longer animated, as it is the case for top/bottom
directions.

For example, when adding data-tooltip-position to an element using the
data-tooltip attribute, the element appeared, but without an animation
for horizontal positions only. After the commit, animation is played
for any position.

The commit adapts the stylesheet of the component to adapt to the
renaming of left/right to start/end.

closes odoo/odoo#105144

X-original-commit: 14553007ec2d46cf1a70bf4e5b228d30c7a817b5
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-11-11 08:05:04 +01:00
gawa-odoo 422ab51460 [FIX] analytic: traceback hr_expense invoicing analytic distribution
Steps to reproduce the issue:
- Have the modules `hr_expense` and `account` installed (not `account_accountant`)
- Create a new expense
- Change the category
- Click on analytic distribution field
=> Traceback

The issue comes from the fact that the account field is present but empty (we don't have accounting).
For the old and new account field, we have 2 undefined values.
We then do a shallowEqual of these, where it will compare length attributes, so traceback.

To solve it, we just give it a value false to the field instead of being undefined for the comparison.

closes odoo/odoo#105593

X-original-commit: face5b8f9134fc052ea09742667a610b508a4886
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-11-10 23:17:19 +01:00
William Braeckman fedede859e [FIX] website_sale: fix traceback with express checkout
It can happen that the payment transaction route is called without the
amount kwargs, the code would crash in that case as we tried to access
it either way.
We moved the code after setting the default amount in the kwargs to
avoid a crash.

closes odoo/odoo#105576

X-original-commit: c124fb3292439a6237f16eff406c0a7d375cab65
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-11-10 23:17:16 +01:00
Habib (ayh) 0eeee27a82 [FIX] account: view arch should not contain owl directives
The Accounting Journal Dashboard Kanban view contains direct owl components and directives. This should not be the case as it may cause problems with studio.

This commit replaces the direct owl with
1. a view widget for the file uploader buttons.
2. the kanban record template is extended to add the dropzone and file uploader with context

Task-3040946

closes odoo/odoo#105575

X-original-commit: 5de857d56c5f4cff318ed6b6c7dd15bf426e6a18
Related: odoo/enterprise#33877
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ayob Habib (ayh) <ayh@odoo.com>
2022-11-10 22:22:07 +01:00
Jacky (trj) 408d573e08 [FIX] point_of_sale,pos_sale,l10n_fr_pos_cert: add error popups back
Due to bc8d7590c04a0f1391021c8d1354f1eabca9742c, the error popups were mistakenly removed.

closes odoo/odoo#105567

X-original-commit: 954d733668f1028fa5ec8471c3cf3a6a6a8246b9
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-11-10 22:22:01 +01:00
Pierre Paridans 121ead1589 [FIX] web: text field's translation icon position
This commit restores the `display: inline-block` to the fields' textarea
to match the char field's input and allowing the textarea and the icon
to stand side-by-side. This rules went away in the
odoo/odoo@fb0bebc6cf commit, but should
have been restored in this case afterward.

Although, a tweak is required for the editable ListView as it triggers
a layout shift at the row's height level (ie. bigger when editing). This
is due to the textarea content's vertical alignment which, in its
default setting (ie. baseline) makes room for the descender portion of a
letter (eg. the part below the baseline, as "g", "j", "q", "p", "y"
letters) and, as result, makes the field vertically bigger.

Steps to reproduce:
- In Settings, add (at least) another language
- Open Project
- Open a project
- Edit a kanban stage
=> the description field's translation icon is below the textarea

closes odoo/odoo#105565

X-original-commit: 2168893749c2c361c3c79e8c3879d673e366c36b
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-11-10 22:21:53 +01:00
Julien Van Roy 7fdea9ab40 [REF] account: account_tour_upload_bill view use grid
Simplify the arch of the account_tour_upload_bill view.
Use the CSS grid from bootstrap instead of the mulitple cols and colspans.
Steps to reproduce: `-i account_accountant,l10n_fr --without-demo all`
Then, in the accounting dashboard, click on "Upload Vendor Bills".

closes odoo/odoo#105562

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-11-10 22:21:51 +01:00
Thomas Josse (thjo) c723637432 [FIX] event_sale: remove 'need to be paid' banner for free ticket
This commit fixes an issue where if a ticket is free, the registration would
still "need to be paid" by the attendee.

This behavior is contradictory for a free ticket, so the attendee now has to
pay the ticket if it is not paid and is not a free ticket.

task-3012928

closes odoo/odoo#105559

X-original-commit: 2b0587fb52bf50d303e3a99ae8aded942ccb69b1
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-11-10 21:16:24 +01:00
Pierre Paridans d70b67a7a8 [FIX] web: kanban group's long title
In a grouped KanbanView, long group's title makes the group (aka.
column) grows instead of keeping its original size and truncate the
title using an ellipsis.

This commit fixes it by forcing a maximum width in addition of the
Flexbox rules (`flex-basis`, `flex-grow`) to prevent this effect.

Steps to reproduce:
- Open CRM
- In the KanbanView, create a new Stage with a very long title
=> the column grows instead of keeping its original width

closes odoo/odoo#105554

X-original-commit: d9872ecce78d6d7ad02cdaa16782aa473e5a7655
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-11-10 21:16:22 +01:00
Pierre Paridans 7277197434 [REF] web: kanban group's width
In grouped KanbanView, group's width follows three usecases:
- on smaller screens, the group (aka. column) takes 90% of the viewport
  (to give a hint of the next/previous column)
- on desktop-like screens, the group's width is based on the regular record's
  width and padding
- on desktop-like screens, a smaller variant of the one above (cf.
  `o_kanban_small_column`)

As the definition of those usecases where a bit
all-over-the-place, this commit takes advantage of the CSS custom
properties and the cascade to conditionally define the
`--KanbanGroup-width` property and set only once the group's width (cf.
`flex-basis`).

Note: it fixes a small issue where the "quick create" column was always
set to the smaller variant, even with regular record size.

X-original-commit: d7aa7dc892c9aa7120291e6eedad7f03bf78baf2
Part-of: odoo/odoo#105554
2022-11-10 21:16:22 +01:00
Romain Derieandqsm-odoo 3da2835b93 [FIX] website, *: hide .s_popup itself too, not only its .modal child
*: website_mass_mailing (tests)

- Web Editor facts:
Since the refactoring of the editor done at [1], the cookies bar popup
is receiving a `contenteditable=true` attribute, making it receive the
chrome default `height` style for such elements.
The problem is that if this cookies bar's modal is hidden, the bar will
be shown as a thin empty white bar.

- Website Builder / Popup Snippet / Cookies bar facts:
A popup element is composed of a `.s_popup` parent containing the actual
`.modal` BS modal. Our internal logic and events are hiding and showing
this inner `.modal` modal element without considering its `.s_popup`
parent. It means that when the `.modal` is hidden, its `.s_popup` parent
is not touched and kept visible.
It might looks like it's not an issue as it would just be an empty
element (its only child is hidden) but it leads to some issues as
explained just above: an ugly white bar is shown.
Note that the cookies bar is nothing more than a `.s_popup` snippet.

- Web Editor facts 2:
During the mentioned refactoring [1], they actually added some code to
hide this bug once you were playing with the edit mode (mainly for when
you clicked on the invisible panel element or before saving).
But this code was actually not fixing the case when you just entered
edit mode.

This commit simply remove that "edit only" web editor logic and add a
new one in charge of simply synchronizing the `.s_popup` snippet
visibility with its `.modal` BS modal in a public widget (which is
obviously also executed in edit mode).

Finally:
- note that if there is no way through regular flow to arrive to the
  same result with a normal popup snippet, it is still concerned by this
  issue and you can reproduce it by moving it somewhere else in the DOM
  and/or simply adding it the `contenteditable=true` attribute.
- we already fixed that issue a few months/years ago, I couldn't find
  a commit related to that so I don't know if it was due to the same
  root cause
- in case one is wondering why we simply couldn't do that in the already
  existing `_onHideModal` of the `PopupWidget`, it is because that
  `hide.bs.modal` is not called when entering edit mode, because the
  `destroy` is destroying it before hiding the modal. The event is thus
  not fired. And we can't move the hide part before the destroy's super
  because otherwise, it would go through the normal hidden process which
  is creating a "seen" cookie for the popup as if it was closed
  manually.

[1]: https://github.com/odoo/odoo/commit/740168ce8d27da3d6a7156d2d79655a898394923

task-2754108

closes odoo/odoo#105553

X-original-commit: 21a5e7000f08fbd1936173937c7d90b152a5414f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-11-10 21:16:18 +01:00
Solan Delvenne (sode) c7bc8e80c0 [FIX] snailmail: Force english locale on snail-mails
Pingen does not support localized country names, as such we need to force English locale.

closes odoo/odoo#105456

X-original-commit: e0233bff032c722cb309357c4b329bf9fe1aae43
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
2022-11-10 21:16:16 +01:00
Hubert Van de Walle (huvw) b214c62e26 [FIX] web: mobile: scroll in selection mode
This is a port of https://github.com/odoo/enterprise/pull/30046 for wowl

Steps to reproduce:

On a mobile device:
- Go to Inventory > Product Variants
- Switch to the list view
- Long press on a record
-> We can't scroll to select records below the current screen

closes odoo/odoo#105545

X-original-commit: cd874593b2390efba8e92228f85e9cf07c0e1a8c
Related: odoo/enterprise#33861
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-11-10 17:53:54 +01:00
fdardenne 9b7ed7ed0b [IMP] web: Layout: make it friendly for client action
Before, the `Layout` component was not friendly enough for
client action. There was no default component for `ControlPanel`
and `SearchPanel` in `Layout`, resulting in the fact that it had to be
defined manually in the client action environment:

```js
useSubEnv({
            config: {
                ...getDefaultConfig(),
                ...this.env.config,
            },
        });
    }
```

Now, the `Layout` component defines default component for `ControlPanel`
and `SearchPanel`. Making it easier to use for generic usage.

closes odoo/odoo#105413

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-10 16:05:56 +01:00
Rémi Rahir bbca93a811 [IMP] spreadsheet: improve typing
closes odoo/odoo#103387

Related: odoo/enterprise#32872
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-10 14:13:46 +01:00
Chong Wang (cwg) b95b549d24 [IMP] core: raise warnings for related translated stored fields
The _compute_related function can only update one translation but not all. We
decide not to update all translations to avoid increasing the time complexity.
As a result, the value for related translated fields should always be generated
in the runtime, and storing it is illegal.

A related translated stored field may work as expected in a single language
environment. But in mult languages environment, if you have a name field

    name = fields.Char(related="parent_id.name", store=True)

changing parent_id in French, will only change the French translation of the
name field

This PR tries to remove these fields. And a warning is added to prevent
developers creating a related translated stored field in the future.

closes odoo/odoo#102553

Related: odoo/upgrade#4004
Signed-off-by: Wang Chong (cwg) <cwg@odoo.com>
2022-11-10 14:13:41 +01:00
Aaron Bohy 98095e082f [FIX] web: AutoComplete: don't show previous results
... when re-opening the dropdown.

Before this commit, in an autocomplete component with an async
source, when:
 - clicking on the input to open the dropdown,
 - then typing something to filter the results
 - then selecting one of them (which closes the dropdown)
 - and finally re-opening the dropdown:
the previously displayed (and filtered) results were briefly
displayed, while the source was being fetched again. It thus
produced a weird and annoying flickering.

This commit fixes the issue by reseting the source before fetching
it.

closes odoo/odoo#105539

X-original-commit: 83769b00837f4eea29586f53709d65d3078ddce3
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-10 13:15:56 +01:00
Guillaume (guva) 355def0bbc [FIX] account: cumulated balance non exportable in GL
We made the field cumulated balance non exportable
in the GL.

Steps:

- Go to Accounting->Accounting->General Ledger
- Unfold and select one or several lines
- export lines
-> The cumulated balance is not computed

The reason is we don't pass in the compute as we don't
come from the search_read method when exporting, so we don't have a domain
to compute the cumulated balance.
As we can't force the domain, we override the fields_get method
to make the field non exportable.

opw-2800669

closes odoo/odoo#105538

X-original-commit: bd41d369342bfc97161a4190f03c98b718458aea
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2022-11-10 13:15:51 +01:00
Aaron Bohy 7931d126d9 [FIX] web: kanban tests: fix typo
closes odoo/odoo#105533

X-original-commit: 48cd64c4c60422dee26a244bdbd06b90e3709c85
Related: odoo/enterprise#33841
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-10 13:15:45 +01:00
miad-odoo decbed094d [IMP] sale_crm: show opportunity in sale order view
Before this commit, the field opportunity_id was only visible in debug mode in
the sale.order form view. It was correctly pointing to opportunities but, when
used to create new records, it was creating leads instead.

The field is now always visible so users can link sale orders and opportunities
and a context was added so that the field correctly creates opportunities
instead of leads.

Task-3039802

closes odoo/odoo#104123

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-11-10 13:15:39 +01:00
Géry Debongnie 03cdc9c417 [IMP] web: prevent duplicate entries in QUnit dropdown search
It is really annoying to have thousands of duplicate entries in that
dropdown menu. This commit hacks the problem away, but modifying QUnit
in place. Some day, we should modernize our testing infrastructure, but
this will do the trick in the mean time.

closes odoo/odoo#105483

Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-11-10 12:22:05 +01:00
Florian Vranckx e1e9b19af3 [IMP] base: improve perfomance of has_group
Using the already existing indexing on the model to slightly improve the perfomance.

closes odoo/odoo#105354

X-original-commit: 4344d399002a32eeca05374527336d77a161c898
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2022-11-10 12:22:03 +01:00
Julien Mougenot cda3396546 [FIX] web,project: Restore kanban drag&drop in Firefox
Before this commit, the drag & drop feature for the Project "Tasks"
kanban view did not work if the drag sequence was initiated from the
title of the card.

This was due to the "o_kanban_record_headings" class having the CSS rule
`overflow: hidden`, because of a well known 6 year-long-and-counting
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1352061

Namely: mouse enter|leave events won't fire on anything underneath
elements having `overflow: hidden`.

This commit solves this issue by introducing a dedicated class name
'o_dragged' to all elements dragged using the `draggable_hook_builder`,
and defining on it the CSS attributes that were assigned in JS before,
as well as `pointer-events: none` on itself and all its children to
avoid the issue mentioned above.

Also in this commit: fixed a syntax error in a CSS rule in project's
"task_name_with_subtask_count_char_field" widget.

closes odoo/odoo#105353

Related: odoo/enterprise#33774
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-10 12:21:57 +01:00
Nicolas (vin) f0eb6f3906 [FIX] website_sale_*: fix a few tests
Some tests are running tours, which have triggers on the amount.
The issue is that if the test is running on a company with another
currency than usd, and these tours ends up using a pricelist in USD for
example, then the prices in the website will be adapted and no longer
match the trigger in the tours.
This change aims to correct that by ensuring that only one pricelist
can be used when these tours are running, and that this pricelist
currency matches the one from the company. As such, the prices will be
as expected and the tours will run properly.

closes odoo/odoo#105523

X-original-commit: 9a81cf604bbbc626a0fa68219a4fe017cd781bc7
Related: odoo/enterprise#33836
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-11-10 09:50:40 +01:00
Nicolas (vin) e8f699428d [FIX] l10n_ar: avoid renaming products in demo data
Because it causes them to be inconsistent with their images,
and causes issues with some website tours depending on them.

X-original-commit: cfbe95ae05fd0c87e24668fc8550da9fdd7ee70d
Part-of: odoo/odoo#105523
2022-11-10 09:50:39 +01:00
FrancoisGe ab5a126f10 [FIX] web: empty group when changing page
Before this commit, in a grouped list view, it was possible to have
empty groups when changing pages.

Why:
Before this commit, if a grouped list performs a load, then it is
checked if its previousParams are equal to the current one. If so, we
keep all the old groups empty. This requirement is related to the kanban
view, so we will move it to the kanban model.
The kanban view needs it when we archive data but don't want to delete
groups (colomns). So we perform a load but we don't want to delete the
empty columns.

How to reproduce:
- Go to a grouped list view
- Click on a record
- Return to the list view using the breadcrumb
- Go to the next page

Before this commit:
The groups on the first page are always present with those on the second
page. The groups on the first page are empty.

After this commit:
We only have the groups on the first page.

closes odoo/odoo#105488

X-original-commit: 04467197b9ec0851e3f9f7a74d1b97c5e27420bc
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-11-10 08:57:28 +01:00
David (dafr) a64a3dc90b [FIX] stock_account: Use correct company for SVL account_move creation
The valuation field of the product_id is company-dependent.
If the user validate the picking in multi-company context with his current company != picking company, then the checks may fail, and the account move can not be created.

closes odoo/odoo#105476

X-original-commit: c29c668d694ef8d675116d42393e496636072d13
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: David <dafr@odoo.com>
2022-11-10 07:14:53 +01:00
niyasraphy 1709cba800 [FIX] sale,purchase,stock,account: partner form warning alignment
closes odoo/odoo#105511

X-original-commit: 6aa86c92c7ee7d46c54250960c2b34753e13b8be
Signed-off-by: William André (wan) <wan@odoo.com>
2022-11-10 00:27:59 +01:00
Walid HANNICHE (waha) 23c8ee0532 [FIX] sale_coupon: move global coupons to the end of the SO
Steps to reproduce:
 - Install website_sale_coupon
 - Load demo data
 - Create a promotion program that applies on the order
 - Go to the webshop and add 2 different products to the cart

Bug:
The line of promotion is in second place, instead of at the end.

Fix:
move the old sale order line to the end if it applies on all the order

opw-2985632

closes odoo/odoo#105517

X-original-commit: 48d20d44cf08fee411411665013fdaca72bf39c3
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2022-11-09 23:33:27 +01:00
William Braeckman a901105299 [FIX] website_sale: fix traceback when unselecting attribute
This commit fixes a traceback when changing the attributes when the
current page has no products to display

TaskId-3045085

closes odoo/odoo#105515

X-original-commit: b8a1b1143eec4a85b9dc8b2c6fbb0112f6b813d7
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-11-09 22:12:48 +01:00
niyasraphy 9b08bb0ea8 [IMP] account_sale_timesheet, project_{}, sale_poject_account : module license
closes odoo/odoo#105506

X-original-commit: a7a991bcdd052c0493c50afe9af8a3b44dcd17c2
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-11-09 21:17:46 +01:00
Adrien Dieudonné a68d8bd2fb [FIX] web: form: ignore invisible items from rows
Before this commit, we had an issue with the width calculated
for data cell (see. sizeOfDataCell).
In some case, the width was 50% instead of taking 100% of the
available space.

This was because some elements of the inner groups that should not
have been visible were computed as if they were, taking an effective
slot in an innergroup's row.

E.g. with two labels:

Before:
"invisible label" and "label" on the same line with `style="width: infinite"`
"data field" on a second line with `style="width: 50%"`

After this commit:
"label" and "data field" on the same line with `style="width: 100%"`

Note that as `infinite` is not a valid value, this wasn't interpreted and
style attribute was empty.

Thanks to grid for still aligning elements even if they are technically
in different rows. It's why we only saw this issue because of the
width of the data cell.

Steps to reproduce:
- Go to Accounting
- Customer -> Invoice
- Create a new invoice
-> See Customer field

Thx to @kebeclibre

closes odoo/odoo#105489

X-original-commit: e177c63e3618e4b9e492a27d1301c098a0066cb6
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-11-09 19:03:48 +01:00
Younn Olivier a377708436 [FIX] web_editor: fix pasting youtube videos from the editor
Before this commit, following this flow in the Website Builder:
- Enter edit mode,
- Drop a snippet with text,
- Paste a youtube video link,
- Click on the "Embed Youtube Video" option of the powerbox,
=> There is a traceback.

This is coming from the bad function calls in the Wysiwyg to create a
video node.
When [1] reworked the MediaDialog in owl, a first implementation was
done exporting some utils (saveVideos, videoSpecificMediaClasses). But
this implementation was not kept and later changed to use static methods
and properties on the VideoSelector class (createElements and
mediaSpecificClasses).

Unfortunately, the outdated util methods used in the Wysiwyg were not
changed, and it was breaking the youtube video instertions.

This commit changes the Wysiwyg to use the existing
VideoSelector.createElements and VideoSelector.mediaSpecificClasses
static method and property to fix this flow.

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

task-2687506

closes odoo/odoo#105475

X-original-commit: 4923c20c29170407d43908f983f2a168241f4817
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Younn Olivier (yol) <yol@odoo.com>
2022-11-09 18:06:56 +01:00
Joseph Caburnay 011b61f425 [FIX] web: fix crash when editing m2m avatar field in list view
When editing a m2m avatar field in the list view, keyboard navigation,
e.g. pressing arrow-left when the focus is on the right-most item,
results to a crash. Also, the "delete" button when in edit mode
is not there anymore so the user is unable to remove items.

This is because we are not building the proper list of tags. More
specifically, we fail to provide `onKeydown` and `onDelete` handler
to the tags, thus, it crashes and no delete button. This proposed
change fixes both issues.

closes odoo/odoo#105467

X-original-commit: 02a046708a96567a41b5f9aec0f71cefc92ab981
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-11-09 17:02:56 +01:00
Sergey Shebanin bc0cd0bb56 [FIX] web: translations hash don't consider all loaded modules
Only server wide modules are being taken into account when calculating translations hash.
So user probably can't get translations of new installed modules unless it is forced by hard page reload (Ctrl+Shift+R).

Problem exists since https://github.com/odoo/odoo/commit/80d74e7ee0eab83dc5100e0776df09d04b882fec and the cause in that `mods = odoo.conf.server_wide_modules or []` string was unpaired with the following `if` statement during refactoring.

This commit restores computation of hash based on all loaded modules.

closes odoo/odoo#105466

X-original-commit: 859cd0463aec4533df30e4839367832fef0685fd
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-11-09 17:02:54 +01:00
Alexandre Kühn 78d2b87a78 [FIX] mail: allow uploading same attachment twice
Before this commit, when uploading an attachment then delete
then re-upload attachment again, the reupload was unsuccessful.

This happens because it should clear the `<input>` of type `file`,
but the condition was wrong and therefore `<input>` was not cleared,
thus keeping same value as before so input was not detected as
changed. A change on this file input is necessary to detect user
interaction file upload.

This commit fixes trigger for clearing the `<input>` of type file,
so that any file upload is properly detected, including uploading
same attachment.

Task-3060429

closes odoo/odoo#105465

X-original-commit: 97f445ae15663486d0100d7127287f9ec3d1d4cc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-11-09 17:02:50 +01:00
Thibault Libioulle b054a9b9c8 [FIX] sale_mrp{,_margin}: fix dependency break on purchase_price
This commit fixes premature usage of `purchase_price` field on
sale.order.line model, before its definition in sale_margin module.

Since this test requires both sale_mrp and sale_stock_margin to pass,
this commit adds an auto-install bridge module that solely address this
issue.

Steps to reproduce:
- Install sale_mrp module
- Run tests (at least .test_kit_cost_calculation)

Problem:
Traceback:
AttributeError: 'sale.order.line' object has no attribute 'purchase_price'

See #100126

closes #104891

closes odoo/odoo#105458

X-original-commit: ac921c88909110deefa9b91be104244bda12458f
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Co-authored-by: Thibault Libioulle <thibault.libioulle@aerospacelab.be>
2022-11-09 16:08:19 +01:00