This PR added a constraint https://github.com/odoo/odoo/pull/120892
This constraint should only be applied on `add_invoice_line` cash rounding strategy.
Initial opw-3185950
closesodoo/odoo#124289
X-original-commit: 02183ef878f8809032892338c41cc8816cab9669
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
Purpose:
--------
Knowledge's sidebar revamp introduces a new draggable hook "SortableList"
that is meant to replace the usage of jQuery's sortable widget and of the
NestedSortable library previously used for the sidebar.
To be able to build this hook using the `draggable_hook_builder`, some
changes have been introduced:
- Do not remove the height of the dragged element when computing its max
allowed height (so that the dragged element is below the cursor even when
the cursor is at the max allowed height, instead of being on top of the
lasts elements, obstructing the view)
- Allow to define mandatory params in the built hook's default params, so
that one does not have to define this mandatory param for each instance of
the hook (eg. SortableList is intended to only work with `li` elements)
Task-3074123
closesodoo/odoo#107490
Related: odoo/enterprise#34788
Related: odoo/upgrade#4118
Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
The target for `this._pluginCall('sanitizeElement', ...)` should never be null.
As we provide the parent element of the initial target for optimal sanitization,
we can encounter some cases where the target element is not yet added in the DOM
and as such doesn't have a parent Element.
We add a verification to ensure sanitization doesn't generate error in those cases.
task-3356284
closesodoo/odoo#124287
X-original-commit: 1d9decd6b08eb2d093f0dcead73f3bb895be27ff
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Many components did not define props, causing warning messages in the developer tools console.
This PR adds static props definitions to components where they are missing.
closesodoo/odoo#124275
X-original-commit: 2df195e6f3d86999442e1c6beeeb5c0c27fb7797
Related: odoo/enterprise#42167
Signed-off-by: Laurent Smet <las@odoo.com>
Bootstrap tooltips are overlapping the parent box, it could cause an
infinite flicker in the web editor because the pointer goes over the
tooltip, disabling the tooltip, refocusing the parent, enabling the
tooltip, etc.
Since commit [1], the tooltips are centered differently, making this
worst because of a bigger overlap.
Steps to reproduce:
- drop a "Text" block
- select it
- hover the bottom border of the "50%" Height option
--> The tooltip flickers infinitely, along with the blue overlay on the
editor.
This commit fixes it by disabling the pointer events of the tooltip.
[1]: https://github.com/odoo/odoo/commit/09b720eff1a7
task-3299236
closesodoo/odoo#124262
X-original-commit: ec343728831c12eacdc6b3d031eb8d0b4b82ecdc
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
This issue occurs when the user tries to create a manufacturing order while the
location type of products is not in production.
steps to produce:
1. install mrp module
2. create a new company and switch to it
3. open inventory module > settings > enable storage locations >
save the changes > configuration > locations > virtual locations
4. now change the default location type from production to any other value
5. Try to create a manufacturing order and the error will be generated.
in mrp_production the location_by_company takes default 'usage' as production:
https://github.com/odoo/odoo/blob/012cfbf82717248631626cab73867fe0362cd59c/addons/mrp/models/mrp_production.py#L474-L477
Therefore, in above use case at time if triggering onchange/compute method, if
location type is not in production, location_by_company gets `Nonetype` which
will lead to above traceback.
sentry-4215242929
closesodoo/odoo#124261
X-original-commit: b07183fbfb938b67edb220f3b53f58053bde5aad
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Steps to reproduce:
-------------------
- create two product of type "service";
- field "Create on Order" is set to "Project & Task";
- create a Sale Order with these two products;
- condirm the Sale Order;
Two tasks are created in a project and each task has its own Sale Order Line Item.
- create a subtask from both tasks respectively;
- select a project for the subtask.
Issue:
------
The same Sale Order Line is selected for the two subtasks.
It always take the first Sale Order line.
Cause:
------
To choose the sale order line, we first look to see if
the subtask belongs to a project.
If so, we take the sale order line which created the project.
Unfortunately, a subtask can belong to a project created with
a sale order line without belonging to the same sale order line
(in the case where a task is added to a project via another product
and therefore another sale order line).
Solution:
---------
- A project without parent --> use project's sale order line
- A parent without project --> no sale order line defined
- A parent in the same project --> use parent's sale order line
- A parent in an other project --> use parent's sale order line
opw-3333936
closesodoo/odoo#124260
X-original-commit: 323d7f631916f5acc5ab34f8531ae59bb0455828
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
ValueError: Expected singleton: stock.move(32, 33)
This error occurs when we get the multiple lines of the same products in
'finish_moves' and after that when we try to mark as done at that time this
error occurs.
applying these changes will resolve this issue.
sentry-4217897073
closesodoo/odoo#124251
X-original-commit: 4933609bd6a8473272f6bb94a1de8aea5cdf6687
Signed-off-by: Tiffany Chang <tic@odoo.com>
* = project,website
On the small screen, the sub dropdown is a bit weird to positioning, so
we use an accordion instead.
We apply this change also on desktop to avoid split behavior between
small screen and bigger screen and also to avoid duplicating code.
Also, we have made some DOM/CSS change:
* avoid reflow of the search bar menu by adding a min-width on the
columns and a max-width on the input for custom groupbys and favorite
filters
* re-align caret vertically for accordion indicators
* reword favorite edition items and add a tooltip
* all menu items have the class `o_menu_item`
closesodoo/odoo#122635
Note: DOM and some tests were adapted to reflect the change
Task-id: 3276542 (Part of)
Related: odoo/enterprise#41563
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Have an action with *_view_ref and search_default_* context keys.
This action has a list view that itself has a many2many_tags field
(it is editable for simplicity's sake)
click on that many2many_tags field and click on the search more item.
Before this commit, the action's context keys *_view_ref and search_default_* were passed
down all the way to the field and to the search more dialog, causing, inevatibly, crashes.
After this commit, those keys are not passed and there are no crash.
opw-3226398
closesodoo/odoo#124252
X-original-commit: 47eab4d987d8cb91a30507c6c33348d1945698f1
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Some Facebook pages have a different URL pattern than what we currently
accept for the snippet. Namely:
- /profile.php?id=<id>
- /people/<name>/<id>
- /p/<name>-<id>
This commit adds these to the accepted patterns and adjusts the call to
the Facebook page plugins with the right format.
task-3147321
closesodoo/odoo#124250
X-original-commit: f3e82c3842f44aaf10cb1a56a90883b5f5338af1
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
pos*: l10n_ae_pos, l10n_co_pos, l10n_fr_pos_cert, l10n_in_pos,
point_of_sale, pos_discount, pos_epson_printer, pos_hr, pos_loyalty,
pos_mercury, pos_restaurant, pos_sale, pos_sale_product_configurator,
pos_six
Previously, none of the templates of the pos were namespaced, this means
that depending on context, you have to access them differently: in xpath
the module prefix is necessary even if the template name itself isn't
namespace, but in owl components you cannot use the namespaced version
because owl doesn't have the notion of modules.
This commit namespaces the component templates of all the pos modules so
that it's consistent with the rest of the code base. It also removes
some extraneous calls to super.setup() that were leftover and are not
necessary for components extending directly owl's base Component.
closesodoo/odoo#124069
Related: odoo/enterprise#42094
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit adds the onInput props, allowing to run code from the parent
of the SelectMenu depending on the search value. This can be used in
situations where the list of choices must be dynamic. Also, whenever the
list of choices or groups is edited in length, the menu is filtered using
the newer values.
For example, choices can be generated from a fetch of items. Now, instead
of loading all items before instanciating a SelectMenu, a limit could be
set during the fetch, and another fetch can happen as the user type.
A test has been added to verify that the onInput props is called correctly,
and executes its code. In this test, the list of choices is edited, and we
assert that the newer elements are present in the menu.
closesodoo/odoo#124224
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
The process of emailing _gift cards_ bought from the Point of Sale is rather confusing.
This PR makes the experience more intuitive.
closesodoo/odoo#123222
Task: 2711714
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
One of the list tests had two "end of selection" characters in its
content before and after the step function. This made it unclear which
was relevant and which wasn't.
closesodoo/odoo#111119
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Superfluous zero-width spaces were removed by the sanitizer and then
upon saving (`cleanForSave`). This commit removes the code dedicated to
that from the sanitizer in favor of the code in `cleanForSave` (adapted
to cover all cases).
Note: this means that with this commit, superfluous zero-width spaces
are not removed from the editor during edition anymore, but only when
saving.
task-3081457
Part-of: odoo/odoo#111119
When cleaning zero-width spaces (ZWS) in the editor, we were replacing
the node values of all text nodes descending from the node we were
cleaning, regardless of whether they contained a ZWS or not. This could
lead to wrong selections in the tests when arbitrarily changing the
value of a text node in the selection.
Part-of: odoo/odoo#111119
We have many issues with this log, except that with a `logger.error` we
do not have exception information (exc_info).
As mentionned in the documentation above, we cannot use `logger.exception`
in this case because we are not within an exception handler.
However, we can still retrieve the exception information using `sys`
module and the `exc_info()` method.
https://docs.python.org/3/library/logging.html#logging.Logger.exception
```
exception(msg, *args, **kwargs)
...
This method should only be called from an exception handler.
```
https://docs.python.org/3/library/sys.html#sys.exc_info
```
sys.exc_info()
This function returns the old-style representation of the handled exception.
...
If no exception is being handled anywhere on the stack, this function
return a tuple containing three None values.
...
```
closesodoo/odoo#124208
X-original-commit: b0844d2f3c0c9655746b4c16c9b612bae9954618
Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
Since the new 'milk' backend theme, we removed previous/next buttons in
the calendar view and made the mini-calendar the main control mechanism
for the calendar view: users were expected to discover that clicking on
a specific date in the mini-calendar would change the main display to
the period encompassing said date (e.g. if the calendar is in week moed
and I click on June 7th 2023, I would see the week of Jun 5-11)
As it happens, it is rather coutner-intuitive and users expect to find a
clearer control mechanism (and I don't blame them).
This commit re-introduces such controls in the sidebar, next to the
period selector.
closesodoo/odoo#123978
X-original-commit: 89897d0902c6e14bcd03fd9853f2fadbe7f348e3
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
Some buttons got lost in the milk theme changes for theme formviews.
X-original-commit: 41eb91a81292ae9ac7a802e8f596ea468183c33f
Part-of: odoo/odoo#123978
Current behaviour before commit:
In list, heading element doesn't indent when pressing tab.
Desired behaviour after commit:
Now heading element gets indented using tab.
Task id- 3239958
closesodoo/odoo#123569
X-original-commit: e9b33cdb835d36329effa01e2d1045980ec288e9
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit fixes issues that could happen when a groupBy is present
in the load params from the ActivityModel. Before the rewrite of the
view to Owl, this code was present but was forgotten. This causes
crashes whenever web_search_read is then called, leading to undefined
record in the template, and crashing the view.
Now, the groupBy param (if present) is replaced by an empty array.
A test has been added to verify that during the load, even if the
ActivityModel has received a groupBy in its load parameters.
closesodoo/odoo#124215
X-original-commit: b6fa8ec174f5467baaed32b0c12acd0224757281
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
This commit adds the signature for mohamedlaminelalmi.md, indicating
that the Contributor License Agreement (CLA) has been signed.
closesodoo/odoo#124211
X-original-commit: bd2082c07f6605a4b991e577aae5249010ff0ccc
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Fix an issue where products with internal references containing point
or slash were not recognized as direct matches in the website searchbar.
Instead, fuzzy search was used to find similar words.
This commit addresses the problem by fixing the regular expression
used for matching words in Odoo's search functionality.
X-original-commit: dee84ff3b0ec56149780e6eefb8724f954918fd1
Part-of: odoo/odoo#124211
Bug
===
If we create a selection properties with some options, change the type
to char, and then again to selection, the options are restored.
But, if we just change the type to char, the options of the old
property are stored in the database, and we don't want that.
Task-3346103
closesodoo/odoo#124129
X-original-commit: 35c99a9110cec3317f36d4ddffae5196b58939e5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
pre_init_hook
When reinstalling a module, an error occurred if using env from
api.Environment in pre_init_hook.
Example:
- Module A depends on module B, and model M that created from module A
- When reinstalling module B, an error occurred if using env['M'] in
pre_init_hook
closesodoo/odoo#124086
X-original-commit: 70fcfa0d9cdf51964fce1a3be31bbd26258e2275
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
When user uninstalls a module it doesn't unlinks custom crons
which are created by user and it will keep running in the background
and will generate traceback.
So, to fix this we unlink all the custom crons which are related to the
module being uninstalled.
sentry-3929309220
closesodoo/odoo#124175
X-original-commit: b0202488220bd48dd177e9e0601f2f3ba8d7a0f1
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
Signed-off-by: Rahul Prajapati (rapr) <rapr@odoo.com>
Before this commit, the error message thrown by the XML assets loader
was designed only for Chrome and logged only part of the error message
(without the actual reason of the parsing error).
This commit ensures that the entire error is logged to comply with all
browsers implementations and have all informations regarding the error.
closesodoo/odoo#124212
X-original-commit: 9d3dbd5f62e0cf8fbd1c64dfd87d2b22610cbf17
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
By default all the draft moves that are not the first one in a period
get the name `/`, indicating it is in draft. In the UI the name field
is then just an uneditable `Draft` placeholder.
When quick edit mode is activated, we always show the text field for
move names to allow users to edit the sequence number beforehand.
However for all abovementioned draft moves, it would show `/` in the
text field, requiring the user to first delete that symbol before
entering the right sequence.
This commit makes sure the names of draft moves without a sequence
number are empty (no `/`), so that in the UI the text field can be
filled out immediately and a placeholder `Draft` is shown.
task-3326827
closesodoo/odoo#124186
X-original-commit: 83a7daa07fedcaeddb983a94a86e4c7a187915d9
Signed-off-by: William André (wan) <wan@odoo.com>
How to reproduce
================
* Install the account_accountant module
* Go to `Journal Items`
* Select the pivot view
* Select the measure `Amount in Currency`
=> A traceback will occur
Cause
=====
Field amount_currency has group_operator set to none to avoid grouping
several amount in different current together.
Proposed fix
============
If the `group_operator==None`, The field will not be shown as
aggregator.
opw-3061776
closesodoo/odoo#124179
X-original-commit: beccce4d5ec26e885c06c5af4cb1d6147cb0e91f
Related: odoo/enterprise#42127
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
Impossible to duplicate the Dutch tax report due to a unique code constraint. I also made sure that this issue does not occur in any other localization.
How to reproduce:
- Activate debug mode
- Configuration>Accounting Reports
- Open the form view of the Dutch VAT Report
- action>duplicate
==> Validation Error:
The operation cannot be completed: A report line with the same code already exists.
closesodoo/odoo#124176
Task: 3199129
X-original-commit: affd307665f3e745e9d2a84b3c9ec213370956c3
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: hupo-odoo <hupo@odoo.com>
The test added in #120818 was relying on a model that does not depend on
module `spreadsheet, rather the opposite. This information was probably
lost during the forwardport process.
Since the fix concerns `spreadsheet.mixin` and not just
`spreadsheet.dashboard`, it makes sense to test it globally, in a
dedicated test module.
Fixes runbot build errors 20966 and 20968
closesodoo/odoo#123947
X-original-commit: 7205e3b26eb3de3f53d6984cd07ec3e4b3fbcfdd
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
If End Date is already defined and user remove that date in
the form view of productivity losses, an error is generated.
Steps to reproduce error:
- Install the mrp module.
- Manufacturing > Configuration > enable work order option.
- In Configuration > Work Centers, open any of the work centers
- In form view of work center click on 'Hours Lost' stat button.
- Now in form view of productivity losses remove the date in the
End Date field and save it.
- Traceback will be generated.
Applying these changes will resolve this issue.
sentry :- 4177445007
closesodoo/odoo#123801
X-original-commit: 4f3e4fe4ba31d9d25b70f3307fcadf0e3a556af2
Signed-off-by: Tiffany Chang <tic@odoo.com>
The danish administration create a standardized COA.
In this PR, we have rework completely the chart of account of the localisation
to match the document given by the government.
closesodoo/odoo#121186
Task-id: 3251723
Related: odoo/enterprise#40956
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Entering a value greater than that allowed by a 32-bit integer raises an
error
Steps to reproduce:
1. Install eCommerce
2. Open the website and go to the 'Shop' page
3. Open the editor and click on any product in the grid
4. Set the value of the 'Number Of Products' to an integer greater than
2147483647
5. An error is raised
Solution:
Limit the number of product per page to 10000. This will have the effect
of avoiding the `NumericValueOutOfRange` error but will also prevent the
user to load too much products at once to avoid a timeout.
opw-3226154
closesodoo/odoo#124158
X-original-commit: f620e95b5e459551f881a9aec2bc75b45b9d354e
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
When inserting a dynamic placeholder in the editable document
we need to ensure the said document currently hold the focus and
have an active selection range.
This was previously handle by the `onDynamicPlaceholderClose()` method
which used to be called before `onDynamicPlaceholderValidate()`.
This seems to have changed from 16.1 to 16.2.
In order to fix the problem and ensure the focus in any situation,
we add a `wysiwyg.focus()` call at the beginning of the validate method.
task-3222474
closesodoo/odoo#124149
X-original-commit: 51b992dec0bcdf09fde5e0811699235b590723ee
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Remove overlapping bottom border of the input since the field is boxed.
Add 4px of left padding to the input not to have the cursor overlapping
the box and feel crowded.
Remove the "action" button left border radius.
closesodoo/odoo#124150
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When we send a report to the iot_w we use Ghostscript to print it. But if it is a ZPL report it crash.
So we need valid if the report sended is a PDF before print it
However if it is a different format, like ZPL, we use print_raw to send directly to the printer
closesodoo/odoo#124146
X-original-commit: a4c315ab657109f2ed69745207cd99ea978889b8
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Before this change, when a package was unpacked the SQL query into the method was looking up all the records into the stock_quant table to find duplicate entries. This could lead to severe performance issue on large database. With this change, if the method is called on a recordset, the SQL query will only try to find duplicate records for records with the same product's ids and location's ids than those in the recordset.
closesodoo/odoo#124143
X-original-commit: c261eb3820e7cbfc98de9c1bd0a79375e6f5d4f4
Signed-off-by: Tiffany Chang <tic@odoo.com>
Since [1] the origin livechat button has no border on the bottom.
This conflicts with the skin of the website livechat button
which is displayed as a circle. This commit solves this issue.
[1]: https://github.com/odoo/odoo/pull/123684closesodoo/odoo#124126
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
From 7s to 2ms for this query with 2.6M records
explain (analyze, verbose, buffers)
SELECT "hr_work_entry"."id" FROM "hr_work_entry" WHERE
(
("hr_work_entry"."active" = true) AND
(
(
("hr_work_entry"."state" in ('validated', 'draft')) AND
("hr_work_entry"."contract_id" in (548259))
)
AND
(
(
(
(("hr_work_entry"."date_start" >= '2023-05-01 00:00:00') AND (
"hr_work_entry"."date_start" < '2023-05-31 23:59:59.999999')
) AND
("hr_work_entry"."date_stop" > '2023-05-31 23:59:59.999999')
)
OR
((("hr_work_entry"."date_start" < '2023-05-01 00:00:00') AND
("hr_work_entry"."date_stop" <= '2023-05-31 23:59:59.999999')) AND
("hr_work_entry"."date_stop" > '2023-05-01 00:00:00'))
) OR
(("hr_work_entry"."date_start" < '2023-05-01 00:00:00') AND
("hr_work_entry"."date_stop" > '2023-05-01 23:59:59.999999'))
)
)
)
ORDER BY COALESCE("hr_work_entry"."conflict", false) DESC,
"hr_work_entry"."state" ,"hr_work_entry"."date_start"
;
closesodoo/odoo#124108
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this patch it was impossible to add a reified field to a
res.users list view via Studio.
The internal methods used by search_read are overwritten in res.users
to ignore reified fields.
closesodoo/odoo#123994
X-original-commit: 11e791d68256a5411d727b031930471eceaafb3f
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: Jinane Maksoud (maji) <maji@odoo.com>
Co-authored-by: Alvaro Fuentes <afu@odoo.com>
We don't want users to edit their websites on a too small screen. To do
this, we hide the edit button when the screen width is less than 768 px
(the MD breakpoint of Bootstrap). Unfortunately, when a user creates a
new website, they go through the website configurator and are then
redirected to their new website with the edit mode enabled. We don't
want that when the screen is small. This commit only opens edit mode
after a website is created if the screen is large enough. Note that this
commit will also prevent users from forcing edit mode with the url
(enable_editor=1) when their screen is too small.
task-3316267
closesodoo/odoo#123992
X-original-commit: 00ea187ce641013feea00650cb2cadab73ebe636
Signed-off-by: Colin Louis (loco) <loco@odoo.com>