Commit Graph
218 Commits
Author SHA1 Message Date
Sébastien Theys a7485e53d6 [REF] mail, *: clean click and contains API
* = test_mail, hr, im_livechat

- Allow only selectors
- Add `value` check to `contains`
- Remove return from `click`

closes odoo/odoo#132799

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-23 17:40:07 +02:00
Sébastien Theys ed7621d726 [REF] mail, *: remove unnecessary makeFakeNotificationService
* = hr, im_livechat

The real service works just as well, gives more guarantee on what is
actually tested, and requires less lines of code.

closes odoo/odoo#132744

Related: odoo/enterprise#46108
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-22 20:01:17 +02:00
Pierre Pulinckx (pipu) c07181b20b [REF] *: Replace env._t() by _t()
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :

<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>

task-3292454

closes odoo/odoo#131390

Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-18 19:17:16 +02:00
Yosua Nicolaus a7205508be [IMP] web: add link to readonly many2one_avatar widget
remove the condition where a many2one field can't be opened when the field is using the many2one_avatar (and its descendant) widget

closes odoo/odoo#131337

Task-id: 3454944
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-08-16 10:24:12 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Michael (mcm) 00d8aef1c7 [REF] web, *: remove legacy patch
This commit removes legacy patch/unpatch functions and adapts their use
by using the modern patch. There was also a custom patch function used
in tests which has been replaced too.

closes odoo/odoo#130867

Related: odoo/design-themes#685
Related: odoo/enterprise#45271
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-07 10:58:48 +02:00
Aaron Bohy f31214aeaa [REF] web,*: remove legacy fields
Those fields are no longer used since all client actions and the
studio report editor have been converted to owl.

Part of task~3439226

closes odoo/odoo#130462

Related: odoo/enterprise#45015
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-03 09:23:21 +02:00
Michael (mcm) 9d6b380a24 [REF] *: adapt patches after new patch function
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.

task 3410198

[1]: 19ea1ac08043e22a811630968e44715cc3bfc495

Part-of: odoo/odoo#125716
2023-08-02 17:29:05 +02:00
Julien Carion (juca) 7e6dd0e7c0 [FIX] mail, hr: fix avatar card popover
This commit introduces various fixes regarding the avatar card.
First one makes sure that the avatar card popover won't launch when
there is no user image associated with the many2one_avatar_user_field.
Second one prevents the card from opening when the related model is not
"res.users".
Third one allows to display the phone number of users even without hr
installed and makes sure that the work_phone and work_email are shown
in priority if available when hr is installed.

Direct fix to Task-3167110

closes odoo/odoo#129876

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-02 15:59:50 +02:00
FrancoisGe 9d2656720c [REF] *: remove model.notify()
Since the relational model was rewritten (PR 114024), it is now reactive,
so it is no longer necessary to use model.notify() to render the view.

closes odoo/odoo#130058

Related: odoo/enterprise#44781
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-31 23:21:18 +02:00
tsm-odoo 577f0b3471 [IMP] mail, *: remove setup manager patches in test
*: im_livechat, website_livechat.

Before this PR, services has to be added to the setup manager in order to be loaded in tests. This was cumbersome because the setup manager was patched by each sub-feature to add feature related services to the registry. The same had to be done for systray/main components registries.

This PR automates this process in order to remove the patches.

closes odoo/odoo#129705

Related: odoo/enterprise#44596
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-28 16:28:52 +02:00
Bastien PIERRE 65242e31e9 [IMP] *: Remove alias in JS files
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo/odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-07-27 11:58:34 +02:00
Julien Carion (juca) 3af4bffeee [IMP] web, mail, hr: Avatar card preview
This commit adds the possibility to see additional information about a
user with a card that appears when hovering avatar user fields for a
set amount of time. This card contains the following information:
- Avatar
- Chat status
- Name
- Email
- Button to send message
and with HR installed:
- View profile Button
- Job position
- Department
- Phone number
- Advanced chat status (when hr_holidays is installed)

Task-3167110

closes odoo/odoo#121943

