Currently, the method `on_attach_callback` is never called on any Widget in the
systray.
Calling `on_attach_callback` is required if any systray widget uses an OWL
component via the ComponentWrapper. Without the callback, the component is never
considered mounted to the DOM and no event handler is triggered.
closesodoo/odoo#46566
Related: odoo/enterprise#8887
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the company specific colors and font were
implemented by systematically overwriting a "virtual" report SCSS
asset file before rendering each report.
This caused many issues, forced frequent asset bundles recomputations
(performance problem + cache invalidation causing random bugs).
And it could simply not work in a multi-company setup where multiple
styles are involved, as the asset management could be made not
thread-safe.
PR #44225 was a first attempt to mitigate the numerous problems by
making the asset bundle invalidation less frequent. But the problems
were still present and a more complete solution was necessary for
multi-company setups.
Besides, the design of the bundle forbade making company specific assets.
This commit uses a different approach: instead of having a
company-specific asset that needs to be constantly updated, a global
"multi-company" asset is maintained and included in the report assets.
It only needs to be generated when a company style changes, not for
every rendering operation.
Unfortunately this change cannot be fully performed without updating the
template declarations, so it will require an update of the `web` (or
`base`) module to be operational.
As this represents a rather invasive change in a stable branch, extensive
testing was conducted to minimize the effects and ensure proper
degradation of features for production deployments where the new code
would be deployed without forcing an update of the `web` module:
- The report SCSS files were left untouched, to prevent any bundle
invalidation, ensuring that old cached assets would remain valid. This
means that single-company setups should not see any visible difference
after pulling the code (with or without updating `web`).
SCSS cleanup will be done later.
- Existing Python methods were kept but emptied, to make sure that
old templates and code would not crash.
- For multi-companies, the last used colors will be applied for all
reports until the `web` module is updated. The old behavior was not
working correctly anyways, so the degradation is actually limited.
- For all setups, changing the colors after deploying this patch will
have no effect unless the `web` module is updated.
/UPDATED FOR master on top of #44393/:
- removed the `res_company.update_scss()` method entirely
- fixed the report SCSS styles, as the variable names referred to the old
behavior, e.g. "$o-company-primary-color" is nonsense.
Renamed to "$o-default-report-primary-color" etc.
--
Improves #44225
Forward of #44393
opw-2168623
opw-2171040
closesodoo/odoo#46647
X-original-commit: a5b1421aecf27b1de408434d3bb6d7ac81f57dc3
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Issue
- Install Accounting
- Resize your window to have the more menu
- Refresh the page to make the JS working correctly
- Click on the item on the left of the more menu
- Do not close the menu just hover the more menu
=> It doesn't appears (the .show class is on the last <li> child instead of the parent)
Click on the more menu
=> It appears but small & with items broken
Cause
Without the :first, all the more menu dropdown where toggled
Issue
Add :first to the target to toggle
OPW-2178843
closesodoo/odoo#46553
X-original-commit: 55a4a834461446a070ad06d1b24d67fbc27799a1
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Co-authored-by: aab-odoo <aab@odoo.com>
Make the domain to match assets attachment more robust to avoid
deleting wrong files.
closesodoo/odoo#46523
X-original-commit: c92d63fa5baf09cb0969fcf4fbd5c28407af58ae
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
[IMP] sale_timesheet: add domain on sales order field
==========================================
A domain has been added to the Sales Order field
on project task so that the task and the so have the same
commercial_partner_id.
[IMP] sale: add kanban view for sale.order.line for better display on mobile
=========================================================
For a SO line on mobile it was displaying only the name of the line without
the SO number. It wasn't very practical for the users so we added this view
to display the display_name instead.
[IMP] web: change the default name of a column in kanban view
=================================================
This changes the name of the column in kanban view when the records
are grouped by date. The column name of the records with no date
went from false to Undefined.
Task-2188831
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#45646
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This changes the name of the column in kanban view when the records
are grouped by date. The column name of the records with no date
went from false to Undefined.
Task-2188831
Co-authored-by: jdoutreloux <jud@odoo.com>
Since formatBoolean returns a jQuery object, boolean fields were
displayed as [Object object] in pivot view.
so fix the issue of checkbox in the pivot view by not calling
fromatValue for boolean instead just set the checkbox element in
in template itself and added test case for checkbox in pivot view.
closes odoo/odoo#46445
Taskid: 2172258
Closes: #44299
X-original-commit: d7d0caf6f599f313687c958c5aff5764c0d23ffd
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The signature of method Component.__patch has changed in the last
version of owl.
closesodoo/odoo#46499
X-original-commit: 2954aa3ecd235d5ed6f537be21882390e8fcb808
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit updates owl from v1.0.4 to v1.0.5.
This last version fixes an issue in the home menu (enterprise).
Issue's task: 2196878
X-original-commit: cce932b9179c5acb6845b895b04312c937f8de96
A previous commit makes the graph view render only the finer interval
option for each date/datetime field.
The fact is that in the control panel, different options can be selected
in any order along with other groupbys. This can lead to situations like
'Foo > Date: Day > Bar > Date: Month'
and becomes unreadable.
For that reason we choose to regroup and order options. For the previous
situation, this leads to the following global groupby
'Foo > Date: Month > Date: Day > Bar'.
Our choice also make more sense in a list view for instance.
Task ID: 2198846
closesodoo/odoo#46269
X-original-commit: 59afc869233165e21ef94f485b91d33ac4543b24
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Rendering a graph view with several options selected for a given
date groupby can take too much time and block the page.
Since grouping on the same date/datetime field several times
barely makes sense in a graph view, we choose to use only the finer
option, e.g. 'week' is prefered to 'quarter'.
Task ID: 2198846
X-original-commit: 7e36bee14e18ca17e15de1bacb7ff26010d0b372
Have a grouped list view with enough groups to have several pages.
Go to the second page, and toggle a filter s.t. it only remains a
single page of groups.
Before this commit, no group is displayed (like if there was no
record matching the domain), whereas it should display groups of
page 1. The issue occurs because we didn't reset the group offset
to 0, like we do for the regular offset.
Bug reported in the v13 migration pad.
closesodoo/odoo#46257
X-original-commit: c6a4123b25e884495c5c44287d4d9fed061eeaa4
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Have a template of that form:
```xml
<t t-if=""/>
<!-- Comment -->
<t t-elif=""/>
```
Before this commit, both python and JS crashed because any type of node
between branching directive was forbidden
After this commit, Comments are just ignored and removed, while actual
template nodes are still forbidden between branching directives
There is no crash anymore
closesodoo/odoo#45899
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
If you have a currency with 3 decimals, when you show a list view
grouped, you might have result like:
[group partner 1 : amount : 4.4€]
- amount : 1.11€
- amount : 3.33€
which is a little odd, it is not that odd since the groupings are an
approximation (eg. you could have a line in EUR and a line in USD and
the grouping value would be the sum of both line).
But there is no way to specify another precision, and since this is a
grouping it could be of line of different currencies so we can't use the
lines currency to decide.
With this changeset, having for example:
<field name="amount" digits="[69,3]"/>
with `digits` attribute is taken into account for the aggregate value
and it would be displayed with 3 decimals.
Without the fix, the added test fails with:
aggregates monetary use digits attribute if available
Expected: "2000.000", Result: "2000.00"
opw-2195042
closes#45545closesodoo/odoo#46094
X-original-commit: 4dd293c71851d0c6e9ffe09402cf54cfe889f402
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Purpose of the task is allow to use a example stages in real project.
Added a button 'Use this for my project' in modal dialog of project
stages examples, by clicking the button, user can directly use stages
of an example in his project. if some stages already exists in project
then new stages will be added next to existing stages.
NB: The stage will be created in user's language. user have to manually add
transalation for en_US.
Taskid-2179536
closes odoo/odoo#44562
Closes: #44562
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
On the partners page, the class is not fully applied to the logos
because 'img-fluid' is applied first via the 'image' widget.
This cause max-width to be overriden with the value 100%, breaking
the partners pae layout.
closesodoo/odoo#45451
X-original-commit: 35bb2978d1af008ea8e84c664bc62f6fae0677db
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
The image illustrating some kanban cards (like "Employees" or
"Contacts") has a weird scaling and rendering on smaller screen sizes.
Step to reproduce (on small screen):
1. Open Employee
2. Apply a filter
3. Picture is ugly (shape changes to get something pretty weird)
This commit fixes it by:
1. removing the rounding which was only applied (sic) on smaller screens
2. adjusting the size and/or the margins of the image to keep its ratio
and the alignment with the other kanban cards.
Task ID: 2198419
closesodoo/odoo#45956
X-original-commit: dd5db84464998b45d0524055f9c96bcad894c4c9
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
PURPOSE
In various views, the min width of some columns is too short for the label of
the field. This task aims at fixing this by increasing some minimal widths
and relabeling some fields.
SPECIFICATIONS
crm
* in view_crm_lead2opportunity_partner_mass, view_crm_lead2opportunity_partner
add date widget on create_date and remove the phone field in the inline
treeview of opportunity_ids;
event
* in view_event_form set width of boolean field 'done' to 70px and in
view_event_mail_tree set string of field 'mail_sent' to 'Sent'
* in view_event_form_inherit_ticket set string of fields seats_max to
'Maximum', seats_reserved to 'Reserved', seats_unconfirmed to 'Unconfirmed'
and set width '100px' in the inline treeview of event_ticket_ids;
gamification
* in challenge_line_list_view and challenge_form_view set string of field
'target_goal' to 'Target' in the tree view and inline treeview of line_ids
LINKS
Task ID 2166865
PR #43401
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently when the company is created or updated the whole
web-client is reloaded
so write a qunit test case when a company is created or when
the data is written to the company for the web-client reload.
closes odoo/odoo#44714
Taskid: 2188789
Closes: #44714
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Commit 9a482fc introduced change for the document layout preview:
all "td" tag included in clearfix were in display: flex;
Because of this some styles were broken in form views on mobile.
We could have only put this rule in the right scope but
we preferred to fix this correctly.
Steps to reproduce:
- Go to Settings
- General Settings
- Click on Configure Document Layout
Related to task-ID: 2184243
closesodoo/odoo#45830
X-original-commit: 0206ee8f8a3652ae0eeb5aa78a94b92bd6e84921
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit ComponentAdapter warned on every update and render.
This can make a lot of noises when we use some adpaters.
After this commit ComponentAdapter will warn only in debug=assets mode.
closesodoo/odoo#45583
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
addEventListener supports an `options` argument, which can
be useful to listen on events during the capture phase
This commit allows to pass these options to the hook useListener
closesodoo/odoo#45478
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Before this commit the sentence was a bit weird as a date is not on the future but in the future. This commit resolves this.
closesodoo/odoo#45548
X-original-commit: b335c33655a707f71fbc01929f5eea2e659e7215
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
VAT, NIF in Spanish, is translated NIT in Spanish from Bolivia
Clean and translate the files with the correct translation.
opw-2197155
closesodoo/odoo#45533
X-original-commit: 641c14f08435b1df1d89184cc00855416bf40bc5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
- Open any product kanban view with missing images
A 404 status code is returned for missing images, while they are
replaced by a placeholder.
This can cause issues when configuring a specific 404 page in a reverse
proxy: the proxy will serve the custom page instead of the placeholder.
opw-2192663
opw-2192340
closesodoo/odoo#45157
X-original-commit: 2719c8a0e40f318787b4d7a46626de46a8fd33f0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This information is necessary for tours going from the backend to
the frontend (or the other way around) to run properly:
Some tour steps may be flagged with 'community' or 'enterprise',
meaning they must only be executed in the corresponding edition.
The TourManager filters the steps according to the edition. When
a tour is executed (either in test mode, automatically, or in an
onboarding situation, manually), the index of the current step is
stored in the local storage. So, the list of filtered steps must
be the same in the backend and in the frontend, which couldn't be
guaranteed as the frontend didn't have the information (thus always
considered being in community).
Part of task 2180175
closesodoo/odoo#45398
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Some functions defined in this file use another function present in the
same file through "this" keyword even if it's not needed.
This cause problems when these function are required in another file
using object destructuring.
This commit fix this issue by calling the function only by its name.
closesodoo/odoo#45299
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, the behavior of the phone widget was tested in web
as if it was always altered with module SMS
Giving wrong test results when sms module was not installed
After this commit, the separation is clearer, and the phone widget's
behavior is tested according to the modules it is altered by
closesodoo/odoo#45271
X-original-commit: 2e337516468797dd898c79c9669b5a90c83b56a7
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Issue
- Install CRM and at least 3 languages
- Deactivate one of them
- Go to CRM > Configuration > Activity Type
- Edit an activity type and try to edit translation
Traceback (Cannot read property '1' of undefined)
Cause
This is because all the translations are fetched
but we don't look if the language they use is active.
So at one moment, the relatedLanguage is undefined and
we do relatedLanguage[1]
Solution
Filter the translation, to keep only the ones with an
active language.
OPW-2193969
closesodoo/odoo#45215
X-original-commit: 9d1259da1bfd60362ec93996f723a4e378434dc8
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Picture of employees are maximazed directly which is annoying when
you move the mouse in kanban view.
Add the ability to put a waiting time before opening the zoom in
option of the field in the view (default value is 0).
closesodoo/odoo#45229
Taskid: 2191289
X-original-commit: a264b17d8fe18464df439d896ecb7dea106caa5a
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
* modify client-side domain normalisation to error if the domain is
invalid (not enough terms / segments for the number of operators)
* add better error reporting to attrs / modifiers parsing
* add a few layered error augmentation to provide clearer context
e.g. "error: invalid domain <thing>" is helpful but "error while
parsing modifiers for field foo: modifier invisible: invalid domain
<thing>" is much more helpful
* rework _evalModifiers to deduplicate it in order to more easily
implement this contextual augmentation
* test that improper domains are properly found improper
* fix a bunch of incorrect attrs domains
* also removed an apparently undefined (& unused) "options" argument
to a _applyModifiers call
closesodoo/odoo#44642
Related: odoo/enterprise#8175
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The translation alert dialog was attached to the entire view in case no
status bar was found. This resulted in the following layout on large
screens:
chrome
--------------------------------------
| alert dialog | form view | chatter |
| | | |
--------------------------------------
Whereas when a status bar was set on the form view, the rendering was as
follow:
chrome
--------------------------------------
| status bar | chatter |
| alert dialog | |
| form view | |
--------------------------------------
The fix make sure the alert dialog is always placed just above the form
view just like when there is a status bar.
closesodoo/odoo#44878
Task: 2075172
X-original-commit: dacdc30681510e9c2db23610c5be5285a72a8949
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
When grouping records in kanban view, if a quick create widget was
already opened, clicking on the "+" to launch another quick creation
would crash.
Fixes https://github.com/odoo/odoo/issues/44680closesodoo/odoo#44949
X-original-commit: b482df17058e6f2117b616e6b152a7f2c90dc121
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit the % symbol was part of the input. We could write a
value with the % symbol to divide the value by 100 (50% = 0.5, 50 = 50)
This commit removes the % symbol from the input and adds it in a span
after the input so we do not need to write the % symbol anymore.
The value from the input will be saved as $value / 100 in database.
task-2065078
closesodoo/odoo#43995
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, there was a discrepancy between
many2many_tags widget and regular many2many list
That is, in tag mode, when someone had read access alone on the comodel
he could modify the members of the m2m relation on the current model
Which couldn't be done in m2m list
After this commit, it is possible in a m2m list to add
records to a relation, even if we don't have CRUD access on the comodel
Task 44074
closesodoo/odoo#40194
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*: web
Before this commit, when a widget declared assets to lazy load through
the assetLibs key, the asset was loaded through a context-less call to
the server through the base `rpc` function. This caused problems in
website: the website ID was not given to the called route and the loaded
assets were then stripped of their specific-website parts.
This commit solves the problem by allowing the `loadLibs` and
`loadAsset` functions to receive an extra argument: an extra `context`
to use for the actual call to the server. The method is now available
in the ajax service, so that website can add its custom context
automatically, the same way it does it for normal `_rpc` calls.
Part of https://github.com/odoo/odoo/pull/44596closesodoo/odoo#44596
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: partner_autocomplete
Those cannot be properly lazy loaded by test widgets, so they are loaded
directly through test assets. Testing lazy loading should be part of
a dedicated test system.
Part of https://github.com/odoo/odoo/pull/44596
In 0.15 accessing werkzeug.urls functions directly through werkzeug
is deprecated, the shortcut will be removed in the eventual werkzeug
1.0.
Fix existing uses of these shortcuts. Also cleanup some imports when
they're not far from a werkzeug* import being altered.
The 'new' (read: the classes not in the 'compatibility layer section')
classes of the kanban views did not allow to cleanly separate an image
header from a content container.
This commit adds such a container, allowing a very simple layout that
should work all the time for a typical 'card with left image and right
content layout':
```xml
<div class="o_kanban_record oe_kanban_global_click o_kanban_record_has_image_fill">
<field class="o_kanban_image_fill_left" name="image_128"
widget="image"
options="{'zoom': true, 'background': true, 'preventClicks': false}"/>
<div class="o_kanban_record_details">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<field name="x_name"/>
</strong>
</div>
</div>
<div class="o_kanban_record_body">
<!-- some fields here (e.g. tags,...) -->
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<!-- some fields here (e.g. kanban status,...) -->
</div>
<div class="oe_kanban_bottom_right">
<!-- some fields here (e.g. user image,...)-->
</div>
</div>
</div>
</div>
```
Before this commit, the absence of a container for the right side meant
that the top/body/bottom were flex-growed in a flex-direction: row
element, appearing as 3 columns instead of rows.
The `FieldBinaryImage` assumes that the image mixin is used to manage
its fields - this is mostly true, until you use custom fields.
This commit makes using the 'background' option of the Image widget
possible by fallbacking the thumbnail field's name to the name of
the field itself instead of `image_128` when we're dealing with a custom
field.
If an automated action raises an exception, in the traceback modal:
- For admins, display Disable & Edit automated action buttons
to be able to directly know with wihch automated action the error occurred,
and to give the possibility to edit or disable it quickly,
- For regular users, just add a paragraph to tell with which automated action the error occurred,
so they can give this useful information to their administrator
This is specially useful for databases which have just been
upgraded to a newer version, and for which the server action
is failing because its code is no longer supported.
closesodoo/odoo#44513
X-original-commit: 8f3940c132bbbc99e47fa3f0cba0e768159d9af2
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Issue
If month - 1 or month - 2 are in the previous year, the filter is
incorrect.
ex: Date = Jan. 2020, Filter = Dec. 2019
=> last_year__last_month = 2018-12 instead 2019-12
Cause
If date is 2020-01-20
Selecting December => adding param "last_month"
Selecting 2019 => adding param "last_year"
Applying "last_month" => date become 2019-12-01
Applying "last_year" => date become 2018-12-01
Solution
Detect the right year to activate by default
when a month is selected and no year is selected.
With that solution it is not possible to get records in Jan. 2020
or in Dec. 2019 only for instance but the global functioning
of date filters stays the same as before.
OPW-2169528
closesodoo/odoo#44208
X-original-commit: 096fdc7d3fe0799aa761c6ad3597569a002c698e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Jason Van Malder <jvm@odoo.com>
Purpose
=======
At the second res.company creation, the multicompany mode is 'enabled'.
But to get the company selector dropdown, the user needs to reload the page.
Specification
=============
Force a reload at res.company creation, similarly to the forced reload when updating the language (lang) of the user.
closesodoo/odoo#44386
Taskid: 2127257
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Due to commit https://github.com/odoo/odoo/commit/7ecae3357117b1fd9889540556d5eba14ef8f237
which is introduces Next Activity icon on kanban cards at left bottom
of the card in contacts
however, this change effects other kanban cards making image and
details separated, such effected kanban views are ratings in project,
products and channels in live chat so fix the layout issue for all the
above kanban cards and it will not effect the contact kanban view.
taskID-2183676
closes odoo/odoo#44349
Closes: #44349
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit adds the new AbstractField class written in owl,
meant to be extended by specific Field owl implementations.
Note that its API is not complete yet, but it is enough for
basic usecases.
This commit also adapts the BasicRenderer to instantiate the
future new fields that will be written in owl.
closesodoo/odoo#43759
Related: odoo/enterprise#7872
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit's intention is to bring class inheritance of event handlers
to components.
Use case:
A component class may want to set generic event handlers for all classes
inheriting from it, in order to set shared event behavior from the start
It is the case in many parts of Odoo, in particular in the cases of fields
which need at least to react on some keyboard event for navigation
The way to implement such a behavior is to make use of the
`useListener` OWL hook, by passing as arguments
event name and the handler function