Commit Graph
158883 Commits
Author SHA1 Message Date
Bruno Boi af00a92b3e [REM] *: remove unused class 'oe_background_grey'
This class is a ghost from the past.
Last related style has been found in da86f505a

Part-of: odoo/odoo#113014
2023-03-01 17:01:02 +01:00
Panagiotis Kyriakou 80e9dc746a [IMP] project: change the way we work with subtasks
This commit changes some of the way that users will
work with subtasks in the project app.
Initially, it changes subtasks from a many2many to
a one2many field.
We also add the ability for subtasks to be viewed
straight from the kanban view by drawing a list of
them inside of the kanban box of the parent task.

task-3085016

closes odoo/odoo#112279

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-01 17:00:56 +01:00
niyasraphy ee00f84c21 [IMP] hr_holidays: remove non used report action
hr.holidays.summary.dept model is no longer existing in odoo and it seems the time off summary report action is also redundant and one is not used.

closes odoo/odoo#108001

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-01 17:00:40 +01:00
Dossogne Bertrand a171164b8a [IMP] hr_holidays: links accrual to company
This commit adds a company field to accruals.

Also removes the unused 'parent_id' field in hr_leave_accrual_level.

TaskID 2817577

closes odoo/odoo#88275

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-01 12:21:40 +01:00
Soukéina Bojabza cdf0870e1f [FIX] web_editor: fix the widget state of the Vertical Alignment option
Since commit [1], an `align-items-start` class is added when going from
grid mode to normal mode in order to always have one of the four choices
of the Vertical Alignment option selected. Indeed, without this class,
none of them are chosen. However, only a few snippets have this option
and it is therefore not possible to modify this class easily in the
snippets that do not have it (except removing it from the DOM manually).

The real issue in fact comes from the computation of this option widget
state, which should select the last button (so the `align-items-stretch`
one) if no class is present, since the behaviors are equivalent in these
two situations.

This commit removes the addition of this `align-items-start` class and
fixes the `_computeWidgetState` of the Vertical Alignment option.

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

task-3142615

closes odoo/odoo#113949

X-original-commit: 75ef0d5d7ed000cf55b47bebb00cc2d0bb34b581
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
2023-03-01 11:08:01 +01:00
qsm-odoo 468096cb6b [FIX] web: restore some dropdown styles in the backend
Steps to reproduce the bug (in 16.0 and above only):
- Go in the backend
- Focus the searchbar
- Type something and use the arrow to navigate the search dropdown
=> You cannot see what you are highlighting anymore

This occurs since [1] (its forward-ported version) which removed rules
that were targeting the frontend dropdowns by mistake while they were
indicated as wanting to target OWL dropdowns only. It appears that those
rules were actually used by chance in 16.0: to style the searchbar which
is not using OWL dropdowns and whose specific 15.0 styles were removed,
fallbacking on those erroneous rules. On top of that, the wanted style
here concerns a rule about the `focus` class... which is actually not
part of Bootstrap 5 anymore but that our old searchbar still uses.

There is a high chance that the problem is only confined to the 16.0
searchbar and not anything else. But as a precaution this commit fixes
the issue by restoring all the rules that were removed (well, rather
moved to be more specific to OWL dropdowns) but inside a backend file
only. The legacy/dropdown.scss file seemed very suitable for this
purpose. Obviously, those rules should be removed as soon as possible
once it will be judged ok in master after a searchbar adaptation.

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

closes odoo/odoo#113944

X-original-commit: 77537678d6b6f3533eb0c9d9d37d8fe679ef9580
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-01 11:07:58 +01:00
Bohdan Lisnenko d9215a766a [FIX] account: recreate analytic lines on account change
Steps to reproduce:
1. Login to Odoo 16.
2. Install Accounting app, apply Generic CoA, enable Analytic Accounting.
3. Create Analytic Plan with list of accounts. Departments for instance.
4. Create Invoice with any product, set financial account to 400000 Product Sales, and specify analytic account.
5. Post the Invoice.
6. Go to Accounitng -> Analytic Items. It should contian Analytic Item with financial account 400000 Product Sales.
7. Go to accounting -> Journal Items, find Journal Item related to our invoice where product and analytics were defined.
8. Mark journal item with checkbox to enable multi edit feature. Change financial account to 450000 Other Income.