Related: odoo/enterprise#44563
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-26 19:18:49 +02:00
Melanie Peyrat (MEPE)anddasz b3be3af61c [ADD] hr_homeworking: add homeworking
Users and employees can now define their usual worklocation
for a day of the week aswell as define unusual ones from the
calendar app. The worklocation is then displayed in the calendar
in two different ways: when only one person is selected, there
is a circle with an icon in it, and a ray that extends to the right
if the person is at the same location for multiple days. If there
are multiple persons selected there is no ray, instead the circles
are grouped by location type and colored accordingly to the filters
in the left panel.

closes odoo/odoo#129585

Task: 3060685
X-original-commit: c74ac3f698d4ea4c9b7a5e060fba4cf77cc9a6d7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Co-authored-by: dasz <dasz@odoo.com>
2023-07-25 21:22:46 +02:00
218ad8456a [REF] *: adapt codebase to new RelationalModel
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.

Main changes that were requested are:
 - record datapoints no longer always have an "id" key in their
 data (they still do if the id field is in the view), so we use
 record.resId instead
 - the new model is based on fined-grained reactivity, so several
 components that previously relied on onWillUpdateProps to update
 their internal state no longer worked. Typically, using the hook
 "observeRecord" is the way to go now.
 - specialdata are no longer handled in the model, so the components
 needing specialData can use the hook "useSpecialData"
 - more generally, all overrides of models (RelationalModel or
 KanbanModel) needed to be reworked.

Part of task~3179751

Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:50 +02:00
Pierre Pulinckx (pipu) 8bfa76a842 [REF] *: Unify _t and _lt
The goal of this commit is to prepare ground to remove
lazytranslate function _lt() and keep only _t()
for a better understanding of the use of the translation function.

In this commit,

the translate function _t() has been updated to return the translation
if they are loaded. If not, it throws an error.
the lazytranslate function _lt() returns _t() function.
Corollaries :
Steps in test tours are now a function that returns an array of steps
to avoid any interpolation of _t in this ones before translations has
been loaded.

Example :

registry.category("web_tour.tours").add("example", {
    test: true,
    steps: () => [
        {...},
        {...},
    ],
});

task-3292454

closes odoo/odoo#124157

Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-07-19 13:13:16 +02:00
Zelong Lin a0aa45ce00 [IMP] mail: chat window dropdown actions from avatar & name
Before this commit, chat window actions were all placed in
the right part of header. It was showing the main action (call),
close action, and all other actions in dropdown menu from
the "..." (more) button.

This commit now replaces the "..." (more) button by clicking
on avatar/name of conversation. The "..." (more) button has been
replaced to "_" (minimize/fold) button, as clicking on header to
open/fold chat window can become hard due to avatar + name being
clickable to show most chat window actions.

This commit also adds the following actions in chat window:
- Open (Employee) Profile
- Rename (conversation)

Task-3336752

closes odoo/odoo#124592

Related: odoo/enterprise#42480
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-29 19:54:38 +02:00
Alexandre Kühn bea3bb541a [FIX] hr: remove deadcode of KanbanView/openChat
OpenChat feature in `hr` is managed by the view widget
"hr_employee_chat", which is added in kanban template.
The override of Kanban View to add openChat feature is
not called at all, so this commit removes this dead code,
and the js_class, as its only purpose was adding openChat.

closes odoo/odoo#125753

Related: odoo/enterprise#42897
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-06-21 20:10:11 +02:00
Kevin Baptiste 29ad9e881e [REM] hr,hr_holidays: remove deprecated code
Remove deprecated code from odoo/odoo#96545

closes odoo/odoo#125894

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-21 19:04:14 +02:00
Victor Piryns (pivi) c77373892b [FIX] hr, hr_timesheet: correct empl. access w/ no rights
Current behaviour:
In mobile view, if an user that doesn't have any rights over
"Employees", clicking on any of the Many2One `employee_id` (for ex:
when adding a timesheet on a task and clicking on the employee field),
for either the dropdown, or to the form view with the `external` button,
we get a stacktrace.

Expected behaviour:
We shouldn't be met with a stacktrace, if we don't have rights, we
should be redirected to the corresponding view for the `hr.employee.
public` model.

