summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/graph/graph_renderer.js
AgeCommit message (Collapse)Author
2021-05-31[FIX] account, mail: link attachments to invoiceAdrien Widart
When using the "Send & Print" functionality, if the user adds an attachment, the latter won't be linked to the record. To reproduce the error: 1. Open a posted invoice 2. Send & Print 3. Attach a file > Select a file on your device 4. Send the email Error: The invoice's PDF is added to record's attachments, but not the other file (from step 3). When the module selects the attachments that need to be linked to the invoice, it only keeps the ones currently linked to `mail.compose.message`: https://github.com/odoo/odoo/blob/6441ab71cb68648aa735057952bf757677a20ee3/addons/mail/models/mail_thread.py#L1719-L1725 This is correct when the user creates a message directly in the chatter. However, when the mail is created thanks to `Send & Print` functionality, the attachment is linked to `account.invoice.send`. Another flow have a similar issue: from invoices list, select few ones, Action > Send & Print: the generated PDF won't be attached to their invoice. In such a situation, here is the source of the problem: https://github.com/odoo/odoo/blob/05ad6c477f7da2a495e5baf5b4629323b9d11fa0/addons/mail/wizard/mail_compose_message.py#L363-L367 There isn't any information about the invoice, therefore it is not possible to linked the attachment to it. OPW-2438457 closes odoo/odoo#71425 X-original-commit: e87f599d4eb22250b628d650b9f59b54db8d043c Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2020-08-14[IMP] web: support action helper on gantt viewDhruv Patel
Currently, only List and Kanban view supports the action helper and display the folder icon with the helper text. With this commit we have also provided the action helper support for other views. The logic for no content helper has been moved in abstract_renderer.js so that it can be accessed by all views. This was done mainly to give the action helper to the gantt view. closes odoo/odoo#53902 Task: 2284779 Related: odoo/enterprise#11563 Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-08-12[IMP] web: sample data in graph viewMathieu Duckerts-Antoine
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>
2020-06-22[IMP] web: disable keyboard navigation with sample dataJulien Mougenot
Previous commit introduces the sample data feature in list and kanban views. When sample data is displayed, most parts of the renderers can't be clicked on, to prevent the user from interacting with sample records (e.g. to open a sample record in form view from the list). This commit disables keyboard navigation as well, as those sample records could still be accessed with the keyboard. To do so, several refactorings have been done in views: - _giveFocus function added on controllers (so that we can hook on the moment where we want to focus the renderer, and prevent it in sample mode), it kind of replaces giveFocus of ActionMixin which wasn't use from the outside - updateRendererState -> _updateRendererState as it is private - _setState function added on controllers, to have a hook when we set a new state (already existed, but only in kanban) - _renderView function moved from Basic to AbstractRenderer, so that we have a proper hook to deactivate clickable elements in sample mode Task 2232801 X-original-commit: 4482a03fe2f083f4f44fc6eb76d90ae22afbff91
2020-05-28[IMP] web: cursor pointer on hover graph legendMohammed Shekha
Before this commit: hovering on graph legend shows cursor default here hovering on legend should display cursor pointer, so user can easily understand it is clickable element After this commit, hovering on graph legend will display cursor pointer. task-2263703 closes odoo/odoo#52030 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-05-19[IMP] web: graph: add bar/line chart sortingPriyanka Kakadiya
PURPOSE Currently, reporting views such as the bar and line charts have their x-axis sorted either alphabetically or according to a sequence. When reporting, the user would be interested in sorting the x-axis values by their measure. SPECIFICATIONS Add 'ascending' and 'descending' options in graph view for bar and line charts Task 2070103 closes odoo/odoo#49970 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Mohammed Shekha <msh@odoo.com>
2020-03-31[IMP] web: graph: drill down to records in bar/pie chartsDhruv Patel
After this commit, in the graph view, when the user clicks on parts of the bar and pie charts, it opens the list view of the concerned records (like what was already done in the pivot view). This is the default behavior, but it can be deactivated by setting the attribute 'disable_linking' to true in the view. Task 2198461 closes odoo/odoo#47796 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-03-18[FIX] web: graph view ignores duplicate labelsjerome hanke (jhk)
Steps to reproduce: - install recruitment - go to recruitment > configuration > job positions > duplicate a job and keep the exact same name as the original > change the department - add any application to the newly created job position - go to recruitment > applications > all applications > select the graph view > group by job Previous behavior: you only see one of the two jop positions with the same name the graph view does not handle multiple labels with the same name and only keeps the latest values when rendering Current behavior: duplicate labels are suffixed to prevent the view from confusing them opw-2214284 closes odoo/odoo#47948 X-original-commit: a77086f8bcb4498361d1183ba8af3d0663cd031b Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2020-02-25[FIX] web: graph renders only finer date groupby optionMathieu Duckerts-Antoine
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
2019-09-20[FIX] web: always show the graph view button "Stacked"Mathieu Duckerts-Antoine
With the actual code, some computations are done in the graph renderer to determine if it is worth to show the "Stacked" button in the graph view control panel for the data on hand. It turns out that that problem is not satisfactorily addressed and is quite hard from a usability perspective. We prefer to restore the old behavior as long as we don't have better ideas. closes odoo/odoo#37188 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-08-14[MERGE] forward port branch saas-12.4 up to 98a55917a60Christophe Simonis
2019-08-08[FIX] web: avoid graph flickering on firefoxMathieu Duckerts-Antoine
The way in which graph tooltips were created and positioned used to make the graph flicker on firefox. This fix solves that problem by choosing a fixed initial position for the tooltip before recompute it (when the necessary information to choose a correct position is available). closes odoo/odoo#35552 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-07-16[FIX] web: no forced date matching in pie chartsMathieu Duckerts-Antoine
In a graph view in mode 'pie', a matching of dates was attempted each time a comparison and a grouping of data using the same date/datetime field was done. Unfortunately, since the read groups results are ordered using the order of groupbys, the matching was not sensible in case the date/datetime field was not the first groupby. We thus restrict the matching to the sole case where it is sensible. More work should be done to have sensible matchings in all situations. closes odoo/odoo#34379 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-07-16[FIX] web: style chart elements in graph views only locallyMathieu Duckerts-Antoine
The elements style was set globally and thus used to modify the style of any chart in Odoo after the first loading of a graph view. For instance, the charts drawn in sale_subscription_dashboard are not the same before and after the first loading of a graph view. This is fixed by this commit.
2019-07-30[IMP] web: graph legend always on topMathieu Duckerts-Antoine
2019-07-30[IMP] web: fill area for unique line chart groupMathieu Duckerts-Antoine
2019-07-30[REF] web: fix graph view code typos and formattingVincent Schippefilt
2019-07-30[IMP] web: make sure all non zero datasets are visible in graph viewsMathieu Duckerts-Antoine
2019-07-30[REF] web: review inline doc of graph rendererMathieu Duckerts-Antoine
2019-07-30[IMP] web: tooltips on graph view legend itemsMathieu Duckerts-Antoine
Graph view legend items are shortened when ther are too long. Here we add tooltips on hover to allow the user to see the full text of items that were cut. We also improve a bit the way items are shortened. Co-Authored-By: Thomas Werland <twe@odoo.com>
2019-07-30[IMP] web: bar charts not stacked if not enough datasetsMathieu Duckerts-Antoine
Co-Authored-By: Thomas Werland <twe@odoo.com>
2019-07-30[IMP] web: custom tooltips in graph viewMathieu Duckerts-Antoine
Co-Authored-By: Thomas Werland <twe@odoo.com>
2019-07-17[REF] web: factorize no content helperAaron Bohy
Different templates were defined for graph, pivot and cohort views for the no content helper. Those templates were similar (only the message sometimes slighlty changed). This rev. creates one generic template used by those three views. closes odoo/odoo#34916 Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
2019-04-01[IMP] web: use Chart.js in graph viewMathieu Duckerts-Antoine
It has been decided to use Chart.js instead of nvd3 to render charts. In this commit the graph view has been largely rewritten to benefit from the options offered by Chart.js. Task ID: 1946138
2019-04-01[IMP] web: graph view improvementsMathieu Duckerts-Antoine
This commit extends the support of comparison mode for the graph view and refine the tooltips and rendering in line mode. The graph view code has also been slightly refactored. Task ID: 1946138
2019-03-06[REF] web: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-02-26[MERGE] forward port branch saas-12.2 up to fcb972db9dcChristophe Simonis
2019-02-21[MERGE] forward port branch 12.0 up to b2db72c9d13Christophe Simonis
2019-02-21[MERGE] forward port branch 12.0 up to 84143a34b31Christophe Simonis
2019-02-21[FIX] web: several columns in line chart tooltips for large dataHiral Bhavsar
Currently tooltip goes out off the screen when the graph view (in line mode) presents a large number of groups. The present commit splits the tooltip content in three columns when the number of groups exceeds 20. This split is not done in mobile mode because it is not an appropriate in that situation. Co-authored-by: Mohammed Shekha <msh@openerp.com> Related to Task: 1917958 closes odoo/odoo#30288
2019-02-21[IMP] web: properly display min and max abs when less that 3 abs.Hiral Bhavsar
In graph line mode, min and max abs are displayed beyond the screen when there are less than 3 abs. This is happening because nvd3 fixes their text-anchor to 'middle'. The present commit fixes correctly their text-anchors to start and end respectively by using the '!important' rule (it seems difficult to do otherwise). Co-authored-by: Mohammed Shekha <msh@openerp.com> Related to Task: 1917958
2019-02-25[IMP] web: graph view legend and tooltips improvementsJuhil Somaiya
This commit ameliorates the tooltips and the legend of the graph view in its different modes (bar, line, and pie). Related task id: 1917940 Co-authored-by: Mohammed Shekha <msh@openerp.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> closes odoo/odoo#29747
2019-02-20[IMP] web: group by more than two fields in graph viewjpr-odoo
Before this commit: select more than two groupbys in a graph view would have no impact at all if mode 'bar' or 'line' is selected. This commit allows to correctly handle more than two groupbys in all modes. Task ID: 1917948 closes odoo/odoo#29673
2019-02-14[FIX] web: first and last line chart x label shownNicolas Lempereur
The graph view displaying a line chart has had some recent changes in b23a9813202. Now it is of the full width of container but when there is less than 4 labels (thanks to c4937132a38) the first and last labels may be cut because they are by default aligned on the middle with its tick (so for the first label, the half left may be missing, and the last the half right may be missing). With this change, we align labels as expected. This could be done in CSS sheet (with `.nv-axisMin-x > text { text-transform: start!important; }`) but here it is done only in the given instance. opw-1917560 closes #31116
2019-01-31[MERGE] forward port branch 12.0 up to cb8fefa8999Christophe Simonis
2019-01-24[FIX] web: bar chart no crazy with 2 group byNicolas Lempereur
In 3d2ca8104e4 some change were introduced to the graph view. But part of it had no sense when displaying data over 2 group by. eg. if the first level has 2 groups (2018, 2019) and each second level 2 groups (Done,Cancelled), we could have: 2018/Done: 0 2018/Cancelled: 5 2019/Done: 8 2019/Cancelled: 9 this gives us two main groups [2018: 5] / [2019: 17], the code remove the 2018 because [2018/Done] is 0 so we have something odd with columns not in order, and in stacked bar chart some part of a bar at the wrong offset opw-1932517 closes #30529
2019-01-08[FIX] web: graph view translationNicolas Martinelli
The control labels 'Grouped' and 'Stacked' are not translated since they are default values from nvd3. opw-1908220 closes odoo/odoo#29975
2019-01-14[MERGE] forward port branch 12.0 up to 6a0675d36ddChristophe Simonis
2018-12-12[MERGE] forward port branch 12.0 up to 047e2b28de4Christophe Simonis
2018-12-07[REF] web: move ControlPanel inside controllers/actionsGéry Debongnie
This branch introduces a large-scale reorganization of the component tree generated by the web client. The short version is that now, the control panel is a child of the view controller and no longer a sibling. Graphically (and simplified), we go from this: webClient / | \ ... ... actionManager / \ controlPanel viewController / \ to this: webClient / | \ ... ... actionManager | viewController / | \ ControlPanelController / \ CPRenderer CPModel The motivation is that this work moves the code where it should be. Before this commit, it was kind of weird to have code in the controllers to render buttons outside of their root node (in renderButtons). Also, the action manager had to take care of coordinating search view states between view transitions. So, this work simplifies the code. It also makes it easier to extend. We see day after day that Odoo needs to take care of more complex UI needs, and in many cases, these needs were quite difficult to implement (we prefer spaghettis in our plates, not in our code). The changes in this branch should open the way to implement these features. For example, - it will now be easy to add the possibility of views (for example, the search view or a new ControlPanel view) to add custom buttons (of type action or object) in the control panel. - Another need will be to serialize/ restore the state of the search view across action boundaries (needed by the dashboard). - Another example is the possibility for views to customize easily the presence/absence of sub menus (filters/groupbys/favorites/ time range/...) - Another need is an easier way for views/client action to customize their control panel. This commit also contains a large rewrite of the search view (so it is more inline with our architecture and easier to maintain). Part of task 1893568 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com>
2018-12-06[FIX] web: prevent crash in line chartTejas Shahu
Before this commit: While user was opening first time line chart graph, at that time undefined label values were not being converted into undefined string due to misplace code. So it was giving traceback error After this commit: Code has been moved to proper place. Joint work with msh-odoo Issue-ID: 1882328 closes odoo/odoo#29306
2018-10-23[REF] web: small refactoring pass on some web componentsAaron Bohy
(mainly views and ActionManager) - add missing docstrings - fix typos - correctly order functions and imports - put functions in correct sections - stop using 'event' as argument of handlers - don't call handlers directly - remove trailing spaces/tabs - move module created in stable version to its own file - follow js guidelines in general closes odoo/odoo#28024
2018-10-16[FIX] web: line chart x ticks labels overlappAdrien Dieudonne
Before this commit, we tried to hide some labels depending of the available size of the graph. However, it doesn't worked when the graph is updated. A much simpler solution is to use the scale’s automatic tick generator implemented in D3. So, in this commit, we realized that 'tickValues' is unnecessary because data are passed correctly (see 'svg.datum(data);') and labels are defined in 'ticksLabels'. There is nothing else to do. We had to remove the skipped test because 'renderEnd' is not triggered for line chart. We need to update nv.d3. We already tried to fix this issue in the following commit: https://github.com/odoo-dev/odoo/commit/c4937132a38873761fa0ac0b41c983b917cb52f1 Documentation: https://github.com/d3/d3-axis#axis_tickValues closes odoo/odoo#27828
2018-10-02[FIX] web: avoid no content helper for pie chart in comparison modeAdrien Dieudonne
In comparison mode with no data, we render two empty pie charts even if it's not an embedded view. The non content helper is still used when there is no comparison.
2018-10-02[FIX] web: fix update problems in graph viewMathieu Duckerts-Antoine
The graph view was not updated correctly with respect to time range menu data. We fix that problem in this commit.
2018-10-01[FIX] web: right labels in bar chart and comparison modeMathieu Duckerts-Antoine
For a single groupby selected, the graph view didn't render well the data when simultaneously in bar chart and comparison mode. The labels were in that case always integers. This commit fixes that situation.
2018-10-01[FIX] web: line chart x ticks labels overlappAdrien Dieudonne
This commit hides some labels depending of the avalaible size of the graph. We had to skip some test because 'renderEnd' is not triggered for line chart. We need to update nv.d3.
2018-09-26[FIX] line chart: show tick labels on x axesAdrien Dieudonne
Before this commit all x axis labels were not displayed because ticksLabels was empty. Now, we show all labels except the first one and the last one because they are truncate. We need at least two intermediate labels to know the scale and the direction. So, we only remove labels when there is more than 3 data points.
2018-09-26[REF] web: design adjustments for dahboard viewsri-odoo
2018-09-25[FIX] web: undefined graph when pie chart has no dataAdrien Dieudonne
Before this commit, a crash occured when the no content helper was rendered on an pie chart without data.