Commit Graph
6838 Commits
Author SHA1 Message Date
Adrien Dieudonne a2016359d0 [REF] web, *: avoid extend on h5 for kanban card title
´extends´ generates a lot of css rules.

So in this commit, we remove it by replacing it by the ´h5´ html tag.

closes odoo/odoo#139484

Related: odoo/enterprise#49408
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-10-24 13:55:30 +00:00
Aaron Bohy 85372ffa94 [REF] web,*: remove last legacy stuff from several bundles
This commit removes the last low level legacy stuff (e.g. Widget,
mixins...) from the backend bundle, and from the webclient bundles
of mrp_subcontracting and project. They are no longer used in the
backend. There're still necessary for the frontend and for the
web_editor though, so we had to manually add them in the lazy
loaded bundle of the editor. Hopefully, the last widgets and
dialogs will be converted soon, and we'll finally get rid of all
those legacy files.

Part-of: odoo/odoo#139154
2023-10-24 12:38:30 +00:00
Aaron Bohy 3f3175d4ca [REF] website,web,web_editor: convert AceEditor to owl
This commit refactors the website AceEditor to owl. The wrapper
around the lib was defined in web_editor, and extended in website,
where it was used (single usecase). This commit thus introduces an
owl Component to replace it, directly in website, and specialized
to the website usecase.

This thus allows to remove the legacy implementation.

This also removes the last usecase of Widget and select2 library
in the backend bundle, which will allow to trim it down.

Part of task~3439226

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Xavier Morel 9ebbfdac73 [FIX] *: incorrect translations markings
Fixes a large number of cases where strings are translated then
formatted, instead of letting `_()` do the formatting internally,
which allows it to recover from incorrect translations (missing,
broken, or extra placeholders).

Also

- removes translation markers entirely when there's nothing to
  translate e.g. `_("%s - %s")` is not useful