Current behavior:
Analytic Item still has financial account 400000 Product Sales.

Expected behavior:
Analytic Item should be updated with financial account 450000 Other Income.

closes odoo/odoo#113940

X-original-commit: d0fdc38385f5f259da259d21e9137494e6d7c17d
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-01 11:07:50 +01:00
Corentin Thaon (thco) a15199ea8f [FIX] point_of_sale: pos.order _compute_margin
The call to check if the pos.order or the pos.order.line margin is zero
was considering the rounding precision as the number of decimal places.

opw-3179013

closes odoo/odoo#113931

X-original-commit: e3faa0659a0c6206740895e68face14c27af14a4
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: thco-odoo <thco@odoo.com>
2023-03-01 11:07:47 +01:00
MerlinGuillaume 25d7d3327d [FIX] base: change default Norwegian date format
The date format set on the Norwegian language is not kept when we click
on date fields

Steps to reproduce:
1. Install Sales
2. Install and switch to Norwegian language
3. Open Sales and create a new quotation
4. Click on the 'Quotation Date' field
5. The date format is changed from '%d. %b %Y' to '%Y/%m/%d'

Solution:
Change the default Norwegian date format to a valid static format
The format used comes from babbel[^babbel], double checked with the
Norwegian locale[^nb.js]
[^nb.js]: https://github.com/odoo/odoo/blob/16.0/addons/web/static/lib/moment/locale/nb.js#L25
[^babbel]: https://www.babbel.com/en/magazine/how-to-write-the-date-in-norwegian

Problem:
The old date format didn't pass the `isValidStaticFormat` test of the
date picker, so the default format 'yyyy/MM/dd' was used instead

opw-3191605

closes odoo/odoo#113926

X-original-commit: c27226e13392207811b61aceb3c77d1e9fcc180d
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-03-01 08:51:20 +01:00
Guillaume (guva) 5d492f4632 [FIX] l10n_de: add missing translations
Add missing translations to .pot

opw-3198115

closes odoo/odoo#113906

X-original-commit: e8762c4b56657df61a05d5720c73027f44c8858f
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-03-01 08:51:18 +01:00
Hansun (hale) 7af08cadeb [FIX] hr: random border appearance on employee badge
To reproduce the issue:
1. Install [Employees] app
2. Add some employee records if not there by default
3. Click on Print icon and [Print Badge]
4. pdf version will show borders

Issue: with the introduction of bootstrap5, setting the class became a necessity
Desired behavior: Make the borders invisible

Impacted versions: 16.0 up to master

opw-3126185

closes odoo/odoo#113925

X-original-commit: 0b78509b1bcba8547e0fe95ff4a14c7199adba92
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-02-28 23:49:57 +01:00
Benjamin Vray c547012420 [FIX] web: fix smooth scroll on drag in iframes
This commit addresses a bug in jQuery Draggable where the 'stop' event
did not trigger a 'mouseup' event outside of the dragged element window
if it was inside an iframe. This issue only occurred in Chrome (Firefox
was not affected).

In mass_mailing, this issue occurred in the email editor when the mouse
was released in the area above the editor. This error also affected the
Sign module, where elements can be dropped into a PDF, and where the
'stop' event of the dragging did not trigger outside of the iframe.

Steps to reproduce the bug in mass_mailing:

- Open the Email Marketing app.
- Create a new mailing.
- Choose the second available email template.
- Click and hold the "drag and drop" button of the first snippet (Your
logo) to start dragging it.
- While dragging the snippet, move the mouse outside of the email editor
iframe.
- Release the mouse button.
- Bug: the drop zones are still present in the DOM, and it is possible
to save the template with them.

opw-3164969

closes odoo/odoo#113893

