Commit Graph
144 Commits
Author SHA1 Message Date
Aaron Bohy a69f117bbf [FIX] board: handle actions with no view_mode
The view_mode attribute is automatically set to the 'action' nodes
when the action is added to the dashboard using the 'Add to
dashboard' button in the searchview. However, other dashboard views
can be written by hand (see openacademy tutorial), and in this
case, we don't want to hardcode action's params (like context or
domain), as the dashboard can directly retrieve them from the
action. Same applies for the view_type, as the first view of the
action can be used, by default.

Before this rev., the second usecase wasn't handled, and it crashed
when no view_mode was specified. This rev. also ensure that the
context and domain are correctly retrieved from the action.

Closes #24088

closes odoo/odoo#27517
2018-10-08 09:19:21 +00:00
Christophe Simonis efb896f915 [FIX] board: fallback to default view when not found in action
This can happen when action is modified after dashboard creation.
2018-08-06 10:24:31 +02:00
Nicolas Lempereur 8c1c7ec23e [FIX] board: open form view of given action
It is possible in a dashboard item to open a form view of a record.

The view did not take into account the action used to display the item,
so for example: from a customer invoice clicking on a record would
display the "Vendor Bill" instead of "Customer Invoice" view.

With this fix, when a view is being loaded to be displayed in the
dashboard, we save a reference to a possible form view and if the form
view is displayed, we use this reference.

opw-1865454
closes #25718
2018-07-13 11:42:15 +02:00
Nicolas Martinelli 9d85fea1c3 [FIX] board: add extra info
When an element is added to the dashboard, it is unclear to the user
that he needs to refresh the browser for the changes to take effect.

opw-1853242
2018-06-07 13:19:17 +02:00
Alexandre Kühn b15e805b5a [FIX] board,web: edit custom views in place
Before this commit, whenever we do an operation on any of these custom views,
such as folding it, the custom view was saved by creating a new one.

This behaviour comes from a lost feature to undo operations on custom views.
Since we do not have this feature anymore, it makes no sense to create new
custom views on save, instead of applying the changes in place.

With this commit, custom views are edited in place.

Fixes #23712
2018-04-17 17:28:49 +02:00
Alexandre Kühn ea25036c14 [FIX] web: graph rendering when in DOM
Backported fixes:

    1. [IMP] web: GraphView: remove hack to render in DOM

        - ref. 166319fa4a
        - fully backported.

This commit backports the fix that removes the hack for rendering graphs
(delay in a setTimeout), so that the graph is rendered when it is in the DOM.

    2. [IMP] web: restore scroll position

        - ref. 4e204ed223
        - partially backported: only keeps `on_attach_callback`
          and `on_detach_callback` in the abstract_controller
          and in the abstract_renderer.

This commit backports the use of the hooks methods `on_attach_callback` and
`on_detach_callback` in abstract controller and renderer, so that the
controller of any view warns the renderer when it has been attached in
(or detach from) the DOM.

Also, this commit adds `on_attach_callback` and `on_detach_callback` for the
dashboard app, so that the graph view is correctly rendered.

Fixes #24092
2018-04-11 14:52:56 +02:00
Christophe Simonis 2f95cfb8ed [MERGE] forward port branch saas-16 up to f99c4f2b48 2018-01-19 12:43:58 +01:00
Lucas Perais (lpe) 56052dee60 [FIX] web,board: a kanban button action should trigger that action
Before this commit, when having a kanban within a dashboard and clicking on an action button,
the action was not triggered, instead, the board form view triggered 'save' on the board model
leading to a server side traceback

After this commit, the action button triggers the demanded one and only this one.

OPW 805707

