Commit Graph
6144 Commits
Author SHA1 Message Date
Jeremy Kersten fe7b6ef900 [FIX] planner: remove console.log and add default value for menu_id.
Add default value because top menu 'Website' from backend don't have a data menu-parent, and toString from undefined displays a traceback.
2015-01-19 16:23:40 +01:00
Géry Debongnie 81588efe26 [FIX] web: remove typo in views.js 2015-01-19 14:17:19 +01:00
Jérome Maes f04280757b [FIX] web : add forgotten lato font direcotry from a279d8a976 2015-01-16 18:52:10 +01:00
Goffin Simon 0fd773a486 [IMP] Cleanup and refactoring of exception handling
Unify and refactor exception handling in framework and addons.

The generic `except_osv` is now deprecated, and replaced by more specialized exception subtypes:
 - `UserError` (renamed from Warning, as it conflicts with the built-in `Warning`) raised when a non-technical error occurs during a business operation. It could be a missing information in the data provided by the user, or a misconfiguration.
 - `AccessError`: raised when any operation is denied because the user conducting it does not have the required access rights.
 - `AccessDenied`: raised when an operation that requires authenticated access is attempted via an unauthenticated request.
 - `MissingError`: raised when an operation is attempted on a record that does not exist.
 - `ValidationError`: raised when an operation violates a SQL or Python constraint.
 - All other exceptions are internal errors due to a system problem or bug, and raised untouched to the client-side, which should display a traceback.

All exceptions take a single message argument.

The `test_exceptions` module has been updated to showcase both new and old (deprecated) exceptions.

A great many old `except_osv` had a useless title with "Error!" or "Warning", those have been removed, as this is handled by the client-side widget that displays the messages.

This commit introduces a more consistent policy for logging errors and warnings:
 - All messages that do not require administrator attention should be logged at INFO level or lower. This includes all errors that are notified to the user in a friendly manner, even for access right problems or validation errors during business operations.
 - All messages that indicate a likely misconfiguration or malicious use by the users should be logged at WARNING level, as they typically require administrator attention.
 - All other unhandled internal errors cannot typically be handled by the user and should be logged at ERROR or higher level, as they require immediate administrator attention.
2015-01-16 17:15:18 +01:00
Yannick Tivisse ded2962d41 [FIX] web tour.js: data-original-title issue with bootstrap lib, bootstrap take the image name as tip title instead of the title allready defined 2015-01-16 16:55:36 +01:00
Jérome Maes 45352c43ca [FIX] planner: less gready with reflow and better integration with webclient (oe_systray)
* Only trigger a menu reflow when needed (show/hide planner)
* Do not include webclient and menu; use webclient reference
(Courtesy of sle-odoo)

Also, change the way to switch planner page. Switching keep now the URL fragment of the webclient, and don't use collapse bootstrap class. Fix url builder server side.
2015-01-16 16:13:04 +01:00
Géry Debongnie 76832cb6a4 [FIX] web: fix breadcrumbs duplicate form views
and prevent the last breadcrumb to be clickable (revert of 61dec05).
The last breadcrumb clickable to refresh the view is no longer necessary
with the form view icon available.

The weird code on the click handler for switching views is due to the
fact that most views refresh with a do_search but the form view is
refreshed with a do_show.  A more generic way to update the view
seems necessary to prevent such artifacts.
2015-01-16 11:17:02 +01:00
Géry Debongnie 65ac1b3a70 [IMP] pyeval: implement weekday function
courtesy of mva.  This adds the weekday function to date objects in
pyeval.  This will be useful for adding better filters (such as this
week) in the searchview.
2015-01-16 10:26:09 +01:00
Mitesh Savani 9162b9930c [ADD][IMP] web: added toogle button for form view. Like already
done in list view, this is a button used for boolean fields
used to switch between pending-grey-false and done-green-true.

hr_holidays: use this newly-introduced button on form view.
I am sure HR people will love R&D now.

