Commit Graph
163215 Commits
Author SHA1 Message Date
Michele a7659ed228 [IMP] doc: add cla for stesiconsultingsrl
closes odoo/odoo#117547

X-original-commit: 5516cff9811d6d5e327c9d71d273b55133253446
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-04-04 13:35:40 +02:00
Andro Gvivradze 46be6f583b [IMP] website_slides: improve quiz ux/ui
This commit improves ux/ui by adding the slide
description on top of a quiz and offering links to additional
resources if the user gets questions wrong.

task-3246366

closes odoo/odoo#117530

X-original-commit: a551f956f05bf7b6782e04a95351bf2d0a0a6610
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-04-04 13:35:32 +02:00
Chenyun Yang 0420239770 [FIX] spreadsheet: borders around header and total row
This commit fixes the problem of invisible borders when pivots and lists are
inserted. Now around headers and the total row, black borders are added.

task 3103403

closes odoo/odoo#117493

Related: odoo/enterprise#39218
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-04-04 13:35:22 +02:00
Michael (mcm) 8e3854e2ac [FIX] auth_totp: fix totp tours
This commit fixes the totp tours which fail on a step in
the profile dialog. The step searches for an element
".o_dialog_container" that is removed since commit
e51112e0df7f5e05d3cdf2c01d236c6bbbf123a6

closes odoo/odoo#117451

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-04-04 13:35:18 +02:00
Jorge Pinna Puissant 067bcac533 [REF] web: kanban record quick create
The aim of this commit is to simplify the RelationalModel by moving
Kanban's specific quick create record functions to the Kanban View.

Before this commit, when asking to create a new record using the quick
create on a kanban view, a new virtual record was created by the
DynamicRecordList and added to the DynamicGroupList on the
RelationalModel. A complex mechanism was used to be sure that only one
virtual record is created between all DynamicGroupLists. When the record
was save, the new record (in form view style) was modified to a kanban
style (to do this, the record's activeFields were modified to be
compatible with the kanban card).

Now, the virtual record is created on the Kanban View, in a more simple
way, the kanban renderer knows in which group there is a quick create,
and only in that one the form renderer of the quick create record card
is shown (not need of complex mechanism to have only one quick create
between all groups). After the save, we simply call an existing function
to add the new record to the group using the record's ID (not need of a
complex mechanism to modify the record to a kanban style).

part-of task-id 3179751

closes odoo/odoo#117449

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-04 13:35:15 +02:00
Mylyna Hy bafa668555 [FIX] website_sale_stock: translate restock email
Problem:
The email created by _send_availability_email is not translated correctly.
The body is always sent in English
and the subject will always use the current language of the database.

Example:
Partner A's language = Spanish
Current database language = "French"

The body of the email sent to Partner A will be in English and
the subject of the email sent will be in French and
the field attributes of the products will be in English.

Solution:
Pass in the partner's language into the self's context and the product's context.
This fix will translate the entire email uniformly according to the context's language.

opw-3207979

closes odoo/odoo#117375

X-original-commit: 8777f86adc3ad382b6948461781fb72b1b068944
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-04-04 13:35:12 +02:00
Joseph Caburnay 40ac299c1d [REF] point_of_sale,*: remove use of legacyEnv in popups
*: l10n_fr_pos_cert, pos_sale_product_configurator

This is a continuation of the effort of making pos addons independent
from legacy web modules. In this commit, the popups are now completely
independent from the legacy environment. `env.pos` inside each popup
is no longer pointing to the instance of `PosGlobalState` (`globalState`).
To access the `globalState` inside each popup, we have to read it from
the `pos` service (via the `usePos` hook) which is done in this commit.

closes odoo/odoo#116307

Related: odoo/enterprise#39271
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-04-04 13:35:06 +02:00
Jinane Maksoud 66a99f4743 [FIX] account: fix stat button computation when multiple analytic accounts exist
The first problem when multiple analytics accounts exist is the
sql query, it is generated with less placeholders than the actual
parameters.
The second problem is the getter from the collected data dict, it
is assuming there is only a single account.

closes odoo/odoo#115189

