/web/action/load is the public controller that Should be used by the
webclient to fetch actions
_for_xml_id is the default access method on actions that implements
fields filtering to avoid leaking server action code or other
information not needed by the webclient
Implementing whitelist of fields that can be access per model
New module for supporting two-factor authentication via time-base
one-time-password (TOTP).
Users (including portal users) can choose to enable two-factor auth in
their user account settings, by scanning a QR code and adding it to an
authenticator app, such as Google Auth, 1Password, etc.
When two-factor is enabled, password-based non-interactive RPC is only
possible by using API keys.
Co-authored-by: Olivier Dony <odo@odoo.com>
Follow-up on 6edb749534, where default
`autocomplete` values were introduced as default for password fields,
according to the new autofill specs.
This patch allows developers to force the "autocomplete" attribute value
on password fields, in case there really is a need for a value that is
not `new-password` (which BTW now triggers the password generator wizard
in many browsers).
It is useful for example when a backend form really needs to ask the
user for their current password, so the correct `autocomplete`
value is `current-password`, as on the login form.
Before this, invalidations to the UID cache is not synchronised
between workers because it's an ad-hoc solution (so a user changing
their password or an admin disabling a user would only lock out an
attacker currently using the API of one of possibly several
workers). Shift the entire thing to ormcache which already has proper
support for synchronising cache invalidation between workers.
Also simplify the cache invalidation mess in Users.write because the
caches have been unified into a single registry-level LRU, so the
half-dozen cache clears on specific ormcached methods & models is
pretty much the same as repeatedly calling clear_caches on the current
model.
**However** registry.cache is trivially accessible from server actions
and safe_eval as long as they provide access to a model (through
`model.pool.cache`). Which is common, and an issue given we're very
much putting sensible data in there.
Fix this by renaming `Registry.cache` to `Registry.__cache`, this
requires few editions and mangled names are not accessible from
safe_eval contexts.
The alternative would have been to add more bespoke handling of the
uid cache to hook it into the cache invalidation propagation
machinery.
After discussion with (@)odony, fixing LRU access and using that seems
cleaner and less error-prone.
Note on lazy_property
=====================
Make Registry.cache / Registry.__cache into a regular attribute: the
overhead of the LRU is not that high (compared to that of the registry
itself), it's rare that we *don't* need it, and it's assumed to be a
persisted attribute (it's not just a cache) so making it a normal
attribute seems fine; and lazy_property doesn't work for mangled
names: the name of the property is mangled using the name of the
definition class, but the name of the symbol (fget) is not mangled so
lazy_property would set the __cache attribute but then Python would
lookup _Registry__cache, creating a new cache every access.
And we can't (always) mangle things correctly on `__get__(obj,
owner)`: `owner` is just `type(obj)`, meaning in the case of
inheritance the type we get is the type through which the property is
accessed rather than the one it's defined on. So it would work in the
cases where no inheritance is involved (such as Registry.__cache) but
not in general (lest we want to play around walking the MRO ourselves
to find the definition source, which doesn't seem worth it).
lazy_property *could* be made to work properly on Python 3.6+: the
descriptor protocol gains `__set_name__(name, owner)`, which is called
with the properly mangled name — and with the definition class to boot
(though there might still be issues when overriding lazy properties as
the override will be mangled & named differently... or maybe that's a
feature?). However we're still supporting 3.5 at this point, AFAIK, so
that's not an option. Plus it feels unnecessary / not very useful.
However add an assertion to `lazy_property` so it signals when we try
to use it on a mangled method (as otherwise it kinda sorta work in the
sense that the property / object is accessible but is in effect a
slower way to write a regular property).
Add an option to display the language selection inline or with a
dropdown. Add an option to choose if language labels are flags, text
or both.
Part of https://github.com/odoo/odoo/pull/55300
task-2203383
Co-authored-by: qsm-odoo <qsm@odoo.com>
In pivot view, a cell data is determined by his row/column key which
are the value chain of field values to get to that row/column.
If you had a grouping with value in a cell and then close the grouping,
you could somehow get the old value back wrongly on next grouping
operations.
This happened because:
- the key was computed based on the value (eg. for relational field the
record ID) but without the field name.
- succeeding read_group only fill existing values.
eg. If on pivot view we had a salesperson with same ID as product
category, if we closed salesperson grouping then opened product
category grouping, we could possibly get the cell value to the product
category that has the same ID as the salesperson.
With this changeset, we clear the cell data corresponding to a grouping
that has been closed.
Added test without the fix would fail by displaying data of a previous
read_group that should have been cleared inbetween.
opw-2262306
closes#55129closesodoo/odoo#55936
X-original-commit: f1df73adca4955561814d4b8e90a62d7d50c1c33
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Before this commit, click on the divider in the menu 'Measures' of the
pivot control panel would cause a crash. The present commit fixes that
situation.
We also bring another small correction: the menu won't close if one
clicks on the measure list but not exactly on a menu item or the
divider.
closesodoo/odoo#55902
X-original-commit: aad9f3fd7499ef8b660cc25fea840a34d70f75a6
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Improve mock server:
- add support for mocked `fetch`
- add support for `active_test`
- add support for x2m `in` in domains
- add support for default values computed from a function
- implement a more natural "next id" compute
- allow initial data without ids
- ensure write and x2m commands integrity
- improve bad data/bad commands error messages
- always warn for failing RPC, not only in debug mode
- fix all existing tests that had inconsistency data
Other changes done in mail (or dependents) that are not just related to tests:
- remove `direct_partner` from formatter result
->`correspondent` can be computed from other keys, especially `members`
- fix `livechat_visitor` convertData
-> only process if there is value
- add `current_partner` and `current_user_id` as `init_messaging` result
-> easier to mock than session
- remove usage of `need_moderation`
-> that was just a search indirection to `moderation_status`
- adapt `partner_id` -> `res_partner_id` key in `_notification_format`
-> to be consistent with field name
- add name in result of `mail_partner_format`
-> sometimes display_name is not the same
- remove usage of `is_moderator`
-> that was just an indirection to `moderation_channel_ids`
Enterprise counterpart: https://github.com/odoo/enterprise/pull/11523
task-2287171
closesodoo/odoo#55854
X-original-commit: 7ba3fecb3377a720d1eb70e7515a0c45da73836d
Related: odoo/enterprise#12391
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
With this commit, the timezone (in the user's preferences) is
automatically set to the timezone of its browser the first time
this user logs in.
Task 2207715
closesodoo/odoo#55726
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Before this commit, the field badge could overflow from its boundaries
and have part of its pill/text hidden.
Now, the "overflow" mixin has been applied and the badge is properly
contained.
closesodoo/odoo#55806
X-original-commit: f4b672bfcf21c7c7f0b6071a8dd18bd6e966266b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes in
community to have sample data in dashboard views.
Task ID: 2282196
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes to have
sample data in pivot views.
Task ID: 2282196
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
A previous commit has paved the way for displaying sample data in the
reporting views. The present commit brings the required changes to have
sample data in graph views.
Task ID: 2282196
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
The present commit brings the global changes necessary to have sample
data in the reporting views. This includes several modifications/
fixes of the sample server (many of them for better visual results).
Task ID: 2282196
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
This commit changes the API of the SampleServer's mock
registry s.t. one can register a mocked version of a method,
whatever the model. The former API required a specific
model to be specified, and only applied on this model.
However, in order to enable the sample data feature on the
cohort view, the 'get_cohort_data' method needs to be
mocked, whatever the concerned model.
One can now register mocked methods for a specific
model only (with key 'model/method') or for every
models (with key 'method').
Task ID: 2282196
The SampleServer picks a random value for selection fields. As a
consequence, field 'activity_exception_decoration' is always set,
either to 'warning' or 'danger'. When this field is set, widget
'ListActivity' (set on 'activity_ids') displays 'Warning', whatever
the value of 'activity_ids'. This means that with sample data, the
next activity field always displays "Warning", which is not great.
This special case has been handled in web, as it is the first (and
only) one. In the future, if we have to implement several special
cases like that, we'll setup a proper hook to allow external
modules to define them from the outside.
Task 2316726
closesodoo/odoo#55703
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Before this commit, the search panel was subject to some inconsistencies
when dealing with a category having enabled counters and with a filter
defining a "domain" attribute. Indeed, the counters could be in an
incorrect state if the right filters/categories were not loaded first,
with no simple way in doing so.
The search panel being complex enough as it is, we decided to disable
all categories' counters in the presence of a filter having a "domain"
attribute regardless of said domain.
closesodoo/odoo#55734
X-original-commit: e78f777bd8ccb314b85451cbc8d1dd9109997d7a
Related: odoo/enterprise#12341
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit adds smart date inputs for date and datetime fields.
The goal of smart date input is to provide the user some shortcuts
when setting dates.
The rule is [+-]\d+[dwmy]?
So we can enter inputs like:
+3 to have today + 3 days
-2w to have today - 2 weeks
+1y to have today + 1 year
+5m to have today + 5 months
-4d to have today - 4 days
closesodoo/odoo#55602
Task: 2270347
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Form sheet with hidden overflow (added to improve ribbon widget css) prevents
emoji button from showing emoji list when clicked. This commit attempts to
show the complete emoji dropdown by removing overflow from the sheet container.
IMPORTANT : This override won't affect ribbon since the hidden overflow was
added on the widget itself.
Task ID-2224393
PR #49096
This commit adds the parameter `scales` in the calendar view's template.
This parameter can be used to choose which mode(s) is/are allowed.
This commit also refactors the way we manage calendar scales.
Before scales were defined in model and renderer, now it's defined
in the view and given to model, controller and renderer by params.
Task: 2193921
This commit reworks the mini calendar's style to make it look like
the months in year mode.
It also reworks the style of the calendar's popover in modes day,
week and month to reduce the differences with the year popover.
Task: 2193921
This commit adds a new year scale to the calendar view.
It comes with a new view in the calendar, this view displays a
4x3 grid which cells are month views.
Task: 2193921
This commit optimizes calendar view especially for year mode
- remove/add events has replaced by an event source and refetch.
- do not re-render events when navigating date
Task: 2193921
before this commit, when change view from graph view to pivot view or any other
view and come back to graph view, Measures button disappear, it's only
appearing if we refresh the page.
after this commit, restore previous view state when switching back to graph
view, this was because measures button is rendered in fragment and when
switching between views, as graph view element was destroyed and re-rendered
so measures button will be mounted in fragment as update method of
ComponentWrapper will render it from previous mountArgs, so to avoid this issue
push measures element in DOM.
task-2250051
closesodoo/odoo#55666
X-original-commit: 40c709fb0abe7721d1650af9bd1d17dc8453895a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
Before this commit, the "fields" object given to the control panel was
altered by the view (e.g. dashboard populates it with its aggregates).
As a result the control panel and its subcomponents had an altered
object with more or less fields than expected.
Now, the initial "fields" object is given to avoid such problems.
Task 2312074
closesodoo/odoo#55640
X-original-commit: 472b314614dc3dd9db880f4cb60c2eda89cce6b4
Related: odoo/enterprise#12310
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Having maps in its state, the search panel has to serialise its state
before sending it via exportState. Before this commit, this was done
on the state object in place, causing issues if the model was restored
without an imported state (no re-serialisation hence having a wrong
state).
Now, the exported object is deep-copied from the original state.
Task 2312131
closesodoo/odoo#55393
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
PURPOSE
Before this commit, when you used the 'image' widget when the record name was
``..`` (double dots) it couldn't retrieve the image since the double dots was
decoded as the parent directory shortcut. After this commit, the double dots
will be replaced by -- with the downside to loose the true record name.
SPECIFICATIONS
Replace the .. (double dots) with -- in the filename.
Using .. may seem like a strange use case but if you actually try to find
a partner called ".." in a production database, you might be surprised ...
LINKS
Task ID-2241513 (eLearning onboarding and testing)
PR #55567
X-original-commit: dcb7a924c36cd3f3aeef891ddd8830bd66322025
From the Sale app create a new Quotation with a long customer
reference. Click on "Save" and then Print.
In the generated report the fields relative to the order details are not
correctly displayed: the general font size is scaled down to make the
text fit the page which is not the correct behavior.
The font size should remain fixed and all the element
should be visible, eventually spanning over multiple lines.
This is due to the broken bootstrap support of QtWebKit, used by
wkhtmltopdf to generate pdf reports.
In particular the new flexbox style introduced in the library is not
supported and every element based on it will be ill-displayed.
The solution is to fall back to the subset of supported features to
implement a different solution, which keep everything on one line but
avoid the font resizing and every possible overflow.
opw-2261573
closesodoo/odoo#55555
X-original-commit: 2dd3ed327aad6fecdcfd4b53c4338bf47e44401b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Issue
- Sales > Create a quotation
- Click on quotation date or start
writing in it
On chrome, if addresses autocomplete is enable
and have data to show, a dropdown will overflow
on the datepicker
Cause
This is mainly a chrome issue and the only way
to solve it without a fix is to disable the
autocomplete totally which is not really a
solution since we want the autocomplete on
adresses
Solution
Add the autocomplete off on datepicker field
OPW-2308278
closesodoo/odoo#55470
X-original-commit: b40fef968ab000870574ae45ba482288cdf94ad1
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Currently, when form view is opened in edit mode and if you proceed
through the tab(keyboard) then focus is skiped on radio field.
For Ex: in project when you procceed through the tab it will skip the
visibility field radio.
The issue occurs because the radio is inherited from the selection
field and in selection field the focus is set on 'select' while
there is no method to set the focus in radio and radio does not have
'select' element it has 'input'
So in this commit, override the method getFocusableElement in radio
widget and set the focus on 'input' instead of 'select'.
closes odoo/odoo#52073
Taskid: 2252798
Closes: #52073
Related: odoo/upgrade#1430
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
With this commit, the FormRenderer no longer directly extends
the WidgetAdapterMixin. It doesn't need to as its parent class
(the BasicRenderer) already uses it. Worse, they both called
WidgetAdapterMixin.on_attach_callback, and thus mounted
was called twice on Components in form views.
closesodoo/odoo#55401
X-original-commit: 4c627abd310a131a4828e9ee6be451aeee4708db
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit handles two things:
1) Move the local storage logic of the search panel into the documents
module.
2) This allows for a variety of optimisations now that we do not have to
constantly wait for a potential default value hidden in the storage.
This is why this commit also introduces a way for the search panel model
extension to sometimes return its query informations sooner than after
being completely loaded.
Task 2284207
The loading of the action model extensions have been split in this
commit:
- when calling load, a first promise is returned. It is meant to be
resolved as soon as all the query informations are available.
- a second promise returned by a new method "isReady" is resolved when
all of the extension data have been fetched.
This difference allow to not wait for server calls irrelevant for the
query. By default "isReady" will always wait for a full load call, but
this is meant to be overridden in case optimisations can be made.
The direction arrows in the datepicker were switched a first time in
fontawesome_overridden.scss
.o_rtl
..fa-chevron-left,.fa-chevron-right
transform: rotate(-180deg);
and a second time in datepicker.scss
.o_rtl
.bootstrap-datetimepicker-widget
.prev,.next
transform: rotate(180deg);
The buttons were flipped twice
Signed the Odoo CLA
Fixesodoo/odoo#50090Closesodoo/odoo#53369closesodoo/odoo#54880
X-original-commit: 8629fa3fdfddbf24f48a58d5add0fcadca60fba4
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Purpose
=======
There are several places where the duration is expressed in hours even though the encoding unit is in Days.
Specifications
===========
The duration should be expressed in days instead of hours in the following places:
[x] Timesheet Entries
[x] Portal > Tickets
[x] Portal > Timesheets
[x] Portal > Tasks
[x] Portal > Sales Orders
[x] Project Overview
[x] Project task form view (in this case, the label of the field should be 'Planned Days')
[x] Timesheets > HR Timesheet/Attendence Report
[x] Project > All Tasks
Hide the following elements if the encoding unit is in days:
[x] 'Timesheet Timer' feature on the project form view
[x] 'Timesheet Timer' feature on the Helpdesk team form view
[x] the 'Round timesheets' feature in the settings of Timesheets (except if the 'Awesome Timesheet' feature is enabled)
Bonus point:
[x] Timesheet form view: 0.00 Days should be displayed in read-only if the duration = 0
Some labels need to be adapted to explicit the unit of measure (is it carrots? potatoes?): e.g. Duration (Days) or Time Spent (Hours) :
[x] Timesheet entries report
[x] on the portal
[x] Project overview: add 'recorded' next to Hours/Days
[x] Project overview: add 'Days/hours Spent' above the total by employee
[x] task form view: make sure the 'sub-tasks days spent' button/label stays on one line
[x] hide the 'start' button on project tasks and helpdesk tickets if the encoding unit is in days
Task ID : 2152322
closesodoo/odoo#46184
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
after this commit, to update legacy widget from owl component,
one need to override renderWidget and updateWidget instead of
render and update method, this has been changed from commit
https://github.com/odoo/odoo/commit/f2de55322e4d417815e6757517163dd0cff544cc
but comment were still has render and update method to override,
so with this commit update comments as well.
task-2238551
closesodoo/odoo#54763
X-original-commit: 16713aaacbd4f4a25bed435bfa9045fab29a8c53
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
In a dialog, a button with `close="1"` should close the dialog when clicked.
It currently only works if the dialog is a subview.
closesodoo/odoo#55200
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: fleodoo <fle@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
Follow-up of odoo/enterprise#11881, in order to eliminate all similar
typos.
The CSS pseudo-class selectors are spelled `:first-child` and
`:last-child`, and never take any argument, as opposed to
`:nth-child(<nth>)` for example.
Ref: https://developer.mozilla.org/docs/Web/CSS/Pseudo-classes
jQuery doesn't care and matches with or without the `()`, but CSS
engines don't, and now libsass SCSS compilation crashes due to the empty
argument list (cfr. opw-2299465)
Better avoid confusion and fix the typo everywhere.
closesodoo/odoo#54685
X-original-commit: 82244e17339615615535073e6f9e1ddbcf0b57d9
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Before this commit, it might happen that text field columns in list
views were completely crushed, to let space to the other columns.
This commit fixes the issue by preventing text fields from being
wrapped during the ideal column widths computation. Doing so, text
fields will take space they deserve according to their content.
They will then be wrapped if necessary, so that they aren't trimmed,
unlike e.g. char fields.
Task 2275747
closesodoo/odoo#54664
X-original-commit: 5c54111127bd99eedb4e0331aba5a0200feb461c
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Improve tooltip style/design to get rid of black background and purple title,
instead design tooltip like popover design, to have tooltip with white
background and light grey title
task-2266829
closesodoo/odoo#53723
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Ipsita Borisagar <ibo@odoo.com>
The commit e69c72f93b removed the line
breaks into tooltip help text.
This commit re-add them for the sake of readability.
closesodoo/odoo#55233
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>