summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework/session.js
AgeCommit message (Collapse)Author
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.
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-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-07-15[MERGE] forward port branch saas-11 up to a62b8cfChristophe Simonis
2016-07-13[FIX] web,website,point_of_sale: session.debug valueqsm-odoo
Now that the debug URL parameter can be equal to "assets", the session debug variable has to be updated to not only be true or false. Now, its value is false if the debug parameter is not specified in the url and a the URL parameter string value otherwise (or 1 if the value is an empty string). Also modify all redirection which kept the debug mode to also keep =assets. Use the $.param.querystring function.
2016-06-17[REF] web: remove dead codeGéry Debongnie
2016-05-30[IMP] web: remove rpc call to get module listGéry Debongnie
It is already in the web client page source (or more precisely, in the assets_backent bundle)
2016-05-30[IMP] web: move currency rpc to session_infoGéry Debongnie
2016-05-30[REF] point_of_sale,web(site): move session info into page sourceGéry Debongnie
This commit introduces a mechanism to add information into the session from a different module, without having to fetch it manually with a rpc. This is intended to be used with small pieces of info required at the start of the web client, such as currency informations. To add information to the session, one can simply inherit from ir.http and modify the session_info method.
2016-05-27[REF] report,web(_editor): services extracted in their own filesGéry Debongnie
session_instance.js moved from framework/ to services/ and renamed into session.js, which required to change the bundles in report and web_editor addons.
2016-04-25[MERGE] forward port of branch saas-10 up to bb8f0f1Christophe Simonis
2016-04-25[MERGE] forward port of branch saas-9 up to 4d337f7Christophe Simonis
2016-04-21[REF] web: stop duplicating webAaron Bohy
Avoid duplicating web addon in enterprise by extracting a common basis. Enterprise features stay in enterprise, but use that common basis. Mainly: - JS refactoring and linting - Conversion of .sass into .less split into multiple files - Templates cleaning and DOM simplification - Re-generation of web.pot, and update of .po files
2016-04-19[FIX] web: fix iOS file downloadingJoren Van Onder
e8a00bc50da435d3859118ca127d20a2eb9a0cab moved the get_file function from web.session to web.ajax. The issue is that get_file uses session.url() for iOS devices. Also, in order to prevent an infinite spinner options.complete() is called before actually opening up the new window. Although this resolves the issue it still requires the user to configure Safari to allow pop-ups, otherwise they are silently ignored. opw-672882
2016-01-11[REM] web: Proxy.loadXavier Morel
Not really useful at this point, if we ever go down the path of embedded web client we can probably make the relevant controllers CORS.
2015-12-01[FIX] web, openerp: debug mode now works without refererJeremy Kersten
In some cases the Referer HTTP header may be missing or stripped by a proxy, browser extension or anti-virus. This breaks debug mode because it was solely relying on the Referer header. Introducing an explicit X-Debug-Mode header for RPC calls allows for an alternative method that works even when the Referer is missing. This won't work in all cases, e.g. for direct $.ajax calls, for example. Closes #9824
2015-10-02[FIX] web: backport module web.config for enterprise compatibilityAaron Bohy
Addon mail needs to know if we are using a touch device to set or not the focus on the chat composer. However, this information was not available in the community webclient.
2015-04-18[FIX] web: session.js: use compatibility layer to avoid DependencyChristophe Simonis
error. Better solution welcome.
2015-04-17[FIX] web: break dependency cicle.Christophe Simonis
2015-04-17[FIX] *: correct previous forward portChristophe Simonis
Due to files renaming, some patched should be applied manually to the correct files. Forgot to `git add` these files when committing the forward port...
2015-04-09[ADD] new fields.Monetary + updated widgetsCedric Snauwaert
Enhance current widget="monetary" client-side feature and convert it to a first-class type of field, allowing proper server-side behavior. - fields: add field.Monetary, similar to fields.Float but supporting a `currency_field` attribute instead of the decimal_precision attribute. `currency_field` indicates the field holding the related currency on the same record. The symbol of that currency is used when displaying the field, and the rounding of the currency is applied instead of the usual decimal precision. - avoids application of a second decimal precision rounding, as was the case when the model field was a `fields.float`. - removes the need for adding explicit boilerplate to each view containing a monetary field, i.e.: widget="monetary" options="{'currency_field': 'currency_id'}" - res.currency: add new field decimal_places needed to round value at the correct decimal places - web: cache all currencies, rounding and symbols at webclient startup to speedup monetary fields - new widget monetary for list view + adapt widget monetary on form view Limitations: - if the currency_field is a related field, the server-side application of currency rounding will only work when the record already exists, not during creation (to be fixed) - this field is only supported in the new API
2015-03-24[IMP] web : add set_cookie in utils.js (framework) since the get_cookie ↵Jérome Maes
method already exists. The set_cookie of session.js is now using the one from utils.js
2015-03-19[FIX] web: session requires a name to properly workGéry Debongnie
For historic reasons, the session had a name (hardcoded to "instance0"), used in at least one place: the get and set cookie methods. The idea was most likely to allow multiple instances of the web client to coexist peacefully. This does not work at all at least for the last versions, and the new module system is a better way to do it anyway. However, before removing completely the prefix in cookies, we should actually check if no external code depends on it.
2015-03-18[IMP] web+addons: improvement to module systemGéry Debongnie
The module system needs to know the dependencies of a given module before executing the function. This is why the dependencies were defined once in an array, and then were described one more times in the call to require. But a trick can simplify this: the boot function can parse the string representation of the module and extract the calls to require from it. It is more work for the processor, but it leads to simpler module definitions.
2015-03-18[REF] web: add module system to the web clientGéry Debongnie
This commit introduces a new module system for the javascript code. Instead of using global (namespaced) variables everywhere (like openerp.web.whatever, ...), each file declare one (or more) module with its dependencies. Each module will be loaded after its dependencies, and will be given a reference to the return values. This change is a massive departure from the way the client worked previously. It will sadly break some/most history, but I am sure that the future git ecosystem will allow you to easily browse the history past this revision (one can dream). This commit feature: * main namespace is now odoo instead of openerp * a way to define modules and dependencies (inspired by requirejs) * many files have been splitted in simpler subfiles * basic support for debugging in odoo.__DEBUG__ * no global variable (i.e. nothing in window.openerp) * many bug fixes, many new bugs Future vision: this modularization should simplify future code development, simplify debugging and will allow a serious testing effort