Steps to reproduce:
- Install Timesheets
- Set Marc Demo's Employee's right to `none/empty`, login as Marc
- In mobile view, go to Project > a task > open the timesheet sheet
- Click on Add or any of the present timesheets
- Click on employee field, either on it (redirect to the mobile
  kanban view of all employees) or to the right edge of it (redirect
  to the form view for the currently selected employee).
- Instead of being redirected, you are met with a stacktrace.

Reason for the problem:
Since the migration to Owl, there is an implicit consistency
expected between what is the requested model for said view, and the
model we get back from the server for said view. In general (for
example when in desktop view), usually we pass by an override of
`get_formview_action` which changes the model we are loading
front-end side depending on the access to the employee model. If
access, we load `hr.employee`, if no access, `hr.employee.public`.
But for mobile, we don't pass by an action, we just load a dialog,
and the `resModel` used for the dialog is based on the `relation` of
the `Many2OneField`, which is `hr.employee`. In that case when
`get_views` is being called, we receive a view with the model key
being `hr.employee.public`, which is inconsistent with what the
front-end requested (which is `hr.employee`) and we have a
stacktrace in owl.

Fix:
Override the `relation` property to the correct model in the
corresponding widget set on the template of the field, based on
available group. This relation is used to set the `resModel` when
opening the dialog.

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

opw-3269817

closes odoo/odoo#124961

X-original-commit: 05f1d58ee6143432ce85bc7629dbe76c74c2da33
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
2023-06-14 10:55:00 +02:00
Jurgen (jugj) 45639a209c [IMP] hr_contract_salary, test_l10n_be_hr_payroll_account : Rework generate simulation link wizard
This task aims to rework the wizard that creates a salary configurator and pre-fills the applicant's name, phone and email
task - 3171707

closes odoo/odoo#124809

X-original-commit: ec2d0ad0bbe6098c8eedd4d913e84260cadd16cb
Related: odoo/enterprise#42460
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-14 08:26:24 +02:00
Jurgen (jugj) d782a42483 [FIX] web, hr(_recruitment) : Fix the phone field widget text breaking in multiple lines This PR Fixes the phone widget in the hr views and adds back the possibility to SMS to mobile and phone task - 3242157
closes odoo/odoo#124626

X-original-commit: f6964d7cab3090acdd9a3b777ef17f02b0d2ac02
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-12 14:04:23 +02:00
Sébastien Theys 9dba4e0d77 [REF] mail, *: reorganize JS files
Remove "fake" feature sub-folders that make files harder to find.

Note: If there are too many files in the main folder now, a new split
that actually makes sense can be done at a later time: this would not
just be code move, but removing coupling between said feature and the
rest of the code.

Apply consistent structure, where the top level folder is a feature (or
core), and sub-folders are subdivision of the feature depending on
context (closely related to assets bundles).

```
- core
    - common
    - public
    - web
- feature
    - common
    - public
    - web
```

The opportunity is taken to reorganize the top of the files and imports:
- Always use absolute path in imports to be able to find all usages of a
  file with a single search.
- Reorganize imports to group them by module, and to sort them
  alphabetically by path/feature.
- Always use single asterisk (*) for `odoo-module`: less characters yay!
  And double asterisk should be used for JSDoc comments, not for custom
  instructions.

Part of task-3265211

closes odoo/odoo#124168

Related: odoo/enterprise#42121
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-08 21:52:44 +02:00
Prakash Prajapati f418002be0 [FIX] hr: remove the quick create on the many2one_avatar_employee and many2many_avatar_employee widget
In this commit we have removed quick create option from many2one_avatar_employee and many2many_avatar_employee
 widget. because of There are too many faulty employees records coming from a
 quick Enter press on a list. 

Example:
    According to my attention when we do quick create then partner is not created.

task-3343117

closes odoo/odoo#124071

X-original-commit: 001b9c8b075d012568f7ea0890ab23b6d46cbed2
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-07 12:02:22 +02:00
Brieuc-brd fa60bac197 [IMP] *: app icons : add viewBox attribute
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.

This commit fixes this issue.

task-3326633
Part of task-3326263

X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
2023-05-22 13:54:08 +02:00
Pierre Paridans eef262abf4 [FIX] *: adapt QUnit tests and tours
[FIX] *: selectors in tours