X-original-commit: 8da76614c58ea1989694a5af3ee623640db126dd
Related: odoo/enterprise#38146
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-04 13:35:03 +02:00
Vincent Larcin a116225e18 [IMP] hr_timesheet,project: take away Marc Demo's admin rights
Since 16.0, the demo user Marc Demo has gained admin access to all the apps.
To facilitate testing access rights, this commit restores his access rights
as they were before for the Services apps.

Enterprise: https://github.com/odoo/enterprise/pull/38055

Task-3229247

closes odoo/odoo#115026

Related: odoo/enterprise#38055
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-04 13:34:54 +02:00
niyasraphy 93527d58bb [FIX] website_profile: show + only when gained karma is positive
Before this commit, in the website profile frontend, if we filter the users
using 'This week' or 'This month' filters we always get a '+' displayed before
the karma gain.

If user gained negative karma, lets say -500, currently it displays as follows
--> +-500 , instead of -500.

After this commit, if the gained karma during the period is it will show
-500 instead of +-500.

closes odoo/odoo#117548

X-original-commit: 53b406bcf92e50e62329f1b128742bd851d22cb0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-04-04 12:11:00 +02:00
gawa-odoo 7b082b2e27 [FIX] account: prevent wrong type tax on move
- Create an account of type current asset
- Add him a Sales Tax and a Purchase Tax
- Create invoice
- Add a line
- Remove the taxes from this line
- Change the account to the one you created

=> A purchase tax is applied to the line.
It should not happen, so we prevent it.

closes odoo/odoo#117539

X-original-commit: 85d89a986b6adcf9d0ac0ce57599d4b2678b59a3
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2023-04-04 12:10:58 +02:00
Kevin Baptiste 7bcb003da9 [FIX] hr_holidays: ensure clicked element is visible in test
The test tour `time_off_request_calendar_view` would fail once the first
Thursday of the year was not visible to the user (e.g. on the 1st April)
as the MouseEvents would not be fired.

closes odoo/odoo#117512

X-original-commit: 70f840999b67515bc7d7220321c8e39bec2adefc
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-04 12:10:53 +02:00
Pierre-Yves Dufays 059dc88d17 [IMP] web: update upload service docstring
As the upload service (js) only uses iteration, index based access and length
on the files parameter, it is compatible as well with an array of File as files
parameter (instead of a FileList). So, we have updated the files parameter
docstring to accept as well array of File. With this change we can easily pass
a modified list of files (ListFile being hard to create on some browser).
Example of use-case, only send to the upload service the files smaller than a
given threshold by transforming a FileList to an array and then by filtering
it.

Task-3179130

closes odoo/odoo#117385

Related: odoo/enterprise#38490
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-04-04 11:02:08 +02:00
Adesh JolheandManisha Tulsiyani 23cf931808 [IMP] hr_,sale_(timesheet, project),purchase: generic improvements for the project
Purpose of the commit is to do the generic improvements for project.

So in this commit did the following changes:
 - adding a label 'last update' to the stat button in project form view.
 - indicate 'my project' in the tab instead of 'project sharing view in portal' in project sharing.
 - set the first non-folded stage of the project as default on newly created tasks.
 - remove user confirming the SO as the default project manager.
 - hide fields service_tracking, service_upsell_threshold if sale_ok is false.
 - set purchase_method to purchase by default if product is of service type.
 - remove the : next to the totals labels and decrease the font-size for values of 'total hours'
   and 'remaining hours' in timesheets notebook in project task form view.

task-2897867

closes odoo/odoo#96548

Related: odoo/enterprise#29774
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Co-authored-by: Manisha Tulsiyani <matu@odoo.com>
2023-04-04 11:01:59 +02:00
Victor Piryns (pivi) cfade861be [FIX] sale_timesheet: hide SO in project's settings if not billable
Current behaviour:
You can see the `Sales Order Item` field in the project's `Settings`
sheet page when the project is not `Billable`.

Expected behaviour:
If the project is not `Billable`, we hide the field `Sales Order Item`.

Steps to reproduce:
- Install `sale_timesheet`.
- Project > kebab-menu on project > Settings
- Click on the Settings tab of the project's form view
- Observe there is a `Sales Order Item` field, even if the project
  is not Billable.

Reason for the problem:
Before, `Sales Order Item` was in the Invoicing tab, which is
visible only when the project is billable and a partner is set.
Due to a recent refactoring (b77f60b155),
the field was moved to the `Settings`, but the visibility condition
that was on the invoicing tab was not.