- fixes a few messes which lead to only partial translatability
  (DRY is generally a bad idea when translations are involved, even
  more so when you don't make the variable part translatable)
- fixes a few nearby issues noticed at the same time
- replaces a few `"%s"` by `%r`, which should automatically quote
  strings relatively appropriately
- fixes translated strings which use `\` to escape a newline (in order
  to fill-paragraph): `\` escapes only the newline, if the
  continuation string is indented this results in a bunch of spaces
  ending in the string to translate, which is pretty garbage for the
  translator, using implicit concatenation works much better

Note: some of the updates revert f-string parameters to %, because
babel (2.9) apparently has trouble with f-strings and blows up trying
to extract them.

Not in scope:

Helping translators fix translatable strings e.g. any translation
string with more than one placeholder probably should use keyword
placeholders

- Provides more context / data to the translator to make sense of the
  sentence.
- Allows reordering the translated terms, which can be necessary
  depending on the sentence and language.

closes odoo/odoo#139314

Related: odoo/enterprise#49311
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-10-23 16:45:09 +00:00
FrancoisGe f91920a440 [REM] *: remove legacy/js/core from asset bundles
Several asset bundles have legacy/js/core files that they no longer use.
So we're going to remove them in this commit.

Part of task: 3439226

closes odoo/odoo#139423

Related: odoo/enterprise#49377
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-23 07:17:51 +00:00
Jorge Pinna Puissant 7adde63d69 [MOV] web,*: move record.js to model folder
This commit is part of a serie of commits which aims at simplifying and
reorganizing js files in the web addon

closes odoo/odoo#139156

Task-id: 3508223
Related: odoo/enterprise#49212
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-20 11:22:17 +00:00
Jorge Pinna Puissant f813e2651b [FIX] project: operator should use in or not
Before this commit, the domain term was using = or != as an operator
with an array as a right expression. This creates a warning in the log
when normalizing the leaf of the domain.

Now, the operations = or != are replaced by in or not in.

closes odoo/odoo#139032

Related: odoo/enterprise#49115
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-10-20 11:22:13 +00:00
Adrien Schoffeniels 31af631607 [IMP] *: add properties fields to various models
Purpose:
--------
This commit adds properties (and related properties definitions) on the
following models:
- hr.employee (hr.department)
- hr_recruitment.hr_applicant (hr_recruitment.hr_job)
- product.product (product.category)
- stock.picking (stock.picking_type)

These have been added to the related form, kanban and calendar views when
applicable.

Properties have also been added to kanban and calendar views of
- crm.lead
- event.event
- project.task
(Properties had already been added on these models and form views)

Task-3458627

Part-of: odoo/odoo#132578
2023-10-20 11:21:56 +00:00
Adrien Schoffeniels b8b450544c [IMP] web: remove hideKanbanOption from properties field
Purpose:
--------
This commit removes the "hideKanbanOption" from the properties field.
This option allowed to prevent users to make properties visible on cards
(kanban cards and calendar popovers).
The rationale being that there is no reason to prevent users of adding
properties on cards now that they have been redesigned (see commit [1]).

Task-3458627

[1]: https://github.com/odoo/odoo/commit/25e8fbe0a1327c289df826cf6eb7882098a4c325

Part-of: odoo/odoo#132578
2023-10-20 11:21:56 +00:00
Michael (mcm) 8cf98fbe67 [IMP] *: remove core.bus
This commit removes the legacy global bus (core bus) and the places
where it was used.
The main users of this bus were the public widgets, they now use the bus
on Component.env.
Some of the uses were dead code and has been removed.

closes odoo/odoo#139076

Task: 3439226
Related: odoo/enterprise#49131
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-10-20 09:35:21 +00:00
Raphael Collet f6b7899a06 [IMP] core: use SQL wrapper in _read_group()
Part-of: odoo/odoo#138019
2023-10-20 09:35:18 +00:00
Raphael Collet c041919f1b [IMP] core: introduce _order_to_sql() to replace _generate_order_by()
The new method should be used to generate an SQL object that represents
how to order by a field in an SQL query.  We introduced the auxiliary
method _order_field_to_sql() so that one can specify some SQL for
ordering by a given field with a simple method override.

Part-of: odoo/odoo#138019
2023-10-20 09:35:18 +00:00
Pierre-Yves Dufays 725e7ffae3 [IMP] various: improve custom activity views
The following summary view of the record in the activity views have been
improved:
- project_task: task state added
- project_project: project manager added
- event_event: responsible and the dates (date_begin_located and
date_end_located) added
- account_move: total amount, customer and state added
- sale_order: total amount and the state added
- purchase_order: total amount and the state added
- crm_lead: customer and stage added
- hr_applicant (hr_recruitment): recruiter added
- survey_survey: responsible added
- maintenance.request: added equipment and responsible
- stock.picking: added scheduled_date
- repair.order: responsible, schedule_date and product_id added
- mrp.production: added responsible
- hr_leave (hr_holidays): status is added and default deadline modified see
below

Ensures that "Schedule activity" is in one line by adding a colspan.

hr_leave activity: When a time off approval activity is created as a
consequence of the creation of a hr.leave, the deadline of the activity is set
to the date_from of the hr.leave minus activity type delay_count (default 15)
except if it leads to a date anterior to today. In that case it is set to
today. That way, in the activity view, the time off approval activities are
more or less sorted by related hr.leave date_from and the cell date is an
indication of when the time off is planned.

Technical note: on most activity view, the activity record was not occupying
all the horizontal space. To solve that problem the css has been modified and
the max-width (200) that was imposed on the sub div has been removed. And as
it was impossible to impose a max-width for a flex div (which is the common
case for the activity record), the max width is imposed on each text that might
be too long using the class o_text_block. That class has been modified to
impose a max-width. That's why that class has been added in most view.
Alternativly, we could have modified the activity compiler to add that class
when the attribute full was set (not done because not sure of the consequence).

Task-3300854

Part-of: odoo/odoo#138135
2023-10-19 19:08:12 +00:00
Pierre-Yves Dufays 3f2f3c1beb [IMP] mail, various: simplify the systray
The system tray has been simplified:
- only one clickable area per activity group
- by default, a click on an activity group open the list view, except for some
model (ex.: journal entries, project, task, documents where the activity view
is opened). This can be defined per model using the _systray_view attribute on
the model.
- the clock icon providing access to the activity view has been removed. As it
is the only action, we also remove "actions" returned by systray_get_activities
in res_users.
- the KPIs are no longer clickable

The tests have been updated (for example, because we open the list view instead
of the kanban view) and one removed "activity menu widget: activity view icon"
as we only have one clickable area now and no more icons.

Task-3300854

Part-of: odoo/odoo#138135
2023-10-19 19:08:12 +00:00
Hugo Carlier (Huca) 5790372661 [FIX] project: improve _get_all_subtasks performances
In the project.task model, the method _get_all_subtasks allows to get
all the subtasks linked to a recordset (recursively). This method uses
the method _get_subtask_ids_per_task_id that retrieves all subtasks ids
for each task record in the recordset using a sql query to optimize
performances (see odoo/odoo#117624).

This commit adds an additional WHERE clause in this request to avoid
looking for subtasks in records that have no parent_id set. On top of
that, a unit test is added for both methods.

task-3504339

closes odoo/odoo#139132

X-original-commit: c2e59b337b9fd705f35473f560733c42227502cd
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-19 17:01:13 +00:00
Abderraouf Ghrissi (abgh) b9532e7549 [IMP] project: Improve ux
Before this commit:
- project.task > list view: Currently, the progress is displayed
in purple if less than 100% and in red if above. The two colors
don't contrast a lot, making it hard to read. In addition, it
is not coherent with the color we usually apply for the remaining
hours in the rest of the app.
- onbording tour: the manual saving step is no longer necessary
as records are now automatically saved. In addition, showing it
doesn't provide a wow effect and is an extra opportunity to lose
people in the process

After this commit:
- the following color code was applied for the progress bar:
*if progress < 80 -> green
*if progress is between 80 and 100 included -> orange
*if progress > 100 -> red

- step removed.

task-3475170

closes odoo/odoo#132854

Related: odoo/enterprise#46162
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-18 18:27:25 +00:00
FrancoisGe bb09cf76e3 [REF] *: remove legacy time.js
The purpose of this commit is to delete the legacy/js/core/time.js file.
We have therefore replaced all calls to time.js with the l10N/date.js utilities.

Part of task 3439226

closes odoo/odoo#138609

Related: odoo/enterprise#48918
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-18 08:56:06 +00:00
Bastien (bvdn) 7bd5bc9969 [FIX] project: write tests for project tags filter
Created custom filters using tag_ids for the tour to click on
using the add custom filter in the filter dropdown was buggy when used in the tour
the o_filter_condition div didnt update when changing the custom filter

Task-3511261

closes odoo/odoo#138930

X-original-commit: cf44186bdd082bb822eb1801534f8bf4b5a904e2
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-18 07:51:42 +00:00
Bastien (bvdn) ddd380edb0 [IMP] project: write tests subtasks unlinking/portal create user
Task-3460027

closes odoo/odoo#135266

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-17 08:53:04 +00:00
Brieuc-brd 538fdab99b [IMP] *: fine-tune app icons
The aim of this commit is to improve the impact and rendering of app
icons in bright and dark mode. It also reduces the size of svg files.

To achieve that, this commit updates the colors to flat colors. This
change will make the icons stand out and improve their readability.

task-3072562

X-original-commit: 667a19162b74fb6554a2389ba9c6e69de4ff5113
Part-of: odoo/odoo#138279
2023-10-16 09:21:17 +00:00
Aman Patel d382b20135 [IMP] project: disable /image for portal user
Steps:
- Install project.
- Create a project and it's task.
- Share this project to portal user with editable rights.
- Open that project from portal user.
- In task description, using `/image`, add one image.

Issue:
- There comes an Access error:
 Sorry, you are not allowed to access this document.

Solution:
We are passing `'allowCommandImage': false, 'allowCommandVideo': false,
'allowCommandFile': false}` so that portal user can't have the /image and
related options.

task-3463461

closes odoo/odoo#136799

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-16 07:58:40 +00:00
Himanshu Rohit 157c8b6493 [IMP] project: improve ux for project
The purpose of this commit is to do generic improvements to the project.

In Commit, made the following changes:

   - replace the rating % by the value out of 5 in the project kanban card.
   - replace the rating % by the value out of 5 and satisfaction by average rating in the
     project update right-side panel.
   - add the placeholder in project stages and project task type.

task-2962386

closes odoo/odoo#99474

Co-author-by: Manisha Tulsiyani <matu@odoo.com>
Related: odoo/enterprise#31013
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-13 21:11:45 +00:00
luve-odoo 7cf8b9f4ae [FIX] project : traceback with multi-company
How to reproduce:
    - Link 2 distinct projects to at least 2 different companies
    - Modify and save any setting in project settings (this action
    should trigger the write function of the project)
    --> Traceback: expected singleton

Why?
    - If projects associated with differing companies are updated
    collectively, the condition self.company_id.id anticipates a
    singular value, but it’s possible for there to be multiple.

Solution:
    - When we want to write a company_id on some projects, take back the
    ones already with the right companyc(as we don't have to change their
    stage) and then write the first stage found on the other records (
    by putting self.company_id.ids in order to avoid the singleton
    exception).

taskid:3520107

closes odoo/odoo#136614

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-13 15:54:25 +00:00
Pierre Paridans 35122d5c7c [REF] *: use raw CSS rules instead of extend utility classes
*:mail,portal,project,web

task-3546717

closes odoo/odoo#138615

Related: odoo/enterprise#48920
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-13 11:46:30 +00:00
Michael (mcm) e062e6f483 [IMP] web,*: remove legacy env
This commit removes all the legacy envs (common_env, env, public_env)
as well as the files used to set up them.

task 3439226

closes odoo/odoo#138348

Related: odoo/enterprise#48781
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-13 09:17:45 +00:00
Thomas Lefebvre (thle) 26e3a113df [FIX] project: invalidate field to get user_ids
Steps to reproduce:
-------------------
- create a project;
- set project visibility of project as
    'Invited portal users and all internal users (public)';
- share that project with a portal user;
- create a task in that project and set one of user in 'Assignee' of the task;
- login in website as that portal user;
- from kanban view of task, open a task.

Issue:
------
The 'Assignees' are not visible in the opened form view.
The `portal_user_name` field will be empty, with the result
that no assignees to the task will be displayed in the project task form view.

Cause:
------
In the business flow, we first perform a `read` (with portal rights)
which will set the value:
`project.task.user_ids: {project_id: ()}` in the cache.

After, we try to get `user_ids` inside the `_compute_portal_user_names` method.
The `insert_missing` method of the cache does not overwrite existing values in cache.

Note:
fetch method uses `_determine_fields_to_fetch` with
parameter `ignore_when_in_cache` equal to `True`.

Solution:
---------
It is necessary to invalidate the cache for this field for the recordset
to make sure the value is updated.

opw-3536187

closes odoo/odoo#138557

X-original-commit: e533daf44c7946fae1e4467e70f9363f675dad07
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-10-13 06:27:43 +00:00
Pierre-Yves Dufays 35d5342887 [IMP] {test_}mail, various: generalize activity plan + activity batch schedule
Generalize the hr.employee activity plan to any model, allowing to create
activity plan that can be launched on any model.

The activity can now be created in batch by selecting multiple record in the
list view and then clicking on a "clock" icon in a row similarly to the batch
records update (selecting multiple records allows to change for example their
name in batch in the list view). We implement also that functionality for the
plan, allowing to launch a plan on multiple records at once.

We also centralize the launching of activity or activity plan through either
the  "Activities" button in the chatter or the "clock" button in the view list.

Scheduling activity is now taken in charge by a wizard that can schedule a
single activity as well as a plan. We add/update tests for checking that the
wizard is launched with the right record selection (on a single record or a
batch) and add tests for checking the wizard itself.

The plan can be defined through an added menu in the technical admin menu but
also through configuration menu added in the module crm, project.

Technical notes:
In the added wizard, to determine that there is a error, we introduce the
has_error field because we cannot use easily the error field for that. Indeed,
to determine that there is no error, we have to compare it to "<p><br></p>"
(more precisely &lt;p&gt;&lt;br&gt;&lt;/p&gt;) which is not handy and may
change in the future. This is because when we write False on field error and
read it after, we get "<p><br></p>". Instead, we centralize this weird
comparison in the model in the compute method of has_error.

The ActivityListPopover still displays the activity of the record on which it
has been triggered but the button to schedule activity will launch a wizard
that create activities in batch for the selected records if more than one was
selected. For that, the ActivityListPopover component receives now an
additional prop: resIds (selected records) on top of the resId prop (record on
which the popup has been triggered). Note that when the line that trigger the
popup is not selected, the batch mode is disabled to avoid confusion.

Test are updated because the wizard is opened instead of the activity form to
schedule a new activity and as the form view is only used to edit already
existing activities, default_res_id and default_res_model are no longer passed.

We defines date_deadline and date_plan_deadline in the schedule wizard because
those date are managed differently (default value, required or not, ...).

Task-3390865

Part-of: odoo/odoo#137969
2023-10-12 16:12:09 +00:00
Nicolas Bayet fac09ae974 [IMP] web_editor,mass_mailing,website: lazy load wysiwyg
In order to improve the loading time of the odoo backend, only load
the wysiwyg before starting an html_field.

task-3493014

Part-of: odoo/odoo#134464
2023-10-12 13:16:42 +00:00
Michael (mcm) 7ebd785764 [IMP] *: rename quick_add into quick_create
This commit renames calendar's attribute quick_add to quick_create
to be more consistent with other views.

closes odoo/odoo#138042

Related: odoo/enterprise#48677
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-11 17:02:07 +00:00
Adrien Schoffeniels 2d7a49dab1 [IMP] web: move properties field's "add a property" btn in the cog menu
Purpose:
--------
When the property field is added into a form view, the "add a property"
button is shown by default.
However, most of the time the users won't add properties when opening a
form view, making this button take up space for nothing.

To alleviate this issue, commit [1] added an option that allows to hide
this button, and added actions to allow adding properties from the cog
menu instead.

Now that properties are being added into several views, one would like
this "add properties" button to be hidden by default, and show an entry
in the cogmenu allowing add properties by default, without needing to
create an action for every view using a property field.
Therefore, a new static action "Add Properties" has been added in the form
controller that is available if a properties field has been encountered
during the parsing of the form view's arch.

The "hideAddButton" has been changed into "showAddButton" and now allows
to show the "Add a Property" by default.

Task-3458627

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

Part-of: odoo/odoo#137589
2023-10-11 17:02:02 +00:00
Aaron Bohy dc2be03dba [IMP] web,*: lazy load jSignature lib and extension
The jSignature lib is only used by the NameAndSignature component,
which is not accessible on a many screens. This commit thus
removes the lib and its extension from the bundles, and makes the
NameAndSignature component load it on demand.

Part of task~3439226

closes odoo/odoo#138054

Related: odoo/enterprise#48633
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-11 08:18:46 +00:00
Aaron Bohy 4bf1384e8b [REF] web,sale,portal: adapt SignatureForm to owl
This commit converts the SignatureForm widget into a Component.
This allows to remove the last usage of the legacy NameAndSignature
widget, which we thus remove.

Part of task~3439226

Part-of: odoo/odoo#138054
2023-10-11 08:18:46 +00:00
kais-odoo ed268f81f4 [IMP] mail,portal,project: add preview to portal link
Before this commit, when the user shares a portal link, the receiver
has to click on the link to understand what it is about.

This commit uses new key called `preview_object` inside
`portal.frontend_layout` template.
When it is defined, it will add some useful information for the
preview link.
This commit also defines `preview_object` in portal view of project
and task to be able to have the preview link to prevent the user
from having to click on the link to understand what it is about.

task-3186692

closes odoo/odoo#113622

Related: odoo/enterprise#37514
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-10 11:07:44 +00:00
Prakash Prajapati 506e779261 [FIX] project: hide empty stages when user perform subtask action
Step:
  - Install project app
  - Activated  Task Dependencies
  - Create project and task
  - Add sub-task
  - Click sub-task action

issue:
    In the commit below we have passed the default_project reference so we get the
   current project stage.
Fix:
   we pass 'subtask_action' context to subtask action and we checked that context
   in _read_group_stage_ids method if subtask_action context is found then we will not
   fetch project's stages.

Side effect of this commit-https://github.com/odoo/odoo/commit/23cf9318084c8a00f37ffcefefa3e056583d2d77

task-3390279

closes odoo/odoo#138024

X-original-commit: 82c29c03cbaa351600b782082554378b4a320b73
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-10 08:19:34 +00:00
Aaron Bohy b3972b26a1 [REF] web,*: remove legacy service provider
This service was used to redirect legacy service requests to the
wowl service infrastructure. It has been incrementally simplified
with the codebase getting converted. It now only allows to redirect
calls to the effect service, which doesn't seem useful anymore.
This commit thus removes it.

Part of task~3439226

closes odoo/odoo#138120

Related: odoo/enterprise#48654
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-10-10 07:15:47 +00:00
Aaron Bohy daf05d48ac [IMP] *: views: deprecate active_* keys from evalContext
This commit aims to simplify the evaluation context used to
evaluate expressions used in views (invisible, required, readonly,
domain and context attributes). For now, the evaluation context is
typically the current record (there's a key for each field in the
view). In addition to that, there're static keys (that may conflict
with field names): uid, allowed_company_ids, current_company_id,
active_id, active_ids and active_model.

The motivation of this commit is at some point to get rid of the
3 active_* keys, because they are misleading and basically useless.

The notion of active_* exists, but it is something else: when you
are in a form view (let's say the form of a partner) and you open
its opportunities (by clicking on the stat button), the list view
of opportunies shows up and in the context, there're 3 keys
active_*, referring to the record from which we came. One can
easily access those information with context.get("active_*"), in
python or in view archs.

However, almost all `active_id` found in archs were actually used
to refer to the id of the current record. Indeed, for now, in the
evaluation context of a record, the value of the `active_id` key is
always the id of the record. So this commit adapts them to
directly use `id` instead. There was no use of active_ids, and
a single use of active_model which was removed (active_model is
the res_model of the view, so it isn't really necessary).

This commit doesn't drop the support of those keys, it deprecates
them. They will be removed for v18. A warning will be displayed if
they are used.

closes odoo/odoo#136665

Related: odoo/enterprise#47917
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-10-10 00:54:04 +00:00
Aaron Bohy 9e46a8a58c [REF] web,*: remove owl.App.validateTarget override
The motivation of this commit was to remove the override of owl
that disables the validateTarget check, which we believed was
necessary for the renderToString function.

Fun fact: renderToString doesn't seem to need the override, as
validateTarget is only called when mounting an app and when
completing a fiber, which renderToString doesn't do. It was instead
probably necessary for the legacy compatibily layers that have now
been removed.

So this commit removes the validateTarget override.

This commit also simplifies the setup of the renderToString fn by
lazy creating the app itself, instead of requiring the application
setup to set the main app as renderToString app (e.g. main.js in
web).

Part of task~3508223

closes odoo/odoo#137807

Related: odoo/enterprise#48514
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-06 14:33:45 +00:00
Victor Piryns (pivi) b01835ac63 [PERF] project: add an index on create_date
Description:
In eedf37d6e2 the index on
`create_date` was removed, but it was still left on our production
database. After recent analysis on the usage of the index over the
span of 2 months (start July 2023 -> end of August 2023), this index
was hit over *100M* times. It's heavily used in custom filters when
grouping by `create_date`. So the goal of this PR is to add it back
in standard code.

Reference:
task-3263544

closes odoo/odoo#134313

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-06 14:33:40 +00:00
Abderraouf Ghrissi (abgh) 56073896a6 [IMP] project: merge date_deadline and planned_date_end
Before this commit:
- The existing of two dates behaving as and end date for project_task
(date_deadline and planned_date_end) is confusing.

In this commit:
- The main goal is to simplify the interface by having one field/widget
that acts as both the deadline and the end date, instead of having two separate fields.
So we removed planned_date_end (changes can be seen in the enterprise related pr (link at
the end) and changed the date_deadline type from date to datetime in project_task and
report_project_task_user

Related PRs:
Enterprise: odoo/enterprise#40866

task-3084978

closes odoo/odoo#120953

Related: odoo/upgrade#4654
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-06 08:25:14 +00:00
Thibault Delavallée e147d35590 [REF] mail: rename 'field' to 'field_id' on tracking value
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled.

SPECIFICATIONS

Rename 'field' to 'field_id' on tracking model. It better indicates it is a
many2one and not a char field holding a field name for example.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:55 +00:00
Thibault Delavallée 6aa0a25df7 [REF] mail: remove 'field_{desc/type}' from tracking value
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled.

SPECIFICATIONS

Remove 'field_desc' and 'field_type' from 'mail.tracking.value' model. Those
can be retrieved when necessary, as it is mainly used for frontend display
in Chatter.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:55 +00:00
Thibault Delavallée c40053bc28 [IMP] test_mail: cleanup tracking tests
When possible, use '@users' decorator. Rename tests to better match their
main purpose, notably

  * test_mail_track*: mail_track specific (specific fields, display)
  * test_message_track*: overall behavior of 'message_track', notably subtypes,
    template usage, ...

Add some additional tests and improve test coverage, as some field types
were not covered (date, datetime, text notably). Improve currency
check for monetary fields.

Move 'mail.tracking.duration.mixin' tests into the file testing mixins
linked to 'mail.thread', rename the Case class according to current test
guidelines.

Also starting from now, `MailCommon` flushes tracking automatically at
setup time, allowing to remove some custom flush done in tests. That way
tests are less prone to non deterministic errors. This implies some changes
in execution of tests, which means some updated query counters notably.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:54 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Michael (mcm) 9c1f704e59 [IMP] *: remove action service mapper
This commit removes the event `do-action` listened on `core.bus`
and adpats the place where it was triggered.

task 3439226

closes odoo/odoo#137088

Related: odoo/enterprise#48144
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-04 13:01:21 +00:00
Aaron Bohy cc3a3a328d [REF] web,*: simplify arch manipulation and parsing logic
*board,mail,project

This commit aims to simplify the XMLParser logic and the way archs
are manipulated in views, motivated by [1] where we had to
modify the arch in View to insert access right information.

First, the xml utils have been reworked. The XMLParser class has
been removed. The xml utils module already exported a parseXML and
a serializeXML functions, this commit adds visitXML, s.t. the whole
XMLParser feature is fully replaced by the 3 functions.

Second, concrete views now receive the arch in props as an
XMLDocument, as the arch is parsed once for all in View. With this,
we were able to remove serializing/parsing back and forth at several
places, where we needed to extract information for sub-parts of an
arch individually (e.g. View, x2many subviews, list view groupby).

Third, even though this change has been driven by the one above and
wasn't initally wanted, the view compiler cache and API have been
simplified. The cache is now flat, there's an entry in the cache for
each template that has been compiled. Moreover, the useViewCompiler
hook no longer takes the cache key in params, as it can directly
compute it itself (the key being the outerHTML of the template).

[1] odoo/odoo#135145

closes odoo/odoo#136376

Related: odoo/enterprise#47808
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-10-04 08:39:12 +00:00
Jorge Pinna Puissant 006ee1fc47 [REF] web, *: remove legacy cookie utils and cookie service
The cookie service was replaced by a utils file in core. This was done
to be able to use the cookies without the need of environment.

"Om Nom Nom Nom" - Cookie Monster

part-of task-id 3439226

closes odoo/odoo#136782

Related: odoo/enterprise#48005
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-03 20:17:40 +00:00
Romain Estievenart adba68440b [IMP] *: remove jQuery.nested_sortable
task-3439226

closes odoo/odoo#136375

Related: odoo/enterprise#47807
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-03 19:20:06 +00:00
Gurupreet Singh a3c4cb6ba2 [FIX] project: fix project tour
When we run the project tour manually, even if we select the assignee, the tour
does not move to the next step, so we have clicked the input button manually.

task-3302315

closes odoo/odoo#137152

X-original-commit: 99f13f2e2c9d30f829c3eba3d16d23ae203d0754
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-09-29 18:16:14 +00:00
miad-odoo 39dd2fc2ab [IMP] mail: allow users to manage own templates
Before this commit, all mail templates were shared, which was cluttering the UI
for everyone.

Now, each user can have their own templates that they can edit and save. Access
is done through the mail composer wizard, where users can only access their own
templates and templates that don't belong to anyone.

Some groups are considered as admins and can access all templates in
Settings/Technical/Email/Email Templates:

- Sales Admin
- Project Admins
- Helpdesk Admins
- Accountants
- Event Admins
- Recruitment Admins

Task-2504439

Part-of: odoo/odoo#126049
2023-09-29 13:11:50 +00:00
Renilkumar Kajavadra 3b448265fc [FIX] project: import records of project
When user import records of project and if it contains tags in the file,
a traceback will appear.

Steps to reproduce the error:
- Go to project > Favorites > Import records > Upload File
Note: Make sure that file contains tags

Error: A traceback appears:
"TypeError: unsupported operand type(s) for +=: NoneType and list"

https://github.com/odoo/odoo/blob/0480005e4498d76fe7a3446693f41500122e41d7/addons/project/models/project.py#L2763
When user import records that contains tags, here args will be None.
So it will lead to above traceback.

sentry-4494554048

closes odoo/odoo#136973

X-original-commit: 9e14cf0fb618c517fe12138416e40c3e66383276
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-09-29 11:59:02 +00:00