[FIX][TMP] account: CogMenu selector in tours

[FIX][TMP] web*: Breadcrumb targetting in tours

Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).

add classname on last breadcrumb item

[FIX][TMP] project: View buttons selector in tours (moved away from CP)

[FIX][TMP] project: Kanban selectors in tours (quick create)

[FIX][TMP] *: SearchBar selectors in tours (toggle menu)

[FIX][TMP] *: ButtonBox selector in tours

[WIP][IMP] web: add toggleSearchBarMenu in search helpers

adapt and unskip 3 list tests

adapt and unskip calendar tests

unskip web_tour test that actually pass

post rebase fix

allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later

post rebase fixes

fix

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
stefanorigano (SRI) 79f57643ce [REF] web, mail, hr, website, auth_totp, test_apikeys: top-menu design
task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:13 +02:00
Bruno Boi f22961ad07 [FIX] web,*: repair root class attr
*: web + adaptations in base, fleet, hr, hr_expense, hr_recruitment,
   loyalty, lunch, mail, mass_mailing, note, project, stock, survey,
   web_tour

**Foreword**
Since d19037e141 the rootnode class attribute for form/list views was
copied two times:
- on the o_view_controller div
- and on the root node of the view renderer.

Examples:

<form class="foo">...</form>

    gives

<div class="o_view_controller o_form_view foo">
    <div class="o_control_panel">...</div>
    <div class="o_content">
        <div class="foo o_form_editable ...">...</div>
    </div>
</div>

and

<list class="foo">...</list>

    gives

<div class="o_view_controller o_list_view foo">
    <div class="o_control_panel">...</div>
    <div class="o_content">
        <div class="o_list_renderer foo ...">...</div>
    </div>
</div>

**Issue**
This could lead to confusion and also unexpected styling issues.
See this PR #119815 to read a message JS Framework team has received.
See also another a fix that had to be made for x2m fields: 980244fa8

**Introduced Changes**
- in the form compiler, the root node attributes are no more copied to
  the root div node of the compiled template the form renderer receives
- the root div node generated by the form compiler now has the
  "o_form_renderer" class, which was removed during the recent form view
  refactoring.
- the list renderer no more adds the root node class attribute to its
  "o_list_renderer" div
- the X2ManyFieldDialog has been adapted too
- since View, X2ManyField & X2ManyFieldDialog both need to compute view
  classnames derivated from the arch root node, an util has been
  introduced to avoid duplicating code
- the whole codebase has been checked and adapted.

Related: odoo/enterprise#40418
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-04-27 16:10:30 +02:00
Julien Carion (juca) 1f6c655cbc [IMP] web, *: Add lazy loading for images in kanban
This commit adds the loading="lazy" attribute to every img tags compiled
by the kanban compiler and modifies some kanban archs in order to use
img tags instead of divs with background-image style to load images
(this allows again the loading="lazy" attribute to work).
The purpose is to avoid loading images that are outside the user viewport
at all time in order to reduce the load on the network when new images are
loaded.
Steps to test: find all views that are using the o_kanban_image or o_kanban_image_fill_left
class and ensure all the images in these views appear in the network tab of devtools
when they enter the user viewport. Example: res.partners, hr.employee, ...

task-3102207

closes odoo/odoo#117049

Related: odoo/enterprise#39560
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-14 15:05:56 +02:00
Romain Estievenart fb8112a06b [IMP] mail,hr,web: change the UX of the Many2ManyAvatarFieldPopover
The commit change the design of the Many2ManyAvatarFieldPopover the goal
is to remove the m2m dropdown and fill the dropdown content directly
inside the popover.

It also reverses the order of the displayed tags inside the m2m avatar
field in the kanban view and inside the popover.

It removes the possibility to unassign users on mouse hover in kanban
view.

Note:
It's still possible to remove users inside an m2m_avatar_field popover.

Task ID: 3229888

closes odoo/odoo#117194

X-original-commit: f0d71e98743421318a798ef9d4f1e75d11a23334
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-03-31 10:53:08 +02:00
Kevin Baptiste 7b9a705f71 [FIX] hr: show employee's avatar
Users without HR Officer rights would see an empty avatar for the
employees, as the m2x_avatar_fields were using `hr.employee` as model.