X-original-commit: f083e664bfe5b6b6abeec7aeee242771a21d8710
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-28 23:49:49 +01:00
Antoine Dupuis (andu) cfb84de489 [FIX] account: Avoid ir_module.account_templates compute error
Issue / How to reproduce:

At the moment, if a localization's python module is not present,
the computation of the `ir.module.module.account_templates` field fails
with a ModuleNotFoundError

How to reproduce:
- Create a fresh DB with a localization e.g. l10n_be
- Remove the localization directory
- Start the DB again and navigate e.g. to Inventory > Configuration >
  Settings. You will see a traceback, whose root cause is that the
  computation of the `account_templates` field failed.

We noticed this in a runbot upgrade between 16.1 and 16.2, for a new
localization that was introduced in 16.0.

Solution:

Make the computation return False if the Python module cannot be found.
Also, filter out the modules where account_templates is False when
constructing the list of available chart templates.

closes odoo/odoo#113875

Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-28 23:49:47 +01:00
Antoine (ande) 26be824319 [FIX] l10n_din5008: wrong translation invoice
To reproduce the issue:
1. new db
2. localization in CH (french)
3. install module l10n_din5008
4. select an invoice
5. change invoice's client's language to
   french (CH)
6. print invoice
7. "Facture d'achat" should be "Facture client"

Error: invoice translation not correct

Invoice translation of this module is not
maintained by transifex
So invoice translation is changed manually in
fr.po

OPW-3186496

closes odoo/odoo#113851

X-original-commit: 5bc846a06cf817d78cfe1847f758bf9aadb4d93b
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-02-28 23:49:35 +01:00
Xavier-Do 7431dac2fc [IMP] tests: add file selection for tags
The test-file is used by some dev to run all test classes from a file.
But test-file is always post install and doesn't always have the same
behaviour of a normal test execution.

This commits modifies the module test tags behaviour to be able to
give a file.

closes odoo/odoo#113850

X-original-commit: 5aff8cf22ab0cbac7a9a3cebf39860f55617f79e
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-28 23:49:33 +01:00
Xavier-Do e9b170da38 [IMP] tests: refactor unittest classes
Odoo Test environments requires to modify many parts of the unittest
TestCase, Suite and Result.

The main initial reason is to **avoid to postpone result at the end of
the test suite**, because even if it is convenient to have all errors
visible after the tests in some case, odoo logs adds information during
the execution that can be useful to debug when a test fail, to have
context for an error. (see **OdooTestResult**)

We are also fixing the stack trace comming from a unittest and since
there is no proper way to hook inside the TestPartExecutor, a dirty hack
injects anoter result on the outcome to manage the error and complete
the stack trace. This was also a way to avoid to postpone subtest logs
at the end of the test case (see _ErrorCatcher)

`_feedErrorsToResult` was used to test the test suite behavior since
there are many customization and this is quite fragile, especially if
unittest changes behavior in other python version.

**Python 3.11** introduced python/cpython#664448d8 That, in a way, goes
in the same direction of the changed introduced with _ErrorCatcher:
immediately feed errors to resut instead of postponing it. But this also
removes `_feedErrorsToResult` that was used to test this behaviors, as
well as other ones.

Since odoo should remain multi-version, this amount of changes on the
initial behavior become to complicate to keep cross-version and the
(already in our mind for a while) solution to **vendor unittest** will
help to simplify most of our test code base.

This commit modified the vendored unittest files to simplify them as
much as possible to suite our needs.

Since the runner is still the unittest one, we need to inherit from
unittest.Testcase in order to have the right type.

This also means that we still have access to all TestCase methods
without overriding them all. This is convenient for assertion methods as
an example but the initial idea is to vendor our own version of TestCase
to avoid having trouble to adapte our miscommunications to future python
versions. A trade-off must be done to chose what should remain in our
code base. The idea is to keep logic closely linked to our changes in
our code base, mainly around the run method, but also addClassCleanup
wich need to be vendored for python 3.7, but assertions methods are
independent. Any logic can be moved fom unittest to our
vendored version in the future if needed.

