Commit Graph
159474 Commits
Author SHA1 Message Date
Tiffany Chang (tic) d251496bbf [FIX] stock: do not allow direct deletion of quants
Some users were updating their access rights to allow for direct
deletion of quants. This could lead to the infamous:

"It is not possible to unreserve more products of %s than you have in stock."

error since directly deleting a quant bypasses the flows of correctly
unreserving the amounts you are deleting. Therefore we now restrict
the unlinking to:
- when in sudo mode, since the automatic unlinking of zero quants always
  occurs in sudo mode.
- stock manager when unlink access right = True. Normally we would allow
  any user with the unlink access to do it, but since we are using the
  existing `_apply_inventory` to ensure that reserved qtys of the
  quant are correctly unreserved before the unlinking, only stock
  managers will correctly do this unreservation.

It is expected that some custom code may break due to this restriction,
but if custom code is directly unlinking quants without a sudo or with a
non-stock manager, then the code in these cases probably need to be
fixed anyways since this will cause inconsistent db data and lead to
the error above.

X-original-commit: d1602e7ddefd59cafa1ce0a5522a53c987135858
Part-of: odoo/odoo#115613
2023-03-20 15:31:21 +01:00
Mylyna Hy 0ce547db68 [FIX] pos_mercury: remove _gc_old_tokens
Problem:
 When point_of_sale and pos_mercury are both installed,
  _gc_old_tokens will get called by the scheduled action "Base: Auto vacuum internal data"
   and it will try to remove the Vantiv tokens from POS orders that are 6+ months old.
    However, there are fields named ref_no and record_no that exists for pos.order;
     so the AttributeError will get thrown.

Solution:
 It is safe to remove the entire method since the Mercury API documentation
  does not explicitly mandate the tokens be removed from old POS orders.
   It was recommended by JOV to not modify the method to prevent the modification of
    potentially 8 years old POS orders from client's databases.
     Since the method is removed, the error will not be thrown when auto vacuum is called,
      pos_mercury is installed, and POS orders are 6+ months older.

opw-3082616

closes odoo/odoo#115466

X-original-commit: 41a82c3326150fba6948667c9e455ae82088bb6d
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-03-20 15:31:17 +01:00
Horacio Tellez 2585c3fca0 [FIX] sale: forbid taxes of different company on sol
Before this commit when in a multi-company environment an user
could assign a company to the sale order and use taxes related
to a different company for the sale order lines.
This is a functional error and also provoques that taxes are not
shown for some users when in a multi-company environment.
After this commit a ValidationError will be raised whenever the
company of the taxes in the sol and the so do not match.

opw - 3117352

closes odoo/odoo#115162

X-original-commit: 295c408568bb623f0b0ead3f18493ba339b87161
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
2023-03-20 15:31:15 +01:00
luve-odoo a92da38773 [IMP] e-commerce : hide decimal on the checkout page
Decimals were displayed in the quantity of products bought in the checkout page, which is not necessary.

task-3135936

closes odoo/odoo#110379

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-03-20 15:31:05 +01:00
Aaron Bohy 7fd803da91 [FIX] web_tour: qunit: stop mutation observer after test
This commit fixes an issue with the tour service tests. Those
tests start the tour service, which in turn uses a MacroEngine.
The MacroEngine uses a MutationObserver. However, tours don't
have a cleanup function, because in the "real" world they are
started once and live forever. In the "test" world, services can
be started in each test, and thus we sometimes need to properly
clear they side-effect. In this particular case, we need to remove
the MutationObserver at the end of the tests.

 Please enter the commit message for your changes. Lines starting

closes odoo/odoo#115841

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-03-20 14:04:24 +01:00
Aaron Bohy dc5632d085 [FIX] web, web_tour: qunit tests: do not log "test successful"
Python tests that run chrome headless wait for "test successful"
to be printed in the console to end the test with green status.
Tours and qunit suites logs that message when their work is done.

Commit [1] reworked the tour system and introduced some qunit
tests of the tour engine. However, running fake tours in qunit
tests  produced the "test successful" message, which caused the end
of the suite. As a consequence, only a small part of the WebSuite
test suite was really executed.