Fix:
Add the missing visibility condition on the field `sale_line_id`.

Affected versions:
- saas-16.1
- saas-16.2
- master

opw-3250937

closes odoo/odoo#117546

X-original-commit: ea97fb5be0ae3d40940f7befac6a2bc19c89b084
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-04 08:03:56 +02:00
Ahmad Khanalizadeh 861db8a5a7 [FIX] delivery: use correct unit price for commodities
Steps to reproduce:
Make a sale order with a product and quantity > 1, add
FedEx international shipping and validate the delivery
In the document you will see that the unit cost is equal
to subtotal which is wrong.

There is a discrepancy between `_get_commodities_from_order` and
`_get_commodities_from_stock_move_lines`, that the former makes
commodities with `monetary_value` equal to the unit price, while
the latter uses subtotal. in the method `commodities` in
`delivery_fedex`, `monetary_value` is treated as unit price, so
the right way to fix it is to do it in
`_get_commodities_from_stock_move_lines`.

Note that when rating a delivery, commodities are made in
`_get_commodities_from_order` and then passed to `commodities`,
while for sending the shipping, commodities are made in
`_get_commodities_from_stock_move_lines`.

opw-3233369

closes odoo/odoo#117521

X-original-commit: 3beddbdd18937e1c69ec4fa6f523296c7c55528b
Related: odoo/enterprise#39234
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Khanalizadeh Ahmad (khah) <khah@odoo.com>
2023-04-03 22:55:48 +02:00
momegahed 915dcda565 [FIX] account_edi: EDI PDF not rendering when having an EDI XML
Steps to reproduce:

- install any edi l10n
- create an invoice with edi xml
- try to print the invoice (this adds a pdf attachment)
- the attachment viewer shows whichever attachment added first
- it shows only the xml file name

Bug:
`_message_set_main_attachment_id` only works if there are no
`message_main_attachment_id` set.

Fix:
Override `_message_set_main_attachment_id` in the `account.move` module to
alter this behavior

OPW-3147811

closes odoo/odoo#117510

X-original-commit: 383834b11bf6b7a80848e5d238b12fa237b9edf3
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2023-04-03 20:48:02 +02:00
william-andre 49b7acf53c [FIX] account: delay the synchronization to end of the registry load
Before this commit, the translations were loaded as soon as `account`
was updated, leading to all fields being read/parsed, even from other
modules.
This commit delays the sync of the translations to after the registry is
loaded.

To reproduce:
* install `l10n_in` (fails because of `python_compute`), or `l10n_mx`
  (fails because of `l10n_mx_tax_type`)
* update `account`

A traceback will be raised inside of `_update_translations`.

closes odoo/odoo#117511

X-original-commit: c50a2d634faef3cd5aceaa3a614c42d9dae6cac2
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-04-03 18:08:58 +02:00
Benjamin Vray 4999a5210d [FIX] website: fix the livechat button that hides the cookies bar
This commit addresses the issue where the livechat button was hiding the
buttons of the cookies bar. With this commit, when a cookies bar is
open, the bottom fixed elements (such as the livechat button) will be
hidden.

Most issues caused by bottom fixed elements hiding buttons on a page had
already been addressed in this [commit]. However, the case of a modal
without a backdrop (like the cookies bar) had not yet been addressed.

Steps to reproduce the bug:

- Activate the livechat on a website.
- Activate the cookies bar on the website.
- When both are open, the livechat button hides the buttons of the
cookies bar (only if the page has a scrollbar and the page is not
scrolled to the bottom).

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

opw-3213808

closes odoo/odoo#117506

X-original-commit: 2e4b9cd6dbcea5844afd4b16a98d9f16abee1556
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-04-03 18:08:53 +02:00
Cuong, Nguyen Minh Tran Manh b44754dcaf [FIX] sale,purchase: fix report pdf borders
Since BS5 integration in v16.0, the pdf of the sale and purchase report have changed. Borders would be present in the body of the report and the total detail.

Came back to v15 display by using the table-borderless class on those elements.

closes odoo/odoo#117492

