summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views
AgeCommit message (Collapse)Author
2019-04-19[FIX] web, project: consider context pivot_row_groupbyParth Patel
Fixing missed 'pivot_row_groupby' assigned to groupedBy in pivot_model.js in Load function (Already done in reload function), which was missed in commit 42f22a2. Added qunit test case for testing correct value. Apply pivot_row_groupby on user in project task-54027
2019-04-18[MOV] web, project: make cover image generic in kanbanSuraj Shukla
Previously, we could only set cover image on the kanban view of project task. This commit makes the feature generic so now cover image can be added to any kanban view. Technical notes: - field used to display the cover image has to be set as 'data-field' attribute on the kanban dropdown's menu related to cover image - developer will have to take care while designing kanban views with cover image ability in such a way that it does not break the design Task 32108 closes odoo/odoo#31731 Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-04-08[FIX] web: correctly update modifiers in editable list with buttonsMartin Geubelle
Since rev. odoo/odoo@015958d it is possible to add buttons in list group headers. These buttons are defined in <groupby> nodes, pointing to m2o fields. Modifiers specified on these buttons thus use fields on the m2o comodel. There was a traceback in editable list view, when grouping by a m2o that defines a groupby button with modifiers as the modifiers are not registered with the same datapoint. When updating the modifiers, one must ensure that the modifier are related to the updated record. closes odoo/odoo#32456 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-10[FIX] web: correctly forward-port 8d34eb1328.Christophe Simonis
I shouldn't have trust the comment and apply the patch anyway.
2019-04-10[MERGE] forward port branch saas-12.2 up to 2694174b410Christophe Simonis
2019-04-09[MERGE] forward port branch saas-12.1 up to af313858b4bChristophe Simonis
2019-04-09[MERGE] forward port branch 12.0 up to c1c322dd401Christophe Simonis
2019-04-05[MERGE] forward port branch saas-12.2 up to f2be461f090Christophe Simonis
2019-04-08[FIX] web: list: re-evalute modifiers depending on idAaron Bohy
In an editable (main) list view with modifiers depending on the record id, add a new record. While the record isn't created yet, the modifiers were correctly evaluated. However, they weren't re-evaluted when the record was saved (thus getting an id), and a reload of the view was necessary for the modifiers to be correctly applied. With this rev. they are now correctly re-evaluated when the record is saved. closes odoo/odoo#32483 Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-04-08[FIX] web: editable list: shift-tab and readonly fieldsAaron Bohy
Before this rev., navigating with shift-tab didn't produce the expected result when there were readonly fields on the way. For instance, pressing shift-tab on a field: - to the right of a readonly field: the focus was kept in the current field, whereas it should have been moved to the first editable field to the left of the readonly one - in the editable first cell of a row, with a readonly field in the last column: the focus was moved to the previous line, which is ok, but on the first editable cell of it, whereas it should have been on the last editable cell. @KangOl this commit needs to be forwardported up to saas-12.2, not later (the code slightly changed in saas-12.3, and we did another version of the fix).
2019-04-05[MERGE] forward port branch saas-12.1 up to f2d0995362cChristophe Simonis
2019-04-04[MERGE] forward port branch 12.0 up to 251021796c2Christophe Simonis
2019-04-03[FIX] web: Load correct form view for calendar popupLucas Lefèvre
When creating a record from a calendar view, the default form view is always used when using the popup mode, ignoring the `form_view_id` attribute of the <calendar/> tag. After this commit, the `form_view_id` is no longer ignored. closes odoo/odoo#32379 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-03-29[MERGE] forward port branch saas-12.1 up to c0cf4049b2aChristophe Simonis
2019-03-29[MERGE] forward port branch 12.0 up to 09fb2469b49Christophe Simonis
2019-03-29[FIX] web: fix error handling of _applyChangesVincent Schippefilt
After 5df4746c9aa144e6e3fce44fea43dac1089a5c51 the error handling has been changed inaccurately. This fix sets the error handling correctly. closes odoo/odoo#32247 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-02[IMP] web: list: directional keys navigation in readonlyDavid Monjoie
With this rev., it is now possible to navigate with arrows in list views (except when editing, as in this case hitting the arrows moves the cursor in the input/textarea), and to expand/collapse groups with keyboard navigation. Part of task 1915702
2019-04-02[IMP] web: fetch records alongside read_groupAaron Bohy
This rev. adds params to the 'web_read_group' method, allowing to search_read records inside each groups in a single RPC, instead of doing a 'web_read_group' RPC followed by n 'search_read' RPCs, where n is the number of opened groups. Part of task 1915702
2019-04-02[IMP] web,account: editable list: no more position absoluteAaron Bohy
Before this rev., widgets were absolutely positioned in table cells. This cause an undesired effect with text fields, as their textarea overflowed and overlapped the next lines. With this rev., wigdets are now statically positioned, and the cells height and width don't change when switching a row to edit mode. Part of task 1915702
2019-04-02[IMP] web: editable list: table-layout: fixedAaron Bohy
This rev. changes the layout of *editable* list views to a fixed layout. This means that we are now responsible of the width of each column. To do that, we associate with each field type a factor, and the higher the factor is, the larger the column will be (w.r.t. the others). This default value can be overriden in the arch. The fixed layout allows to remove the absolute positionning of widgets inside editable lists (done in the next commit). Part of task 1915702 Co-authored-by: Martin Geubelle <mge@odoo.com>
2019-04-02[IMP] web: allow mass update in editable listsMartin Geubelle
From an editable list view, if you select several lines then change a field, you are now asked if you want to apply the same change on all selected lines. If you accept, a write is directly performed (without applying onchange, as the records are reloaded and the view re-rendered). If you decline, the classic behavior still occurs. Part of task 1915702
2019-04-02[IMP] web,base: put buttons in list group headersMartin Geubelle
It is now possible to put buttons in the list view group headers. When the view is grouped by a many2one field, those buttons appear next to the header title when the group is opened. The buttons are specified in the views in a <groupby> tag in the list arch, with the following structure: <groupby name="groupedField"> <!-- must be a many2one --> <button type="object" name="my_method" string="Button1"/> </groupby> It is also possible to add `field`, inside the `groupby` which can be used for modifiers. These fields thus belong on the many2one comodel, like: <groupby name="partner_id"> <field name="name"/> <!-- name of partner_id --> <button type="object" name="my_method" string="Button1" attrs="{'invisible': [('name', '=', 'Georges')]}"/> </groupby> These extra fields are fetched in batch when grouping on the field. Part of task 1915702
2019-04-02[IMP] web,board: enable pagination in grouped listsAaron Bohy
With this rev., when there are a lot of groups in a grouped list view, groups are displayed under several pages, whereas they were all displayed in the same page before. This is especially interesting with the new 'expand' attribute, to ensure that we don't read records for a large number of groups. By default, the groups limit is set to 80 (like records), and to 10 is the 'expand' attribute is set to true. This limit can be overriden with the 'groups_limit' attribute. Part of task 1915702
2019-04-02[IMP] web: list: add expand attrsAaron Bohy
When this attribute is set to true on the <tree> root node, in a grouped list view, first level groups are automatically opened. Part of task 1915702
2019-04-02[IMP] web: list: editable grouped list viewsRavi Gadhia
This rev. enables the editable feature in grouped list views. Part of task 1915702 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com>
2019-03-29[MERGE] forward port branch saas-11.3 up to ec29b4d3648Christophe Simonis
2019-03-28[MERGE] forward port branch 11.0 up to 4231103cc99Christophe Simonis
2019-03-26[FIX] web: drag & drop month calendar->keep timeNicolas Lempereur
In fullcalendar, we have in f5b7ad80f fake moments date with UTC time that are the local time, thus when we move an event to another day, we need to set it as: - the selected year-month-day - the original utc hours (real local hours) -> local hours - the original utc minutes (real local minutes) -> local minutes - the original utc seconds (real local seconds) -> local seconds When it is sent to server, timezone offset will be removed so we will transfer to server the expected datetime in UTC. With this changeset we send server the correct time when a fullcalendar event is "all_day" but the original event was not (eg. drag and dropping event on the month view). Added test without change failed with: - 4. event moved to 27th nov 16h00 +40 hours timezone (expected "2016-11-29 08:00:00", result: "2016-11-27 16:00:00") - 5. expected: "event|6|11/27/2016|16:00:00" result: "event|1|12/09/2016|08:00:00" - 6. expected: "event|1|12/09/2016|08:00:00" result: "event|3|12/10/2016|23:55:05" opw-1955281 closes #32136 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-26[MERGE] forward port branch saas-12.1 up to f00c490be86Christophe Simonis
2019-03-25[MERGE] forward port branch 12.0 up to 11b1e12cde3Christophe Simonis
2019-03-25[FIX] web: format date without localeMartin Trigaux
moment().locale('en').format('YYYY-MM-DD') "2019-03-25" moment().locale('ar').format('YYYY-MM-DD') "٢٠١٩-٠٣-٢٥" moment().locale('my').format('YYYY-MM-DD') "၂၀၁၉-၀၃-၂၅" Was rejected as a valid bug at moment/moment#4448 Apply the same logic than 109b319d643b439 Fixes odoo/odoo#32081 closes odoo/odoo#32102 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-21[MERGE] forward port branch saas-12.1 up to 6878c9f3424Christophe Simonis
2019-03-19[MERGE] forward port branch 12.0 up to 82c4393fd02Christophe Simonis
2019-03-18[MERGE] forward port branch 11.0 up to 7e33b547714Christophe Simonis
2019-03-18[MERGE] forward port branch saas-11.3 up to 4e39328a76aChristophe Simonis
2019-03-14[MERGE] forward port branch 12.0 up to a26496b6e79Christophe Simonis
2019-03-14[MERGE] forward port branch saas-11.3 up to f5ab04ce509Christophe Simonis
2019-03-14[MERGE] forward port branch saas-12.1 up to ff1bca32f3aChristophe Simonis
2019-03-14[FIX] web: fix kanban_image when called for a different recordSébastien Theys
The issue is manifesting for example in the Contact kanban view where the company image should be displayed in small. Before this fix, the person image was displayed twice instead. Following PR #30881 and commit: f78b7a76d62d6b5f3e82f2f4a02b14981859df1f The fix introduced by the above commit highlighted another issue with the method: if the `model` and `id` given in parameter are different than the current record, the method returned the url for the current record instead of the requested record. To fix the issue, we return the `raw_value` only if the requested record is the current record. Otherwise, we return the manually built url. PR: #31842 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-13[MERGE] forward port branch 11.0 up to c23d1186e7bChristophe Simonis
2019-03-08[FIX] web: record datapoint context without group_by or orderedByLucas Perais (lpe)
Have a list view, apply a group_by and a filter with a sort parameter Click on one record to access the form view Have a x2m within it Before this commit, the x2m records were loaded with a context containing the keys orderedBy and group_by It seems harmless at first, but even conceptually those keys should not be here - they apply on a list of records, and not to individual ones - they may contain field names not existing in the x2m model Hence, when accessing another list view through an action button, the list will try to be orderedBy or group_by with the given context Which is plain wrong in the first place and may cause crashes After this commit, the context of a record datapoint (representing a single record) is stripped from the keys Read the opw for a concrete use case OPW 1943583 closes odoo/odoo#31706 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-08[IMP] web: allow to override the number of buttonbox buttonsFlorent de Labarre
See odoo/odoo#31546 closes odoo/odoo#31698 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-03-11[MERGE] forward port branch saas-12.1 up to 2b3296bbf8bChristophe Simonis
2019-03-08[MERGE] forward port branch 12.0 up to c023d0784f2Christophe Simonis
2019-03-06[FIX] web: pivot no result no remove groupbysNicolas Lempereur
Since f8b38f64d dictionaries "groupbys" are the same object between the pivot model instance and the headers menu. But this causes an issue in 12.0 since when there is no results, the headers menu groupbys is truncated and now being the same object, the pivot model instance is also truncated. So succedding search that find results would possibly have lost the groupbys which is unexpected and breaks some 12.0 tests not expecting it. With this changeset, the groupbys are not truncated anymore. Without the change, the added test fails with: Column groupby not lost after reload after empty results expected: { "pivot_column_groupby": [ "customer" ], "pivot_measures": [ "__count" ], "pivot_row_groupby": [] } result: { "pivot_column_groupby": [], "pivot_measures": [ "__count" ], "pivot_row_groupby": [] } closes #31644 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-06[FIX] web: update breadcrumbs when switching viewMartin Geubelle
To reproduce: 1. go on list view 2. open record in form view 3. come back on list view 4. switch to kanban 5. open record in form view 6. click on breadcrumb Before this rev. we were back on the list view, and not the kanban view. This is due to the fact that the breadcrumb was not updated when switching view, (if a controller was already existing) so the form view control panel breadcrumb was still referencing the wrong (list) controller. This bug appeared with the control panel refactoring, which is now managed by the view itself (and not the action manager as previously). Task 1932646 closes odoo/odoo#31598 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-05[MERGE] forward port branch 11.0 up to 27081bf6f5fChristophe Simonis
2019-03-06[FIX] web: keep col group by on 2nd reload+after 0 resultNicolas Lempereur
In 11.0 f8b38f64d improved the column group by managment when reloading several times by having the same "groupbys" dictionaries between the pivot model instance and the header menu. This has been reverted in 12.0 (with c6e7adfb95d) because the following pivot tests failed with the change: - 'rendering of pivot view with comparison' - 'export data in excel with comparison' The failure is because now that the "groupbys" dictionaries are the same object, the truncated dictionary of a header truncate the one of the model instance. So if we search something that has no results, then something with results, the groupbys could be lost. This behavior has no reason to be and is changed in 11.0 with #31644, this commit is the forward-port of f8b38f64d and #31644. closes #31627 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-02-27[FIX] web: correctly handle (no result) selection in searchMartin Geubelle
In the recent control panel refactoring, selecting '(no result)' (when using the autocomplete on a many2one for example) was no correctly handled and was leading to a traceback. It is now correctly handled and the search bar is correctly re-rendered. Task 1936745 closes odoo/odoo#31438
2019-02-26[FIX] web: keep col group by on 2nd reloadNicolas Lempereur
In 187c32c2 some improvements were made for conserving/restoring group bys on the pivot view. This introduced an issue on the column group by: - before reload, if we set manually a column group by (+ icon in the header) it would be saved and not lost (unless a context or filter in the search view override it) - after reload, the following manually set column group by are not saved anymore on subsequent reload (the column group by at the first reload are set back) This behavior is not normal since the behavior (conserving or losing column group bys) should be the same at first reload or second reload. The issue was caused by the duplication of group bys that were not synchronized (one on the column root header, one on the pivot model instance). Without the change, the added test failed with: "Column groupby not lost after second reload" and product_id is hidding from the object pivot_column_groupby dictionary (having only "customer"). Using _.clone on initialRowGroupBys was necessary change because without duplication of "groupbys", the initialRowGroupBys would be changed on expandHeader which is unexpected. opw-1941095 closes #31407