closes #22191
closes #22371
2018-01-19 11:26:52 +01:00
Christophe Simonis 5851a69aa3 [MERGE] forward port branch saas-16 up to 3f66814a0d 2017-11-28 15:12:31 +01:00
Martin Geubelle 4de48320ca [FIX] board: avoid crash for non-existing action
After uninstalling an module, some actions specified in the dashboard
may not exist anymore (the dashboard view isn't correctly cleaned up).

This was causing a traceback because the dashboard was trying to load views
corresponding to an non-existing action.

Closes #19995
2017-11-20 17:50:25 +01:00
Nicolas Lempereur 54d5678696 [FIX] board: manage modifiers on save
With da136d83 we have modifiers on every elements but when saving them
for dashboard they have to be stringified to be used.

Also a part of a previous code was still present that removed context
and domain from a saved dashboard when modifying it.

opw-779071
closes #20725
2017-11-08 12:43:55 +01:00
qsm-odoo 489db80101 [REF] web: better mock images routes
Before this commit, only the routes which began by '/web/image' were
mocked (simply ignored). This forgot the case were it is a full URL
(http://www.test.com/web/image). Now, also mock the static images
routes (for .png and .jpg).
2017-09-05 12:13:55 +02:00
Christophe Simonis 4879ce0407 [MERGE] forward port branch saas-17 up to fe77df3ba4 2017-08-31 12:55:41 +02:00
Christophe Simonis 4ac347735d [MERGE] forward port branch saas-15 up to 063381e0f6 2017-08-28 14:02:35 +02:00
Christophe Simonis e18fe88751 [MERGE] forward port branch 10.0 up to 22eb3ee971 2017-08-28 12:13:05 +02:00
Christophe Simonis 22eb3ee971 [MERGE] forward port branch saas-11 up to 428ad2dfe3 2017-08-28 11:30:46 +02:00
Nicolas Martinelli 9214d78152 [FIX] board: height of graph
When a graph is added to the dashboard, it doesn't have a minimum
height set, so only the label and the axis are displayed, not the
content.

opw-766454
2017-08-23 17:59:04 +02:00
Christophe Simonis fcfb4782b6 [MERGE] forward port branch saas-17 up to a445548f07 2017-08-02 12:31:05 +02:00
Martin Geubelle c66fbed5c6 [FIX] board: pass domain in view creation
In the dashboard, the domain wasn't passed to the view since the new views.
The action in the dashboard and the one saved were thus different (ex: when
saving 'Customer', you got all partners).
This was also causing a traceback when editing a value in the grid view.

This domain is now correctly passed.
2017-07-31 15:02:36 +02:00
Aaron Bohy 3d6420d4b3 [FIX] web,*: display dashboard panel if no content
*board,crm

Before this rev., the dashboard panel (e.g. of the sales team
dashboard) wasn't displayed when there were no record to display,
whereas it should. Only the nocontent helper was displayed.

This was a bug introduced with the new view: the views' controller
was in charge to display the renderer (if there were data to
display) xor the nocontent helper. As the dashboard panel was
rendered by the renderer, it couldn't be displayed alongside the
nocontent helper.

This rev. moves this logic to the renderer. So now, the controller
always contains the renderer, which decides what to render (the
data or the nocontent helper). This way, the dashboards can display
their panel and the nocontent helper.
2017-07-27 10:59:08 +02:00
qsm-odoo 5f1ef0910b [IMP] web, *: lazy load dialog xml template
* web_editor, web_planner, website

The 'Dialog' class is used in both backend and frontend. Also, lots of
actions can be done without the use of any modal. It thus makes sense
to lazy load its related xml only when a first modal is opened.

This change also allows to get rid of the "base_common.xml" file as the
dialog template is the only remaining one in there and, in the future
website update, it will allow to not load any static XML file on website
page loadings.
2017-07-24 14:28:35 +02:00
Olivier Dony ba15df47cb [MERGE] Forward-port saas-15 up to 17b847c0f6 2017-06-01 01:10:29 +02:00
Olivier Dony b9e2207267 [MERGE] Forward-port 10.0 up to 7e44444878 2017-06-01 00:15:27 +02:00
tarteo b853573ff1 [FIX] board: fix 'Add to my dashboard' margin issue
Board module allows to add favorites to my dashboard. This is an option
added by the board module under Favorites menu item of search view.
However its margin is incorrect and displays badly compared to other
options in search view.
2017-05-29 17:36:55 +02:00
Aaron Bohy 38dfe6c51d [FIX] board: properly render with twice same action
Before this rev., the dashboard wasn't rendered correctly when
the same action (same action id) was several times in the
dashboard.

For instance, if the dashboard contained the list and kanban view
of an action, both views were rendered in the same block, leaving
the other one empty. Moreover, (un)foldeing one automatically
(un)folded the other one.

This was because the action id was used to identify each view, but
this id is not unique in the dashboard. We now use a generated id
instead, which is unique.
2017-05-24 08:25:22 +02:00
qsm-odoo 250e716c3a [REF] web, *: restore views design
Since the new views merge, a lot of design elements were broken. This
was particularly impacting the fields in the editable list view; indeed
the editable list view is not using an inline form view anymore so the
fields in the list were not properly styled as the LESS was still
defined assuming the form view environment (for example the invalid
fields were red for o2m fields in form view but not in editable list
view even though they got the right CSS class).

This commit refactor the LESS following these rules:
- No more division of non-layout and layout rules. Dividing LESS rules
  in x_layout.less and x.less was a mistake. Many rules can be
  considered to be layout and not layout at the same time, developers
  always have to switch from one file part to the other, many CSS
  selectors (and rules!) are duplicated for nothing, ...
- Field style is extracted from x_view.less and put in the new
  fields.less file. As before, the fields_extra.less will contain the
  rules specific to community so that the enterprise repo can override
  those by replacing the whole file.
- Many classes have been renamed so that o_form_x_y becomes o_x_y as
  many classes can now be applied outside of form view. These classes
  should not be used in templates anyway.

The commit also changes the DOM of fields so that it is more minimalist
(no useless parent div, etc).

Input elements are not automatically styled anymore, they have to get
the o_input class explicitely. This allows to fix lots of small style
bugs of previous versions (required monetary field had not the proper
style, readonly m2m tags appeared as editable, ...). This also improves
the LESS code.

The editable list view should also completely stop flickering on chrome
and firefox.

The commit also removes the orange outline on list view dirty cells.

The commit also removes deprecated static xml, LESS and other code.

Notice there are still styles to restore/fix and LESS to improve.
2017-05-04 12:07:30 +02:00
Damien Bouvy 9dc53b620c [MERGE] forward port branch 10.0 up to fc06646cf9 2017-05-04 10:45:02 +02:00
Lucas Perais (lpe) 4a0f9da2e1 [FIX] board: invalidate cache when board is modified
Before this commit, when the user modified the dashboard, it was not always visible without refreshing the web client
For example, display the current dashboard, then go to another view and add an extra view in the dashboard, then go back to the dashboard.
The reason is that the dashboard layout is actually stored in the arch of a form view, and that arch is cached by the data manager.

This is why each change to the dashboard arch requires that we clear the cache.

OPW 740739

Closes #16691
2017-05-03 09:24:00 +02:00
Géry Debongnie 3deac18485 [REF] board: update dashboards to new js framework
With the new views, we totally broke the dashboard.  This commit
rewrites all the code to comply with our new coding guidelines, and make
sure it works, with some tests.

Note that a big change is that we don't instantiate an action manager
and a view manager, we directly instantiate the views.

Also, this is not the best way to organize the dashboard.  I think that
it should be a client action, not a form view, so we don't have to
overload all the form view classes and we don't depend on form view
behaviour/view caches/...
2017-04-11 19:44:38 +02:00
Géry Debongnie 2106e3dd2e [REF] web, *: simplify our RPC system (in JS)
The RPC system was not completely satisfactory, we decided to prepare
the future and do it properly.  This commit introduces the new rpc
system, which replace the previous new one.  We now simply have a
method, this._rpc, which takes a dictionary of parameters.  The idea is
that depending on the parameters, it is able to add correct default
value when necessary.

For situations where we don't have the this._rpc method, we can use the
rpc.query method, which takes the same arguments, but directly calls
ajax.rpc instead of triggering up some events.
2017-04-11 19:44:38 +02:00
qsm-odoo e1b68dae50 [FIX] web, *: fix domain building without CompoundDomain
* board, google_spreadsheet

Commit 8e0c7ccc77f358601b0701536fcb33842ca324a6 got rid of the
CompoundDomain class but did not adapt the code correctly.

- Domains have to be concatened, not regrouped in a big array
- String domains have to be converted to array
- "OR" joining must normalize subdomains first (add explicit "AND"s)
2017-04-11 19:44:38 +02:00
Géry Debongnie 86a87aa8b0 [REF] *: use _rpc method for all rpcs
The _rpc method is now the preferred method to do a rpc, so we need to
update all calls.
2017-04-11 19:44:38 +02:00
qsm-odoo 5804ed100e [IMP] web, *: compute contexts and domains from datapoint
This commit tries to refactore the management of contexts and domains
in the webclient.

- Get rid of CompoundDomain: use standard array manipulation to
join multiple domains or use the Domain class (to be improved)
- Get rid of data.js build_domain and build_context methods
- Link this.record to the data point from the basic model for all
fields (not only relational fields)
- Add a getContext and a getDomain function to the basic model
data point (localData element) so that AbstractField implementations
can use them thanks to their this.record element.
- Remove the autocontext binding for field RPCs (see FieldManagerMixin)
2017-04-11 19:44:38 +02:00
Géry Debongnie 136292f689 [REF] web, *: move CompoundContext out of data.js
We want to remove data.js, but we still need the CompoundContext class,
so we take it out, and rename it 'Context'
2017-04-11 19:44:38 +02:00
Géry Debongnie 905e01921f [REF] web, *: redesign all JS views
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-04-11 19:44:38 +02:00
Christophe Simonis 777a87cde8 [MERGE] forward port branch 10.0 up to 2ef43281c2 2017-03-13 16:22:57 +01:00
Christophe Simonis 2ef43281c2 [MERGE] forward port branch saas-11 up to 2e972578b9 2017-03-13 15:53:55 +01:00
Christophe Simonis 2e972578b9 [MERGE] forward port branch 9.0 up to 73d6f9023a 2017-03-13 14:49:12 +01:00
Christophe Simonis 73d6f9023a [MERGE] forward port branch saas-6 up to 31474efec2 2017-03-13 13:53:54 +01:00
Christophe Simonis 31474efec2 [MERGE] forward port branch 8.0 up to 7a15e52cea 2017-03-13 13:38:04 +01:00
Christophe Simonis f9fa39a8c0 [FIX] board: correctly handle invalid actions
This may happen when a dashboard contain references to deleted actions.
2017-03-08 16:31:03 +01:00
Christophe Simonis 6c4389df41 [MERGE] forward port branch 10.0 up to 6804085b8c 2017-01-23 14:33:53 +01:00
Christophe Simonis b9374d5c21 [MERGE] forward port branch 9.0 up to 0997a1cf6d 2017-01-23 13:39:09 +01:00
Nicolas Martinelli 68dd9bdb0a [FIX] board: prevent crash if no action
If the user tries to save on the dashboard a view which was not open
through an existing action, the call to method `add_to_dashboard`
crashes because of incorrect arguments (`action_id` is undefined in JS).

This is for example the case when trying to save an "Inventory at Date"
in the dashboard (will be fixed in a subsequent commit).

opw-703649
2017-01-23 09:19:49 +01:00
Nicolas Martinelli 7180d948f0 [FIX] board: prevent crash if no action
If the user tries to save on the dashboard a view which was not open
through an existing action, the call to method `add_to_dashboard`
crashes because of incorrect arguments (`action_id` is undefined in JS).

This is for example the case when trying to save an "Inventory at Date"
in the dashboard (will be fixed in a subsequent commit).

opw-703649
2017-01-23 09:19:23 +01:00
Denis Vermylen (dve) eed8a34686 [IMP] crm_*, sale_*: sales channel dashboard
Functional
        ==========

Sales teams become sales channels. Their dashboard cards now include a graph
displaying customizable data for managers (comparable to those in accounting).

By default, you now have the following sales channels (non-demo):

      Direct Sales      (with installation of crm or sale)

  Sales Channel type: Sales
  Works same as before, what's changed is:
    - their cards display one big button directing to the start of their
      workflow
    - the links on the right-hand side have been reworked, and are only
      displayed when there is at least one item requiring attention.
    - 'More' tab remains unchanged.

      Website           (with installation of website_sale)

  Sales Channel type: Website
  Differences lies in the links displayed in the dashboard card:
    - it displays abandoned carts, awaiting payments and payments to capture
  Default Channel linked to all sales made from the eCommerce.

      Point of Sale     (with installation of sale and point_of_sale
                                              -> auto-installs pos_sale)

  Sales Channel type: Point of Sale
  Linked to pos.configs and their pos.sessions and pos.orders.
    - only links to their linked pos.config dashboard and open sessions
    - can't use opportunities, lead or invoicing and can only display
      pos.order data in the graph.
  Default Channel linked to the default pos.config.

        Technical
        =========

- Add a channel type: sales, pos, website that have different actions/settings
- Add a graphs to the kanban cards in the sales/crm dashboard, configurable in
  the form view in the new dashboard page.
- Rename sales teams to sales channels, rename and add default and demo sales
  channels
- Change dashboard links depending on the channel type and add a related
  computed fields on crm.team
- Rename strings and improve channel form view.
- Leads are now checked by default once activated for 'sales' type channels
- Disable checking "leads" without using "opportunities".
- Hide invoicing and invoicing target depending on channel type.
- Move currency_id to sales_team
2017-01-03 19:04:34 +01:00
Christophe Simonis 3d085f632d [MERGE] forward port branch saas-12 up to 6386037 2016-11-08 15:01:20 +01:00
Goffin Simon b9759971b9 [FIX] board: action_id not available in modal
The  favorites menu is always added in search views. Then the
menu "add to dashboard" is always added even if it is triggered from
a form view in a modal. In this case, the action_id is not available
in the object FavoriteMenu.
If the action_id is not available, the menu "add to dashboard" is
hidden.

opw:692023
2016-11-03 10:54:06 +01:00
Christophe Simonis 3bb022d57c [MERGE] forward port branch saas-12 up to 6f8e40c 2016-10-27 18:17:59 +02:00
Christophe Simonis 6f8e40cdec [MERGE] forward port branch saas-11 up to 1304d13 2016-10-27 17:55:47 +02:00