X-original-commit: 8dd6927ca6195f9972f6f444395765aafca1b593
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-04-03 17:07:32 +02:00
Samuel Degueldre a838223a35 [REF] web: remove dependency of js module system on guardedCatch
guardedCatch is a legacy feature meant to differenciate promises
rejected as control flow from promises rejected because of an error. In
recent years we have settled on the stance that using promise
rejections, which are treated as errors by the language in many ways, is
a bad idea. This commit removes the dependency of the odoo module system
on this legacy feature.

closes odoo/odoo#117457

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-03 17:07:30 +02:00
Michael (mcm) ff0d6dd580 [REF] *: replace odoo module by native one
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.

task id: 3162300

closes odoo/odoo#117305

Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-03 17:07:24 +02:00
c5dd03ffee [FIX] project: review UX and UI in Project app
This commit reviews the UX and UI in Project app and improves the usability of the
new features recently added (subtasks list in kanban card, state field replacing
kanban_state field, etc).

The following changes are made in this commit:

- swap of user_id icon in the kanban box and the removal of the allow_unassign field and setting
- change the ordering of the fields in the subtask list
- make small layout changes in the project.task and project.project kanban cards
- remove the "lock-icon private" sub-title of private tasks, replace it with a
  little lock icon on the bottom right icons of the kanban card.
- remove the break tag in the project.task kanban card that was unecessary
  given the new display and margin style settings
- lock icon is bigger
- kanban icons are better aligned
- state is as big as avatar
- remove the 'remaining hours on SO' field
- deadline field will be optional and hidden by default in project.task list view
- remove the rating field
- add stage field as optional in project.task list views
- priority and state fields will no longer be optional
- stage_id will be copied when duplicating a task, except when the task is
  generated through the recurrence
- remove the tooltip of the tag_ids field
- When duplicating a task having sub-tasks, '(copy)' is no longer
  added to the name of the sub-tasks of this task.
- project.task kanban view:
  * (+ x tasks) mention next to the name is removed
  * The caret is replaced with 'fa-check-square-o x/y'
    which will represent the number of sub-tasks closed
    compared to the total number of sub-tasks
  * Only open subtasks are displayed
  * When changing the state of a sub-task to a closing one,
    the sub-task is muted and removed from the list on the view reload
  * The name of the parent task on the kanban card of sub-tasks is
    displayed except when viewing the sub-tasks of a particular task
    through the sub-tasks stat button
  * project.project kanban view: the fa-check-square-o icon of
    milestones is replaced with fa-flag-o
  * project.task kanban card: the fa-play and fa-pause icons
    are moved on the right of the remaining hours widge.
  * Allow users to edit the stage_id in batch from the list view of tasks
    if all of the selected tasks are part of the same project.
  * the state will have the same size as the avatar
  * change the opacity of the tasks that are closed
  * state is at the right of subtask list
  * the striked should be replaced by the opacity on the kanban card

Enterprise PR: odoo/enterprise#38132

Task-3229873

closes odoo/odoo#116628

X-original-commit: 09b5d5843096d27b5a4ab0f603ad44bdb2e74723
Related: odoo/upgrade#4478
Related: odoo/enterprise#38771
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Co-authored-by: Panagiotis Kyriakou <paky@odoo.com>
Co-authored-by: Bastien (bvdn) <bvdn@odoo.com>
2023-04-03 17:07:21 +02:00
Kartik Chavda cb12ab2f1c [IMP] {hr,sale}_timesheet{,_attendance}: improve generic UX
Purpose of this commit is to do generic UX.

So, in this commit done following points:
 - improve search on invoice for portal commit when invoice is in
   draft then search on id of invoice instead of name.
 - display unit_amount field in muted when value of unit_amount
   is equal to 0.
 - rename timesheet attendance report.

task-2969791

closes odoo/odoo#100141

Related: odoo/upgrade#3897
Related: odoo/enterprise#31304
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-03 17:07:07 +02:00
Kartik Chavda fdb692c25b [IMP] project_timesheet_holidays: create timesheets for global leave wo calendar
Before this commit when user create a global without calendar then
it'll not create any timesheets for any employee but global leave
without calendar is taken as leave global leave for all calendar
in that company's calendar and should create timesheet for all
calendars employee in company.

This commit create timesheets for all calendars employee in that
company if global leave does not have specific calendar set on it.

task-2969791

