summaryrefslogtreecommitdiff
path: root/addons/web/static/src
AgeCommit message (Collapse)Author
2019-02-08[MERGE] forward port branch 11.0 up to 9553240adc4Christophe Simonis
2019-02-07[FIX] web: calendar: take locale to format datesLucas Perais (lpe)
Backport of d9fed5381a78c19ce14ddc8b9233f60d53c65453 Before this commit, when opening the calendar view with a specific locale in the "week" view the days were translated but the date format was wrong and fell back to english This was because the translated terms were passed explicitly, but the locale did not get passed After this commit, we do what it takes to pass the locale to fullcalendar and the dates are formatted with the right pattern Also, there may be a bug in fullcalendar, because just passing the locale in the options won't work, it should be instanciated first in fullcalendar's "locales cache" OPW 1922092 OPW 1934127 closes odoo/odoo#30909
2019-02-05[MERGE] forward port branch 11.0 up to e0b14bf9a7aChristophe Simonis
2019-02-04[FIX] web: correct list view caret positionqsm-odoo
Through many design refactorings, the community caret position was broken while the enterprise was not. This commit removes the breaking rule to put it in enterprise only. closes odoo/odoo#30799
2019-01-29[MERGE] forward port branch 11.0 up to 36d96e01503Christophe Simonis
2019-01-29[MERGE] forward port branch saas-15 up to 788684a5ddcChristophe Simonis
2019-01-28[MERGE] forward port branch saas-14 up to aaa2035bcf7Christophe Simonis
2019-01-28[MERGE] forward port branch 10.0 up to 4a5862a492fChristophe Simonis
2019-01-28[FIX] web: add exponential backoff strategy for lost connectionGéry Debongnie
Before this commit, the web client had a naive strategy to handle lost connections: it tried to poll the server every 2 seconds until a rpc succeeds. This works quite well from the perspective of the user, but may be a problem from the perspective of the server. If a server is down for a longish period, then each users active tabs will then perform a request every 2 seconds. This means that the server will be progressively hammered by many requests, which will clutter the logs, and make it more difficult to gracefully recover. With this commit, we simply exponentially increase the delay each time, and add a little jitter to give a better distribution. Cherry-pick of 4a3f04bcc580c514c61e3bd608fa2b85065434cc closes odoo/odoo#30136 closes odoo/odoo#30596
2019-01-24[FIX] web: translation issue fixedTejas Shahu
Before this commit: Editing a translatable field -> clicking on a translation warning -> come back through breadcrumb do not preserve translation warning. After this commit: Editing a translatable field -> clicking on a translation warning -> come back through breadcrumb preserves translation warning. Technical note: alertFields is now an object and an attribute of the form renderer that stores translation alerts per record. The translation alerts created for a given record are maintained unless they are closed manually or the renderer is destroyed. Issue-ID: 1877480 Co-authored-by: Mohammed Shekha <msh@openerp.com> closes odoo/odoo#29377
2019-01-23[MERGE] forward port branch 11.0 up to 984a99611eeChristophe Simonis
2019-01-23[MERGE] forward port branch saas-15 up to 3cba1862d44Christophe Simonis
2019-01-23[MERGE] forward port branch saas-14 up to 81c9e28eabaChristophe Simonis
2019-01-23[MERGE] forward port branch 10.0 up to 90c1af1151cChristophe Simonis
2019-01-23[FIX] web: no chrome autocompete on many2one widgetNicolas Lempereur
For editing many2one fields (and partially many2many) most widget show an autocompleting list of targeted records. They thus have `autocomplete="off"` to prevent browser completion. But chromium has an history of breaking `autocomplete="off"`, see: - https://caniuse.com/#search=autocomplete - https://crbug.com/468153 - https://crbug.com/587466 - https://crbug.com/914451 - https://crbug.com/923895 It seems that since chromium 71, the heuristic to ignore `autocomplete="off"` has become more aggressive and for example if there is at least 3 fields like an address in a page, chromium will ignore `autocomplete="off"` for the fields like an address. So for example the eidting the many2One field with placeholder "Country" in a contact page now has a browser autocomplete menu that is: - hidding the many2one autocomplete - going to save empty country it appeared visually filled if the autocomplete result was selected. With this changeset, the placeholder in the many2one instance is interspersed with U+FEFF charcters (ZERO WIDTH NO-BREAK SPACE) so the browser does enable the autocomplete feature by force. This should thus remove the issue (until it is fixed by chromium) in the case of field named "Country" or matching other regexes in this file: https://github.com/chromium/chromium/blob/cdb1b2073f12/components/autofill/core/common/autofill_regex_constants.cc U+FEFF has been chosen instead of more recommended characters because other have been shown erroneous for printing in some windows configuration (see cb2a3afa7). 10.0 version of #30439 opw-1930588 closes #30439 closes #30449
2019-01-31[FIX] web: make value_from of Datefield work without calling complete beforeNans Lefebvre
Commit 9af941428880af8e1810dfd9feef494d7a745e98 made it so that the value_from function depends on a variable defined after the function complete has been called, without any guarantee that this function would be called after. Apparently this is the right OOP thing to do. opw 1930523 closes odoo/odoo#30712
2019-01-24[FIX] web: allow to open community website menu on iOSqsm-odoo
Before this commit, the menu to go into the backend from the website was not possible to open on iOS without opening the right menu first. This was because position: fixed is not able to counter overflow: hidden in iOS. This is the fix for stable versions, the proper solution will be done in master. Closes https://github.com/odoo/odoo/issues/29390 task-1923151 closes odoo/odoo#30507
2019-01-17[MERGE] forward port branch 11.0 up to 19558129f0eChristophe Simonis
2019-01-17[FIX] web: pivot correct context after reloadLucas Perais (lpe)
Open a pivot view with default filters automatically activating Disable those filters Change the groupBys on the rows and cols of the pivot Save your result as a favorite filter Before this commit, the filter did not contain the context information for columns groupby Also, the search view did not exploit the context of the new filter as it should be After this commit, the flow works as expected OPW 1913732 closes odoo/odoo#29415
2019-01-16[FIX] web: can reopen ModelField selector widgetChristophe Matthieu
Before this fix, in studio when the user select the field then focus out then focus in and selected a child field, an exception is triggered because the last page is visible but the data are removed. backport of 12.0's 9eef25ae0a opw-1928453 closes #30277
2019-01-15[MERGE] forward port branch 11.0 up to 4f2f2995346Christophe Simonis
2019-01-11[FIX] web: one2many list: quickly switch between pagesAaron Bohy
Before this rev., a crash might occur when the user quickly switched twice between pages (e.g. go to page 2, then page 3) on a slow network. In the given example, when data of page 2 returned, the list was re-rendered. Unfortunately, the offset of that list' datapoint was already changed due to the switch to page 3, meaning that the view tried to render a page that wasn't loaded yet, leading to a crash if there were modifiers to evaluate, or to empty records being displayed. This rev. ensures that the view is rendered with the data of the page it expects. closes odoo/odoo#30150
2019-01-11[FIX] web: reset offset in the search more view dialogNans Lefebvre
Start on the modal obtained by a "search more". The offset is never reset. So suppose you are on page 2, looking at record 81-160. Do a research that gives less than 80 records. The result of the search is nothing, since is has been done with a 80 offset. It should be reset to 0 when we do a new search. opw 1920826 closes odoo/odoo#30109
2019-01-08[MERGE] forward port branch 11.0 up to c07b7200b26Christophe Simonis
2019-01-03[FIX] web: attach document fix click on firefoxNicolas Lempereur
As of saas-11.3 there is a "Attach document" widget that is meant to more easily add attachment. But on firefox the click event is coming from the button, where on other browsers it was possibly from a child element. So the code expecting the child element did not work on firefox. opw-1920842 closes #29903
2019-01-04[FIX] web: X2Many read propagates field contextNicolas Lempereur
Most operations on X2Many widget possibly propagates a field context (name_create, name_search, ...) but the original read or read on an onchange does not. With this changeset, the field context is also used in these instances. The assertions added in the added test failed with: expected: ["world"], result: [undefined] expected: ["world","world"], result: [undefined,undefined] fixes #29203 opw-1914466 closes #29866
2019-01-02[MERGE] forward port branch 11.0 up to d82c0d133edChristophe Simonis
2018-12-19[FIX] web: read records up to list limitlen-odoo
Fine-tuning of commit e7fab234201e357da52c3576ad2e8fc9ceee9359 In a one2many with more than one page with a limit of k records, add a line l. It increments the list limit to k+1. Remove a line above (of index <= k). It will try to load a line l' to replace it, that it will find on page 2. However when deciding if it should read missing fields on that record, it will scan at most u records, skipping virtual ids. Here u is the min between the current number of lines and the list limit without the temporary increase due to the added record. Since there are at least two pages, u = k. However since l is in the list at index k, then l' won't be read, and since it was on page 2 its data hasn't been loaded. Therefore the js would traceback when trying to evaluate it. opw 1913361 closes odoo/odoo#29338
2018-12-18[FIX] web: x2m in x2m with different fields in different viewsMartin Geubelle
Use case: a x2m (ex: attribute values) displayed in a x2m (ex: attributes on product) using different fields in different views (ex: tags in product form view and list in product attribute form view). When opening the x2m record (in a wizard) then going back on the form view, the tags are empty because the `display_name` value has been lost when fetching x2m for the second time. In this case, the list `fieldsInfo` needs to be updated with the existing (default for tags) one so all the fields will be correctly loaded. Task 1916891 closes odoo/odoo#29598
2018-12-13[FIX] web: handle `context` key in calendar reloadMartin Geubelle
When filtering the calendar view on search filters, the filter `context` was not taken into account during the reload. For example, in the Calendar app, the filter 'My Meetings' has a `context` {'mymeetings': 1} which was not passed to `search_read`. Task 1917628 closes odoo/odoo#29531
2018-12-05[FIX] web: exclude orderedBy when changing actionLucas Perais (lpe)
When activating a filter on a list view, the environment of the action contained a context with an orderedBy key which was then used by every controller and model in the various parallel flows, i.e. changing actions After this commit, we prevent it by excluding the key when executing an action OPW 1913190, 1914019 closes #29190
2018-12-04[MERGE] forward port branch 11.0 up to 2156af480fdChristophe Simonis
2018-11-30[FIX] web: prevent crash in some cases (o2m)Géry Debongnie
Recent works in the orm (see [1] for example) changed the behaviour of the server in the case of onchanges: it tries to optimize Odoo by sending a minimal diff to the web client in onchanges. Concretely, this means that the web client receives commands 4 (link to) instead of command 1 (update + record data). It also sends a minimal diff in that case. This is a big issue for the web client, because it relied on the knowledge of the data from the command 1 to be able to evaluate some modifiers. The good news is that we can mitigate the issue in one case: we do not actually need to evaluate the modifiers in the case of a command 4 (comming from the server), because we can assume that the record is valid. So, we simply bypass the check in that case. Note that this should fix most of the problem, but a deeper problem still remains: a crash can still happen when an onchange modifies a record in a one2many (but in a different page), and we also have a modifier which needs to be evaluated. opw: #1904514 [1] https://github.com/odoo/odoo/pull/29086 closes odoo/odoo#29172 closes odoo/odoo#29086
2018-11-28[MERGE] forward port branch 11.0 up to bb6f6c57f97Christophe Simonis
2019-01-25[FIX] web: date filter operators less than greater thanHetal Dhanak
Before this commit, in the filter, when using a custom filter with a date field, the operators "is after" and "is before" were set to execute "is after or equal" and "if before or equal" respectively. That means it includes in the results, records with the same date as the filter. Now, the operators 'is after' and 'is before' won't include the records with the same date as the filter. And the operators 'is after or equal' and 'is before or equal' will include the records with the same date as the filter. Fixes #29868 OPW-1921756 closes odoo/odoo#30560
2018-11-28[FIX] web: context orderedBy not propagated to x2mLucas Perais (lpe)
Have: - Model A with a x2m to model B - Object A with multiple objects B in x2m (that will be sorted) - On the list view of model A, click on a column to sort by a field - this field shall not exist in B - open a record A (towards form view) Before this commit, the sorting of the x2m crashed, because the key orderedBy was propagated Due to commit e713ed2a69af9fe97fbe2d54843adc8f1ce689aa After this commit, it doesn't crash OPW 1913133 closes odoo/odoo#29094
2018-12-05[FIX] web: exclude orderedBy when changing actionLucas Perais (lpe)
When activating a filter on a list view, the environment of the action contained a context with an orderedBy key which was then used by every controller and model in the various parallel flows, i.e. changing actions After this commit, we prevent it by excluding the key when executing an action OPW 1913190, 1914019 closes odoo/odoo#29186
2018-11-22[MERGE] forward port branch 11.0 up to 263b388c504Christophe Simonis
2018-11-15[MERGE] forward port branch 11.0 up to 468dab6748aChristophe Simonis
2018-11-15[FIX] web: update renderer when _callButtonAction failedMohammed Shekha
Before this rev., the following scenario didn't work: Open manufacturing order and click on Produce button (note that bom product should have Serial number enabled) then add quantity in Done field in o2m and press Record Production button in wizard, it will produce UserError and after then if you change Lot number field in wizard's o2m then the many2one value doesn't get selected. This occured because the renderer wasn't updated after the RPC fail and thus still got an outdated version of the state. The issue raised after commit: 02eef78bbd3 which was done to remove useless rpc call, it's OK to remove rpc call but let's keep updating renderer. Related to task ID: #1852715 Co-authored-by: Tejas Shahu <tsh@odoo.com>
2018-11-13[WIP] looking good babeLucas Perais (lpe)
2018-11-13[FIX] web: load SubViews without previous' view _view_ref context keysLucas Perais (lpe)
On a form view (of model A), define a many2one (model B) with a [form|tree]_view_ref context key In that view, have a x2m field (model C) with a different [form|tree]_view_ref context key Before this commit, the second load_views (i.e. on the model C) crashed because the wrong context key was sent to the server, which returned the view to which the _view_ref points i.e. the view of the model B After this commit, we clean the context of subviews loading, because those keys are only useful for the python and one shot. Hence, there is no crash OPW 1903780 closes odoo/odoo#28260
2018-11-12[WIP] another testable solutionLucas Perais (lpe)
2018-11-12[FIXUP] testable solutionLucas Perais (lpe)
2018-11-12[FIX] web: search input date in another timezoneLucas Perais (lpe)
Put the browser in timezone Sao Paulo (Or like West of UTC) Trigger the autocomplete (and the subsequent search) on a date field by writing a date (in the locale format) in the search view Before this commit, the domain sent to the server contained the date as the day **before** the one asked for in the input This is because, the string input is parsed and gives: input = 12/02/2018 When creating the moment object: > since there is no explicit time, moment will interpret it as 12am (midnight) > We force moment to consider the string as being UTC (function: moment.utc()) > the moment contains, as output the time ** 2018-02-12T00:00:00 UTC ** When getting the facet value for making the domain > we call toDate on the moment object, which, according to the browser is UTC and will be converted to the locale timezone before formatting > And the domain will use the date 2018-02-11T22:00:00 Brazil/SaoPaulo which gives the day before the one we asked for After this commit, this issue doesn't arise, because we use the string representation of the moment object in search_inputs (i.e 2018-02-12T00:00:00 UTC), to create a new one *BUT* we create it with a date format that excludes the time from being interpreted. Also, the resulting moment object in this case is not flagged as UTC anymore OPW 1903224
2018-11-20[FIX] web: implement filter orderedByLucas Perais (lpe)
related to: #28446 On a pure list view, click on a column to sort the records by that field. Save the filter as favorite Reload, now apply the filter Before this commit, there were two issues: 1. The order of the list was never propagated to search view, which couldn't save the filter with its attribute "sort" 2. There was no mechanism to load the attribute sort from a loading Filter After this commit, those two issues are corrected Unfortunately, complex search view flows are not testable in v11.0 OPW 1906968 closes odoo/odoo#28766
2018-11-19[FIX] web: External LinkNicolas Martinelli
In the case of a One2many list view in a `<group>` tag, the 'External Link' button of a Many2one field (which allows opening the form view) is not visible. The `flex: 1 0 auto;` should not be applied in the list view. Corresponding PR in v12: #28741 opw-1903158 closes odoo/odoo#28812
2018-11-19[FIX] web: m2o+o2m in o2m onchange no lose dataNicolas Lempereur
Steps: - open a modal form view from tree view first line and make a change - open a modal from the second line and make a change - open the second line back: the change were lost In a given number of conditions (a many2one inside the form view, there is a one2many in the form view not inside the tree view, ....) this happened because: - when we save the first line, we get onchange data for the second one - this onchange data can't be applied before second line is loaded, but it is saved so it can be applied if second line is ever opened - when the second line is opened the saved change is applied => OK - when the second line is opened a second time the saved change is applied again, possibly overwriting posterious change => BAD With this changeset, when the record with unapplied onchange is loaded for the first time, the unapplied onchange is applied only once. Added test without the change failed with: - only 1 turtle for second partner (result: 0 not 1) - second partner turtle is Michelangelo (result: "" not "Michelangelo") opw-1846820 closes #28644
2018-11-27[FIX] web: progressbar updates on field resetLucas Perais (lpe)
Have a form record with a progress bar Modify the max_value of the progress, as well as the current_value bar through an onchange Before this commit, the new max_value was not taken into account After this commit, it is. closes odoo/odoo#29056
2018-11-26[FIX] web: propagate can_create into the search popupLucas Perais (lpe)
When creating a SO line and clicking on search more for product_id Before this commit, every user had the button "Create" to create a product.product After this commit, only user in groups that actually can create a product have the button OPW 1910371 closes odoo/odoo#28924