This commit mocks console.log in those tour qunit tests, s.t. the
suite is now fully executed again.

[1] 3a798039d6

Part-of: odoo/odoo#115841
2023-03-20 14:04:24 +01:00
Pablo Montenegro 24b225d470 [FIX] l10n_ar: VAT on foregin invoices
Partner's VAT identification number now is not missing when printing Foregin Invoices.

closes odoo/odoo#115595

Task: 947
X-original-commit: a0d684f6f93598024be4dcff82c6a7bc21277ce0
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-03-20 11:20:46 +01:00
niyasraphy 883541f654 [IMP] hr: improve downloaded badge file name
before this commit, on printing employee badge the
download pdf file is named print badge - employee name

after this commit, the downloaded file name will be
changed to badge - employee name

closes odoo/odoo#115009

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-20 11:20:44 +01:00
sofiagvaladze 630f13fb1d [IMP] *: manage smartbuttons on employee form view
*: hr_attendance,hr_skills_slides,hr_timesheet,hr_work_entry

Don't show smartbuttons that lead to a view without records

task - 3134772

closes odoo/odoo#113105

Related: odoo/enterprise#37274
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-20 11:20:38 +01:00
David Monnom (moda) f8482b716d [IMP] pos_loyalty: display program name on reward selector
Before this PR, the name of the program from which an award comes
was not displayed in the selection popup.

closes odoo/odoo#112122

Taskid: 3069449
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-03-20 11:20:35 +01:00
Michael (mcm) 3f65bfb158 [FIX] web: prevent recreating a deleted record
Before this commit, deleting a record containing
changes (dirty) recreated the record when leaving the view.
Now, the changes are discarded when deleting the
record so it is not marked as dirty and not recreated.

task id: 3063834

closes odoo/odoo#115767

X-original-commit: cf8952aaac1ba9b43f0f558cc15e48462defcfe7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-20 09:03:49 +01:00
Pierre Paridans 1ea7a3d6ad [FIX] web: don't update related daterange field when not in the DOM
This commit avoids to update the related daterange field (aka. end date
when changing start date, and vice-versa) when this field is not present
in the DOM (could be 'invisible' field or hidden column in list).

Steps to reproduce:
- Open Field Service
- Switch to list view
- hide the End date column
- select record(s) to enter multi edit mode
- click on the Start date of the selected record to open the date range
  picker
- select a new range
- click Apply
==> Error saying that cannot read setStartDate from undefined

task-3200845

closes odoo/odoo#115766

X-original-commit: 9e00bd26ac43bfdaacd74de324ead84e4154a912
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-20 09:03:46 +01:00
AlienAtSystem 10f0b2ef77 [CLA] update signature for manatec
Added contributor

closes odoo/odoo#115575

X-original-commit: c57f1e1fec810fd4c60b23569e8fed6b2df21156
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 09:03:43 +01:00
Jairo Llopis aaf7eb1660 [FIX] mail_client_extension/mail_plugin: let users allow mail plugin to work
This commit fixes a regression introduced in https://github.com/odoo/odoo/pull/104323.

That fix was preventing the default behavior of the 1st `.oe_login_form button[type=submit]` found.

It turns out that, for allowing the mail plugin to work, you actually need to have the default behavior of that element working normally.

Without this patch, the `&do=1` query is never added to the POST parameters. Thus, the user is unable to authorize their mail plugin.

@moduon MT-2552 MT-2553 OPW-3230686

closes odoo/odoo#115733

X-original-commit: d350b084317057d62a018a86f57a0a26b454100f
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-03-20 07:58:46 +01:00
Jeremy Kersten 81a875fcaa [FIX] web_editor: adapt color of svg support rgba with space
Before this commit, we only support rgba(xxx,yyy,zzz,v.www)
Now we support also rgba(xxx, yyy, zzz, v.www)

How to reproduce:
Edit theme color secondary, chose a color with transparency.
Go to a 404 page and the pinky will be not loaded.

closes odoo/odoo#114486

X-original-commit: e418c912509999e44bcfc5325f3df6844af9bfe6
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-03-19 15:49:04 +01:00
Gaetan Vanden Bergh (gavb) 32feeccf8b [FIX] account: include archived journals on code creation
Fetching journals to get the next bank/cash code must fetch archived/active=False journals too else an occur can for client: 'A journal group name must be unique per company.'