X-original-commit: 9a5d1ea54be49e4cc8208c33e76a6bbd2414d5d0
Part-of: odoo/odoo#113850
2023-02-28 23:49:33 +01:00
Xavier-Do 630b6484a2 [FIX] tests: vendor some unitest files
Vendor some unitest file before modifying them in next commit

Chosen files are suite, case, and result since they are working together
and are the most modified classes in odoo.

mock, signals, runner and utils will still be imported from unittest.

X-original-commit: 742d165b9a1bff23deb736dee6b266c76f3ce727
Part-of: odoo/odoo#113850
2023-02-28 23:49:32 +01:00
oco-odoo 1997c0a01d [IMP] account: improve test helper
Creating a test invoice without tax was impossible with this helper, as the default tax got applied when the 'taxes' parameter was None. We change that to allow doing it by simply providing an empty list in it instead of None.

closes odoo/odoo#113541

X-original-commit: f3ae4f7fa91b73be6a5647724697f73fdf77cbdd
Related: odoo/enterprise#37484
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-02-28 23:49:25 +01:00
Julien Castiaux eaff61793b [FIX] website: public user should see published pp
As the public user, browse the website where you usually should see some
profile pictures (e.g. inside the forum). All the images are wrongly
replaced by the grey avatar placeholder.

When using `ir.binary._find_record` it was checking the access rights
and raising `AccessError` early even if the record was
`website_published`.

closes odoo/odoo#113526

X-original-commit: 0611fb437b699588317919e72ccfa1c41f1245bc
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-02-28 23:49:22 +01:00
Kevin Baptiste 6419bd7f06 [IMP] hr_recruitment: no refuse reason on archive
Don't ask for the refusal reason when archiving an applicant.
Show a pill/ribbon for archived applicants.

task-3172203

closes odoo/odoo#113474

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-28 22:49:57 +01:00
Kevin Baptiste 1aff45e35e [IMP] hr_skills: improve resume
- Replace "CV" with "Resume"
 - Allow to choose which information to show on the resume (Contact +
   Skills)
 - Use the company colors by default
 - Minor cosmetic changes on the template (reduced margins, better page
   break, etc.)

task-3198645

closes odoo/odoo#113218

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-28 20:39:11 +01:00
Odoo's Mergebot 76e0b18d50 [REF] web, *: OWL conversion of gantt extensions
We bring here some fixes, refactoring that allow us to finalize the OWL conversion of the gantt view extensions done in
the PR: odoo/enterprise#37091.

closes odoo/odoo#112756

Task-id: 3184636
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-28 20:38:51 +01:00
Julien Mougenot 8f7154771b [FIX] web: allow tours to use new drag&drop helpers
Before this commit, the new drag & drop tour helpers could only be used
on the white-listed "o_record_draggable" class name. This meant that
only the new kanbans could use the "drag_and_drop_native" tour helper.

This commit allows any element using the "o_draggable" class name to use
that helper, and renames occurences of "o_record_draggable" to
"o_draggable".

Part-of: odoo/odoo#112756
2023-02-28 20:38:50 +01:00
Bruno BoiandMathieu Duckerts-Antoine 8a39822aa5 [IMP] mail: add Avatar component
We introduce a new component Avatar whose role is to allow an easy
display of an image and a display name for a user (or emplyee, ...).
A click on the image opens a chat window allowing to chat with that user.

Part-of: odoo/odoo#112756
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-28 20:38:50 +01:00
Mathieu Duckerts-Antoine 926c4d4769 [REF] mrp: revert partly "[IMP] mrp: adapt workorder gantt view"
Revert partly https://github.com/odoo/odoo/commit/d55e6cca0648c78ab27e0107ab7d545e9fd4972b.

Rationale: if the field workcenter_id is not found in the group_bys, the
records in a given row can be associated with different workcenters with
different unavailabilities. So if for instance two records in the same
row are related to workcenters 1 and 2 with respective unavailabilities
from Monday to Wednesday, and Thursday to Sunday, that row would be
totally greyed. This leaves the user with no interesting information.

