Currently kanban columns propose an Archive / Unarchive option if the
records model has an active field. It allows to directly archive or
restore all records belonging to that column. It is currently not possible
to control whether this option is present or not as it only depends on the
active field being defined on the model.
In some specific cases we want to be able to hide this option even if the
active field exists. For example future commits will hide this option for
leads (crm.lead) as business flow goes through marking them as won or lost
instead of archiving / restoring them.
This commit adds support of a new archivable parameter when defining the
kanban view that hides the archive buttons if it is set to False. Default
value is true so that current behavior is kept as it is by default.
Doc and tests are added.
This commit is linked to task ID 1880051 and PR #26977.
Purpose is to add a width on dropdown 'box' in order to have long labels
like 'Set cover image' being squeezed against the border.
This commit is related to task ID 1884053 and closes PR #26936.
The change of navbar color from blue to purple in community,
also changed the the background color of the search facets were light purple
before this commit.
This commit fixes the background color of search facet to light gray,
which should look almost the same as before the change above.
This commit improves UI of charts:
- Reduce margins of svg
- Put ticks label on right of y axis
- Bigger lines (line chart only)
- ligther area color (line chart only)
- Hide y axis line
- Force charts to begin at y=0
- Hide zero tick on y axes
There is no test because these changes only concerns visual effects.
Task ID: 1877588
Before this rev., the pie_chart widget was rendered from scratch
with nv.d3 and we had duplicated code.
In comparison mode, two widgets were instancied and it was a bit
difficult to synchronize the size of these svg graphs.
nv.d3 graphs are attached when the dom is ready because it needs
to calculate the available space. UI bugs can appear if the dom
changes... .update() must be executed on the graph to avoid this
as we already do in graph renderer.
So now, the rendering of the pie_chart widget is done by the
graph renderer.
As comparaison mode is supported by the rendering, only one
widget needs to be instancied.
Task ID: 1835644
This was necessary because the rendering was always determining
which app item should have the class 'active'.
This was an issue with the 'Click Everywhere Test': at the beginning
of the script, it gets the jQuery element that matches all nodes
`a.o_app` in the app menu. When an app item is clicked, it re-renders
the whole app menu, so that older referenced nodes are detached from
the DOM. As a result, clicking on them no longer works, because it
never triggers the MouseEvent `click .o_app`.
This commit fixes the issue by rendering the whole app menu once.
When an item in the app menu is clicked, it dynamically changes
the `active` app.
The navbar in community now looks more like the navbar in enterprise.
Here is a sum-up of the changes in community:
- The navbar in community is now in blue, instead of black.
- No more app list that almost fills the whole navbar: there is
now an "Apps Menu" in the left-most side of the navbar.
- No more sidebar for the menus inside an app: those menus are
now located in the middle part of the navbar.
The navbar in community does not support mobile (< 768px width),
but it should still somewhat usable on most mobile devices.
As for the website navbar, it has been unchanged and should still
support mobile layout.
Task-ID 1878649
The datepicker lib has been updated to tempus dominus (BS4)
recently, but our code hasn't been adapted correctly to the
requirements of the new version of the lib. As a consequence,
the datepicker didn't close itself when the input was focused
out anymore.
This required a slight change in the DomainSelector widget as it
produced a crash when a focused datepicker widget is removed from
the DOM (before the datepicker is destroyed), e.g. by a call to
html() on one of its parent.
Task 1878254
Revision on https://github.com/odoo/odoo/commit/0de5c1f076d7e7d0e5361e08c810c727bd41d9e0
With the commit above, the following error was shown in the devtools
when accessing a frontend page without website that is installed:
missing module "[root.widget]"
This is caused by the fact that there is no root widget in the frontend
bundle without website installed. This may prevent executing tours
in some cases, because the tour manager needs a root widget to run.
This commit solves this issue by ensuring a root widget in the frontend
even when website is not installed, so that tour manager can run.
This rev. is similar to db9b91ff, but treats the x2many case.
Calls to the 'commitChange' function of renderers must not be done
inside a mutex, mainly since 241704536, as they could end up in a
deadlock. For x2manys, it was actually the case in practice in
Inventory > Operations > Inventory Adjustments > Create > select
'One product only' > select a product > try to edit the real
quantity in the editable list > focusout > deadlock.
The reason why the deadlock occurred in this view and not in, e.g.
sale.order, is due to the presence of the field_float_scannable
widget. Indeed, the barcode engine intercepts input events and
manually re-triggers them. As a consequence, the 'change' event is
not triggered on the field, and it does not notify the environment
of its new value by itself, until the field x2many asks it to
commit its value. Note that this might be an issue as well, as
onchanges are thus not triggered.
Task 1878254
Rev. f241441 recently added the possibiliy to define custom
controls (instead of the single 'Add a line') in editable list
views. However, it didn't take into account keyboard navigation.
Suppose that the focus is on the field preceeding the list, and
the user clicks on TAB, the code assumed that there was only one
control, and focused it. However, when there were several control,
the last one was focused (which is typically the less common one),
and there was no way to navigate to the others.
This rev. focuses the first control by default, and allows to
navigate through controls with RIGHT and LEFT. Pressing TAB still
moves out of the list, to the next field.
Note that i'm not happy with this fix, as the logic doesn't seem
to be in the right place. Indeed, the notion of controls is the
concern of the editable list, not the x2many field, so the list
should handle this logic by itself. Unfortenately, this is not that
easy to change, as for now the list doesn't even know that we are
navigating to/from its control(s), until we click on it/them.
Changing that will be for later, in master.
We also did a linting pass on the concerned code.
Task 1878254
We're not shipping the sourcemap files, and while the assets minifier
strips out the mappings they're getting hit in debug=assets which is
bot useless and problematic when running odoo-bin without a proxy for
static folders: if sourcemaps are enabled (which is apparently the
default in all browsers if devtools are opened at this point) the
browser tries to fetch the sourcemap, which does through the
SharedDataMiddleware which doesn't find them and passes the query on
to the regular Application which goes through the entire dispatch &
NotFound process.
If website is installed, that process ends up rendering website.404,
which can be pretty costly until everything is properly cached:
# initial request
"GET /web/static/lib/bootstrap/js/index.js.map HTTP/1.1" 404 - 319 0.198 0.954
# a few requests later
"GET /web/static/lib/bootstrap/js/index.js.map HTTP/1.1" 404 - 27 0.022 0.060
And the way sourcemaps are fetched (might be headers, might be the
stampede as browsers will try to fetch a dozen sourcemaps as fast as
possible) seems to make this problem much, much worse: instead of 300+
the requests take 800+ queries each, multiple seconds, and requests
get worse as time goes on (didn't investigate the exact reason for
that) *and* they apparently don't ever get cached (at least they don't
after half a dozen reloads of the client).
This will be used to add the 'Upload' button on the tree view of vendor bills, by extending the regular view.
Was part of PR #26740
Was part of task #1880089
This commit fixes the handling of the service parameter
in a mocked environment:
- updated docstring: now an object (previously an array)
- no longer used by mocked server (unused parameter)
- enforces default value for this parameter (empty object)
The test was failing because it was using an old approach to mock
services in JS tests. Also, it provides ajax service in the list
of services, which was not supported in a mocked environment.
With this commit, when an ajax service is provided in the test,
it will use this service instead of using mocked RPCs from the
mocked server.
cherry pick of 634de21b76
Before this commit, we had two different errors when data was
unavailable:
The first one is generated by Odoo: "No data to display, try to[...]"
The second one is generated by nvd3: "No Data Available".
We always want the same message.
So now, we always make some checks before rendering
the graph by calling _render.
opw-1874349
Hardening of commit:995610c065bf0242cb5023cfad2940234395739e
The JournalDashboardGraph requires nv, which is lazyloaded.
However it requires nvd3.js which is loaded after nv.d3.js.
A function called in destroy is defined by nv.d3.js,
which can make the crashhappen with the right (wrong) timing.
opw 1873749
The resequence mechanism works if the sequence is sorted by its handle field.
Therefore sorting on another field should lock the handle, while sorting on the
handle field should unlock the handle.
opw 1867049
Modal generic:
- Fix footer overflowing buttons by pushing them to a new line.
Page manager:
- Add an SEO column to easily see which pages have incomplete SEO.
- Add an edit SEO column to navigate to the SEO modal on said page.
- Hide "edit in backend" column as debug.
- Generally improve the whole view by adding appropriate titles on icons, etc.
SEO modal:
- Improve general style.
- Add description length alert.
- Restructure the keyword table/suggestions.
- Reset page meta to their initial value on Discard.
- Various small usability improvements.
PR: #26897
task-1850579
Before this commit, it was not possible to open systray menus in mobile.
This is due to popper.js that is wrongly dynamically positioning the
dropdown menu.
This commit fixes the issue by disabling dynamic positioning by popper.js
for the systray menus, so that it uses ou custom styles for dropdown menu.
Closes#26434
Revision on https://github.com/odoo/odoo/commit/d91ec258e6a31153beb9eb16cfe8f916546b7688
The commit above reverts a commit when we were using bootstrap 3.
The equivalent of XS in bootstrap 3 is SM in bootstrap 4.
So the correct revert with bootstrap 4 is to use SM.
Also removing useless style on 'o_mobile_menu_opened'.
Closes#26434
The report layout "background" has an image background from bottom to
top. When we transform the report in PDF, we have no idea in the
document of how many page, which orientation, width or height it will
take.
Thus to be able to have the background at the bottom of a page when
there is not enough content, we set a min-height for the body content.
This height was 1000px originally and has been decreased to 900px in
41c75ad0c3 because an empty page was possibly added (since the height of
body + header + footer was bigger than page size).
This issue is about getting a blank page when pdf is in landscape.
For example in A4 with 90ppi has a 1052px height in portrait, but 744px
height in landscape so we always get at least two pages with possibly a
blank one.
With this commit we lower it to 620px allowing 124px headers/footers.
opw-1881059
closes#26962
- added two new actions to the form view debug action list,
both opens list (+ form) views of messages and attachments respectively
for which the domain is restricted to the current record.
task: 1860031
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.
It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.
Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature. This allows us to increase the global
timeout for the js test suite without fear!
Backport of 611c836a46
This reverts commit 4cb585ab4f.
When creating from the kanban view:
- crm.stage
- hr.recruitment.stage
- project.task.type
- helpdesk.type
- mrp.eco.stage
We go from a dashboard of eg. "GroupRecord" named "group_id" in the
record. And when a stage is created, "default_group_id" is used. With
the change the stage was not linked to the current "grouping".
We could probably use "search_default_group_id" instead but the behavior
may be present in existing customization.
opw-1884217
closes#26943
Before this rev., there was a race condition making some tours
randomly fail on runbot, when the following steps occurred in that
order:
- load webclient
- as soon as the menu is ready and visible, click on a root menu
which thus leads to a doAction
- in the meantime, an RPC is done by the webclient to retrieve
the (optional) default action of the user (if there is no
state in the url, which is the case for tours in general)
- when that RPC returns, this action (if any), or the action of
the first menu is executed, thus leading to a second doAction
- the ActionManager using a DropPrevious, the first doAction is
dropped and thus the action linked to the clicked menu is
never shown, making the tour fail
This rev. uses the state of the ActionManager's DropPrevious to
prevent the default action from being executed if another action
is already being executed, thus removing that race condition.
Note that this fix is temporary, as the community webclient is
currently being refactored.
Due to the route beginning with 'test: ', it was interpreted like a
protocol and on some OS (ubuntu for example), a xdg-open prompt pops up.
So, the window looses focus and some tests will fail because of that.
Rev. db9b91ff removes a use of a mutex where it could end up in a
deadlock situation (and where the use of the mutex wasn't
necessary). However, it caused an issue as the following scenario
didn't work anymore:
- in a form view with a one2many with fields A and B (required),
with an onchange on A setting B,
- add a row and set a value for A,
- click on 'Save' directly (before the onchange RPC returns)
- whereas it should wait for the onchange to return before
trying to save, it tries to save directly but faces an unset
required field, and displays a warning to the user.
The reason is that, before saving, the FormController asks all its
widgets to commit their value (through a call to commitChange).
This call was, prior to db9b91ff, done in the mutex. The onchange
RPC being itself done in that mutex, we thus waited for the
onchange to return before calling commitChanges. After db9b91ff,
since there was no longer a mutex, commitChanges was called
directly, and the editable list returned a warning as one of its
required field was unset.
This commit ensures that commitChanges is called once all onchange
RPCs are done, by waiting the mutex to be idle.
Before this rev., if the user clicked on a tag to open the color
picker, and then clicked in the dropdown, but not on a color, the
color picker closed itself, and it was no longer possible to open
it again.
This issue came with the migration to BS4 and its following fixes.
As the color picker is now a classical BS dropdown, it closes
itself automatically, so we don't need to manually close it on
focusout.
Task 1878254.
Since 6dc37ee461 a d-none class was added to hide the menus in the
navbar during the start of the navbar. A timeout was set to mimic the
old behavior and let enought time to bind events on menus.
When the project app was installed alongside with all other apps on the
runbot, there was not enough place in the navbar. This resulted in a
race condition at the begining of the project tour.
With this commit, the d-none class is immediately removed and then the
menu are started (binded to events) before the tour has the hand to
continue its next step.