opw-3204708

closes odoo/odoo#115786

X-original-commit: ce4a366185d3b2f1c69f3f7292aa7c5455d63b7c
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-18 10:27:22 +01:00
fdardenne ab3ca0d17c [FIX] web: kanban quick create: truncate buttons
Steps to reproduce:
- Switch to German
- Go to project and select a project
- Go to the quick create interface

Current behaviour:
The buttons label are too long and the buttons overflow the width
of the card.

Expected behaviour:
Text in buttons are truncated to respect the kanban card width.

taskid-3234707

closes odoo/odoo#115775

X-original-commit: 8e7727fd85d2304ab87039b2a373f438b9123066
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2023-03-18 03:32:58 +01:00
Thibault Francois 47c06171e4 [FIX] analytic: constraint should only apply on current recordset
Before this commit, if a single analytic line in the database
has an inconsistent company with it's anlytic account, all creation
of an analytic account was impossible because the constraint
_check_company_consistency is checked on the entire table.

This commit restrict the _check_company_consistency only
on the current record set.

closes odoo/odoo#115768

X-original-commit: 49bf7d149095e0c202cc53171a99eea8ec5b59b7
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-18 03:32:55 +01:00
Valentin Vallaeys (vava) b0211e91a7 [FIX] sale: fix header in quotation mail
A header in the mail gives the amount and the validity date of a
quotation. Its means the quotation will expire at this date, and is not
related to any missing payment. The validity date has no meaning on a
confirmed sale order and is therefore removed.

task-3185072

closes odoo/odoo#115752

X-original-commit: 89ebc9ad4f0524109fd4846156448692d1d20a44
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-03-18 03:32:53 +01:00
Paolo Gatti (pgi) 2a3d65e3e9 [IMP] account_edi_proxy_client: Debug views added
Added views and menuitems for account_edi.document
and account_edi_proxy_client.user, so that our technical team
will be autonomous in its investigations.

Task link: https://www.odoo.com/web#model=project.task&id=3204255
Task-3204255

closes odoo/odoo#115751

X-original-commit: 5e771b131e85b42a747936daf698f62fe2b125b5
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2023-03-18 03:32:40 +01:00
moerradi 49e2a5b995 [ADD] l10n_mz: add COA, taxes and tax report
Add chart of accounts, taxes and tax report for Mozambican localization

closes odoo/odoo#115710

Task-id: 3162293
X-original-commit: a794b29d84eefc91c037112b44293698c7db4d49
Related: odoo/enterprise#38348
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Erradi Mohammed (moer) <moer@odoo.com>
2023-03-18 02:14:39 +01:00
Alexandre Kühn 99fc12db92 [FIX] mail: message deletion should not crash
Was due to typo in code.
Tests should have failed due to crash, somehow it passed ci/runbot

closes odoo/odoo#115677

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-18 00:53:41 +01:00
Nemael 9e24ba9b0a [FIX] mail: messaging menu counter disappear at 0 notifications
This commit changes the behavior of the messaging menu counter
When there is 0 notifications, the counter will disappear

Part-of: odoo/odoo#115677
2023-03-18 00:53:41 +01:00
Sébastien Theys 6f0eae31ed [FIX] mail: remove flickers when (un)following
Part-of: odoo/odoo#115677
2023-03-18 00:53:41 +01:00
tsm-odoo 62b736be2d [FIX] mail: download logs
- disable when no logs available
- log file contains undefined in its name

Part-of: odoo/odoo#115677
2023-03-18 00:53:40 +01:00
Zelong Lin 9824634e7c [FIX] mail: not possible to mention
Part-of: odoo/odoo#115677
2023-03-18 00:53:40 +01:00
Martin Maes aca91877a5 [FIX] repair: din5008 repair printing tracebak
This commit fix a traceback when printing the repair quotation
using the DIN 5008 repair module.
The field updated was not the correct one

task id : 3178931

closes odoo/odoo#115454

