Commit Graph
6859 Commits
Author SHA1 Message Date
Elisabeth Dickinson 89082fbd56 [IMP] web, *: fix favorite alignment
*: account, hr_recruitment, project, lunch, mrp

By removing the absolute positioning on ".o_favorite" inside kanban
views, we allow it to align naturally with the rest of the elements,
thus removing the custom code that was needed for padding.

By doing so however the icon - which is now only visible on hovering the
card in the Project's kanban view - should remain visible at all times.
The behaviour would be the same as in other kanban views: an outlined
star when not active and a full yellow star when it is.

The margin on the kanban heading in the Manufacturing orders has been
removed to realign the top elements.

task-3462098

closes odoo/odoo#131559

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-11-02 12:03:40 +00:00
Louis (wil) a46c800d53 [I18N] *: export source terms
closes odoo/odoo#140529

Related: odoo/enterprise#49925
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-31 15:54:32 +00:00
Michael (mcm) 89bf62b0c1 [IMP] web,*: remove legacy/utils.js from backend
This commit removes useless function from legacy/utils.js and removes it
from several backend bundles. The file is moved in wysiwyg and frontend
bundles as it is still used in these bundles.

task id: 3439226

closes odoo/odoo#140260

Related: odoo/enterprise#49812
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-10-30 15:18:00 +00:00
Odoo Translation Bot 6739c317d1 [I18N] Update translation terms from Transifex 2023-10-29 00:07:17 +02:00
c0b683e2f4 [IMP] web,*: improve darkmode
This commit introduces some adjustments to the dark mode color scheme
and the use of bootstrap classes in Community.

- Mini calendar contrast -

The colors were not using variables, making them non dynamic
and breaking the contrast in dark mode.

- Avoid !important rules spreadsheet -

Prior to this commit, spreadsheet top bar was using a `bg-white` class,
making it pure black in dark mode.

Since spreadsheet is designed with light colors and we don't provide a
dark mode for it, we remove that class and set a `background-color`
property using CSS in Enterprise.

- Input color -

This commit fixes the focus behavior on the searchbar in the control
panel, the `command_palette_search`, and the `start a conversation` in
discuss.

- Copy clipboard field border color -

Make use of the `text-primary` color for the copy to clipboard field
We use the o-theme-color function to avoid an undefined since primary
doesn't exist in the o-theme-text-color map in white mode.

- Web_editor toolbar variables -

The toolbar was using the `o-brand-primary` variable
which was set to a darker shade. This caused issue when activating an
option due to how vibrant the color is.

- Improve the controls on border-color -

Introducing a custom property on the border-color to allow
further control on individual components (such as the popover).

- Improve setting tabs colors use -

Prior to this commit, the colors of the settings tabs menu were kinda
inverted. The menu was light in dark mode and dark in light mode.

We fix this by changing the values associated to the CSS variables in
use.

- Make model field selector dark mode proof -

Fixing the design of the model field selector popover in both
light and dark mode. Since the popover was using custom style with
arbitrary values, it was not designed for the dark mode and had a lack
of consistency.

To improve the design, we use variables rather than custom style, and
make sure the desired render is as close as before.

- Sign colors use -

This commit aims to improve the sign module in both light and dark mode.
There were some readability issue with some `btn-light` having poor
contrasts in both light and dark mode, and the use of some classes was a
bit unexpected (e.g `card-header` to set a grey background with some
padding).

- Improve buttons design inside listview -

Prior to this commit, this button was using custom CSS to make it look
like a primary button, while it was using classes related to secondary
buttons.

We remove the custom CSS used to style it correctly and keep our button
design consistent.

- Messaging menu layout in mail -

This commit aims to improve the design of the notifications displayed
in the messaging menu. Prior to this commit, the notifications dropdown
was using custom CSS variables overriding the regular behavior
of our dropdowns.

In fact, the layout was generating some friction:

1) Marking a notification as read would turn its background into a
darker color

2) Effects like `:hover` were all based on the custom CSS variables
resulting in an inconsistent layout.

- Multi company selector adaptations -

In darkmode the multi company selection was using the btn-light which
creates a weird effect and overrides the dropdown default hover behavior

This commit uses the btn-link to display an hover effect on the
company switch and on the checkbox while blending with the background
and the default dropdown hover effect.

- Adapts default badge design -

Improve the design of the default badges in dark mode.

If you open the light mode, these badges are dark grey with a white
text. If you switch to dark mode, they are dark grey but with a dark
text, which makes them look either muted or off.

We make use of SCSS variables to handle the color of the component,
providing a good styling in both modes.

- Fix kanban cards borders inside dropdown -

Fixes the issue with the divider inside the kanban dropdown menu not
showing in dark mode.