Courtesy of RD India: Mitesh Savani (msa@odoo.com)
Reviewed by Use Merge: Thibault Delavallée (tde@odoo.com)
2015-01-12 14:33:07 +01:00
Géry Debongnie 278ff38dbe [FIX] web: usability issue: display form view icon
form view icon should always be displayed in the view manager.  This
is useful in some situations:
* switch to form view from editable list view
* refresh a form view
2015-01-09 13:10:14 +01:00
Richard Mathot 7b763176ba [REM] modelines: Gotta catch 'em all 2015-01-08 11:38:58 +01:00
Julien De Coster d88c34d11e [IMP] Mass mailings send in cron
1. The merge of the "email_template" module into the "mail" module.
2. The send action of the mass mailing has been moved from the frontend to a cron, because it was too slow to send over 10,000 mails (the user's browser was blocked for 15 - 20 minutes). Mass mailings have now their own process in the kanban view.
3. Mails sent from the mail form are sent immediatly instead of from the mail queue (for instance, when you go to sales > customers > list view > select 2 -3 customers > More > Partner Mass Mailing).
4. Users have now the choice from which mailing list they want to unsubscribe when they click on the unsubscribe link at the bottom of the mail.
5. Mass mailings inherit from their campaign UTMs and mass mailing campaigns are linked to an UTM campaign.
6. Many little improvements
2015-01-07 18:01:58 +01:00
Aaron Bohy ba083dbb47 [IMP] Web: navbar isn't displayed on several lines while rendering
- Add a new SystrayMenu widget to improve and facilitate the way
    of adding widgets in .oe_systray
  - Rendering of the modules menu now waits for the systray and
    user menus to be rendered
  - A few refactoring of the UserMenu and Menu widgets
2015-01-07 15:13:51 +01:00
Aaron Bohy ecc3bb7647 [FIX]: y-truncated username in usermenu 2015-01-07 15:13:51 +01:00
Christophe Simonis fab4d6d442 [MERGE] forward port of branch 8.0 up to ea54d4a 2015-01-06 11:49:04 +01:00
Christophe Matthieu 9069d0127c [IMP] website: use the new summernote editor 2015-01-05 10:59:42 +01:00
Christophe Matthieu ba1144551c [REM] remove ckeditor 2015-01-05 10:17:11 +01:00
Christophe Matthieu 9f51d7fdfa [FIX] tour.js to dispatch a real keyup event to simulate keypress with summernote lib 2015-01-05 10:17:10 +01:00
Simon Lejeune 099ff0b236 [FIX] web: base.sass: jquery.ui widget in bootstrap's modal
Apply a z-index of 1051 (bootstrap'smodals are 1050). This fixes
an issue with the many2one hidden in a modal. Also, removed a
reference to a removed file.
2015-01-02 10:57:17 +01:00
Aaron Bohy d661902aff [FIX] web: notebook: rendering of pages with invisible modifier
- Old behavior: each page with such a modifier was first set
    invisible at creation of the InvisibiliyChanger attached to
    it, and then, after domain evaluation, the page was reset
    to visible if needed.
  - New behavior: wait for the domain evaluation to decide to set
    a page invisible. It also fixes a bug when 2 pages where
    active simultaneously. Moreover, we only switch to a newly
    displayed page if we are in edit mode (use case: we edited
    a field making the page's domain true, so we want the user
    to pay attention to this page).
2014-12-31 12:57:15 +01:00
Simon Lejeune a60f1ed8c4 [FIX] web: form rendering: use attr in attach_node_attr 2014-12-30 17:16:54 +01:00
Géry Debongnie 64e57568bf [FIX] web: fix various syntax problems in views.js
linting views.js revealed some problems.  Most of them minor, but
some of them more serious: redeclared variables in if clauses can
shadow the outer variable, or not.  It is fragile, and will cause bugs
if the code is refactored.
2014-12-30 11:15:23 +01:00
Géry Debongnie 61dec05b9f [FIX] web: makes last breadcrumb item clickable
clicking on last breadcrumb item should reload the current view
2014-12-30 10:35:58 +01:00
Simon Lejeune bdde2fb96f [FIX] web: notebook: remove fade effect on tab switch
Also, fixed two global variables introduced by rev b2e32a8f7e
2014-12-29 11:15:17 +01:00
Paramjit Singh Sahota 5042d2396e [FIX] web: fixed display of datepicker in editable list view.
The icon was quite board, leading to ugly and sometimes too short display
of the date itself.
2014-12-26 16:26:15 +01:00
Aaron Bohy 3505dcce70 [FIX] web: view_form.js: radio buttons bug fix
Clicking on a checked radio button doesn't uncheck it anymore
2014-12-24 15:37:50 +01:00
Denis Ledoux 1684206122 [MERGE] forward port of branch saas-3 up to 0b1b820 2014-12-24 14:04:18 +01:00
Denis Ledoux 0b1b820677 [MERGE] forward port of branch 7.0 up to 6372313 2014-12-24 14:02:17 +01:00
Denis Ledoux 5a207fa08e [FIX] web: firefox print all pages of list view
opw-619093
2014-12-24 13:52:45 +01:00
Denis Ledoux 6372313494 [FIX] web: datetime value parsing without time
If the date format language was changed to invert month & day values (so, changed to the classic european format instead of the american format)
Then, when entering manually a datetime without the time (so just '01/02/2014' instead of '01/02/2014 00:00:00', the day and month were inverted (the datetime was set to 02/01/2014 instead of 01/02/2014) because the datetime entered did not exactly match the date + time pattern.

We therefore added a fallback case, to test to parse the value with the date pattern alone (without the time)
2014-12-24 11:37:55 +01:00
Simon Lejeune b7e2f5be8b [FIX] web: base.css: fallback for browsers without calc support
see https://developer.mozilla.org/en-US/docs/Web/CSS/calc
2014-12-23 10:32:27 +01:00
Valentin Lab 7727a31d1f [FIX] web: correctly show/hide container div
view manager should hide/show divs even if you don't have a controller set.
2014-12-22 13:37:18 +01:00
David Monjoie 873bfc6c10 [IMP] web: update font awesome to 4.2
Required for themes which uses the new icons
2014-12-22 13:21:46 +01:00
Simon Lejeune b2e32a8f7e [IMP] web: use bootstrap's notebook, rewrite process_notebook
Introduction of a specialized InvisibilityChanger for the notebook. It
allows to handle more elegantly the issues of the notebook during
page execution: modifiers hiding the active tab that must now
active its sibling.

Process_notebook only handle the processing of the page while
NotebookInvisibilityChanger only handle the behavior of the notebook
during the page execution.

- readable code (more readable, at least)
- correct handle of autofocus
- rendering of the whole notebook in one call to qweb's render
- one invisibility changer bound by header/content
- no custom css, only legacy bootstrap
2014-12-19 17:49:13 +01:00
Simon Lejeune 01409c1d7b [FIX] web: openerpframework: replaceElement on multiple roots nodeset
jquery's `replaceWith` function behaves differently between 1.8 and 1.9.
This function is used by `renderElement` of the Odoo widget API and, when
called on a template with multiple root nodes, will fail to replace the
whole original nodeset by the new but instead will replace every node
by the new nodeset.

Sample:
1) Suppose a DOM containing
    <div>1</div>
    <div>2</div>
and a jquery nodeset [<div>1</div>, <div>2</div>] referring to the
previous DOM part in a var named $oldel.;
2) suppose another jquery nodeset [<div>3</div>, <div>4</div>] in $el;

$oldel.replaceWith($el) will result in
"3434" in jquery 1.9.1
"34" in jquery 1.8.3

This issue particulary concerns us when the dom of a widget is not wrapped
into single tag and when re-calling renderElement (triggering replaceElement).

The fix is to wrap the element to be replaced ($oldel in the example) behind
a div before calling replaceWith.
2014-12-19 17:49:13 +01:00
Simon Lejeune a7f869e51f [FIX] tour.js: remove synchro between selected property and attribute
This line was previously used to allow attribute selectors to match the
`selected` property, by changing the attribute each time the property
was changed. Now it doesn't make sense since rev c611846 introduced
property selectors + it seems to mess with phantomjs, as the test does
not pass in phantomjs environment but passes ok in a "real" webkit browser.
2014-12-19 17:49:12 +01:00
Simon Lejeune f017a9fe2b [FIX] tour.js: introduce common properties selector
Since jquery 1.9, attr selector only matches attributes (the behavior was not
consistent before, sometimes it returned the properties [0]) and tour.js was
relying on those inconsistencies. This commit introduce common properties
selector to allow matching properties during a tour.

[0] http://jquery.com/upgrade-guide/1.9/#attr-versus-prop-
2014-12-19 17:49:12 +01:00
Simon Lejeune c095e01efe [FIX] web: override jquery-ui ui-state-error css 2014-12-19 17:49:12 +01:00
Simon Lejeune 74ed4b276d [IMP] web: update jquery-ui to 1.11.2 version 2014-12-19 17:49:12 +01:00
Simon Lejeune a9c6ccaf8c [IMP] web: update jquery.form to 3.51.0-2014.06.20 version 2014-12-19 17:49:12 +01:00
Simon Lejeune 1fd6c0f75c [IMP] web: update jquery.autosize.js to 1.18.15 version 2014-12-19 17:49:12 +01:00
Simon Lejeune f4c3ecb493 [IMP] web: update jquery.scrollTo to 1.4.14 version 2014-12-19 17:49:12 +01:00
Simon Lejeune 4d5012924e [REM] web: jquery.ui.bootstrap 2014-12-19 17:49:12 +01:00
Simon Lejeune 4d07900cf7 [FIX] web: reintroduce $.bbq to keep compatibility with jquery.ba-bbq 2014-12-19 17:49:12 +01:00
Simon Lejeune 8d500172e6 [IMP] web: update juqery.ba-bbq to 1.3pre version 2014-12-19 17:49:11 +01:00
Simon Lejeune d608df59b5 [IMP] web: update jquery.blockui to 2.70.0-2014.11.23 version 2014-12-19 17:49:11 +01:00
Simon Lejeune 7db5175274 [IMP] web: update jquery to 1.11.1 version 2014-12-19 17:49:11 +01:00
Géry Debongnie 2dceaa9ffe [FIX] web: clicking on view buttons now refresh view
clicking on a view button should load the view, even if it is the
active view.
2014-12-19 16:08:01 +01:00
Julien Legros 26bf35260d [FIX] web: reordering in editable list views
Broaden the set of conditions where reordering is allowed. Lists can be
reordered when they are sorted by sequence (or sequence ASC)

opw-619465
2014-12-19 15:18:31 +01:00
Géry Debongnie 2c08dc0ba6 [IMP] web: new pivot view, full rewrite of graph view
This commit is a split of the former graphview into a pivot view (the
tabular view) and graph view (the various charts).  The code was fully
rewritten.
* pivot view should be faster (better underlying data structure and
better algorithm)
* better integration with the web client (use of sidebar, of menu buttons,
bettor style)
* new feature: pivot view can be sorted
* new feature: pivot view cells can be clicked to open a list view with
the corresponding domain
* web_graph addon was removed, and the graph view code has been moved
to the addon web.
* the interaction with the searchbar was changed (no more column facet)
* better and simpler code for graph view
* mary corner cases in graph charts have been corrected (for ex, pie
chart with positive and negative numbers)
* graph/pivot correctly save their state when added to dashboard/saved
(state such as current measure, chart mode, column groupbys, ...)
2014-12-19 14:34:23 +01:00