X-original-commit: 008cd881abcc9856de8bd7a7a8a5382fc31dc272
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-03-17 23:24:11 +01:00
Daniel Kosky (dako) 1efa19478c [REF] l10n_ke_edi_tremol: adapt invoice posting client action for owl
The client action that allows the user to post invoices to the Kenyan
fiscal device needs adapting to utilise the current JavaScript
framework.

This commit refactors the existing client action defined in
'l10n_ke_edi_tremol/static/src/js/post_send.js'.

The functionality is mostly factored out of the action, and into a hook
and a dialog that are utilised by the action.

The hook is called 'useKEProxy' and handles all of the logic related to
posting an invoice to the device. It has a 'state' attribute that
represents the current progress in this posting process.

The dialog is called 'KEProxyDialog', and is passed to the dialog
service by the client action. It makes use the useKEProxy hook and its
state, which is used to update the UI to inform the user about the
success/failure of posting the invoices.

The dialog uses the slots from the standard dialog, removing the close
'x' button from the header, and hiding 'ok' button from the footer
unless there has been an error (this gives the user time to read the
error message before closing the dialog). If all invoices are
successfully posted, the dialog automatically closes.

Additionally, the function on the account.move model that decomposes the
results and writes them to the fields of the records has been renamed to
"l10n_ke_cu_responses" and its behaviour adapted to handle batched
responses.

closes odoo/odoo#111334

Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-03-17 23:24:09 +01:00
Mathieu (mano) 934069f834 [IMP] web_editor, mass_mailing: add and sort shapes
This commit is the first step towards the addition of various SVG shapes
for the website app.

The purpose of this commit is to add the new shapes SVGs and to sort the
current shape menu into new categories.

The avoid duplicating the shapes added in mass_mailing, the 3 shapes:
   - Circle
   - Slanted
   - Triangle (corner)

Are now in the web_editor, their existing reference in mass_mailing
template have have been changed to their new locations. To adapt to
`b1a3a3b18370ad76280726298602815769dce1c2` the paths have been changed
and a new record for `s_tech_default_image.jpg` have been created in
the new file `mass_mailing_themes/data/ir_attachment_data.xml` since 
it's an image only used in themes. (Also removing  `noupdate=0` from
the data element in `mass_mailing/data/ir_attachment_data.xml` 
since it is the default value).

I also removed the .png and old .jpg of this image since now the shape 
is applied directly on the image. 

Since the shapes + their image are converted in a base64 img+svg on
save, we can move the assets of the current website shapes in use 
without compatibility issue. Therefore these shapes were renamed and 
moved their new folder category.

The SVG width and height of the new and previous shapes was set to
600x600 since they are mostly squarish and are going to be rendered in a
square preview in the future.

To simulate the future preview of the shape selection menu, the
`we-button img` width was set to
`$o-we-sidebar-content-field-dropdown-grid-item-height` and the
`we-button` width to `1/4` in the file `wysiwyg_snippets.scss`.

It makes the preview 60x60 and displayed in a four tiles layout.

Note : 

- If later on the SVG are rendered as inline-svg rather than base64
the current IDs inside the .svg might conflict if multiple svg are
on the same page.

- The previous shapes might look a bit weird with the squarish ratio
in preview, alternatives solutions should be explored during the 
implementation of the new UI. 

task-3094258

closes odoo/odoo#110673

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-03-17 23:24:06 +01:00
Guillaume (guva) 5b057d6cf1 [FIX] l10n_din5008: missing term in de.po
"Invoice Address", "Shipping Address",
"Invoice and Shipping Address" were not
translated because they were not in
.po file.

opw-3198115

closes odoo/odoo#115737

X-original-commit: 94b32d25df914933383007639d810cfa37f0e86b
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-03-17 22:27:30 +01:00
Aaron Bohy fef810a32f [FIX] web: kanban: keep column folded when d&d a record
In a grouped kanban view, drag a record and drop it in a folded
column. Before this commit, it opened and loaded the target column.
It shouldn't, the column should remain folded. This behavior has
been introduced in v16 with the wowl views.

This commit restores the legacy kanban behavior, which keeps the
target column folded and thus doesn't load it. We ensure that
the progressbar of the source column is correctly updated though.

Task 3208098