To ensure it is visible, we assign it the `$dropdown-divider-bg`, which
is the color it should use, as the horizontal divider above uses.

- Fix tour pointer design for dark mode -

This commit aims to insert the tour pointer and its content inside the
styling we applied to our tooltip.

To do so, we make sure it uses CSS variables, allowing more control and
consistency, plus we replicate the overall look of our tooltips.

- Fix `text-primary` on action background contrast -

This commit improves the readability of our `text-primary` classes when
it's used on a `$o-component-active-bg` background.

Prior to this commit, the `text-primary` was not meeting the contrast
standard, mainly when you were using the `CMD+K` shortcut on the
app switcher.

To prevent that, we changed the background to a `$o-component-active-bg`
background with an opacity ensuring our text provides a good contrast.

- Fix input states -

Prior to this commit, the `--o-input-border-color` CSS variable was
using the `$o-form-lightsecondary` variable to define the standard color
of the `border-bottom` property of our inputs.

This was conflicting since `$o-form-light-secondary` is also used to
define the `background-color` of our table on focus.

With this commit, we separate these two element with different variables
to make sure they don't affect each others.

- Fix kanban ghost background -

Before this commit, if you created a project without any stage or element
in it, the ghost cards that act like placeholders would be pure `#000` in
dark mode, due to the `bg-white` class.

This commit replaces that class with a `bg-light`, providing a better
visual result in both light and dark mode.

- Fix new message design -

Improve the design of the new message element while
inside Discuss, using our danger color, ensuring a good visual result in
both modes.

task-3201038

closes odoo/odoo#139966

Related: odoo/enterprise#49666
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: chgo-odoo <chgo@odoo.com>
Co-authored-by: stefanorigano <sri@odoo.com>
2023-10-28 10:07:53 +00:00
Hugo Carlier (Huca) 074a453611 [IMP] project: add tests for personal stages unlink
This commit adds tests for the new unlink method of project.task.type
model and in particular for the deletion of personal stages.

task-3345132

closes odoo/odoo#140050

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-27 14:22:12 +00:00
Hugo Carlier (Huca) 463f67c22f [IMP] project: adapt tests for project_task_type
After the refactoring of personal stages, some tests are adapted.

task-3345132

Part-of: odoo/odoo#140050
2023-10-27 14:22:12 +00:00
Hugo Carlier (Huca) 2236e5c97c [REF] project, project_todo: refactor personal stages
Personal stages of project.stage records are based on two main field:
- personal_stage_type_ids: the list of all personal stages linked to a
  task (M2M)
- personal_stage_type_id: a computed field (not stored) indicating the
  personal stage of a task for the current user.

When reading a set of project.task records grouped by personal stages,
two options are possible:
- Group the records by personal_stage_type_id (approach used in former
app Notes): in which case the read_group method has to ne rewritten as
it can be used on a non-stored field.
- Group the records by personal_stage_type_ids (approach used in app
Project) in which case, the kanban view has to be overriden to be able
to drag and drop a task between personal stages (which is not possible
by default, when grouping according to a M2M field).

The main evolution proposed by this refactor is to use an hybrid
approach that would:
1. Group the project.task records by personal_stage_type_id
2. Use the read_group with groupby set to 'personal_stage_type_ids' as
this should give the same result.

This would allow to:
- Avoid a complex and costly (performance wise) read_group override
- Avoid an override of the kanban view that is costly to maintain
- Simplify the implementation (and thus readability) of personal stage
management (among which, removal of the model
project.task.stage.personal).

task-3345132

Part-of: odoo/odoo#140050
2023-10-27 14:22:12 +00:00
Maryam Kia 9c8d39d1a8 [IMP] account, helpdesk,...: same title for all portal chatters
By this commit, all portal chatters have a same title as `Communication history`

closes odoo/odoo#139735

Related: odoo/enterprise#49566
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-27 13:02:10 +00:00
Thibault Delavallée 43c6b5e7a8 [IMP] mail: add message_type for outgoing emails
Currently both incoming and outgoing emails are using the same 'email'
message_type. However both flows are not linked in any way.

Purpose of 'message_type' is to distinguish who generated the message.
In this case incoming emails are generated by the mailgateway while outgoing
emails are generated by mailins e.g. using the composer in mailing mode.

We now distinguish outgoing emails from incoming emails by using a specific
type for outgoing emails. Addons are updated accordingly.

Default 'message_type' value when removing sms/snailmail/whatsapp is now
'comment' instead of 'email', as default value of messages should be
comment as discuss is the main source of messages.

Task-3285720

closes odoo/odoo#139814

Related: odoo/enterprise#49597
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-27 11:35:01 +00:00
Louis (wil) 3f6f949fa5 [I18N] export sources
closes odoo/odoo#140002