closes odoo/odoo#116972

X-original-commit: 3205680cf902e1b84900f28cfdda5528cbb37ae5
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-29 13:06:55 +02:00
7710c3331e [REF] mail, *: refactor Discuss
This commit refactors discuss code to use OWL components
and new tools and services in web/.
Functionally, Discuss app should work relatively the same as
before this commit.

closes https://github.com/odoo/odoo/pull/110188

Related:
https://github.com/odoo/enterprise/pull/38058
https://github.com/odoo/upgrade/pull/4423

closes odoo/odoo#110188

Related: odoo/upgrade#4423
Related: odoo/enterprise#38058
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre (aku) <aku@odoo.com>
Co-authored-by: Didier (did) <did@odoo.com>
Co-authored-by: Géry (ged) <ged@odoo.com>
Co-authored-by: Louis (wil) <wil@odoo.com>
Co-authored-by: Maël (mapa) <mapa@odoo.com>
Co-authored-by: Maryam (maki) <maki@odoo.com>
Co-authored-by: Sébastien (seb) <seb@odoo.com>
Co-authored-by: Thanh (tso) <tso@odoo.com>
Co-authored-by: Matthieu (tsm) <tsm@odoo.com>
Co-authored-by: Zelong (zel) <zel@odoo.com>
2023-03-17 11:47:09 +01:00
Joseph CaburnayandJulien Mougenot 3a798039d6 [REF] web_tour,*: convert web_tour to owl
* The tours are now run by the `MacroEngine` defined in `macro.js`.
  * This is accomplished by converting (at runtime) the user-defined tours to
    `Macro`s. See `tour_compilers.js` for the step (and tour-to-macro) compilation.
* API is kept the same as much as possible. Basically, declaring tours stayed
  the same with some exceptions:
  * `allowInvisible` can be provided in a step to allow consuming the trigger
    element even if it is invisible.
  * `isCheck` can now be used to replace the no operation `run` that is
    traditionally signals the runner to only perform a check.
  * Before, multiple `run`s can be called simultaneously. Now, each `run` method
    is awaited before proceeding to the next step.
* If the trigger element is `disabled`, the tour runner will *not* proceed on
  calling the `run` method and the runner will stay on current step until the
  trigger element becomes `enabled`.
  * However, the tour runner is okay with `disabled` trigger element if the step
    has `isCheck = true`. As long as the trigger element is found for `isCheck`
    step, the tour runner will happily move to the next step.
* Some tours are adjusted to properly run with this new tour runner.
* When the tour failed:
  * The dom string is not logged anymore.
  * However, a warning message containing the relative location of the step will
    be logged. This is better in helping the author in locating the failed step.

**Some guidelines learned during the development:**

* Each step may trigger a dom mutation. It's a good practice to insert an
  intermediate step that *checks* the existence of an element that result from
  the action of the previous step.
* Refrain from using the `run` method for assertions. `run`, in principle, is
  provided to perform actions that are not offered by the helper. Use the
  `trigger` for assertions.
* During dev, find `SHOW_POINTER_DURATION` and set it to `250`. This will show
  the pointer (pointing to the trigger element) for 250ms when watching the
  tour.

closes odoo/odoo#107618

Task-id: 3082036
Related: odoo/enterprise#37560
Signed-off-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2023-03-15 13:19:45 +01:00
Romain Estievenart 66321f76aa [IMP] web,mail: many2many avatar quick assign
Purpose:

Allow quick assignation of records in the kanban views (and other places
by extension).
Currently, if you want to work in a board-like env (e.g. tasks in
kanban, crm in pipeline, that kind of thing), having the possibility to
quickly assign/unassign records without having to open them fullscreen
can be really useful => it should be possible to "quick edit" these
fields in kanban views easily, without switching to form views.

If you want to keep the field readonly don't forget to add the readonly
attribute.

Task-id: 3121207
Part-of: odoo/odoo#114400
2023-03-10 17:54:56 +01:00
FrancoisGe d060853b7a [REF] web: remove dirtyTranslatableFields from model
The logic of dirtyTranslatableFields is only needed in one place in
the form view. We will therefore remove this function from the model.
We'll take the opportunity to replace dirtyFields with isFieldDirty
because all uses of dirtyFields want to check with the name of a field
if it is dirty or not.