closes odoo/odoo#115728

X-original-commit: d6d6e4f64ea379a6795b139c5fafd604b7e185eb
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-17 22:27:24 +01:00
Florian Charlier 863b95c919 [FIX] onboarding: hide toggle visibility button
In cases where the progress record does not yet exist, it is not
possible to toggle the visibility of the onboarding panel.

Therefore, we hide said button.

Task-3192327

closes odoo/odoo#115727

X-original-commit: 68e3e2b93d9028d6c469c627ef6d1b3c661a70a2
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-17 22:27:21 +01:00
Alexandre Kühn df1c973db6 [FIX] mail: messaging menu header sticky
Before this commit, when scrolling in messaging menu, the header was scrollable too,
which shouldn't be the case.

closes odoo/odoo#115715

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-17 22:27:19 +01:00
Romain Estievenart 3f6cc7c0a1 [FIX] web: listview edit with m2m_tags shouldn't always take two lines
On listview, a m2m_tags takes two lines when it's not needed to avoid
this effect we reduce the flex basic value by half wide should still be
plenty enough space to be an easy target to hit.

Task ID: 3074587

closes odoo/odoo#115714

X-original-commit: 0527d170606fcc32e3dcc096470da8288228610a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-17 22:27:16 +01:00
Michael (mcm) c57fcf4e9e [FIX] web: truncate m2o dropdown item's text
Before this commit, when a record had a very long
display name, the name could be cut in the middle of a
word in the many2one's dropdown.
Now, these names are truncated and have ellipsis to tell
the text continues.

task id: 3234714

closes odoo/odoo#115712

X-original-commit: ed9f9098e3b85c8c739ed7fa5ff6b28bfa2e3584
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-17 22:27:14 +01:00
Julien Van Roy d8890195db [FIX] account: fix join bank statement lines and move
In some databases, there are multiple bank statement lines linked to the
same move. Example:

* account_move:

id | statement_line_id
---+------------------
 5 |                20

* bank_statement_line:

id   | move_id
-----+--------
  20 |       5
  21 |       5

Thus, joining both tables should be done using the
account_move.id and the bank_statement_line.move_id. Otherwise, some
bank_statement_lines will be missed.

opw-3202392

closes odoo/odoo#115687

X-original-commit: c63cdde8506e201bf3313c5566049dde6692d0a6
Related: odoo/enterprise#38338
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
2023-03-17 20:21:22 +01:00
pedrambiria 7718f12c8b [FIX] point_of_sale: allow to refund less than one quantity
Before this commit: if you had a pos order with one product and one
quantity, it wasn't possible to refund less that one quantity.

Steps to reproduce:
 1. Create POS order with any product -> Qty = 1.0
 2. Go to the refund page -> Select Order -> Update Qty to 0.5 -> Click
 on the 'Refund' button

The solution is to keep the input quantity in case of a single product
refund.

issue https://github.com/odoo/odoo/issues/112291

closes odoo/odoo#115671

X-original-commit: d7baf99405d2b5ee092a38e2beb3b201292b9345
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-03-17 20:21:20 +01:00
David (dafr) f3646f58e2 [FIX] stock_account: Compensate rounding error on small quantities
To reproduce the issue:
1. Create a product:
   - Type: Storable
   - Category:
     - Costing Method: AVCO
2. IN 2 @ 4.63/u
3. IN 5 @ 3.04/u
4. OUT 0.1
5. Repeat step 4 70 time in total, so that the final quantity is 0
6. Open the inventory valuation of the product

Error: the total value is $-0.04 instead of $0.
The compensation of rounding issue is stuck by a check that ensure we don't erase a valuation error.

However, this check can never succeed with small quantities, here is the mathematical proof:
°Current check: rounding_error <= qty * curr_rounding / 2
With:
1) rounding_error >= curr_rounding
2) 0 < qty < 2
3) v1 = rounding_error / curr_rounding
4) v2 = qty / 2
We can be sure that:
5) v1 >= 1 because of 1)
6) v2 < 1 because of 2)
7) v1 > v2 because of 5) and 6)