Moreover, we are about to refactor the GanttView and we want to simplify
the API of the method gantt_unavailability, in particular we do not want
to send row records anymore.

Part-of: odoo/odoo#112756
Co-authored-by: Mathieu Duckert-Antoine <dam@odoo.com>
2023-02-28 20:38:50 +01:00
859a289b01 [REF] web,*: OWL GanttView (part 2)
This commit acts as a setup that allows the newly converted gantt view
extensions in enterprise to work properly.

Part-of: odoo/odoo#112756
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-02-28 20:38:49 +01:00
Mathieu Duckerts-Antoine efe09fd7ad [FIX] website_livechat: MockServer: patch _performRPC
The new MockServer has no _mockCallButton method. Due to an issue with
the patch function that does not reasign this._super correctly when
entering the _mockCallButton function, a crash did occur.

Part-of: odoo/odoo#112756
2023-02-28 20:38:49 +01:00
Victor Feyens 29b13cbdd6 [MOV] website_sale: move payment-specific logic to website_payment
The `website_id` field is defined in the `website_payment` but not used
for anything until `website_sale` is installed.

This commits moves the `_get_compatible_providers` override filtering
providers based on the current website from `website_sale` to
`website_payment`, where the `website_id` field is defined.

Task-3084364

closes odoo/odoo#111148

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-02-28 19:08:59 +01:00
maximilien(malb) 9c134ec379 [IMP] account: simplify payment term usability
v16.0 introduced a new payment term view and the possibility of an early payment discount.

However, this view and the underlying behaviour can be simplified.

- Changed the payment term view and the report invoice view to better display the installment
- Removed the balance field from payment terms, replacing it with percentage
- Simplified the due date configuration in the payment terms
- Simplified early payment discount by only enabling it on one-line payment term, so it's user-friendlier
- Moved the early payment computation on the payment term rather than the company

task-3090382

See :
Enterprise : https://github.com/odoo/enterprise/pull/36046

closes odoo/odoo#110274

Upgrade: https://github.com/odoo/upgrade/pull/4349
Related: odoo/enterprise#36046
Related: odoo/upgrade#4349
Signed-off-by: Laurent Smet <las@odoo.com>
2023-02-28 19:08:51 +01:00
Guillaume (gdi) 2874b241f4 [IMP] website: ease the header and footer visibility management
This commit doesn't introduce any functional change but allows to manage
header and footer visibility with the already existing data-invisible
system. This simplifies the code and avoids doing an RPC at the start of
the `VisibilityPageOptionUpdate` option.

Related to opw-2971181

closes odoo/odoo#107387

X-original-commit: 07fdbc8847d254498b908a1cde0d910a77666f25
Related: odoo/upgrade#4120
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-28 19:08:44 +01:00
Guillaume (gdi)andxO-Tx 934f413c1f [FIX] web_editor: do not update the options when destroying them
Since [1] it is visible that there is a race condition in the editor.
The race condition was caused by a call for an update of the option
visibility during the save, but the options may be in the destruction
process. This commit prevents the visibility of the options from being
updated when the option destruction process begins.

Before 16.0 (the merge of the frontend into the backend) the bug was
easily visible by following these steps:
- Drop 2 times the image - text block on a page
- Drop a popup block
- Save

=> During the save, a traceback occurs.
From 16.0 the race condition is more difficult to see but we still need
this fix because the problem is still there.

Note: this forward-port commit took time to get merged in master.
Meanwhile, two fixes related to it were merged in stable. The first one
already reached master a while ago ([2]) but had thus no effect as was
relying on this particular commit here. This is actually great as [2]
introduced a big mass mailing bug, fixed by the second fix which is yet
to be forward-ported to master. That one has actually been put as this
current commit's parent so that [2] is fixed before it can create the
mass mailing bug.

[1]: https://github.com/odoo/odoo/commit/686e011f9b54bcfe93cc22db24435d2ca9213664
[2]: https://github.com/odoo/odoo/commit/6bf3823c2996af4ec0534ff69471887ac43a8ddf