Part of Task: 3179751

closes odoo/odoo#114560

Related: odoo/enterprise#37866
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-08 08:24:21 +01:00
Bruno BoiandMathieu Duckerts-Antoine d19037e141 [IMP] web,*: better classes handling in view archs
**Before this commit**
- The optional "class" attribute set on the root node of a view arch
  is ignored, except for the kanban view which has a custom
  way of using it.
- The optional "js_class" attribute set on the root node of a view arch
  does not have any impact on the class names passed to its controller.

**After this commit**
The content of the optional attribute "class" set on the root node of an
arch like in

<list class="o_custom_class">
    ...
</list>

as well as an additionnal class derived [1] from the value of the
"js_class" attribute set on the root node of an arch like in

<list js_class="extended_list">
    ...
</list>

will both be found in the prop "className" of any view controller.

[1] a js_class value of "xyz" yields to the class "o_xyz_view"

**Note on this commit**
The kanban view was already appending the root node class attribute
to its renderer element. This is no longer the case and some styling
rules has been adapted.

closes odoo/odoo#113014

Related: odoo/enterprise#37265
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2023-03-01 17:01:03 +01:00
uso-odoo 83082d7ee7 [FIX] hr: use correct close tag
There was an error in the XML template of the 'department_chart', the
opening tag was a <div> but closed with a </t>

sentry-3951803776

closes odoo/odoo#113543

X-original-commit: 2ea1efb20861c1cbd1d3a19ef9b4ef54385effed
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-02-23 18:29:19 +01:00
FrancoisGe 5126c9b1d4 [REF] *: register widget descriptors instead of components
Before this commit, the widget's description was stored on the
component and this component was then registered.

Now, an object describing the widget is used on registration the same way
as it is done for views since b828cfc.
This split the component's description (props, template, ...) of
the widget's description ( component, extractProps, ...) and makes
it clearer.

We did the same thing for fields in 9f4622492c

Part of task: 3179751

closes odoo/odoo#112962

Related: odoo/enterprise#37215
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-21 15:53:06 +01:00
Michael (mcm) 9f4622492c [REF] *: register field descriptors instead of components
Before this commit, the field's description was stored on the
component and this component was then registered.

Now, an object describing the field is used on registration the same way
as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671.
This split the component's description (props, template, ...) of
the field's description (displayName, supportedTypes, ...) and makes
it clearer.

closes odoo/odoo#112498

Task: 3171520
Related: odoo/enterprise#37105
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-16 14:13:32 +01:00
Aaron Bohy 49297bc7bb [REM] *: remove legacy basic views + some fields/widgets
This commit removes the legacy implementation of the form, kanban
and list views. It also removes the legacy view widget registry,
and all legacy widgets it contained. The legacy field registry
couldn't be removed yet as some fields are still used (e.g. in
client actions: FieldMany2One, FieldMany2ManyTags...), and
sometimes accessed from that registry (e.g. uom service). More
clean up will come later. Note that all tests using legacy views
have thus been removed, even though the tested feature might still
remain (e.g. FieldMany2One tests have been removed, but that field
is still there). However, those features are deprecated and
unlikely to evolve. They should be removed in the next saas, or the
one after.

Finally, this commit also removes the legacy view dialogs.

Task 3168640

Part-of: odoo/odoo#111809
2023-02-08 13:27:58 +01:00
Géry Debongnie b53f78e224 [REF] web_tour,*: use the registry in collecting the tours
This is a step closer to a goal of avoiding dependence on asynchronous
modules. Starting from this commit, new tour definition should be
registered to `registry.category("web_tour.tours")` registry.

So, instead of the following:

```js
import tour from "web_tour.tour";
tour.register(name, options, steps);
```

We now do:

```js
import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add(name, optionsWithSteps);
```

Notice the `options` and `steps` params are merged when registering
the tour definition. It should look something like so:

```js
registry.category("web_tour.tours").add("account_tour", {
  test: true,
  steps: [ ... ],
});
```