° rounding_error <= qty * curr_rounding / 2
° rounding_error * curr_rounding <= qty * curr_rounding / 2 * curr_rounding
° rounding_error / curr_rounding <= qty / 2
° v1 <= v2
==>> This contradict 7), hence this check can never be True for qty < 2

To fix this issue, we change the check to:
 ° rounding_error <= qty * curr_rounding / 2 OR rounding_error <= curr_rounding
 Where the 1st part doesn't change, but the second one is true when rounding_error == curr_rounding

closes odoo/odoo#115668

X-original-commit: 7825e0e474bdfedc741a20af0e1ee0ffba9a25fc
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: David <dafr@odoo.com>
2023-03-17 20:21:17 +01:00
Xavier Morel b799ef34ae [FIX] web: disable scripting & autoprint in PDF viewer
Support is limited and more of a hindrance than a help, as some
clients' suppliers create PDFs with broken scripting which trigger the
autoprinting any time they're loaded and can have other odd
misbehaviors, which is a hassle.

OPW-3208409
OPW-3222228

closes odoo/odoo#115659

X-original-commit: a7331d9709c8e097356f89bf144986f441c8f2cc
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-03-17 20:21:09 +01:00
Elisabeth Dickinson 98f5503e95 [IMP] web: add icons to odoo_ui_icons font for text-wrapping styles
Add new icons allowing editor to choose how text should wrap around the
image when adding a picture inside a paragraph.

task-3235798

closes odoo/odoo#115629

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-03-17 20:21:07 +01:00
Guillaume (gdi) dc842ecfca [FIX] website: prevent submenus overflow in edit mode
Since [this first commit], the elements that make up the submenu of the
navbar of a website can no longer overflow the page. Depending on
whether the content is too long, the elements are aligned to the left or
to the right. Unfortunately, since [the merge of the frontend into the
backend], the dynamic alignment no longer works in edit mode. This commit
restores the dynamic alignment of the submenu items so that they no
longer overflow the page in edit mode.

Steps to reproduce the bug:
- Have a submenu with a long element in it
- In edit mode align the navbar elements to the right

=> When opening the submenu in edit mode, the long element goes over the
page instead of being aligned with the right side of the menu.

Technical explanation:
In edit mode, the dropdown opening in the navbar is done by
`WebsiteWysiwyg` which is instantiated in the backend while the function
that allows to align the submenu elements correctly is declared in
`menuDirection` in the iframe. So the dropdown must be opened with the
Bootsrap instance of the iframe in order for the iframe to detect that
the dropdown has been opened.

[the merge of the frontend into the backend]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[this first commit]: https://github.com/odoo/odoo/commit/392c91cda3133b921e9aca9a7b1c511231027438

task-2904507

closes odoo/odoo#115607

X-original-commit: 11f817e8d0b0764427f0db7d62fb0cdd403e3012
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
2023-03-17 19:22:25 +01:00
Guillaume (gdi) 8689241f86 [FIX] web, website: prevent the submenus from overflowing the page
Since [this first commit], the elements that make up the submenu of the
navbar of a website can no longer overflow the page. Depending on
whether the content is too long, the elements are aligned to the left or
to the right. This was done with the public `menuDirection` widget which
looked at the available space on the left and right and depending on the
size of the submenu elements, aligned the submenu in an optimal way. It
has now been decided to get rid of all this widget because Bootstrap
(with Popper) knows how to position dropdowns dynamically. Unfortunately
Bootstrap has limited this dynamic positioning by disabling it on
dropdowns that are in a navbar. So this commit removes the public widget
and replaces it with a bootstrap patch so that dropdowns are dynamically
aligned in navbars too.

Note that if we had not made this patch in master, we would have had to
adapt the public widget to the migration to Bootstrap 5 (see original
commit).

[this first commit]: https://github.com/odoo/odoo/commit/392c91cda3133b921e9aca9a7b1c511231027438

task-2904507

