Commit Graph
1633 Commits
Author SHA1 Message Date
mano-odoo 3df4eaff92 [FIX] *: minor settings spacing issues
The purpose of this commit is to review the responsiveness and spacing
of some settings that were visually broken.

The nested checkboxes were growing too much on smaller screens
making the content overflow.

This commit adapts these checkboxes settings to make them more readable
and consistent.

It also review the input that overflow similarly to nested checkboxes
such as the count of extra hours in attendances settings.

In 16.2 some SCSS was added to control field widget spacing on mobile,
however it was breaking the layout for the `.o_boolean_fields`.

Task-3113372

closes odoo/odoo#126347

X-original-commit: 80aa03e86bd47e6349a5fa69397857fdf6a8cc0b
Related: odoo/enterprise#43142
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-07-17 19:26:03 +02:00
Thomas Lefebvre (thle) e937d480d0 [FIX] hr_attendance: correct timezone in report
Steps to reproduce:
-------------------
- with timezone "Europe/Brussels" (UTC +02:00);
- create an attendance that starts at 1:00 AM;
- go to pivot view in Reporting tab.

Issue:
------
Attendance appears to be a day early.

Cause:
------
When converting a date to UTC for database storage,
it's possible that the date may change
(due to a large offset or hours close to 00:00).
Therefore, when we use `CAST(check_in as DATE)`,
we will keep the date that has potentially changed.

Solution:
---------
Use postgresql's `at time zone <timezone_name>`
statement to convert the recorded attendance
to UTC in the employee's timezone.

Note:
-----
On an employee's form view, the "Working Hours" field
(`resource_calendar_id`) is required.
The `resource_calendar_id` field is a Many to One
to the `resource.calendar` model.
The `resource.calendar` model contains
the `tz` field, which is required.

As a result, it will always be possible to find
an employee's timezone via his calendar resource.

Hypothesis:
-----------
Attendances are created using the browser's timezone.
It is normal to think that the employee's
calendar timezone is the same as his browser timezone.

opw-3370874

closes odoo/odoo#127989

X-original-commit: 8ac7e19ce94685438ab16f052c6550e86e692a75
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-07-10 21:25:51 +02:00
prye-odoo 7694f012cd [FIX] *: handle unlink/create access for reporting views
*: account,event_sale,fleet,hr_attendance,hr_contract,hr_timesheet,
im_livechat,point_of_sale,project

When the user tries to delete a record(s) from the reporting views,  this
traceback will be generated.

Steps to produce (Example only):

- Settings > Technical > Actions > Window Actions
- Search for the Work Entries Analysis. Open it and add a 'tree' as view_mode
in that action.
- Payroll > Reporting > Work Entries Analysis menu and select the tree view.
- Select one or more records and try to delete these records.

Error: A traceback appears: "cannot delete from view "hr_work_entry_report"

Handled the unlink access by using their model access of the reporting models.
similarly, this issue resolves in other reporting models.

Sentry-3975590063

closes odoo/odoo#125697

X-original-commit: 209d8c76ce9bb1d6cc7084d55b5623e939af8fbc
Related: odoo/enterprise#42825
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2023-07-03 21:55:48 +02:00
Rémy Voet (ryv) c5cb357d90 [IMP] *: add dependencies to display_name field
The previous commit introduced an optimization to reduce the number of
queries and fields fetched when we call `name_search`. But it works much
better when the dependencies of `display_name` contain field names used
in the calculation (on the same record/model).

Then, to improve the performance and the cache coherency, add `depends`
and `depends_context` depending on the custom `_compute_display_name`.
Add only the first level of dependencies (never traverse relational
field) because only these have a positive impact on the previous
optimization and the cost is very low (see `modified`).
About `depends_context`, we don't include `lang` because (when `_` is
used by example) it is unlikely to get the same display_name in the same
request with two different lang.

closes odoo/odoo#122085

Related: odoo/documentation#4639
Related: odoo/enterprise#42599
Related: odoo/upgrade#4780
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-06-28 17:41:19 +02:00
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
Rationale
=========

Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).

To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)

Changes
=======

- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).

Part-of: odoo/odoo#122085
2023-06-28 17:41:19 +02:00
althaf shaik 2fdefd0f21 [FIX] hr_attendance: restrict to compute worked hours without employee
This traceback raises when user not selected 'Employee' and only selecting
'Check In' and 'Check Out', while creating a new attendance.

To reproduce the issue:

