when moving from company A to company B, company A should not be 'uncheck' (it should stay in the set of visible companies)
use case: https://drive.google.com/file/d/1o9lN_8jHSxDOkeqTpo7F_NgmvO4NwF2l/view
I start in A with only A visible
I check B to make both A and B visible
I move to B and A is not visible anymore
when moving to a company that is not checked, it should be checked, but the reverse is not true (moving out of a company should not uncheck it)
fp request
when user in the group by list view it is not allow to change
the sequence of items by drag & drop with the handle widget,
so it does not make sense to display handle widget.
After this commit handle widget will hide in grouped list view.
Task-1964661
closesodoo/odoo#32855
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
While hovering in the systray a menu dropdown can only be open if user currently on his parent menu.
It should close when user hover on another systray menu.
Task: #1959678closesodoo/odoo#32322
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Before this commit,
Defining action using <a type="action"> outside of normal views(like qweb view)
css style does not apply to it because missing the href tag. by defining href
tag on a link will first open home screen then perform do_action thus it will do
flickering.
After this commit,
Prevent event default behaviour so it will stop flickering and restore css style
for action by defining href tag on it.
closesodoo/odoo#33703
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit when user want to add multiple record at that time
they only allow to add one record at a time.
After this commit user can add multiple record from search more wizard.
Added function _getSearchCreatePopupOptions so that it can be overridden
in FieldMany2ManyTags, options for FieldMany2ManyTags will differ, like
FieldMany2ManyTags SearchCreateDailog should have multi record selection,
Many2ManyTags' SelectCreateDialog should display record other than selected
This commit is related to task id: 1945912
closesodoo/odoo#32453
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
* We want to limit the obtrusiveness of the mechanism & at the same
time show the warning immediately, so send the warning through a
private channel between the superuser and the admin user rather than
the regular mail.thread's message_post which would likely send the
warning though email.
* Ignore issue when the request comes from a "private" IP (likely a
local dev box where it doesn't matter).
* Only check for "admin" on the admin user: passwords created manually
are already length-checked (required) and strength-checked (visual
indicator).
Task 31122
Supersedes #22428closesodoo/odoo#33254
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
In the SearchPanel there was a separation between selecting and
unfolding a category with children.
With this commit, when the user click to select a parent category the
children are also folded/unfolded.
This reduce the number of actions needed to reach a sub-category.
Task ID: 1917277
closesodoo/odoo#32660
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
SearchPanel widget in kanban views has been introduced in commit
https://github.com/odoo/odoo/pull/30517/commits/25c9355c02485e85914430188f3281246fc54cda.
But this feature was disabled for mobile.
This commit removes unneeded differentiation between desktop and mobile
for the SearchPanel.
It also adapt related tests to reflect this change.
Task ID: 1917277
Widget class indirectly inherits from ParentedMixin (through
PropertiesMixin).
The Widget's children are destroyed in both the ParentedMixin and the
Widget's own destroy() method.
This commit prevents from trying to destroy already destroyed children
and specifically from looping again on those children (resulting into a
minor performance improvement).
closesodoo/odoo#32174
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
The pdf_viewer widget fails to load file and hence shows error.
This is due to the wrong controller called(wrong URI passed),
while loading a file using pdfjs.
For files other than images, /web/content controller should
be called since since odoo/odoo#31811.
This is similar to the enterprise fix 793c76298a2b301a2
task-1932190
closesodoo/odoo#33354
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Generate a unique URL for translations and cache them forever in the
browser. This reduces the number of requests, in exchange for computing
the hash of the translations when the session object is added to the page
Today, some resources that varies very infrequentely are requested on
every page load: the menus, the translations and the qweb templates
After this commit, there will be 2 improvements that will make the
loading of the webclient faster:
1. cache almost static resources forever
when loading the /web/ page, the user session will
contain the cache key to be used to fetch these resources. As the content
of the resource itself it used to compute the hash, the request can be
put in cache by the browser forever (for a year).
The up side is that in general less requests are needed to load the web client
The down side is that the load time and number of queries of /web page
has increased to include what is needed to compute the hash of translations,
menus and qweb templates
2. trigger the loading of the menus before the download (and startup) of
the JS and CSS assets:
The menus contains the definition of the action, wich is the first thing
needed to load a page in odoo. Starting the loading of the menu much
earlier means that when they are not yet in the browser cache (see point 1),
the browser does not need to wait for the entire assets to be downloaded
and parsed before starting the 'load_menu' request, but instead start it
immediately and hold onto a promise to be used instead of the rpc 'load_menu'.
Because the request is done before anything else is loaded, including
JQuery, it is made in vanilla JS.
Co-authored-by: Julien Mougenot <jum@odoo.com>
* = tools, base, web, website_profile, website_slides
Before this commit it was impossible to pass those parameters in the URL because
they were received as string but expected as int.
The opportunity is also taken to properly use named parameters when calling
`image_process`.
closesodoo/odoo#33506
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
* = partner_autocomplete, point_of_sale, web_editor,
website_forum, website_slides
This can be used for example to preview an image from a file input field.
It can also be used to send the base64 content of the input by RPC instead of
having to rely on form submit as POST with multipart/form-data.
Technically wrap FileReader.readAsDataURL in a Promise.
This will also be used in task-1930726
PR: #33508
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
After this commit, the order of the elements of the search panel
categories follow the original order received from the back-end.
This is achieved by getting the order from the Array received
from the backend instead of the dictionary used to store the record data.
Task: #1972698closesodoo/odoo#33358
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This fix an issue in the mobile app in iOS.
Safari is less permissive and a blank page was shown.
closesodoo/odoo#33498
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Since ea1b3254bb, the phone widget was no more highlighted as it is not contain in a 'span'.
This commit reintroduce the correct behavior for the phone widget.
closesodoo/odoo#33460
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Currently, an editable list view (`editable` set) makes its cells editable. However, if
the attribute `edit=false` is set (from context key or from access right restriction.
See _postprocess_access_rights method of `ir.ui.view` for more details), the list view
should not be editable, but is still.
This commit makes the 'editable' property of the listview checking the `edit` attribute
and provides some tests.
Task-32612
closesodoo/odoo#21613
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
For signature field widget, we can set 'full_name' node option, which can be
used to auto fill the sign. However, current implementation for getting data
for field provided in 'full_name' (mainly, a string) has some flaws.
For example :
-In case of m2o fields, the string is not properly fetched due to different
structure than regular 'input' fields
- In case of x2m views inside a form view, field with same name can exist in
both parent record and child records. This is already the case with form view
of res.partner, where 'phone' field is there in both parent's form as well as
children's kanban view (for field 'child_ids'). With current implementation,
if we add signature on the form view, and set 'phone' as 'full_name' node
option, instead of form view, we will get phone number from 'child_ids'.
This commit improves the behavior by getting data from the 'recordData' instead
of searching them from the DOM. To have recordData in it's latest state, we've
set 'resetOnAnyFieldChange' flag to true.
task-1948364
closesodoo/odoo#33105
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
The disconnected/connected notifications were broken due to changes in
the way the Notification template was loaded. We need it loaded in
assets as we cannot load it afterward if the server is disconnected.
This was broken by : https://github.com/odoo/odoo/pull/32793closesodoo/odoo#33252
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Purpose
=======
Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.
It is confusing for users to see the records from the company he is connected to
and the records of the children companies.
Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.
/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.
Specifications
==============
1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.
2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.
3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.
4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.
5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.
6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
the correct company, re-copy/paste -> Ok.
7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids
8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.
9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.
10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.
11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624
12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.
13/ Introduce a res.group to enable/disable the multi company per tab
feature.
14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.
15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.
16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.
17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.
TaskID: 1960971
closesodoo/odoo#32341
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Since saas-11.3:
Bootstrap sanitizer sanitizes html and removes attributes which are not
defined in whitelist, here is the documentation link:
https://getbootstrap.com/docs/4.3/getting-started/javascript/#sanitizer
Restore sanitize=false for bootstrap popover.
A scenario where the sanitizer will break a popover: compare 2 products
and open Compare popover and try to delete a comparison item from the
popover -> item can not be deleted because data-product_product_id has
been removed by sanitizer and so the item can not be deleted because
deletion logic depends on data-product_product_id.
Reference commit: https://github.com/odoo/odoo/commit/36caf5fc16b5a95a0bf37f08f0caf974683b2df6
Closes https://github.com/odoo/odoo/pull/31961
task-1950702
In the context of a livechat session, a placeholder that looks like a
person is better than a generic "missing picture" one, when the user has
no public avatar.
In order to allow a different placeholder without exposing a public
placeholder parameter, a separate route is introduced for the
purpose of displaying user avatars:
/web/partner_image/<id>/<field>/<model>
and can be simplified to:
/web/partner_image/<id> for loading a partner avatar (`image_small`).
The common part of the /web/image route was moved into a helper
function that is not directly exposed.
Task-ID 1924666
Closes#32664
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
- Install the 'Maintenance' app
- Create a maintenance request, set a day and a duration of 6 hours
- Go the calendar view, month mode
- Move the maintenance request from one day to another
The duration is changed with a non-sense value.
In month mode, the hours are not represented in the calendar so it is
not possible to compute the `date_delay`. Moreover, when a record is
moved from one date to another (`_onDropRecord`) in month mode, there is
actually no point recomputing the duration; the `date_start` is enough.
Note that `date_delay` is used (at the time of writing) in 2 views and
absolutely not tested.
opw-1984637
closesodoo/odoo#33193
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Following f4fbaf1efa
which changes the label/checkbox structure into:
```
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1">...</label>
</div>
```
So, before this commit, there may have been multiple input with the same Id.
The consequence is that, when clicking on a label, the browser would take the first Id it found
which was erroneous, because all checkboxes in Favorites menu had the same Id
In reality, the use case goes as:
- open a x2m,
- search more
- Favorites > Save current search
> click on one the two checkboxes
> The dropdown closed, without checking the box
After this commit, when clicking on the checkbox in the favorites menu
the checkbox is toggled and the dropdown stays. Also, the checkboxed have now unique ids
OPW 1974587
closesodoo/odoo#33032
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This rev. disables Popper.js 3d transformation for positioning
bootstrap dropdowns in navbar, as this transformation causes a
rendering issue on webkit-based browsers (the text in the dropdown
is blurry).
See https://github.com/twbs/bootstrap/issues/23590
Note that it has already been disabled for the other menu dropdowns
(user menu, debug menu) by rev. 5373db1.
Another solution would have been to override the default value in
our bootstrap.js extension file, but for dropdowns that aren't in
the navbar, the dynamic positionning could be interesting.
Fixes#33096closesodoo/odoo#33174
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Arabic customers are complaining the Lato font is very odd looking for
Arabic scripts. Furthermore, since #32312 Noto is used as the prefered
font to display arabic scripts.
The classes are used by the "Company Tagline" configured along with the
template in use in the general settings.
opw-1946109
closesodoo/odoo#33141
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
The `read` done by `_fetchRecord` in `basic_model.js` expicitly set a
`bin_size: true` in the context. That context option tells the backend
to send the size of the binary payload instead of the payload itself
thus slim the response size. Frontend widgets are then responsible to
fetch the actual payload in a separated http req.
The `search_read` done by `_searchReadUngroupedList` didn't set the
context option thus all the binary fields were sent b64 encoded along
with the `search_read` response.
opw-1963842
closesodoo/odoo#33014
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Open a record with a chatter (ie an opw task), add an attachment, enable
debug mode and click on "Set Defaults" in the debug tools, traceback.
The `message_attachment_count` field is a special view added by the
chatter on the form view. This field exists on the view but is absent on
the list of field listed by the XML file. Setting a default value on
that special field is not supported.
opw-1972372
closesodoo/odoo#33044
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>