summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework/formats.js
AgeCommit message (Collapse)Author
2017-04-11[REF] web, *: redesign all JS viewsGéry Debongnie
This commit introduce a full redesign of all JS views. We started basically from scratch. The goal was to unify all the various views under a common framework, to make them testable, to make then usable in different conditions (in studio, or in the frontend), and to make our lives easier. Some important points are: - we introduced new coding guidelines (camelCase, 80 chars width, ...) - we have a brand new testing framework (still QUnit based) - kanban view moved to the web addon - calendar view (formerly web_calender) moved to web as well - the tree view was removed - all new code should be documented We hope that this code is the start of a new era for the Odoo web client, we want to have a high quality codebase, well documented, well tested, well designed. Work done by the framework team: mostly aab, ged, chm, dmo, qsm
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-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-07-06[MERGE] forward port of branch saas-11 up to e7190cbChristophe Simonis
2016-07-05[FIX] web: parsing of date with abbreviated month/dayDenis Ledoux
When using the abbreviated month in the language date format (`%b`), e.g. `%d %b %Y` in some languages, the parsing of the date from this format to the database format (YYYY-mm-dd) failed because of a dot `.` added from time to time to the end of the abbreviated name e.g., in French, `5 juil. 2016` This is a bug of `moment.js` < 2.13.0, handling badly this dot. This is solved from `moment.js` 2.13.0, thanks to the below revision moment/moment@41fdb58572546740c3a840ebd36fbe9e1bcdc9cb moment/moment#3078 Unfortunately, we cannot update this library to its latest release in stable release of Odoo (e.g. 9.0), as this is seen as an unstable change (if some API changes occured in the given library) Instead, if the parsing of the date fails with the strict mode (meaning the date must respect the format exactly), we perform a second pass without the strict mode, so this dot will be ignored, and the date can be correctly parsed. The issue can be reproduced by loading the French language, and setting `%d %b %Y` as date format, and then performing an advanced search on a date field. The value of the date in the advanced search will be empty without this revision (for the months having more than 4 chars, other than `mars`, `mai`, `juin`, `aout`). Fixes #11854 opw-682534
2016-06-17[REF] web: add ajax.rpc and change some dependenciesGéry Debongnie
2016-05-10[FIX] web: search input of dateNicolas Martinelli
When the user searches for date (or a datetime) in the search bar, the suggested date can become completely wrong. For example, in the French localization where the date format is DD/MM/YYYY, the system will search for the date MM/DD/YYYY. This is even worse when the date is not fully written: DD/MM could be converted to MM/DD/0000, which doesn't make any sense. This is related to the moment issue https://github.com/moment/moment/issues/1407. The fix is to make sure that the input date has a correct format thanks to `parse_value`. The latter converts the date into a fixed format. Fixes #11876 opw-676604
2015-08-21[IMP] web: use css to display attachment mimetypeChristophe Matthieu
Widgets and website display images or display the type with icon like pdf, doc...
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-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