1) Install hr_attendance
2) Open Attendance and create a new record
3) Give values to only 'Check In' and 'Check Out'

Error:  "AttributeError: 'bool' object has no attribute 'upper'" appears.

On '_compute_worked_hours' method calendar variable is getting value from
employee_id and that calendar timezone is used to get timezone.

https://github.com/odoo/odoo/blob/937d207028ab9bc1d3d332dc6dfe25f0de045026/addons/hr_attendance/models/hr_attendance.py#L50-L60

Therefore in the above use case, when triggering the compute method,
because of 'calendar' is depending on 'employee_id' and when
employee is not selected, it will leads to the above traceback.

Sentry-4274226351

closes odoo/odoo#126465

X-original-commit: 31491e40d2505c03d76e6c802435ad1dafa71c52
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-27 09:29:30 +02:00
Wolfgang Taferner 080c2fc574 [IMP] hr_*_attendance: leave in terms of working time not respected
As the leave is deducted from the needed time to work
in case for example Home Office which is configured as
working time (other) is handled like a real leave (absence)
which will lead to an extensive overtime instead the difference
to the work entry defining the work time.

A domain clearing out this missing link and variation
cleans up this misalignment and therefore overtime will
be computed correctly.

closes odoo/odoo#126373

X-original-commit: 02a679d6ab7db49c8338471e5fc85c1141f8e877
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Wolfgang Taferner <w.taferner@wtioit.at>
2023-06-26 21:10:37 +02:00
Martin Trigaux 2afdda2576 [I18N] *: export saas-16.3 source terms
closes odoo/odoo#123046

X-original-commit: 137f5ca0cb703ee953cb01db525362f7a778e6bd
Related: odoo/enterprise#41703
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-01 11:43:51 +02:00
dasz c68e4606f8 [IMP] hr,hr_presence,hr_attendance,hr_holidays: move presence computation to employee_base
Employee presence is not a sensitive data and should be available for all db users
this commit moves the computations from attendance, holidays and hr_presence to the
employee_base model, which is how it was originaly made in the hr module. This way
the presence marker does not depend on the user's hr rights

closes odoo/odoo#118437

Task: 3267790
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-31 15:53:54 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +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
Brieuc-brd ee75969979 [IMP] *: app icons: replace svg to png
The introduction of Milk has brought new app icons.
Using the svg format creates a lack of anti-aliasing on the edges of the
shapes, which makes the icons look bad.
Since the png size has been reduced, we can afford to use the png format
to have the best possible quality without having a lack of performance.

task-3326633
Part of task-3326263

X-original-commit: e07cb722f2b11407a3ad093bd688b7d37afd5a88
Part-of: odoo/odoo#121886
2023-05-22 13:54:07 +02:00
Martin Trigaux 077bbd0b0b [I18N] *: export master source terms
closes odoo/odoo#121563

Related: odoo/enterprise#41140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-17 10:34:00 +02:00
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

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
Thomas Lefebvre (thle) bc2d796dbc [FIX] hr_attendance: prevent the edition of employee_id
Issue:
A user has write access rights to modify his own attendances.
However, he can modify the `employee_id` field.
This can cause attendances to be moved to other employees.

opw-3280850

closes odoo/odoo#120632

X-original-commit: 1c25a9b964e9e2acf9d431897e83cf72ecdca1cb
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-05-05 14:55:00 +02:00
dasz 1b8b35e216 [FIX] hr_attendance: account for lunch break in overtime calculation
Remove lunch hours from work intervals so that overtime is not calculated when it's not due
tests adapted to take into account lunch period

task 3217799

closes odoo/odoo#120455

X-original-commit: 97c052432a25a1461de23fd8ab0c73ffe9b084ff
Related: odoo/enterprise#40677
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-04 08:56:12 +02:00
Marc Durepos c999f1ec14 [FIX] hr_attendance: prevent error caused by pre-fetching non-public employee fields
Fixes a situation where users who are part of the Attendances Officer (or Manager) group but
  without access to private employee data would see the following error when trying to book time
  off.

  `ValueError: Invalid field 'last_check_in' on model 'hr.employee.public'`

  Other instances of the same ValueError were observed by managers trying to approve employee leave
  and employee expenses.

  As per hr/models/hr_employee.py:22-26 fields not available on hr.employee.public should have
  groups='hr.group_hr_user' and this was not the case in hr_attendance.

closes odoo/odoo#120324

