This commit will make date(time) raw_value an ISO string
instead of a native JS Date.
- Before this commit
In kanban templates:
- the raw_value property of a record's date/datetime field is
a native JS Date object.
The problem with raw_value is that JS Dates toString
method depends on the system locale and timezone.
In the code base, the usage of raw_value for date/datetime fields
usually parse the raw_value into a luxon DateTime object
in order generally to display it in a specific format, or in order
to compare it to another luxon DateTime object (e.g. the now instant).
- After this commit
The raw_value property of a record's date/datetime field
has become an ISO8601 string, instead of native JSDate toString
format (which I recall depends on system's locale and timezone).
The ISO8601 format is easier to work with.
Part-of: odoo/odoo#98980
The goal of this revision is to get rid of the `groups_id` field of the model `ir.ui.view`.
- This feature wasn't really known or used by most developers,
and not straight-forward to understand.
Removing it allows one less complicated thing to learn for developers.
Besides, thanks to odoo/odoo#95729,
changing the behavior of the `groups=` attribute,
we can easily get rid of this `groups_id` feature
by simply adding `groups=` in the elements of the views
using the `groups_id` field, it will have the same effect:
adding the elements in the view only for the users part of the specified group.
- By getting rid of the groups_id many2many field on ir.ui.view,
it makes possible to cache the view architecture without
requiring to use the groups in the cache key.
Currently, if we want to cache the view architecture,
it would be required to use the intersection of the user
groups with the groups_id groups of the view,
making it costly to compute the cache key,
therefore altering the performance point to cache the view
architectures.
Part-of: odoo/odoo#98551
Just doing the summer file cleaning. Move mail data into files named based on
their model, easing maintenance and searching for those data.
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#98661
This revision is to make uniform the behavior of the `groups` attribute
on the Python model fields
and on the node in the view architecture.
In both cases, remove the node from the view completely.
Before this revision,
in a back-end view:
- In the Python model, if a field has the `groups` attribute set
and the user is not part of
the groups, the field is removed, completely, from the view.
- In the view architecture, if a node has the `groups` attribute set
and the user is not part of
the groups, the node is made invisible (not completely removed, just
made invisible).
in a front-end view:
- if a node has a "groups" or "t-groups" set and the user
is not part of the groups, the node is removed from the view.
So it's 2/3 cases removing nodes restricted to a group.
and 1/3 case making invisible nodes restricted to a group.
It's simpler to have a uniform behavior for the 3 cases,
simpler to understandard for developers.
In addition, this will help for the goal to cache back-end views.
It makes possible to convert views using the `groups_id` field
by moving the content of these views directly
in the view to which they add content which is suppose to be completely
removed when the user has not the according group.
By getting rid of the `groups_id` many2many field on `ir.ui.view`,
it makes possible to cache the view architecture without
requiring to use the groups in the cache key.
Currently, if we want to cache the view architecture,
it would be required to use the intersection of the user
groups with the `groups_id` groups of the view,
making it costly to compute the cache key,
therefore altering the performance point to cache the view
architectures.
closesodoo/odoo#95729
Related: odoo/enterprise#29592
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
When a record is created through xml data, its HTML fields should
receive a `type="html"` attribute, not a `type="xml"` attribute.
When important XML data with XML type instead of HTML type will have 2
differences:
- The field value will be prefixed by `<?xml version="1.0"/>`
- If the HTML contains multiple root nodes, the value will be wrapped in
a `<data/>` tag.
See `_fix_multiple_roots()` and the `xml_import` class for more details.
closesodoo/odoo#98239
Related: odoo/enterprise#30491
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Purpose
=======
Avoid having too many search for, lead the end user to use the main one.
closesodoo/odoo#98096
Taskid: 2937036
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Only for terms containing Credit Note and expenses
closesodoo/odoo#97840
X-original-commit: 1754b094a66476a0bdb29fe60dc5583c03336c3f
Related: odoo/enterprise#30262
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
fields having a tooltip in the future UI.
4/ some cleanup of existing messages too
The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX
closesodoo/odoo#97279
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
When archiving a vehicle, the active state of its Contracts/Services
were toggled, which was confusing (an archived Contract would suddently
become unarchived on an archived vehicle).
Now we only archive the Contracts/Services when the Vehicle is archived,
and no unarchiving is done.
task-2898104
closesodoo/odoo#95650
X-original-commit: 0be40d67c28b8575613f59ca5b4d8d6ea99638cb
Signed-off-by: Kevin Baptiste <kba@odoo.com>
For bugfix purposes, app administration groups have been given to
(implied by) the "Settings" group because without those rights,
opening/saving the settings crashed.
1) Do not load hidden view content
This commit uses the conditional inheritance of views
(depending on user groups) to avoid loading unnecessary view
& record content client-side.
This improves performance for admins without the specific application
admin rights, but also fixes the main bugfix problem,
caused by the webclient querying name_get for the records in relational
fields content.
Example:
sale_management adds a res.config.settings field to specify
the default sale.order.template for the current company.
If a 'Settings' user without 'sale.group_sale_manager' opens the
settings, he won't see this setting, but if a default template is
specified for the current company, the webclient will still request
the name_get of this template to the server, because the field
was present in the view, only hidden with a groups attribute.
With this commit change in sale, the field won't be in the view unless
you have the Sale manager group, avoiding the error/traceback/bug.
2) Remove implied application administration groups
Do not force the specific application groups on all 'Settings' user,
they globally do not need those rights, and if they need it, they
can add it to their account themselves.
3) Add a test to make sure settings user are able to manage settings.
4) Enforce 'settings' -> 'access rights' -> 'internal user' groups
As the previous test highlighted some 'false positives' because
it considered a settings user unable to read `crm.team`
and `stock.warehouse` records, we also took the opportunity to enforce
the fact that 'Settings' & 'Access rights' users must be internal users.
It makes no sense for a portal/public user to have access to the
settings, and didn't work anyway.
Part-of: odoo/odoo#91909
Minor usability changes:
* Reorganize menu to be more consistent with other HR apps;
* Tweak several views;
* Don't expire contract when date is set to Today - they will be
automatically expired the next day;
* Show contract name on form view.
closesodoo/odoo#92604
Related: odoo/enterprise#27919
Taskid: 2856135
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The kanban view was recently improved to add the support of 'action' and
'type' attributes on the kanban arch. This commit takes advantage of
that change to simplify a few views in various addons.
Part-of: odoo/odoo#92071
Assignment logs list view can be accessed both from fleet and from hr_fleet,
however they show many repeating fields and, for this reason, this commit
improves these views by leaving the repeating fields as optional="hide".
task-2742923
Part-of: odoo/odoo#83755
When a vehicle is archived, its corresponding services/contracts are archived
as well. However, the corresponding records were no longer counted for
the stat buttons.
closesodoo/odoo#90406
Taskid: 2841384
Signed-off-by: Kevin Baptiste <kba@odoo.com>
There shouldn't be a distinction between full hybrids.
'hybrid' and 'full_hybrid_gasoline' are replaced in this commit by a unique 'full_hybrid'.
fixes task 2629318
taskID 2753096
closesodoo/odoo#90413
Related: odoo/enterprise#26886
Related: odoo/upgrade#3494
Signed-off-by: Kevin Baptiste <kba@odoo.com>
*:
approvals
hr_apprasaisal
hr_payroll
hr_referral
fleet
hr
hr_attendance
hr_holidays
hr_recruitment
lunch
Change various access rights names to improve understandability for users.
Addition of an officer role in fleet with intermediate accesses
TaskID 2742855
closesodoo/odoo#87545
Related: odoo/enterprise#25741
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Most of the extensions of `_name_get` are very similar and only want to
search for the given string in multiple fields.
A lot of extensions also don't take into account the negative operators.
Some implementations were also really outdated and needlessly
complicated.
closesodoo/odoo#86588
Related: odoo/enterprise#25608
Signed-off-by: Raphael Collet <rco@odoo.com>
This commit modifies most of the usages of read_group and uses
_read_group instead. _read_group doesn't join automatically on the
many2one fields when no order_by is specified, making it more performant
when the "name" of the many2one is not relevant, which is the case for
most back-end cases
closesodoo/odoo#84908
Task-id: 2479334
Related: odoo/enterprise#24877
Signed-off-by: Raphael Collet <rco@odoo.com>
the search method of contract_renewal_due_soon and
contract_renewal_overdue return a domain
id in res_ids where res_ids are id of contract
not vehicle
So it return random result
Solution
--------
Get the vehicle_id from the contract record set
closesodoo/odoo#84987
X-original-commit: 975841953adaa6b7adc8016fb96cc6efc8891613
Signed-off-by: Kevin Baptiste <kba@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>
There was some confusion about all the types of hybrid vehicles.
Also changes the order in which they are displayed.
TaskId-2629318
closesodoo/odoo#82672
X-original-commit: 73171da60059c85355e8675061db485e84aedb05
Related: odoo/enterprise#23460
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Steps to reproduce:
- Install Fleet
- Go on report-cost
- Click on a specifi vehicles
-> The cost associated are not correct
Solution:
Correction of the SQL-query which was not correct (id not unique)
closesodoo/odoo#81688
X-original-commit: e06114b3b7e188d8ce293f77d8395592193eb83d
Signed-off-by: yosa-odoo <yosa@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Step to reproduce:
- Have a fleet contract that need renewal
Current Behaviour:
- A new activity is created everytime the scheduler is called
Behaviour after PR:
- A new activity is only created if there is no current renewal activity present when the scheduler is called
opw-2713537
closesodoo/odoo#81919
X-original-commit: 3610069ea2c10fccf8fcc82c384a2194c4702e06
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
The PR #75475 removed the method `_compute_manager_id` without removing
the reference in the field.
closesodoo/odoo#81766
X-original-commit: a4e1477d120c336ace405421ddb860a72cfeafe1
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This reverts commit 2e58d23e760313dbf58ce6a90f26b7160db460d8.
Actually the fleet officers want to be notified.
The correct way to handle the original issue is to ping the employees
via their documents, instead of on the fleet.vehicle, to avoid setting
them as followers of the car.
closesodoo/odoo#78716
X-original-commit: 437bd8cc54d999a40ee2d83e2fef9c0ced19f47e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The "Claim Car Report" action was not working as expected.
Now the statbutton "Cars" will show the car history of a specific
driver.
closesodoo/odoo#76550
Related: odoo/upgrade#2882
Taskid: 2646113
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Description of the issue/feature this PR addresses:
In fleet, the demo data for service type have two entries for summer tires
The service types are sorted by alphabetical orders instead of id
Current behavior before PR:
The summer tires service type is appearing twice in the demo data
The service types are sorted by id
Desired behavior after PR is merged:
The summer tires service type is unique in the list
The services types are sorted by alphabetical order
task-2641484
closesodoo/odoo#76403
Signed-off-by: Kevin Baptiste <kba@odoo.com>
We clean various graph archs taking into consideration that:
- the default type of a graph is "bar".
- a bar chart is by default stacked.
- the field attributes type="row" and type="col" does not make sense for
a graph view (since its implementation was separated from the pivot
implementation a long time ago))
- the boolean attributes should now take 1 or 0 as value (but the other
values are accepted for retrocompatibility).
Part-of: odoo/odoo#76065
Following the removal of read access on ir.model (odoo/odoo#69120),
the mail.activity.type model was not accessible to non-admin users due
to the res_model_id many2one field.
Before this commit, a project user could not access the Activity Type
menu.
Convert it to a selection field with the selection values being
computed in sudo.
closesodoo/odoo#74981
Related: odoo/enterprise#20214
Related: odoo/upgrade#2734
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
How to reproduce the problem:
- Install the Fleet app.
- Create a user that has access to 2 or more companies (e.g. Mitchell Admin).
- Log in as this user. Go to fleet -> Vehicles -> Vehicles Costs/Contracts/Fuel Logs/Services Logs
- Uncheck one of your companies.
- The user still has access to the fleet of the other companies, even if they are unchecked.
Cause of the problem : missing record rules
Solution : added multi-companies rules
opw-2518188
closesodoo/odoo#73925
X-original-commit: 41828bc22b5cf663b96196371f412ad2bfbbfb22
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Currently, there are many useful pivot views on reporting models but most
of them lacks the dedicated list view. Dedicated list views will allow users
to see useful information when one directly drill down to the records from
the pivot table in odoo spreadsheet [1].
With this commit
1. we remove 'disabled_linking' attribute from the very important pivot
and graph views (see the full list on task pad);
2. we added dedicated list views for the following reporting models
- account.invoice.report
- fleet.vehicle.cost.report
- hr.timesheet.attendance.report
- purchase.report
- project.profitability.report
- report.membership
- report.pos.order
- report.project.task.user
- sale.report
Task-2547881
[1] See task-2506116
closesodoo/odoo#72394
Related: odoo/enterprise#19122
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When consulting the costs reports, if the beginning of the dates range
has a day greater than the day of today (e.g., start date: 2021/02/25,
today: 2021/07/10 => 25 > 10), the costs of the current month won't be
include in the report.
To reproduce the issue:
(DB without any demo data. Let X be the day of the month for today)
1. Create a vehicle V
2. Add a service S1 for V
- The category of the service type does not matter
- Cost: 500
- Date: today
3. Add a second service S2 for V
- Same service type
- Cost: 250
- Date: Last month with a day > X (so if today is 2021/07/26, date
could be 2021/06/27)
4. Fleet > Reporting > Costs
Error: The report does not include S1
When generating the dates range, the current date is used as the end of
the interval. Since the interval step is '1 month', it will lead to an
issue in the above case:
Suppose today is 2021/07/26, the interval starts on 2021/06/27. Then, if
we add one month to this date, we have 2021/07/27, which is after the
end of the interval (2021/07/26), so the date is ignored. As a result,
current month won't be included in the report.
Note: A similar issue can happen with the contracts
OPW-2477004
closesodoo/odoo#74273
X-original-commit: 7ea6300f951bd426c94d721bb56e6ad85a58bd30
Signed-off-by: Kevin Baptiste <kba@odoo.com>
When adding some services to a vehicle that does not have any
immatriculation date, the costs report does not consider these services.
To reproduce the error:
(DB without any demo data)
1. Create a vehicle V
- Remove the Immatriculation Date
2. Add a service for V
- The category of the service type does not matter
- Cost > 0
- Date: today
3. Fleet > Reporting > Costs
Error: Costs Analysis is empty, the service is not considered
In the SQL view, the date used as start point is the oldest
immatriculation date. Therefore, if the vehicle doesn't have this date,
the report lines won't be generated.
OPW-2477004
X-original-commit: 8d362af654c1905535d78fbf8d73677633b65d63
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Currently, some business object related menus have the
same names with the technical menus and it creates
confusion among users.
This commit renames the following menus:
- in fleet app, 'Models' menu is renamed to 'Vehicle Models'
- in website app, 'Views' menu is renamed to 'Page Views'
Apart from that, to be consistent with menu item, this commit
also renames the action 'website_visitor_view_action' from
'Views' to 'Page Views'.
TaskId-2595993
closesodoo/odoo#73755
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Overall UI review of the fleet app.
Also changes the behaviour of shared fields between vehicles and vehicle
models.
Task ID: 2468228
closesodoo/odoo#72943
Related: odoo/upgrade#2601
Related: odoo/enterprise#19356
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>