And if the `TourManager` instance is needed, one can get it from the
registry like so `registry.get("tourManager")`. Note however that
this instance is only available when the `TourManager` has been
instantiated -- so it's not available at top level of the module.

closes odoo/odoo#111103

Related: odoo/enterprise#36335
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-01-27 23:17:35 +01:00
Kevin Baptiste ae45b2f83f [FIX] hr: use correct close tag
There was an error in the XML template of the department org chart, the
opening tag was a `<t>` but closed with a `</div>`...

closes odoo/odoo#110142

X-original-commit: 10ce40dd6b181f6dd6e434f208aa9f13b33975d3
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-17 16:47:14 +01:00
FrancoisGe 8959b67ed0 [FIX] web: changing the language should reload the page
Before this commit, when saving a language change in My Profile,
nothing happened. The expected behavior is a page reload.

How to reproduce:
- Go to the "My profile" tab in the User Menu
- Edit the language
- Click on save

Before this commit:
The record is save.

After this commit:
The record is saved and the page is reloaded.

closes odoo/odoo#109508

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-11 12:16:05 +01:00
Dossogne Bertrand 060a383aa3 [FIX] hr: fix visuals for mobile on form & kanban views
Before this commit, two visual errors were present on mobile:
- In the employee form view, the name and professions were
overlapping with the profile picture;
- In the employee kanban view, the presence logo and the
activity logo were misaligned

This commit also fixes some indentation errors.

closes odoo/odoo#109145

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-01-09 16:39:04 +01:00
Kevin Baptiste d20940cfd8 [IMP] hr: add Department org chart
Add an organisation chart on the Department form view.

task-3071039

closes odoo/odoo#106005

Related: odoo/enterprise#34184
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-12 15:17:09 +01:00
FrancoisGe 96e158a8b8 [REF] web: simplify customizations of static menu actions
There are several customizations of the list and form view that consist
in modifying the behavior of a static menu action (archive, unarchive,
export, delete, duplicate). We have seen that this one is very complex.
So we decided to simplify it.

Solution:
Add the getStaticActionMenuItems API point. This allows us to easily
modify the behaviour of static actions.

We also took advantage of this commit to simplify the ActionMenu api.
We have removed the other actions because it was not clear enough.
They are directly added in the action category.

closes odoo/odoo#107086

Taskid: 3089039
Related: odoo/enterprise#34598
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-06 17:11:53 +01:00
niyasraphy 4a3683b912 [FIX] hr: warning in log on exporting translation of hr
closes odoo/odoo#107016

X-original-commit: 8484b6237154f2109f71d456415f6fe03917a983
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-12-06 10:52:21 +01:00
Dossogne Bertrand ed486f2c62 [FIX] hr_*: fix visuals after always-edit mode
hr_*:
- hr
- hr_contract
- hr_work_entry
- hr_work_entry_contract

Fixes multiple visual issues in various models

task-3002444

closes odoo/odoo#106540

X-original-commit: 6164cf814520560dc016a5eb04080c12c516a509
Related: odoo/enterprise#34395
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-25 17:56:45 +01:00
Aurélien Warnon bb58fdacba [FIX] base: allow user to modify its own preferences
The res.users model functions a bit uniquely since it should allow a user to
modify their own parameters but turns off model edition priviledges by default.
See "SELF_WRITEABLE_FIELDS".

This implies that ir_ui_view#_postprocess_access_rights method will by default
turn off record edition, by automatically adding a 'edit="false"' attribute on
the form node when the frontend calls 'get_views'.

This will in turn prevent the user from modifying its preferences as it will
set the form view in readonly mode.
(It was apparently ignored pre-OWL, hence why we only have this issue now).

To fix the issue, we force the edition by manually setting 'edit="1"' on our
"view_users_form_simple_modif" form.
Allowing the end-user to modify their own settings again.

A tour was added to ensure this behavior.
Note that tour steps need to be adapted in the 'hr' module, as this module
changes the flow of modifying user preferences.

Task-3067001

closes odoo/odoo#106440

X-original-commit: 490d480458590c205962c3f9b95a63790a59f4d3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-11-24 19:25:16 +01:00