summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework
AgeCommit message (Collapse)Author
2019-02-22[FIX] barcodes, web: float scannableNicolas Martinelli
- Switch to French language - Go to Inventory > Inventory Adjustment - Launch an adjustment The field 'Real Quantity' doesn't follow the float formatting. This is because the widget is set as `field_float_scannable`, which is not recognized by the formatting function. Since the widget descriptor has priority over the type descriptor, we must explicitly take this widget into account, on top of adding the `format_value` method. opw-1940884 closes odoo/odoo#31366
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
2018-09-06[FIX] web: relativedelta>11months work as expectedNicolas Lempereur
Since march 2015, using in a domain "relativedelta(months=X)" with X being bigger than 11 or lower than -11 would result in an error. This is because in the refactoring adding modules (e8a00bc50d) the two functions divmod and utils.divmod with different implementation in pyeval.js were replaced by one function divmod in web.utils module. But there was still an usage of the removed implementation. opw-1880766 closes #26816
2018-07-16[FIX] web: groupby product on package types triggers a js errorlen-odoo
On a database where many modules are installed (e.g. runbot all), with the option "manage available packaging options per products", doing a groupby "product" on the "package type" list view triggers a js error. It comes from the fact that the fixed_group variable contains a "length" attribute; the _().each function uses this to determine (erroneously) that the object is an array. It thus uses fixed_group[0] to get an undefined, and then tries to access a method of undefined. We replace the each by a simple js loop. opw 1863576
2018-05-18[FIX] web: get_file handles arbitrary AND serialized exceptionsLucas Perais (lpe)
Commit bcd4c90 was intendend to make get_file handle uncaught/unserialized exceptions in the context of a http request The drawback is that when get_file received a serialized exception (route: /report/download) the JS modal was empty in that case This commit handles both the cases OPW 1848606 closes #24794
2018-04-26[FIX] web: `get_file` and CPU time exceededNicolas Martinelli
- Create a binary field which takes some time for computation. For example: ``` ding_dong = fields.Binary(compute='_compute_ding_dong') def _compute_ding_dong(self): if not self.env.context.get('bin_size'): while True: 3*3 for x in self: x.ding_dong = x.product_id.image_medium ``` - Run the server with a limited CPU time, for example: `--workers=2 --limit-time-cpu=10` - Download the file A JS traceback occurs, without any information about the real crash. The error management is simply not working: `JSON.parse` is called on a string which is not JSON-parseable. opw-1838832
2018-02-21[MERGE] forward port branch 9.0 up to e544ec8df70Christophe Simonis
2018-02-20[FIX] web, web_editor: Better email validation with regex (JS)Romain Derie
This commit improves link creation in web editor. Before this commit, anything with a @​ would be considered as valid email which is obviously not the case. It would then be prefixed by 'mailto:'. This was causing 2 issues: - URL with @​ symbol in it would have 'mailto:' added as prefix, like google maps coordinates. eg: mailto:http://www.google.com/maps/whatever/@​312211.22,321321 - Incorrect emails would go through (eg: @​@​@​, ko@​k@​k@​, mail@​mail) Now, we will try to detect and identify valid emails from invalid emails from URLs. It will also handle 'mailto:' directly typed in the input. This commit comes with it's counterpart in enterprise https://github.com/odoo/enterprise/pull/1859 This closes #11984, closes #22936 Note that there is a WIP in master to use this new is_email function everywhere we try to validate emails. It will aim to uniformize email validation in odoo's javascript that are often performed with different mean here and there, some more permissive than others, some only checking for @​.
2018-01-12[MERGE] forward port branch 9.0 up to 26d3b77a1deChristophe Simonis
2018-01-12[FIX] web: Kanban image not showing in some languagestbe-odoo
- In some languages the kanban images are not displayed because of a bug in human_size method in JS. This method translates the Unit Size for data and strip with the string with a comma as separator. When the translatation contains spaces after the commas (like in the French translation), there is extra spaces in the final result. This then cause an issue with the method is_bin_size that expects a unique space between the value and its unit. Resulting in a bug in the method 'kanban_image'. opw #804973 #804970 #804648
2017-12-19[FIX] web: prevent double translation in kanban viewGéry Debongnie
The kanban view uses a template which comes from the server, already translated. Before this commit, it tried to retranslate again the template in qweb.js, which may be a problem (in addition to the useless work): if some english string A is translated in B (french), but B is also a valid english string which is translated into C in french, then we will have a wrong result. In this commit, we simply add a flag to disable the translation process, which should also slightly improve the kanban view rendering performance.
2017-11-14[FIX] web: handle SessionExpiredException in the crash_managerfwi-odoo
2017-09-01[FIX] account: reconciliation_widget: rounding of reconciliation_amount ↵Lucas Perais (lpe)
computation Use case: - a tax of 10%, computation method: percentage of tax included - a account_reconciliation_model with an amount of 90% - make a statement of 1.31 (or something weird when it comes to digits) - reconcile it with a counterpart - prefill that counterpart with the account_reconciliation just created - push on reconcile Before this commit, the amount that was computed was not rounded, resulting in making unbalanced account_moves (by 0.001) This was invisble since the display of monetary is rounded After this commit, the rounding is done according to the currency's parameters and produces correct move_lines OPW 751881
2017-07-28[FIX] web: change exception name from openerp to Odoo Yenthe V.G
The crash manager still used the old name for the exception. (PR #18522)
2017-05-02[FIX] web: min/max integerNicolas Martinelli
In PostgreSQL, a field of type `integer` must be in the range -2147483648 to +2147483647. If the user enters a lower or a larger value, a traceback is thrown. opw-740286
2017-03-28[MERGE] forward port branch saas-11 up to 8bab7aebd62Christophe Simonis
2017-03-28[MERGE] forward port branch 9.0 up to e876becada8Christophe Simonis
2017-03-28[MERGE] forward port branch saas-6 up to 7bcfa2b52a3Christophe Simonis
2017-03-28[MERGE] forward port branch saas-11 up to c2569b9df1bChristophe Simonis
2017-03-24[MERGE] forward port branch 9.0 up to 8376f538b56Christophe Simonis
2017-03-24[MERGE] forward port branch saas-6 up to 9d04d14669fChristophe Simonis
2017-02-03[FIX] web: do not call session load_qweb on frontendqsm-odoo
Since commits 2a8a17024d2b46f3f8837a8672334a7dff3abd1b and 9c68bc74827864a3c6c21be8ead1b2ed3d122d73, the session is not started by the webclient anymore but directly by the session service instead, and the session info is found in the DOM instead of by RPC. Because of that, the session is started in the frontend and other non-backend environments which caused a JS error while trying to load qweb (as no qweb has to be loaded). This commit makes the session start check if it is a non-backend environment and only initialize session info (from DOM) in that case.
2017-01-23[MERGE] forward port branch 9.0 up to 0997a1cf6dcChristophe Simonis
2017-01-19[FIX] web: date < 01-01-1900Nicolas Martinelli
The Python method `strftime` raises an error when the date is older than 01-01-1900 ("The datetime strftime() methods require year >= 1900"). If the user mistyped the date (or was expecting 01-01-16 to be converted into 01-01-2016), this can lead errors since the ORM uses this method frequently. opw-702313
2017-01-19[FIX] web: date < 01-01-1900Nicolas Martinelli
The Python method `strftime` raises an error when the date is older than 01-01-1900 ("The datetime strftime() methods require year >= 1900"). If the user mistyped the date (or was expecting 01-01-16 to be converted into 01-01-2016), this can lead errors since the ORM uses this method frequently. opw-702313
2016-12-01[MERGE] forward port branch saas-11 up to 7842498Christophe Simonis
2016-12-01[MERGE] forward port branch 9.0 up to 5bed95fChristophe Simonis
2016-11-30[FIX] web: date autocompletionNicolas Martinelli
When a user fills partially a date or datetime field, the system will somehow autocomplete the value entered. For example, if the user enters "11//11" then clicks on the Tab key, it will be completed as "11/11/0000". However, the year 0000 is not recognized in Python, and this causes a crash upon saving. opw-695035
2016-11-29[FIX] website_sale: format amount according to currency client sideJeremy Kersten
This commit closes #1103, closes #11553
2016-11-08[MERGE] forward port branch saas-12 up to 6386037Christophe Simonis
2016-11-08[MERGE] forward port branch saas-11 up to c19f546Christophe Simonis
2016-11-08[MERGE] forward port branch 9.0 up to b795755Christophe Simonis
2016-11-07[FIX] web: correctly saves last change in wizards with many2omanyChristophe Matthieu
With this change, form_relational_widgets will wait for the 'web.ListEditor' module to be loaded before patching the list view. This is particularly important for wizards containing and editable list view. Note that to achieve this, I had to fix a horrible hack in session.
2016-11-04[FIX] bus,im_odoo_support, web*: fix various memory leaksChristophe Matthieu
* Tip are never destroyed when change view mode * unbind methods * mail: memory leak with unbind methods * web: memory leak because 'ui-autocomplete' is never destroyed * web_editor: memory leak for wrong unbind on destroy * web: memory leak: must remove fileupload handler * bus: memory leak: correctly debind handlers on window in bus.Bus * remove handlers on switch buttons and views $buttons * remove handlers on breadcrumbs * web: memory leak: correctly debind handlers * im_odoo_support: memory leak: remove fileupload handler odoo_support Note: part of this commit was actually authored by aab
2016-10-27[MERGE] forward port branch saas-12 up to 6f8e40cChristophe Simonis
2016-10-27[MERGE] forward port branch saas-11 up to 1304d13Christophe Simonis
2016-10-27[MERGE] forward port branch 9.0 up to 25616b9Christophe Simonis
2016-10-24[FIX] web: BufferedDataSet write to length fieldNicolas Lempereur
Underscore method _.each expects an array like object when a "length" property is present. This was an issue with a record having a numeric "length" field set to a non-negative value. opw-691070
2016-09-28[REF] web: process views arch in data managerAaron Bohy
A refactoring of the js views is in progress. Those new views are used in web studio, and this change is part of it. This is necessary to allow web studio to correctly fetch data from the server when rendering a preview. Note: this is necessary for special widgets (status bar, selection, radio widgets)
2016-09-28[IMP] web: allow to clear the cache in data managerMartin Geubelle
Sometimes, we need better control on the cache. For example, if a view or an action has been changed, it is required to make sure that the correct data is loaded.
2016-09-28[FIX] web: add modal-body class when renderElementAdrien Dieudonne
2016-09-09[MERGE] forward port branch saas-12 up to 9f28139Christophe Simonis
2016-09-09[MERGE] forward port branch saas-11 up to dc4d6b6Christophe Simonis
2016-09-09[MERGE] forward port branch saas-10 up to e1bd405Christophe Simonis
2016-09-09[MERGE] forward port branch 9.0 up to af87c57Christophe Simonis
2016-09-06[FIX] web, web-kanban: update dataset size at record's drop in a columnPierre Masereel
When we drag and drop a record in a folded column, the number of elements in this column displayed in the column title is not updated. This issue is present because when a record is droped in a column its id is not added to the dataset of its new column. To fix this, we had to add the id of the record in the dataset, and override the method 'add_ids' in 'DataSetSearch' to have the size of the dataset equal to the number of ids in it. We have replicated the behaviour of the function 'remove_ids' in the new function 'add_ids'.
2016-08-31[FIX] web: avoid autoresize duplicatesDenis Vermylen (dve)
In web_planner, changing pages would take more and more time after a few clicks if autoresize was called on textareas. Every time we would change page, autoresize was called on all textareas and added an additional textarea for each one, doubling the amount on each page change. The autoresize function in dom_utils was checking too shallowly for duplicates and created a new textarea where autoresize would again be called upon on a later stage. This commit fixes both problems.
2016-08-22[FIX] web: Set correct debug mode value in headers variable 'X-Debug-Mode'Yannick Tivisse
For the need of the next commit, we have to know when making a request from an RPC call in which debug mode we are. Previously, the value was always 'true' if we were in debug mode. Now it will return 'true' if we are in simple debug mode and 'assets' if we are in the other one. (this is the current behavior for the simple WebRequest). Why do we need to know that? When loading the settings dashboard, an rpc request to /web/dataset/call_kw to load the view is accessing the odoo.debug @property method. This value is used in the template to decide which buttons to display to activate or deactivate the debug mode.
2016-08-20[MERGE] forward port branch saas-12 up to 9ad5f26Christophe Simonis
2016-08-20[MERGE] forward port branch saas-11 up to 3a2147dChristophe Simonis