Part-of: odoo/odoo#100141
2023-04-03 17:07:07 +02:00
Joseph Caburnay 2989ef360a [FIX] point_of_sale: edit list popup failed to show
When trying to add a product that requires specifying lot/serial numbers,
the popup to list the numbers failed to display. This is because there
is no longer `el` in component. We need to explicitly reference the element
we need. This commit introduces a t-ref in the root element of the EditListPopup
to have a reference to it from the useAutoFocusToLast hook to fix the issue.

closes odoo/odoo#117465

X-original-commit: 2a6368e7b72da5a64705cbc3c1f5d44b85677ab0
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-04-03 15:59:54 +02:00
Thanh Dodeur 6c8439ce43 [FIX] mail: add missing call icon in the discuss sidebar
Following the discuss refactoring* the call icon in the discuss sidebar
has not been reimplemented.

This commit fixes this issue.

\* https://github.com/odoo/odoo/pull/110188

closes odoo/odoo#117464

Signed-off-by: Debondt Didier (did) <did@odoo.com>
2023-04-03 15:59:52 +02:00
David (dafr) f9f4190e53 [FIX] purchase_stock: Prevent picking update when product_qty isn't updated
_create_or_update_picking() is a time-consuming method.
On some Purchase, all the purchase.order.line may be written with 'product_qty' in 'values', even though it did not change.

OPW-2978569

closes odoo/odoo#117387

X-original-commit: 5575fe2dedfae2e9d558ca29884d2ebead3c8bbe
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: David <dafr@odoo.com>
2023-04-03 14:56:39 +02:00
xO-Tx 29fd20d945 [FIX] website: fix input default value translation
Issue:

- Go to website > edit mode > add a form
- On one of the form fields, add a default value > save
- Change language > translate > the input has html code shown as value.

On translation editor, the default html values we get from translation
mapping (see 'ir.translation' > _get_terms_mapping()) are used on the
editor's JS code (beforeEditorActive()) to set the right translatable
attributes values on DOM elements, and since the use of jQuery "attr()"
will not update the "value" property on inputs, we force it to replace
the default translation html.

Remark: the same issue will prevent updating the "value" property on
the input when "AttributeTranslateDialog" is used for translation.

task-3042522

closes odoo/odoo#117472

X-original-commit: 9dbc25aab92ee31281d2bbc8c2ab6d743d5e43af
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-04-03 13:55:30 +02:00
xO-Tx f56ff35a5f [FIX] website: fix input attributes translation
Issue:

- Go to website > edit mode > add a form
- On one of the form fields, add a placeholder > save
- Change language > translate > impossible to translate the placeholder.

The fix on [1] was added to prevent interacting with inputs in editable
zones. This prevents translating attributes on those inputs too (using
the AttributeTranslateDialog) so the goal of this commit is to add
an exception to the restriction in [1], when input attributes are
translated.

Remark: On translation editor, elements with translatable default values
will get a `<span/>` as translation value which stays visible until the
content is updated on the editor. This issue can be fixed on CSS for
`placeholder` and input `value` attributes (since we can select elements
with attribute translation on CSS). In this commit, we need to hide the
text on JS until the editor's code sets the right values on inputs and
textareas.

[1]: 3e598a8

task-3042522

X-original-commit: 52aa67f74b89ad95d773bf1af836a136d0445b3a
Part-of: odoo/odoo#117472
2023-04-03 13:55:30 +02:00
Bastien Fafchamps (bafa) dfda7a14c1 [IMP] web: SelectMenu: Truncate selected value while keeping auto width
Before this commit:
When the label of the selected value was too long, the SelectMenu width
would grow indefinitely to accomodate, this behaviour was causing some
layouts to break.

After this commit:
The width of the SelectMenu is still automatic and will try to fill its
parent but will not make it grow. Instead, if the label is too long and
does not fit in the parent, it will be truncated.

Solution:
Using a grid display we can easly set the label to auto and truncate it
while keeping a constant size for the icons.

closes odoo/odoo#115799

Related: odoo/enterprise#37285
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-03 13:55:18 +02:00
Bastien Fafchamps (bafa) 7a6a64068b [IMP] web: SelectMenu: Support for de-selection in the dropdown in multiselect mode
Before this commit, in multiselect mode, clicking on a selected choice in
the dropdown did nothing. Now, while hovering, the choice's background
becomes red and clicking on it will remove it from the selection.