Related to opw-2971181

X-original-commit: 47cdb15082f774da0aa07e289361445ddc3a48f1
Part-of: odoo/odoo#107387
Co-authored-by: xO-Tx <mou@odoo.com>
2023-02-28 19:08:44 +01:00
xO-Tx 562c760ce8 [FIX] web_editor: prevent unwanted actions on save
Starting from [1], a `willDestroyEditors` attribute was added to prevent
race conditions caused by an update on options visibility during the
"save" (after checking the code, it seems that the issue here was caused
by the `hide.bs.modal.SnippetPopup` event which triggers the
`_onSnippetOptionVisibilityUpdate()` handler on `snippetMenu`, leading
to a traceback if editors are destroyed).
So with this fix, the visibility update will be ignored during the save
process.

[A] Note that `willDestroyEditors` is set to `true` on `cleanForSave()`
and never set to `false` after saving the content or destroying the
editors.

Another fix was added in [2] to prevent the click (before the preview
is blocked) on the page while saving, and uses the `willDestroyEditors`
attribute to ignore the click.

Now since `cleanForSave()` is called on `MassMailingHtmlField` >
`commitChanges()` and because of [A], the click will be always ignored
on this field's content.

The goal of this commit is to fix this behavior using a global
`savingContent` indicator which will be used to handle both cases
(a click on page & options visibility update) during the save.
It will be only set to `true`  during the content save.

Note: the forward-port of [1] actually took too long to reach master.
Actually [2] already reached master, having no effect as relying on [1].
This commit here will actually be merged first (preventing [2] to create
the mass mailing bug when [1] reaches master). [1]'s forward-ported
version will actually be the commit following this one.

[1]: https://github.com/odoo/odoo/commit/47cdb15082f774da0aa07e289361445ddc3a48f1
[2]: https://github.com/odoo/odoo/commit/6bf3823c2996af4ec0534ff69471887ac43a8ddf

X-original-commit: b2b8590d19e07659c6ad7c3e3afba0a848b414a5
Part-of: odoo/odoo#107387
2023-02-28 19:08:44 +01:00
Guillaume (gdi) 6007264afb [FIX] website: put the popups shared on all pages in a separate section
Before this commit, when a popup was created and the user wanted to have
this popup on all the pages of his site, the popup was moved to the
footer. Unfortunately, this caused a lot of problems:
1) We had to disable the effects on the footer when the popup opened, so
that the popup would not block the page when the footer had a slideout
effect (see original commit).
2) The popup shared on all pages was attached to a footer template so
that if after setting the popup, the user changed the footer template,
he lost his popup.
3) Putting the popup in the footer led to an important limitation which
is that it was impossible to have a popup shared on all pages on a page
where the footer is voluntarily hidden (via the page visibility option).

This commit fixes all these problems by adding a shared section
dedicated to the shared popup on all pages.

Related to opw-2971181

X-original-commit: 0f131160097deb0693d7bdb4adc43fd69ea49c09
Part-of: odoo/odoo#107387
2023-02-28 19:08:44 +01:00
Mahamadasif Ansari 9dd01bffe2 [FIX] stock: sequence_code key error when create stock pick type
KeyError "sequence_code" occurs when creating a stock picking type. This is
because there is not a key "sequence_code" in vals.

This commit added the condition to ensure "sequence_code" key
is available in vals.

sentry-3828105626

closes odoo/odoo#113849

X-original-commit: f88cd4967d0f455b246f481104090417e4ec10e0
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-02-28 18:08:32 +01:00
Habib (ayh) 9d86983617 [FIX] account: the comparison of the previous bank statement's closing balance vs the current bank statements opening balance is not rounded which might cause statements to be invalid
closes odoo/odoo#113844

X-original-commit: 693649f7a611478d620f8c5d67549abb5bd1ca5e
Signed-off-by: Laurent Smet <las@odoo.com>
2023-02-28 18:08:26 +01:00
det 5c28294dbd [FIX] account: make register payment works in expense
Before this commit, on the list view of the expenses,
when trying to register payment, there is a traceback.