X-original-commit: ff4e7d6a414097d000e62825cf43425ea14bd77e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-05-03 08:38:13 +02:00
Victor Feyens f4ea6d3226 [FIX] *: strict api for main orm methods
Enforce strict types for returned values for
* create
* write
* unlink
* default_get

to make those methods more consistent and reliable.
Also make sure they can be called with empty self/values,
i.e. that they follow the same behavior as the base methods
defined in the main orm Model.

closes odoo/odoo#116809

Related: odoo/enterprise#38880
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-04-25 15:20:43 +02:00
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Denis Ledoux 1480f2fad5 [FIX] *: session.modified has been renamed is_dirty
Since odoo/odoo@04e972660b
The session `modified` flag has been renamed `is_dirty`.

However, it has not been renamed correctly in these
three different places.

The goal to set `modified` at this three places
is to force the session to be saved,
for instance because a mutable (a list or a dict)
contained in the session was modified,
but not the dict of the session itself,
therefore `modified` is not flagged automatically.

As the flag `modified` has not been renamed to `is_dirty`,
a key/value `modified: True` was actually assigned to the
session dict, and saved in file. The behavior
to save the session in these three places was kept,
as one key/value of the session has been changed,
but by the way to assign a new value in the session file,
which is not ideal.

It's better to assign the correct flag to avoid
setting a new key/value in the session for no reason.

closes odoo/odoo#118719

X-original-commit: b6f4a27f2d95d5bc5510f4da50132ab66d8c86aa
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-04-17 11:47:15 +02:00
Kevin Baptiste 749a73ecff [FIX] hr_attendance: allow kiosk to use My Attendances
The Check In / Check Out menu would show that the user is not linked
to an employee because it was trying to read on `hr.employee` and not
`hr.employee.public`.

opw-3268217

closes odoo/odoo#118498

X-original-commit: 233a185362f2bc3243187f1f0b740ee5b154f039
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-13 17:57:58 +02:00
dasz d832fcf0ce [IMP] hr_*: standardise UI displaying of employees accross all hr apps by using the widget avatar_user
Appraisal: done, fix  chat widget issue
Employee: done, removed unused view
Attendance: done
Expense: done
Time Off: done
Fleet: done
Payroll: done
Referall: done
Lunch: done

task-313272

closes odoo/odoo#111817

Related: odoo/enterprise#36663
Related: odoo/upgrade#4310
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-13 15:25:46 +02:00
FrancoisGe 0ada8e8edb [FIX] hr_attendance: empty lines at the beginning of an xml file
Having one or more blank lines at the beginning of an xml file can
cause problems when parsing the xml.

closes odoo/odoo#116624

X-original-commit: aa400dbec834e7229f0f8d22298db995a490379b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-27 09:40:01 +02:00
Kevin Baptiste 7fbfb36285 [FIX] hr_attendance: show employee's picture
The pictures of the employees were no longer showing in the kiosk mode
as it tried to read on `hr.employee` instead of the `hr.employee.public`
model.

closes odoo/odoo#115950

X-original-commit: 3794bfed7d474f470f6e401d697d8c36ad620820
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-21 09:36:15 +01:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00
sofiagvaladze 630f13fb1d [IMP] *: manage smartbuttons on employee form view
*: hr_attendance,hr_skills_slides,hr_timesheet,hr_work_entry

Don't show smartbuttons that lead to a view without records

task - 3134772

closes odoo/odoo#113105

Related: odoo/enterprise#37274
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-20 11:20:38 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
Victor Feyens 24ccf7d9b0 [CLN] *: useless type info for actions
The type fields of actions already defaults to
the model name in the base model definition.

Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).

closes odoo/odoo#114539

Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 17:33:37 +01:00
Kevin Baptiste 8c1ab1f47c [IMP] data_recycle,hr_*: JS improvements
*: hr_attendance, hr_org_chart

Apply recommendations from odoo/odoo#104975 to HR apps.

task-3069138

closes odoo/odoo#114208

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-02 18:18:56 +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
Xavier BOL (xbo)andYannick Tivisse 1648c25cc9 [IMP] resource: make working schedule optional in resource model
closes odoo/odoo#110548

Related: odoo/upgrade#4248
Related: odoo/enterprise#36101
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2023-02-22 20:25:16 +01:00
Kevin Baptiste 8dbf2e1ce4 [IMP] hr_attendance: input PIN using keyboard
The kiosk's PIN mode was only accepting codes entered using the keyboard
shown on screen, dismissing keys entered on a real keyboard.

task-3127253

