summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework/pyeval.js
AgeCommit message (Collapse)Author
2017-03-28[MERGE] forward port branch saas-6 up to 7bcfa2b52a3Christophe Simonis
2017-03-24[MERGE] forward port branch saas-6 up to 9d04d14669fChristophe Simonis
2016-06-27[FIX] js: translations and string substitutionsMartin Trigaux
_('foo '+bar) does not work as `bar` is a variable with undefinied content during translation export (and variable content during evaluation) so a match will not be found. Also trailing spaces are stripped during synchronisation with transifex. The proper syntax would be _.str.sprintf(_t("foo %s"), bar) but to avoid breaking existing translations (need to reexport .pot) use the syntax _("foo ") + " " + bar that is more stable friendly. The 'No value found for the field...' string is not possible to be fixed without breaking the translations should be split at least twice. Write it the propre way directly.
2016-03-16[FIX] web: len & non zero implementation for wrapping list/dictDenis Ledoux
The implementation of `__len__` & `__nonzero__` were not defined for the py types `wrapping_dict` and `wrapping_list`. For instance, this prevented an empty list to be considered as `False` in domains evaluated by the web client. e.g., in the automatic partner merge wizard, the domain ``` [('id', 'in', partner_ids and partner_ids[0] and partner_ids[0][2] or False)] ``` is used. When the `partner_ids` list was empty (meaning the "partners to merge" list was empty in the wizard), it wasn't considered as `False`, and it therefore attempted to get `partner_ids[0]`, which resulted to a crash, as the list was empty. opw-672095 Closes #11343 Courtesy of Xavier Morel (xmo@odoo.com)
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