Commit Graph
159976 Commits
Author SHA1 Message Date
Géry Debongnie 44052d58d7 [FIX] web,base: do not display js module errors in some cases
Since saas 16.1, we added a more visible error information box when the
module system cannot find some dependencies, or if there is an error in
the JS code. This error box is very useful to understand a lot of
typical devlopment issues.  However, it was occasionally displayed in
production code.

However, we sometimes observe that the error information box was
displayed, because the request to load an assets failed with a 404.

It is unclear in which circumstance this can happen, but it seems that
the following elements are involved:

- the user has an open tab with odoo, kept open for a while
- some js code is changed on the server, which causes the previous
assets to be deleted
- the user reload its open tabs, so the browser will load the /web page
from disk, which points to the old assets files
- then it will try to load all assets, with a 404 on one of the script
- the error information box is displayed

This commit intercepts the loading error and stop displaying the error
information box, which is basically the same behaviour as 16.0 and
before. We could force a reload in that case, but it seems dangerous,
since in case of errors, it could easily lead to an infinite loop.

closes odoo/odoo#117625

X-original-commit: 0a44b5b1e008b591a716efd26217c7db7360c37b
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-04 16:02:12 +02:00
Denis Ledoux 70a8758760 [FIX] core: convert_file and xml_import must ingore env.lang
Before revision 5bf1207c8c
a new environment was created for each call
at `xml_import` or `convert_file`,
with `odoo.api.Environment(cr, SUPERUSER_ID, {})`
meaning the context was empty, meaning the lang was never set

Now that we pass from end to end the environment,
the caller of `xml_import` or `convert_file`
passes his own environment, therefore propagating
his `context` variables, therefore potentially passing
a lang in the context.

Therefore, since this change, the lang of the user
is taken into account when calling `xml_import`/`convert_file`,
and it updates the translation term rather than the source term
for translated fields.

This could be an actual/intended valid behavior,
this needs to be discussed,
but currently the places where `xml_import`/`convert_file`
is called expects to update the source term,
not the translated term.
See for reference
https://github.com/odoo/odoo/pull/116780#issuecomment-1486506663

Therefore, as this is an unexpected/unintended change of behavior
of the refactor 5bf1207c8c,
and as code blocks calling `xml_import`/`convert_file` have not
been adapted, we prefer to play it safe
and revert the behavior to what is was.

This is very possible other context keys will need to be dropped,
but one of the desired change of the refactor was to be
able to pass keys in the context, currently we prefer
to not wipe the environment context and just blacklist the one we
do not want to propagate, such as the lang.
If other related issues arise, we will then re-consider.

closes odoo/odoo#117621

X-original-commit: 44fa57e52fbc853b7756a96c73c94baa469c99ca
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-04-04 16:02:09 +02:00
pedrambiria 24b068645a [FIX] pos_loyalty: not showing error without orderline
Steps to reproduce the error:
 1. Open a Pos
 2. Without any orderline, click on `+-` button
 3. You will see an error

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

closes odoo/odoo#117620

X-original-commit: a588bb7fbe9ad6accaa12ebf1ce59767284c4f12
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-04-04 16:02:06 +02:00
Michael (mcm) 77e825cab2 [REF] web: 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#117456

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-04 16:01:57 +02:00
Tommy (tong) ad063d60b9 [IMP] l10n_jp: update chart of account
- Japan chart of account template updates
- Translation updates
- Use better code names for tax report

task-3127047

closes odoo/odoo#115175

X-original-commit: 7a914a0e1d519767b3caeb8e38eeb2c930fce4fc
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-04-04 16:01:48 +02:00
Pierre Rousseau 70a2a62ec9 [FIX] spreadsheet: correctly format date/datetime values of list
Before this revision, a date/datetime field was displayed in UTC instead
of in the user timezone.
This revision fixes this issue.

opw 3127742

closes odoo/odoo#117623

X-original-commit: c07b450594f7e3e1f093d0b5a5a083f915f75310
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-04-04 14:46:09 +02:00
william-andre a226e2317b [FIX] l10n_be: do not override demo accounts from other modules
Other modules (i.e. `hr_payroll_account`) might also be creating demo
accounts, do not prevent that.

closes odoo/odoo#117551

Related: odoo/enterprise#39256
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-04-04 14:45:57 +02:00
Adrien Guilliams (adgu) 168762c838 [IMP] pos, pos_restaurant: adaptation of change of quantity for orderlines
In the previous state of the point_of_sale module, when the l10n_fr_pos_cert
module was used, we were too restrictive leading to an unusable flow by some
clients. We adapt the modules here so that the FR module is more usable
by the clients while still respecting the law.

closes odoo/odoo#113754

Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
2023-04-04 14:45:54 +02:00
Hubert Van de Walle (huvw) 3f962d3754 [FIX] website_slides: reponsive design
Steps to reproduce
==================

- Go to elearning
- On the "Trees, Wood and Gardens" card, click on "view course"
- Click on Main Trees Categories

The slide name is outside the view
Also, the XP badge is cropped

opw-3225999

closes odoo/odoo#117595

X-original-commit: 1d5a92a04ba8e52099715cf782cecbb2c73feb14
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-04-04 13:35:50 +02:00
Filip Brcic f9ebed0f38 [CLA] signature for brcha
closes odoo/odoo#117575

X-original-commit: b5acd987554181d76ddb16b7966193ef591e1c97
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-04-04 13:35:45 +02:00
Abderraouf Ghrissi (abgh) a75cf43c9f [FIX] project: display project in read-only when portal user is not a collaborator
Before this commit:
- A portal user cannot access the project if he's not a
follower but a public user can do that and it doesn't
make sense for portal users to have less access than public users.

- Technically the problem was that we call _check_project_sharing_access
with the portal user instead of sudo, so when trying to access
self.collaborator_ids, an exception is raised saying that
the portal user cannot access to project fields.

After this commit:
- Portal users can access the project in read-only when they are not
followers.
- Technically, we preferred searching over just adding self.sudo()
to get the result directly in one query for a better performance.

task-3205644

closes odoo/odoo#117549

X-original-commit: f51685213c2c10a54e4d31f42d20a4bc7f4b17cc
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-04-04 13:35:42 +02:00
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