closes odoo/odoo#112922

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-21 08:32:58 +01:00
nda-odoo c55f39b5b1 [FIX] hr_attendance: set default filter for reporting
If you have a lot of attendance spread accross various employees and various dates,
the report takes ages to load (or your browser freezes and you can't access reporting).

And if it loads, the report is unreadable anyway. Use a default filter to always
display user friendly graphs. Since we group by day, a default period of a month seems
like a good compromise.

To reproduce the issue:
- install hr_attendance
- use a script to create some attendances (ex: create 300 employees and 30
attendance for each, spread randomly in the last 3 years)
- click on "Reporting"

opw-3167099

closes odoo/odoo#112879

X-original-commit: 59bf5d4c5e7c95c6f561140f71634d84a12568a0
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-16 16:58:43 +01:00
FrancoisGe 01519ac2f6 [REF] hr_attendance: convert legacy client actions to owl
The goal of this commit is to convert the last legacy client actions from
/hr_attendance to owl.

Client actions:
    hr_attendance_greeting_message
    hr_attendance_kiosk_confirm
    hr_attendance_kiosk_mode
    hr_attendance_my_attendances

closes odoo/odoo#110095

Taskid: 3138068
Related: odoo/enterprise#35884
Related: odoo/upgrade#4296
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-02-10 17:49:45 +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
Yannick Tivisse 3bdfbe31c0 [IMP] hr_attendance: Take lunch time into account on work hours count 2023-02-03 10:25:00 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Goffin Simon f864ac9d23 [FIX] hr_attendance: Function write must return True
The function write must return True when it ends.

opw:3121809

closes odoo/odoo#109713

X-original-commit: 6adeabf6445c72e7ddfd540ceaea8c01473e062d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Simon Goffin <sig@odoo.com>
2023-01-12 11:09:40 +01:00
Julien Castiaux ad9bd90d7b [FIX] core, *: BaseModel overrides signatures
*: base, account, crm, hr, hr_attendance, test_access_rights

The various public methods of the ORM can be override in other models,
those overrides sometime don't implement the exact same signature as the
original method in the ORM. In this work we sanitize all the overrides
to ensure a better compatibility. The background objective is to make it
possible to call any public method using kwarg: `search(domain=[...])`.

* `search`, the first parameter was renamed from `args` to `domain` in
  0e9adf7 but the overrides were not updated.
* `invalidate_models` and `invalidate_recordset`, a new `flush=True`
  parameter was introduced in 9c3b9a4 but the overrides were not
  updated.
* `update`, there is a clash between the `update` method responsible for
  writing on a record and `update` in bus responsible to update the user
  presence. The bus method has been renamed so it doesn't clash with the
  ORM.

This sanitization comes with a new linter that verifies that all
overrides of BaseModel public methods share a compatible signature. The
linter has been disabled for `create`, `write` and `default_get` as too
many overrides don't respect the signature of BaseModel.

closes odoo/odoo#106999

Related: odoo/enterprise#34991
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-15 12:36:56 +01:00
Jorge Pinna PuissantandMichael Mattiello (mcm) c7c2959449 [IMP] web, *: simplification and standardization of the settings arch
The aim of this commit is to simplify and standardize the settings archs.

To do this, a small DSL exclusively for the settings was created. This
new DSL introduces 3 tags: `app`, `block` and `setting`.

The `app` tag is used to declare the application on the settings view.
It creates an entry with its logo on the sidebar of the view. It also
acts as delimiter when searching.

```xml
    <app string="CRM" name="crm">
    ...
    </app>
```

- `string` : The "display" name of the application.
- `name` : The technical name of the application (the name of the module).
- `logo` *optional* : The relative path to the logo. If not set, the
        logo is created using the `name` parameter :
        `/{name}/static/description/icon.png`.

The `block` tag is used to declare a group of settings. This group can
have a title and a description/help.

```xml
    <block title="Title of group Bar">
    ...
    </block>
```

- `title` *optional* : The title of the block of settings (the old h2),
        you can perform research on its text.
- `help` *optional* : The description/help of the block of settings
        (the old h3), you can perform research on its text.

The `setting` tag is used to declare the setting itself. The first field
in the setting is used as the main field (optional). This field is
placed on the left panel (if it's a boolean field) or on the top of the
right panel (otherwise). The field is also used to create the setting
label if a `string` is not defined. The `setting` tag can also contain
more elements (e.g. html), all of these elements are rendered in the
right panel.

```xml
    <setting string="this is bar">
        <field name="bar"/>
        ...More elements
    </setting>
```

- `type` *optional* : By default, a setting is visually separated on two
        panels (left and right), and is used to edit a given field. By
        defining `type='header'`, a special kind of setting is rendered
        instead. This setting is used to modify the scope of the other
        settings. For example, on the website application, this setting
        is used to indicate to which website the other settings apply.
        The header setting is visually represented as a yellow banner on
        the top of the screen.
- `string` *optional* : The text used as label of the setting. If it's
        not defined, the first field is used as label.
- `title` *optional* : The text used as tooltip.
- `help` *optional* : The help/description of the setting. This text is
        displayed just below the setting label (with classname
        `text-muted`).
- `company_dependent` *optional* : If this attribute is set to "1" an
        icon is displayed next to the setting label to explicit that
        this setting is company-specific.
- `documentation` *optional* :  If this attribute is set, an icon is
        added next to the setting label, this icon is a link to the
        documentation. Note that you can use relative or absolute path.
        The relative path is relative to
        `https://www.odoo.com/documentation/server_version`, so it's not
        necessary to hard-code the server version on the arch anymore.

closes odoo/odoo#106425

Task-id: 3081367
Related: odoo/enterprise#34337
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: "Michael Mattiello (mcm)" <mcm@odoo.com>
2022-12-02 14:40:25 +01:00
Kevin Baptiste 80576925e9 [FIX] hr_(holidays_)attendance: recompute overtime on leaves > 1 day
1/ When approving / refusing a leave spanning multiple days, the
   overtimes were only recomputed for the starting date and not the
   whole period.

2/ Overtimes should be computed whatever the kind of time off that's
   been taken (Absence or Other).

task-3073155

closes odoo/odoo#106751

X-original-commit: 116d7cb46132404354e00e67a2364b8239fcdce5
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-29 09:32:48 +01:00
Alexandre Kühn cc6546677d [IMP] mail, *: Rename component to match model (step 2)
[IMP] mail: rename ActivityBox to ActivityBoxView (component)
Task-3046113

[IMP] mail: rename ActivityMarkDonePopoverContent (component)
Task-3046122

[IMP] mail: rename AttachmentBox to AttachmentBoxView (component)
Task-3046129

[IMP] mail: rename AttachmentDeleteConfirm (component)
Task-3046160

[IMP] mail: rename CallActionList (component)
Task-3046187

[IMP] mail: rename CallParticipantVideo to CallParticipantVideoView (component)
Task-3046193

[IMP] mail: rename ChannelInvitationFormSelectablePartner (component)
Task-3046287

[IMP] mail: rename ChannelInvitationFormSelectedPartner (component)
Task-3046288

[IMP] mail: rename ChannelMember (component)
Task-3046298

[IMP] mail: rename ChannelMemberList (component)
Task-3046306

[IMP] mail: rename ChannelMemberListCategory (component)
Task-3046307

[IMP] mail: *: rename ChatWindowHeader (component)
*: hr, im_livechat, website_livechat
Task-3046330

[IMP] mail: rename ChatWindowHiddenMenu (component)
Task-3046358

[IMP] mail: rename ChatWindowHiddenMenuItem (component)
Task-3046515

[IMP] mail, *: rename Composer (component)
*: hr_recruitment, im_livechat
Task-3046555

[IMP] mail: rename ComposerSuggestedRecipient (component)
Task-3046598

[IMP] mail: rename ComposerSuggestedRecipientList (component)
Task-3046624

[IMP] mail, *: rename ComposerTextInput (component)
*: im_livechat
Task-3046648

[IMP] mail: rename DeleteMessageConfirm (component)
Task-3046661

[IMP] mail, *: rename Discuss (component)
*: im_livechat
Task-3046685

[IMP] mail: rename DiscussMobileMailboxSelection (component)
Task-3046703

[IMP] mail: rename DiscussMobileMailboxSelectionItem (component)
Task-3046709

[IMP] mail, *: rename DiscussSidebar (component)
Task-3046719

[IMP] mail: rename DiscussSidebarMailbox (component)
Task-3046732

[IMP] mail: rename DropZone (component)
Task-3046739

[IMP] mail: rename FollowButton (component)
Task-3047154

[IMP] mail: rename Follower (component)
Task-3047203

[IMP] mail: rename FollowerListMenu (component)
Task-3047236

[IMP] mail: rename FollowerSubtype (component)
Task-3047272

[IMP] mail: rename MailTemplate (component)
Task-3047314

[IMP] mail, *: rename Message (component)
*: im_livechat, sms, snailmail, website_sale
Task-3047352

[IMP] mail: rename MessageAuthorPrefix (component)
Task-3047683

[IMP] mail, *: rename MessageList (component)
*: hr_recruitment, website_livechat
Task-3047718

[IMP] mail, *: rename MessageNotificationPopoverContent (component)
*: sms
Task-3047742

[IMP] mail: rename MessageSeenIndicator (component)
Task-3047765

[IMP] mail, *: rename MessagingMenuTab (component)
*: im_livechat
Task-3047802

[IMP] mail: rename MobileMessagingNavbar (component)
Task-3047806

[IMP] mail, *: rename NotificationGroup (component)
*: sms, snailmail
Task-3047829

[IMP] mail, *: rename NotificationList (component)
*: im_livechat
Task-3047871

[IMP] mail: rename NotificationRequest (component)
Task-3047883

[IMP] mail, *: rename PersonaImStatusIcon (component)
*: hr_holidays
Task-3047969

[IMP] mail, *: rename ThreadIcon (component)
*: hr_holidays, im_livechat
Task-3047980

[IMP] mail, *: rename ThreadNeedactionPreview (component)
*: im_livechat, rating, test_mail_full
Task-3048021

[IMP] mail, *: rename ThreadTextualTypingStatus (component)
*: im_livechat
Task-3048042

[IMP] mail, *: rename ThreadTypingIcon (component)
*: im_livechat
Task-3048043

[IMP] snailmail: rename SnailmailError (component)
Task-3048051

[IMP] website_livechat: rename VisitorBanner (component)
Task-3048069

Task-3047725

closes odoo/odoo#104548

Related: odoo/enterprise#33411
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-28 20:39:58 +02:00
Philippe Wauthy 6f71c43207 [FIX] hr_attendance: fix barcode layout
In the Odoo Community edition, the barcode picture to invite the user to scan his badge
in kiosk mode has no size restriction. This creates a layout issue when displaying the attendance
kiosk mode in community.

This commit fixes the layout by restricting the size of the picture to the size of the enterprise version.

task-3036986

closes odoo/odoo#103892

X-original-commit: 02ab64e110ae2cb8e0d2a304886147be9e450a87
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-24 14:12:28 +02:00
Kevin Baptiste e2232c8909 [FIX] hr_attendance: use correct reference for kioskDelay
A traceback would occur in some situations because of incorrect
reference to `this.kioskDelay`.

closes odoo/odoo#103753

X-original-commit: 5069c8fd1cee063827873de0f6c2d9fe938337a9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-21 14:06:22 +02:00
Kevin Baptiste eb514d364c [FIX] fleet,hr_(recruitment|attendance): fix post-always edit
This PR adapts the form views since the merge of odoo/odoo#100570.

task-3002465

closes odoo/odoo#102488

X-original-commit: 56b877c2cbeeaf3bd6e42645db691467a1ba4ff4
Related: odoo/enterprise#32431
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-07 09:10:08 +02:00
Martin Trigaux 1a8772769e [I18N] *: export 16.0 source terms
closes odoo/odoo#100573

Related: odoo/enterprise#31507
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-20 13:48:49 +02:00
Gorash 39ea7a1fab [IMP] web/all: XML templates are now declared into the python manifest.
Adapt all manifest, split some XML file and update JavaScript files.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
Kevin Baptiste 6610e7e183 [IMP] hr_attendance: add camera choice for barcode scanner
Add new settings to allow the user to select which camera to use for the
barcode scanner and to allow/disallow the manual identification of
employees.

task-2973809

closes odoo/odoo#99622

Related: odoo/enterprise#31082
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-07 09:23:47 +02:00
Rob Coekaerts 351bcdbb41 [REF] hr: Split hr_icon_display into two separate fields.
The icon that is displayed in the employee kanban view is determined by the
field hr_icon_display, computed in the method _compute_hr_icon_display. This
method is overridden in multiple modules such as hr_holidays, hr_attendance
and hr_homeworking.

Currently this field has a state to show no icon (presence_undetermined). In
this change this state is extracted into the a separate field
show_hr_icon_display with the default state of hr_icon_display being
presence_to_define. In this way a module such as hr_attendance, which only
overrides _compute_hr_icon_display to show the default icon for everyone as a
default, now only needs to change this separate field and does not need any
knowledge of what other states exist. This reduces coupling between modules.
2022-09-02 13:18:33 +02:00