Part-of: odoo/odoo#115799
2023-04-03 13:55:18 +02:00
luvi 804c74813e [IMP] web: export SCALE_LABELS from calendar_controller.js
This commits exports the SCALE_LABELS list from the calendar_controller.js
file. This allows us to import and know the list of available scales from
other locations (Studio for example), and be updated with the supported
scales with their value and label.

Part-of: odoo/odoo#115799
2023-04-03 13:55:18 +02:00
luvi 129fa3f150 [MOV] web, *: move TagsList to core components
Since this component is imported and used in many places, it is more
convenient to move this component a core component instead of a
component made exclusively for the Many2ManyTagsField component.

This change makes the usage of TagsList possible by SelectMenu, which
would create issues as the fields folder should not be imported in
other modules.

Part-of: odoo/odoo#115799
2023-04-03 13:55:17 +02:00
Bastien Fafchamps (bafa) eb4a7d18b9 [FIX] web: SelectMenu value with no corresponding choice should not be displayed
This commit fixes an issue where when a value without a corresponding
choice was given to the SelectMenu, we would display it as a
string. It was missleading as it looked like an option was selected.

Now giving a value with no corresponding choice will result in the same
behaviour as giving no value.

Part-of: odoo/odoo#115799
2023-04-03 13:55:17 +02:00
luvi 2d28239f9b [IMP] web: SelectMenu has multiSelect props
This commit adds the ability to select multiple values from the
SelectMenu component. A list of tags are displayed in the toggler
to remove already selected values, and selected values are colored
in the list of choices.

This feature is similar to how jquery select2 handles multiple
selections, by adding the values in the input toggler. The feature
will be used by the studio sidebar during the refactor.

Part-of: odoo/odoo#115799
2023-04-03 13:55:17 +02:00
fdardenne d760b81271 [IMP] web: SelectMenu: support object as value
Before this commit,  the `SelectMenu` component didn't support object
in the value props of the component.

This commit allow us to use object in the `SelectMenu` value props.

Part-of: odoo/odoo#115799
2023-04-03 13:55:17 +02:00
luvi 98a89ed51f [IMP] web: improve SelectMenu and DomainSelectorDialog components
This commit makes some changes to the SelectMenu and DomainSelectorDialog
components, since they are now used by web_studio, in the sidebar editor.
Those changes makes them more in line with the features that were used by
their legacy counterpart.

Part-of: odoo/odoo#115799
2023-04-03 13:55:16 +02:00
Lucas Perais 47699f3e47 [REF] web: x2manyField: ensure we don't pass the props viewMode if not set
Before this commit, we passed the viewMode props to the X2many field everytime.
Since that props is optional, we don't have to pass it if it is not a string (null or undefined)

This allows to display a field set as invisible in studio

Part-of: odoo/odoo#115799
2023-04-03 13:55:16 +02:00
Lucas Perais a28c3c6897 [FIX] web_tour: wait animationFrame instead of setTimeout, handles o_blockUI
Before this commit, the tours waited only a setTimeout before executing a step.

After this commit, it waits a whole animation frame.

It makes sense in itself, as tours test visual cuesn but also needed as OWL relies
on animation frames to patch the DOM. In cases where we want to check in the DOM something
that is not css-selectable (ie inputs and their value), the animation frame is the right timing.

Also, the tours now handle the class .o_blockUI which blocks the tour's execution

Part-of: odoo/odoo#115799
2023-04-03 13:55:16 +02:00
Lucas Perais 91000641f1 [FIX] mail: tests helpers: export mail setup registries
This commit exports the function responsible for setting up the mail registries in tests.

This is usefull if one doesn't want to instanciate a full webClient in tests and still have mail features.

Part-of: odoo/odoo#115799
2023-04-03 13:55:16 +02:00
Lucas Perais 2787c9539c [IMP] web: core: ModelFieldSelector improved extensibility
Before this commit, when the ModelFieldSelector was updated, it only transmitted its chain as a string
But in some cases we do need the full chain as Object to check on fields that are part of it.

After this commit, this is the case.

Part-of: odoo/odoo#115799
2023-04-03 13:55:15 +02:00
luvi d80f45792d [IMP] web: add Notebook component features
This commit improves the Notebook component to support the ability to
disable some tabs. Once the page is disabled, the tab is greyed out
and set as inactive. Also, an icon can be placed in the tab, before the
label.