The reason is that 'views' is a required field on record
 of type 'ir.actions.act_window'.

related: https://github.com/odoo/odoo/pull/109671/
& https://github.com/odoo/odoo/pull/110518/

closes odoo/odoo#113832

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-02-28 18:08:21 +01:00
Aurelien van Delft (avd) a3e2431073 [FIX] pos_loyalty: speedup Customer View loading in pos session
Currently, when there is a huge number of loyalty cards (>4000) for
the LoyaltyProgram for instance, loading the Customer View in a
pos session can take a few seconds. This is mostly due
to the getLoyaltyCards function in JS.

This commit adds a small cache in the form of a partner_id ->
coupon_ids mapping. This cache is a kind of like a view
on the couponCache and it allows to retrieve the PosLoyaltyCard
instances from the couponCache much faster.

opw-3145342

closes odoo/odoo#113805

X-original-commit: 2e88d9fef8e713ccc4227cd14b0fa85420d983e3
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Van Delft Aurélien (avd) <avd@odoo.com>
2023-02-28 18:08:18 +01:00
Pedro M. Baeza 90fa089013 [FIX] l10n_es: Amends on 2023 new taxes
Followup of odoo/odoo#110592

- Incorrect 0% soportado fp mapping
- Homogenize new tax names for import and intracommunity
- Incorrect tags for services import. And it should be both supported
  and subjected.

forward port of 3915e68a3077c55f6f83f744e50247075044d78b

closes odoo/odoo#113801

X-original-commit: 4b0a56e96033255d18392863129d67c87d6e3ac3
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-02-28 18:08:15 +01:00
Florian Vranckx 4ac35f1170 [IMP] auth_signup, auth_totp: isolate signup_token and auth_totp
This commit is a security reinforcement.

It applies the same logic as for the password of the user to the totp_secret and signup_token

closes odoo/odoo#113753

Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
2023-02-28 18:08:12 +01:00
Archana Vaghasiya bf4cdcaef3 [FIX] stock: index error in stock_move while split_lines is empty
An IndexError `list index out of range`  trace back that occurs in stock/
stock_move : _onchange_move_line_ids was caught by sentry.
because split_lines list is empty when user enter blank entry  in value.

So hear we check the split_lines is empty or not.

sentry - 3942491608

closes odoo/odoo#113808

X-original-commit: 7e22d16681a68e15ba66bb2c81cd36ad19f6abff
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-02-28 15:59:00 +01:00
Thomas Josse (thjo) 09c2b5cdbd [FIX] survey: adding test for QuestionPageListRenderer
This commit adds a QUnit test to ensure that the colspan value for the title
column of a section in a List View is correctly computed in order to let enough
space to edit the `random_questions_count` column.

We are testing 4 scenarios:
 * Without the random column,
 * With the random column,
 * With the question_type column at the start of the row,
 * With the random and question_type columns at the start of the row.

For each scenario, we test the value of colsan of the title column and if
every editable column is indeed being edited when clicked on.

closes odoo/odoo#113564

X-original-commit: 98e6b6e932c595881c1a2e4804b505ee9eec6a63
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-02-28 15:58:57 +01:00
Thomas Josse (thjo) 22e3c9749b [FIX] survey: corrects progress number for random questions
Purpose
=======

Ease the edition of sections.
Make sure we display a correct progress number.

Specs
=====

There is now more space when editing the number of random
questions.
We added an icon on hover to indicate that a section is editable.

When configuring a survey as one page per question, the numbers
near the progress bar where not correct.
With this commit they now are.

Inside this commit we are overriding a function `focusCell`.
This is necessary to enable te user to edit the right column in the view
if those were moved with studio.

Now the method identifies the requested column via its name and not the
actual object.
This is necessary for section rows in which the title column is modified
with an additional parameter `colspan`, rendering the column different from
the original one.

task-2988062