X-original-commit: b6963dc21bad4b012aace16b9ea9264c33a0d618
Part-of: odoo/odoo#115607
2023-03-17 19:22:25 +01:00
Rémi Rahir (rar) 50219f2322 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/f41d64a2 [REL] 16.3.0-alpha.1
https://github.com/odoo/o-spreadsheet/commit/a5c5a9bc [FIX] xlsx export: empty string in filtered range
https://github.com/odoo/o-spreadsheet/commit/804bae64 [IMP] components: expose FigureComponent to extend chart menus
https://github.com/odoo/o-spreadsheet/commit/bf20db7f [IMP] functions: DATEDIF and ADDRESS
https://github.com/odoo/o-spreadsheet/commit/1633f098 [REL] Bump master version to 16.3.0-alpha.0
https://github.com/odoo/o-spreadsheet/commit/5fa40538 [IMP] top_bar: added placeholder to topbar composer
https://github.com/odoo/o-spreadsheet/commit/4d93a990 [IMP] toolbar: fix style of icons and of hover
https://github.com/odoo/o-spreadsheet/commit/2c6fe88a [REL] 16.2.0-alpha.4
https://github.com/odoo/o-spreadsheet/commit/5da3ae45 [FIX] ColorPicker: Convert custom string to valid HEX color Task: 3224839
https://github.com/odoo/o-spreadsheet/commit/8b1620b8 [FIX] chart_scorecard: adjusted title and baseline description colors
https://github.com/odoo/o-spreadsheet/commit/c8dd3159 [REF] figure: unify chart and image menus
https://github.com/odoo/o-spreadsheet/commit/cd919f01 [IMP] readme: add npm package
https://github.com/odoo/o-spreadsheet/commit/06bd4fe4 [FIX] server: Do not capture exit process event
https://github.com/odoo/o-spreadsheet/commit/8beef23d [IMP] package: disable console clearing
https://github.com/odoo/o-spreadsheet/commit/aa58c5ac [IMP] package: add task label
https://github.com/odoo/o-spreadsheet/commit/3b23d4ee [FIX] bottom_bar: left/right scroll sheet arrows don't WorkbookData
https://github.com/odoo/o-spreadsheet/commit/febacd14 [FIX] filters: filter can hide all the visible rows of a sheet
https://github.com/odoo/o-spreadsheet/commit/2e34887f [FIX] package: correctly name package entry files
https://github.com/odoo/o-spreadsheet/commit/b8efb5ea [IMP] XLSX: export images
https://github.com/odoo/o-spreadsheet/commit/635a643b [IMP] spreadsheet: separate ZoneDimension and DOMDimension
https://github.com/odoo/o-spreadsheet/commit/734c930c [FIX] package-lock.json: remove git conflict markers
https://github.com/odoo/o-spreadsheet/commit/0cad29b7 [IMP] rollup: improve argument handling of rollup.config.js
https://github.com/odoo/o-spreadsheet/commit/1296e415 [IMP] bundle_xml: improve the bundling o xml

closes odoo/odoo#115514

Related: odoo/enterprise#38296
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-03-17 19:22:19 +01:00
Arnold Moyaux da8c905428 [IMP] mrp: clean test files + adapt to code
No need a common file for 3 tests. On top of it contains
global variable and a lot of indirection, making it impossible
to read.

Also before the quant reservation commit, a savepoint was call
during the action_assign and trigger a flush and recompute all.
Since it has been remove, it's computed during the first read on
it, that's during the mark as done and since the MO state is not
draft it will keep the default value (False). Call it after create
to trigger the computation at the right time.

+ a bit of linting

closes odoo/odoo#115328

Related: odoo/enterprise#38207
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-17 19:22:13 +01:00
Arnold Moyaux 7d9d6e8834 [FIX] stock: create/write on stock.move.lineresponssible for quant reservation
A lot of issue with "It is not possible to unreserve more products of ... than you have in stock".
It's the result of a desynchronisation between
`stock.move.line`.`reserved_qty` and `stock.quant`.`reserved_quantity` fields.

It should never happens in theory. However we already faced it a lot due
to bugs/custom code/server actions... It's not trivial to fix because
the issue come from data corruption. So it is hard to spot the different
main issues.

In order to avoid it, this commit try to modify the structure of stock
module. Before the operations was made in this order:
- The `stock.move` checks the quantity available on `stock.quant`
- The `stock.move` write the quantity reserved on the `stock.quant` and
  save it in a variable