This change is used since the Notebook component is used as the sidebar
element during the web_studio refactor. The sidebar needed to disable a
tab depending certain conditions. Now, the component has this behavior
by default once a page has the isDisabled attribute.

To display an icon before the label, you can use the icons props, as an
object, which keys are page names, and values are font awesome classnames.

A test has been added for each new feature introduced.

Part-of: odoo/odoo#115799
2023-04-03 13:55:15 +02:00
Lucas Perais 6085480ea1 [IMP] web: core: draggable: execute willStartDrag
Before this commit, the draggable hook did not execute willStartDrag, that is, before
the element is actually moved.

After this commit it does, allowing for implementing some features, like copyOnDrag.

Part-of: odoo/odoo#115799
2023-04-03 13:55:15 +02:00
Atul Patel 323b893049 [FIX] l10n_no,l10n_de_skr03,l10n_de_skr04: remove chart template reference
As rewrite the whole chart template mechanism,
from here: https://github.com/odoo/odoo/commit/512574861691f425ec6a17f20fe4b586bb88a299
we need to remove chart template reference from
localization module. some of them are remaining.
so removed from norway, Germany localization in migration
script otherwise we got this error:

```
 from odoo.addons.account.models.chart_template import update_taxes_from_templates
ImportError: cannot import name 'update_taxes_from_templates' from 'odoo.addons.account.models.chart_template'
(/home/odoo/src/odoo/saas-16.2/addons/account/models/chart_template.py)
```

closes odoo/odoo#117466

X-original-commit: 76a40e484d70b876dc1b406d25c6cab3839b7216
Signed-off-by: Christophe Simonis <chs@odoo.com>
2023-04-03 12:56:56 +02:00
Géry Debongnie 332c781ff6 [FIX] web: make mock_server implementation closer to orm
The mock server implementation does not exactly match the actual orm
implementation. It is not really a big deal, but it makes the test suite
less useful.

In particular, the onchange call should return a value for all fields
when we are creating a new record. Also, the default get implementation
was not exactly correct.

The motivation for this change is to prepare the future relational model
refactoring.

closes odoo/odoo#117434

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-04-03 12:56:54 +02:00
Mahamadasif Ansari 1de2820e5c [FIX] survey: consider question as normal if question selection is random
Currently in the survey:
- If we have a conditional question and the question selection mode is
  random and we select the question layout as one page with all questions
  or one page per section, the conditional question is not visible. This
  happens because the  random mode condition is ignored.
- If we have a conditional question and the question selection mode is random
  and we select the question layout as one page per section, the traceback is
  generated when we start the survey. This is because it is trying to get value
  from the "selected_answer", which does not exist in random mode.

Expected behaviour is If the question selection mode is random, the conditional
questions are considered normal and visible and do not generate a trace back if
the question layout is one page per section.

This commit fixes the above issue by adding a condition that treats
the conditional question as a normal question when the question
selection mode is random.

task-3142209

closes odoo/odoo#117048

X-original-commit: 73552632b4397ebad1149c6e394ce4ff6d0f0d1e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-04-03 12:56:51 +02:00
Audric Onockx (auon) f403a3f179 [IMP] hr_timesheet: allow progress over max
Allow tasks' progress to go beyond go beyond 100%.
In tasks' list views, display the progress bar in red
if the progress > 100%.

task-2909337

closes odoo/odoo#96104

Related: odoo/enterprise#29565
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-03 12:56:46 +02:00
Audric Onockx (auon) 399e08fa85 [IMP] web: display progressbar in a different color when > 100%
This improvement will give a visual indication that the progress
has gone over 100% by changing its color.
As, depending on what it measures, it could be positive or negative,
we add an option to the widget to determine the class (color)
that should be used.

task-2909337

Part-of: odoo/odoo#96104
2023-04-03 12:56:46 +02:00
pedrambiria ce1c3f90ab [FIX] l10n_fr_pos_cert: raise error when there is no order
Before this commit: if the user wanted to generate a
POS Inalterability Check statement, an IndexError was raised.
This commit raises a more understandable error.

opw-3237383

closes odoo/odoo#117398

X-original-commit: 9cc56fc3d3cdb43e393df0975e10192c3b10f455
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-04-03 11:45:39 +02:00