X-original-commit: 737e080bd25fe9136c5606c1f77f94d6cfb0ddf4
Part-of: odoo/odoo#113564
2023-02-28 15:58:57 +01:00
Benoit Socias 1e2ff5d7f1 [FIX] website: handle search keyboard navigation manually
Since [1] when BS5 was introduced, the keyboard navigation of search
autocomplete suggestions did not work anymore.

This commit avoids relying on bootstrap and JQuery to navigate the
suggestions.

[1]: https://github.com/odoo/odoo/commit/971e5a91aab96d36129a823e03f1f9f1b1293968

task-3148871

closes odoo/odoo#112733

X-original-commit: be549b7b64a253149d55b7f73f1d1a25a29388f9
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-28 13:01:41 +01:00
Jorge Pinna Puissant 4a8876b550 [IMP] web: oh-snappisation
The aim of this commit is to make more warning and error dialogs behave
like the "oh snap" dialog of form views.

task-id=3126594

closes odoo/odoo#112276

Related: odoo/enterprise#37593
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-28 13:01:36 +01:00
dasz 5060163ef2 [FIX] hr,base: fix layout of simple user form, access rights on create_employee
company_id is not in the group with phone, which makes it unaligned and weird looking, you can
see that especially when HR is installed and adds a boolean with a longer label.

this commit closes odoo/odoo#111567.
task 3127608

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-28 13:01:34 +01:00
std-odoo e649b36a49 [FIX] web: fix boolean properties value change when editing
Bug
===
- Create a boolean property
- Close the popover definition
- Re-open the definition
> The boolean value has been change because it received the click event.

Task-3172106

closes odoo/odoo#113448

X-original-commit: 677aac62b0efb4b16afd0348c3b3b2c9b4ef65b0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-02-28 10:02:49 +01:00
std-odoo bbb20584c2 [FIX] web: use default value when creating a new property
Bug
===
Currently, the default value of a property is only used when we create
new record. But it can also be used when we create a new property.

Note that the default value is written on the property ONLY if the
property just have been created, to not update existing value on
other records (the goal is to have a behavior similar to normal fields).

Task-3172106

X-original-commit: e3099ae584cef74434fdb51f7fee2ae6250f18ca
Part-of: odoo/odoo#113448
2023-02-28 10:02:48 +01:00
David Monjoie 7c7c369237 [FIX] web_editor restore placeholder when switching records
When switching records, the editable content of the previous record
is replaced by the one of the new record. Unfortunately, there was
no code that handled restoring the placeholder in case the new
content was empty after the change as this was previously only
handled in the constructor.

closes odoo/odoo#113811

X-original-commit: a3c236ef0e047127583f6565461f0b90781584e4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-02-28 08:14:46 +01:00
David Monjoie 5fba47e860 [FIX] web_editor: no rerender when content is reset with empty string
This event listener was added for the `historyStep` event of the editor
in [1] as a proxy for the `input` event of the editable node. This was
wrong because the `historyStep` event is also triggered at other times
than when the user makes an input.

In particular, it is called when switching records. In such case, the
new value from props can be '' which is not suitable for edition, so
it is replaced with '<p><br></p>'. But since that happens in a function
that is going to call `_historyStep` and the editing value was just
changed to something else that the value received in props, the listener
from [1] would make it dirty and thus trigger a re-render etc.

This commit fixes the issue by modifying the listener in such a way
that it listens to the proper event it was intended to target.

[1]: f56e3bca2456f04616982a9a0e77b8d4c5a0abff

X-original-commit: 384ff11f06ba86360f1993cf0c8a17c2dbaa11de
Part-of: odoo/odoo#113811
2023-02-28 08:14:45 +01:00
vishal padhiyar 0f609527df [FIX] web_editor: missing placeholder after saving record
Before this commit:

Creating a new record and saving it afterwards does not show the placeholder in
the description.

After this commit:

You will see placeholders when you create a record and save it.

Task-3167136

X-original-commit: 793e48ae0478ead38ed6ac7c9a71228e2678e2c7
Part-of: odoo/odoo#113811
2023-02-28 08:14:45 +01:00