- The `stock.move` create a `stock.move.line` with the quanity reserved.
The main issue is that a `stock.move.line` could be easily created with
a reserved quantity while the `stock.quant` are not update nor checked.

After this commit the operations will be:
- The `stock.move` checks the quantity available
- The `stock.move` dispatch the available quantity among the `stock.move.line`
  based on create or write calls.
- The `stock.move.line` reserve the quantity on `stock.quant`
- If the quantity is bigger than available, we write the max available on
  `stock.move.line`

The idea is to respect the different layers
`stock.move` <-> `stock.move.line` <-> `stock.quant`.
Avoid the interactions bewteen `stock.move` and `stock.quant`

This behavior is already well managed in other use cases.
E.g. the real quantity itself, `_do_unreserve` of `stock.move`,...

opw - a lot

Part-of: odoo/odoo#115328
2023-03-17 19:22:13 +01:00
Samuel Degueldre 38f463af32 [FIX] web: restore error dialogs for erroring js modules
In 64fc704527, we made it so that when an
async module throws an error, we catch the error and log it so that we
can mark the module as being in error. This means the error is now
invisible to the error service.

We do not want to rethrow the error, as this would stop us from loading
the rest of the modules, but we can still allow the error service to see
the error by simply dispatching it as a promise rejection in a separate
async call stack, allowing us to continue loading modules but also
giving the opportunity to the error service to see the error if it is
started.

Closes #92192

closes odoo/odoo#115230

X-original-commit: facc0f0c022df94487ef9518348f039b56c7b536
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-03-17 19:22:05 +01:00
Benjamin Vray c2e85ba46c [FIX] web_editor: fix shape flipping
This commit fixes an issue that causes thin spacing to appear between
two snippets containing shapes. This bug had already been fixed in this
commit [1] but the theme snippets have not been adapted to the changes.

With this commit, the shapes of theme snippets are automatically adapted
when they are dropped on the page.

Steps to reproduce the bug:

- Choose the "Clean Theme" for a website.
- Drag and drop a "Call to action" snippet on the page.
- Drag and drop a "Text" snippet with a dark background before it.
- Resize the window to change the window width.
- At some points, the gap will appear.

[1]: https://github.com/odoo/odoo/commit/42b3ad10e0b32b7fc72f801e2c67d6baf938c566

task-2824607
opw-3069213
opw-3057533

closes odoo/odoo#115004

X-original-commit: 256ff539afe331544ccb58848f1ecd0eecbe4daa
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-17 19:22:02 +01:00
Martin Maes 35eb9ef155 [FIX] mrp: timer wrong values on list view
The value of the timer was wrong when timesheeting with multiple employees
at the same time.
The problem was that the compute duration already takes the current timesheets
into account. So the problem was that we added some time
that was already in the duration

task id : 3216277

closes odoo/odoo#114901

Related: odoo/enterprise#38007
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-03-17 19:21:54 +01:00
Martin Maes a4e441e885 [IMP] mrp: added mass start stop on workorders
This commit add a mass start and stop buttons that allows to start
or stop multiple workorder at the same time.
Starting a workorder checks if the user needs to be logged and
if the workorder is not blocked.
This commit also change the appearance of the mark as done button

task id : 3216277

Part-of: odoo/odoo#114901
2023-03-17 19:21:54 +01:00
det 043dadaa91 [FIX] hr_expense: currency and payable line discrepancy
Explanation:

A rework of hr_expense has been introduced in master and landed in 16.2.
https://github.com/odoo/odoo/commit/f79ff3fb374650670e89f231aaf17bb8d6596c25

There was a need to backport it to 16.0 then 16.1.
https://github.com/odoo/odoo/commit/90affb562962d0dc233526e3f15f5b60f383331d

During the backport;
- a computed fields 'journal_displayed_id' has been introduced and will need to be removed again in master.
- 2 bugs have been discovered:
-- the analytic.account were not created anymore (function not called)
-- the payment terms for expense paid by company could not be modified as a filter was missing

closes odoo/odoo#115650

X-original-commit: 672f4efd2c990ab6eef8f934c41625860b8ded46
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Detry Thomas (det) <det@odoo.com>
2023-03-17 15:02:46 +01:00