Related: odoo/enterprise#49687
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 08:36:16 +00:00
Xavier BOL (xbo) 6bf135df6a [IMP] project: factorize writable context keys for create and write
closes #7334

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-15 13:27:48 +00:00
Pierre Paridans 963842381e [IMP] web,*: replace ClipboardJS with Web API and homebrew polyfill
*: auth_totp_portal, mrp_subcontracting, project, survey, web_editor,
   website, website_links, website_sale_loyalty, website_slides, test_lint,
   spreadsheet

Implements missing `clipboard.write()` and `ClipboardItem` ; targets
only Firefox (which partially implements Clipboard API, features hidden
behind a preference flag).

Supported browsers: Chromium 76+, Safari 13.1+, Firefox 63+, Safari iOS
13.4+.

This allows to replace ClipboardJS by the native Clipboard Web API.

Reference:
https://caniuse.com/?search=clipboard
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API
https://w3c.github.io/clipboard-apis/

task-3439226

closes odoo/odoo#134881

Related: odoo/enterprise#47154
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-26 07:22:54 +00:00
Yannick Tivisse 7ebafb1eb7 [IMP] base: Remove manager rights to user demo
closes odoo/odoo#139731

Related: odoo/enterprise#49562
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-25 20:56:11 +00:00
williamandh4818 dc696c8ed4 [IMP] analytic: allow cross analytics
Purpose
=======

Make it possible to compare analytic values between plans by inputting
up to one account per plan on each line.
For instance, if we have 2 plans: "Country" and "Product Type", with the
following accounts

| Country | Product Type |
| ------- | ------------ |
| BE      | Drinks       |
| LU      | Food         |

And the following invoices:
* 1000€ of drinks in Belgium
* 2000€ of food in Belgium
* 3000€ of food in Luxemburg

We want to be able to display the following pivot tables:

|     | Drinks | Food | Total |
| --- | ------ | ---- | ----- |
| BE  |   1000 | 2000 |  3000 |
| LU  |      0 | 3000 |  3000 |
| Tot |   1000 | 5000 |  6000 |

|        | Total |
| ------ | ----- |
| Food   |  5000 |
| * BE   |  2000 |
| * LU   |  3000 |
| Drinks |  1000 |
| * BE   |  1000 |
| Total  |  6000 |

Implementation
==============

* `ir.fields` are added/removed dynamically on `account.analytic.line`
* Each analytic plan corresponds to one field on `account.analytic.line`
* The fields are added dynamically in the views.
* `account.analytic.plan` doesn't have a `company_id` field anymore,
  meaning that all the companies have access to all the plans. This
  means that the applicability fields and lines are now company
  dependent, and those can be used to know which fields/plans to display
  for which company.
* There can no longer be one "Project" plan per company, even if the
  accounts of that project can still be owned by only one company.
* There is now only one method to get the default (or "Project" plan),
  which is `_get_plan_columns`

task-3497653

closes odoo/odoo#139225

Related: odoo/upgrade#5306
Related: odoo/enterprise#49226
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: william <wan@odoo.com>
Co-authored-by: h4818 <ayh@odoo.com>
2023-10-25 18:10:57 +00:00
Bastien (bvdn) 78f551b2fc [FIX] project: allow state reset for stage batch modification
The onchange on the stage_id/project_id wasn't triggered when modifing tasks in batch
we are now putting the same conditions as the onchange but in the task write() method

closes odoo/odoo#139491

X-original-commit: 0accffc0eb65f40e44d31402a0a362abaaa9b9bd
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-25 17:03:20 +00:00
Chrysanthe (chgo) df8535fbd4 [REF] portal, *: portal redesign
*: base, account, account_payment, auth_top_portal, hr_timesheet, loyalty,
   mrp_subcontracting, payment, project, purchase, sale, sale_stock,
   sale_timesheet, website_crm_partner_assign, website_sale,
   website_slides

Portal general redesign. Increase visual consistencies with the backend
[1] and adapt to the new default website design [2].

[1] https://github.com/odoo/odoo/pull/116641
[2] https://github.com/odoo/odoo/pull/120302

task-3046004

Part-of: odoo/odoo#138077
2023-10-25 15:50:36 +00:00
Michael (mcm) fcb16a3b1b [IMP] *: remove guarded catch
This commit removes the promise extension which added the function
`guardedCatch`. It was used to filter server and connection errors from
javascript errors. Instead of using guardedCatch, we should use catch
and check if the reason is a server or connection error if needed and
re-throw the error if it's not handled.

closes odoo/odoo#137702

Task: 3439226
Related: odoo/enterprise#48451
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-25 15:50:34 +00:00
Thibault Delavallée c68ddce1b9 [IMP] various: update alias management in views
PURPOSE

