From commit 2ecfed335d, clicking on the arrow of a m2o opens the
record in form view and passes it the context of the current view.
After this commit, only the context defined on the <field> is passed.
Problem:
An example of a problem, is the use of an incorrect active_id in the
second view that is passed through the first form view to the second.
Previously, the active_id of a form view was always the id of the record
and not that of the previous view. This behaviour is debatable, but it
leads to major changes. We therefore prefer to revert to the old behaviour
and no longer pass the entire context in order to avoid this problem.
How to reproduce:
- Go to a form view with a m2o
- Click on the arrow of the m2o
Before this commit:
The view context contains all the context from the first form
view and the second.
After this commit:
The view context contains the context of the m2o field and the second view.
closesodoo/odoo#127538
Taskid: 3394945
X-original-commit: a9bec1fec3ff08461732ef2717457524339eb716
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Steps to reproduce:
1) Install the timesheet application.
2) Open the grid view and select a project.
3) Search for a task that does not exist, for example, 'xyz'
4) Notice that both 'Create xyz' and 'No records' are displayed
Cause:
-The issue arises when using the timesheet grid view, as the default_project_id
is passed through the context. However, when a project is initially selected,
the props do not update, resulting in the 'canCreate' value being set to false.
Fix:
-This change will allow canCreate value to be set as true when the project
is selected.
-In the timesheet grid view 'no_create_edit=True' is passed, indicating that the
user should not create and edit new tasks. Modifying this value is not
appropriate as it goes against the functionality of preventing the user from
editing the tasks.
task-3318851
closesodoo/odoo#122485
Related: odoo/enterprise#41500
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
Before this commit timesheet uom timer not displaying proper
aggregated value because it was not added in formatters registry.
This commit add timesheet uom timer widget in formatter registry to
display right value when timesheets are encoding in days and views
are displaying aggregated value(e.g. total in list view).
task-3251672
closesodoo/odoo#121788
X-original-commit: ef20722b9d4513519ef78ab6e973edda4fa4d7fc
Related: odoo/enterprise#41252
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Steps to reproduce
==================
- Use an IOS device
- Open a view with a float field
- Try to edit it
The virtual keyboard displayed is missing a dot, so you can only input
integers
Cause of the issue
==================
For fields that should accept a float value, the inputmode attribute
should be decimal.
Also, specifically on IOS, even with the inputmode set to decimal, it
isn't possible to enter a negative value.
> decimal:
> Fractional numeric input keyboard containing the digits and decimal separator
> Devices may or may not show a minus key (-)
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
Solution
========
For IOS, remove the inputmode attribute so that the default keyboard
shows. For other devices, use the decimal/numeric value depending on
whether a float should be accepted.
opw-3269275
closesodoo/odoo#120129
X-original-commit: fb37550715034e7a1fbe751889cd8ea2bd6e4128
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Currently the width of float_toggle widget is 100% so it appears in full size. In this
commit we have reduced it to 15%.
task-3251667
closesodoo/odoo#117317
Related: odoo/enterprise#39644
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit adds a new service called "timesheet_uom", this service will
help to find the right component to use for the `timesheet_uom` widget
sicne this widget could be float, float_factor, float_toggle or
float_time widget. This service also adds the right formatter to use for
this widget to correctly format the value when the formatter is used
instead of mounting the component.
task-2702636
Part-of: odoo/odoo#108605
**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.
closesodoo/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>
From a practical point of view, it seems better to also add the
dialog service in the service registry when calling
setupControlPanelServiceRegistry.
closesodoo/odoo#113610
Related: odoo/enterprise#37510
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
closesodoo/odoo#112498
Task: 3171520
Related: odoo/enterprise#37105
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
*=hr_timesheet,sale_project,sale_timesheet,spreadsheet_dashboard_hr_timesheet
The main goal of this PR is to minimize code duplication for the search and list views for tasks and projects.
Task search views
-----------------
The most important change was to merge the search views used in the task reports with the "normal" corresponding search view. The reporting search view should now be almost identical to the normal one in both project and fsm.
The `project.task`/`project.task.user` search views are now following this inheritance diagram:
```
┌─┐
┌─┤1├─┐
│ └─┘ │
│ │
┌▼┐ ┌▼┐
│2│ ┌─┤3├─┐
└─┘ │ └─┘ │
│ │
┌▼┐ ┌▼┐
┌──┤4│ │7├──┐
│ └┬┘ └┬┘ │
│ │ │ │
┌▼┐ ┌▼┐ ┌▼┐ ┌▼┐
│5│ │6│ │8│ │9│
└─┘ └─┘ └─┘ └─┘
```
1. `view_task_search_form_base`: Base search view containing all the fields/filters common to project, project sharing and fsm
2. `project_sharing_project_task_view_search`: Search view for project sharing.
3. `view_task_search_form_project_fsm_base`: Base search view containing all the fields/filters common to project and fsm (not project sharing).
4. `view_task_search_form_project_base`: Base search view for project only, with fields/filter common to the normal search view and the one used in reporting.
5. `view_task_search_form`: Search view for project.
6. `view_task_project_user_search`: Search view for the project report.
7. `project_task_view_search_fsm_base`: Base search view for fsm only, with fields/filter common to the normal search view and the one used in reporting.
8. `project_task_view_search_fsm`: Search view for fsm.
9. `report_project_task_user_fsm_view_search`: Search view for the project report.
With this organization, we can easily add a field to both fsm and project at once, and even to project sharing at the same time. Since the goal is to keep the reproting search views identical to the normal ones, it'll also add the field to both of them.
Task list views
---------------
Similarly to the search views, the task list views were also refactored to minimize code duplication, following this inheritance diagram:
```
┌─┐
┌─┤1├─┐
│ └─┘ │
│ │
┌▼┐ ┌▼┐
│2│ ┌─┤3├─┐
└─┘ │ └─┘ │
│ │
┌▼┐ ┌▼┐
│4│ │5│
└─┘ └─┘
```
1. `project_task_view_tree_main_base`: Base list view containing all the fields/filters common to project, project sharing and fsm.
2. `project_sharing_project_task_view_tree`: List view for project sharing.
3. `project_task_view_tree_base`: Base list view containing all the fields/filters common to project and fsm (not project sharing).
4. `view_task_tree2`: List view for project
5. `project_task_view_list_fsm`: List view for fsm.
Project views
-----------------
The search and list views for projects in fsm now inherit the ones from project, since our goal moving forward will be to keep those as similar as possible.
Other changes
-----------------
- Merged and removed many filters/fields from the task search views.
- Changed `total_hours_spent` and ` subtask_effective_hours` labels in `project.task` model to avoid changing them manually in many views.
- Renamed `state` into `kanban_state`, `hours_planned` into `planned_hours` and `hours_effective` into `effective_hours` in `report.project.task.user` to make it consistent with `project.task` (so we can keep the same views for both of those models).
- Moved the sale line filed in the "Settings" tab in the project form view (so that the `sale_line_employee_ids` field in "Invoicing" takes the full width).
---
Enterprise: https://github.com/odoo/enterprise/pull/34106
Upgrade: https://github.com/odoo/upgrade/pull/4216
Task-2746370
closesodoo/odoo#106015
Related: odoo/upgrade#4216
Related: odoo/enterprise#34106
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit field width was not as expected because
its label defined in container(Ex: div,span)
This commit fix field width issue by giving o_td_label class
to container of label to properly compute its width
task-3032518
closesodoo/odoo#106336
X-original-commit: 41b354f3edf7fc77162a59613ccafc0b9b9066a0
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Prior to this commit, altought the widget was working from the UI, tests
have detected that `activeActions` from the state was not updated when
props where updated.
task-3001470
X-original-commit: 0fb1ff059c40b2489e315fe630a3b39625c468ec
Tests adaptations will come in a following PR, but the current focus is set on owl conversion.
task-2936932
closesodoo/odoo#101500
X-original-commit: 78e15be0b58c0c964f1df79e95f17fcf72480a5b
Related: odoo/enterprise#31970
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit removes an unused widget from the field, formatter
and parser registries.
X-original-commit: 6f88435e792fdefe17e0684308482b8c2821c361
Part-of: odoo/odoo#101661
Tests adaptations will come in a following PR, but the current focus is set on owl conversion.
task-2936932
closesodoo/odoo#101208
X-original-commit: 22c8e0ec8cd0ffc6a14302fc548bb5fffc5c4e11
Related: odoo/enterprise#31820
Signed-off-by: Xavier <xbo@odoo.com>
This commit add tests that ensures that the toggling is working as expected
when a factor is used.
task-2990758
closesodoo/odoo#100626
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit also adds the necessary tests in oder to ensure that
`timesheet_uom_factor` is taken into account/ignored in the right widgets.
task-2974145
closesodoo/odoo#100378
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Now that web_studio no longer uses the legacy graph and pivot views and
that all their extensions have been converted, we can finally remove
them from the code base.
closesodoo/odoo#99734
Related: odoo/enterprise#31112
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit removes all custom codes to create a QRCode to get the link
of the Timesheet Awesome App, the link is sufficient to download the
mobile app.
closesodoo/odoo#99362
Related: odoo/upgrade#3840
Related: odoo/enterprise#30942
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Before this commit, a service called `timesheet_uom` is created to add
in the legacy registry, the right component to use when `timesheet_uom`
is searched in the registry because it depends on the UoM set on the
current company.
This commit converts all the widgets in which be used in the
`timesheet_uom` registry and also adapt the service to use the session
instead of the legacy one.
task-2944742
closesodoo/odoo#98380
Related: odoo/upgrade#3787
Related: odoo/enterprise#30565
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Have an editable list view, displaying a many2many tags field. The m2m field
has a context, mentioning `active_id`. (`context="{'default_field': active_id}"`)
"basic context keys" is to be understood as the usual suspects: active_id, active_ids, current_company_id, active_model
Type something in the m2m input, and selet create and edit, in order to create a new record in a dialog form view.
Before this commit, there was a crash because active_id was not present in the evaluation context.
After this commit, the new record opens in its form view, with the right value for the field that must have a default.
closesodoo/odoo#96910
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit fixes an "Uncaught Promise" error that is thrown when the
timesheets configuration page is accessed since 150f63c1b6.
The error stems from the appStoreWidget component and specifically from
how the component props are handled.
closesodoo/odoo#97341
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
To make cleaner code and keep a similar API than fields, the
extractProps static method is added to the the widgets.
extractProps allows making new props out of the attrs of the widget
node.
Part-of: odoo/odoo#96843
*hr_timesheet,point_of_sale,website
This commit moves the settings form view implementation from base
to web, and converts it to owl.
The setting's search has been improved to take into account more
elements. Before, it was possible to only search on the field's
labels. Now, we can also search on the field's description, and
the titles of setting's group.
Part-of: odoo/odoo#78221
Co-authored-by: Samuel Degueldre <sad@odoo.com>
From [1]:
> Dropped all .badge-* color classes for background utilities
> (e.g., use .bg-primary instead of .badge-primary).
We now have to manage constrast for some badge. It's why we
add 'text-dark' at some point.
Note:
Due to the backport of 'text-bg-#{theme}', we can use this to
avoid to use 'text-dark'.
Ref:
[1] https://getbootstrap.com/docs/5.1/migration/#badges
Task ID: 2766483
Part-of: odoo/odoo#95450
Earlier in Odoo, JS views were defined by defining 4 elements: View,
Controller, Model, Renderer. This was complex in some way, because we
wanted to inherit behaviour as well, so it was necessary to think along
multiple dimensions to understand how the code was running.
Then, with Owl, we rewrote some views, and simplified them: views were
now just a Component. Most of the common behaviour now came from the
generic View component that instantiated the concrete view with the
proper informations. In practice, views were still split in views
(which was the equivalent of the Controller of earlier views), Model and
Renderer
Now, this commit reintroduce the Controller, and change the way views
are defined: by an object with multiple metadata, and an (optional)
props function to compute the actual props used by the view.
As a result, views are now much easier to extend/modify.
closesodoo/odoo#89889
Related: odoo/enterprise#26728
Signed-off-by: Géry Debongnie <ged@odoo.com>
** = hr_timesheet_attendance,project_timesheet_holiday,
sale_timesheet
Purpose of this commit to improve generic usage of
timesheet app.
So, in this commit done following change:
- change no content helper for reporting menu actions.
- change no content helper for attendance report menu action.
- make timesheet editable in batch.
- add suspicious duration filter in timesheet search view.
- add analytic tags in timesheet views only visible when analytic
tag feature enable from accounting settings.
- remove group group_no_one from section_leaves div.
- remov group group_no_one from timesheet group in leave type
form view.
- improve search view.
- remove form view reference from project_id of timesheet.
- add a condition for decoration danger in o2m tree view for
timesheet_ids in project form view.
task-2725525
closesodoo/odoo#82305
Related: odoo/upgrade#3355
Related: odoo/enterprise#23284
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
For now `hr_timesheet_graphview` doesn't work with dashboard because
`board` is still in legacy and `hr_timesheet_graphview` in owl.
So we have to create a legacy version of it to adapt it to dashboard.
Similar fix: https://github.com/odoo/odoo/pull/86571/files
opw-2793729
closesodoo/odoo#88673
X-original-commit: 0b298005bebdc4b0de35608749f244e4b96b4f93
Signed-off-by: Xavier <xbo@odoo.com>
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.
Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)
closesodoo/odoo#84280
Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
This commit fixes the broken inheritence between project and
hr_timesheet modules regarding the GraphView.
Hr Timesheet module extends GraphView rather than ProjectGraphView which
makes the view unaware it should use the ProjectControlPanel.
This commit adds project tour steps to ensure every view contains the
project update breadcrumb.
task-2642872
closesodoo/odoo#78503
X-original-commit: aa59771d3a4ffd2f7372c58bf56ca8dcc1183d2e
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Signed-off-by: Thibault Libioulle (tle) <tlibioulle@users.noreply.github.com>
The purpose of this task is to improve the setting of the timesheet module.
In this commit, we improve the following:
- Rename the label, description and align the field with the name and
description of the feature
- Add an 'OK' button in the 'download our app' modal
- Render the frequency field properly in the employee/manager reminders
setting on mobile view
- In configure your services link: change the name of the action to "Services"
- Display the following options in the community, with the usual 'Enterprise'
tag: Round Timesheet, Employee/Manager reminder, Invoicing Policy
closesodoo/odoo#74967
Task-id: 2531338
Related: odoo/enterprise#20182
Related: odoo/upgrade#2771
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Remove superfluous dash in `project.task name_get` and replace it with
nbsp to be able to split on that specific value in a similar manner as
before.
Closesodoo/odoo#74350
Task ID: 2596229
Related: odoo/enterprise#19916
Related: odoo/upgrade#2705
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Purpose of the commit is to do the generic improvement for the
timesheets app.
So in this commit, done the following changes:
- added the "Timesheet Entries" report for the project.task object in project app.
- added the "Minimal duration and rounding applied when using the timer"
description for 'round timesheets' and rename 'round timesheets' to 'Time
Rounding' in the setting of the timesheets app.
- added the kanban view for the "reporting" menus in the timesheets app.
- change the 'x Timesheets' stat button into 'x Hours recorded' and icon to
'fa-clock-o' in invoice form view.
- rename 'round timesheets' to 'Time Rounding' in
setting.
closesodoo/odoo#71590
Taskid: 2459783
Related: odoo/enterprise#18668
Related: odoo/upgrade#2525
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Adds new optional stages for the project.project model.
Previously projects would stay dormant when they were finished, we can
now define stages for those projects to determine where a stage is in
it's lifecycle.
Also adds some small changes to the project itself, such as adding tags.
Closesodoo/odoo#73648
Task ID: 2581575
Related: odoo/upgrade#2646
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
The purpose of this task is there are several places where the
duration is expressed in hours even though the encoding unit
is in Days. This creates inconsistencies.
In this commit, we convert hours into days when the encoding
unit is in Days. Also, we changed the string of the fields
according to the encoding unit.
closesodoo/odoo#70512
Task-id: 2512950
Related: odoo/enterprise#18197
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
QUnit's before and after hooks should not be used as they are triggered at the end of a QUnit's module
So that tests within that module would have side effects on one another
This commit changes those hooks to use beforeEach/afterEach so that each test has its own execution environment.
In timesheets, which widget should be used to display durations depends
on the company's unit of measurements.
Previously, this was done by overriding the webclient's init method,
where we could check the company's UOM and insert the appropriate field
widget in the field widget registry.
In wowl, the extension mechanism that was used (include on webclient) no
longer exists, as such, this is now done in a service that is started by
the webclient during it's initialization, and as such, happens
essentially in the same part of the webclient lifecycle, but no longer
needs to patch the webclients internals.
Before this commit, when the user wants to create a timesheet in the
list or form view of this model, the user can quick create a project and
a task if he wishes. The problem is when the user wants to quick create
a task without defining a project in the form view of timesheet, because
the default_project_id of the task will be false and a task without
project will be created.
This commit checks when the user clicks on the task_id field if the
default_project_id exists in the context and if the default_project_id
is not false, then we allow to the user to quick create a task for this
timesheet, otherwise he can just select a task.
Moreover, the js file is updated to fit with the new syntax.
closesodoo/odoo#69420
X-original-commit: d3693ad15eae23829e5ed6ef6dfa915eeab5c8cc
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>