Allow alias domains to be multiple, notably to be used in a multi company
environment where each company has its own alias domain.

SPECIFICATIONS

Update fields used in form views. Use 'alias_domain_id' instead of domain
that is now simply a related on 'alias_domain_id.name'. To ease UI we add
a placeholder on this field as it is now writable e.g. in multi domains
environment. Avoid unwanted configuration change by making it generally
no_open / no_create_edit.

In project, remove an unnecessary field adding complexity for few real use
case now that aliases are more open to configuration.

Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
Thibault Delavallée 9345060498 [IMP] mail: respect alias domains in 'mail.mail' and outgoing emails
PURPOSE

Allow alias domains to be multiple, notably to be used in a multi company
environment where each company has its own alias domain.

SPECIFICATIONS: MAIL.MAIL

Update MailMail to use alias domains. Notably "Return-Path" headers are
now computed based on alias domain when possible, using the recently added
fields on 'mail.message' model for that purpose. Fallback is to use current
company's bounce email when mail_mail creation is done outside of classic
mail flows or without that information.

SPECIFICATIONS: IR.MAIL.SERVER

Update IrMailServer and low-level stack to use alias domains. This has an
impact notably on default values computation for from and bounce emails

  * '_get_default_bounce_address' is called when there is no 'Return-Path'
    given. Most classic mail flows will set it according to current record
    company / alias domain. Fallback when not set is to fallback on current
    company's bounce email, computed based on its alias domain;
  * '_get_default_from_address' is used in two use cases
    * computing a default 'email_from' for outgoing emails when it is not set.
      In most classic mail flows it is set based on current user's email. If
      not set fallback on current company's notification emails is considered
      as a safe bet, replacing the global configuration parameter;
    * overriding the 'email_from' of emails that are considered spoofing the
      mail server, allowing to wrap the sending into a 'notifications@domain'
      generic sender. For those we should try to keep record's information as
      it may be called in classic mail flows;
  * '_get_default_from_filter' is added in base and overridden in mail to
    either use 'mail.default.from_filter' ICP, or use the one defined on
    the alias domain. Supporting both is still an option, as its behavior
    is implemented for basic email sending, without mail being available.

Those methods are updated to try to support multi domains / multi company
setup. However as those defaults are located ar ir.mail_server level it is
not always easy to have complete environment information, hence fallbacking
on current company's parameters when no better information is provided.

A test about 'mail.default.from' is removed, as it was testing a default_from
outside of catchall domain. It is not possible anymore as default_from is now
part of domain definition. As multi domains is supported, no need to support
exotic configuration like that.

SPECIFICATIONS: FROM MAIL.MAIL TO OUTGOING EMAILS

When sending emails based on MailMail, we now prepares sending groups based
on MailServer, email_from, but also alias domain to which the mail belongs to.
Information about alias domain (e.g. notifications email based on default_from
and bounce email) is propagated to low-level email preparation methods. It
uses the context as it is the easiest way to propagate information to that
level without hacking too much models or calls.

Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
Thibault Delavallée 3a0da2278f [IMP] mail: respect alias domains in mail gateway
PURPOSE

Allow alias domains to be multiple, notably to be used in a multi company
environment where each company has its own alias domain.

SPECIFICATIONS

Make mail gateway support alias domains instead of relying on configuration
parameters. This implies the following changes

  * destination alias check is now based on full email by default. Previously
    only left-part of aliases were checked. Optionally an allowed list of
    domains could be additionally checked. Default from now on is to check
    the complete email e.g. 'sales@mydomain.com' != 'sales@mydomain.in';
  * detection of direct write to catchall implies checking all domains
    catchall emails;
  * detection of write to bounce implies checking all domains bounce emails;
  * when having to send bounce emails using the bounce alias as mailer-daemon,
    find the bounce email from the relevant company;

However we have to ease transition from the old ICP-based model used since
ages to the new domain-based model. Notably a common usage of mail gateways
is to do mail forwarding e.g. forward mail from domainA to domainB without
rewriting destination. It means that e.g. sales@mail.domainA should be
considered as a valid alias equivalent to sales@mail.domainB. This was
working due to left-part only check of destination aliases. In order to
keep this setup working after migration a flag is added on aliases allowing
to keep the detection of those aliases based only on local parts.

In summary: When searching for aliases, mailgateway now either checks for
exact email, either for matching local parts when the flag is active. This
is not the default behavior, as we want a stricter comparison of emails by
default but it will be the default behavior at **migration time**.

The 'mail.catchall.domain.allowed' configuration parameter is kept. It is
used only for left-part check aliases, allowing to limit the scope of the
match.

Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
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