Commit Graph
109237 Commits
Author SHA1 Message Date
Géry Debongnie a765ff503d [FIX] web: reload list view after button action
Before this commit, the code that handled buttons in list view was kind
of simple, and did not reload the view after.

But clicking on action button is not only a problem for the list view,
the form view already had something in the controller doing exactly
that.  With this commit, we move that code to the basic controller, and
use the method in the list view.
2017-04-24 10:43:20 +02:00
sap e59c1b49c2 [IMP] web, various: apply kanban card color on header instead of whole card
Currently applying a color to a kanban item applies it to the whole
card. This creates usability issues as the content is not dynamically
updated to match the chosen color.

This commit proposes to apply the color only to the header and let the
card content standard. It helps designing cards that are always usable
and readable.
2017-04-24 10:36:29 +02:00
Géry Debongnie d658fe67db [FIX] web: debugmanager view metadata should not crash
In general, I think that we can safely consider that crashes are not the
intended behaviour.

In this case, viewing metadata crashed because we tried to format a date
which was not parsed (so, a string), instead of a moment object. We
simply just parse the date before, and it works as intended.
2017-04-24 10:28:52 +02:00
Géry Debongnie ae1a30e618 [FIX] web: use correct id when using form buttons
With new records, it could happen that clicking on a button in the
header was followed by actions using the wrong id.  This was caused by a
field name="id" in the view (see sale order view, in the
delivery.view_order_form_with_carrier inherited view).

In that case, the id was registered in the changes list, and caused
invalid data in the record: its data.id was set to null.
2017-04-24 10:20:34 +02:00
Géry Debongnie e4bf1f1ccc [FIX] web: form view should focus fields if possible
When a form view switches to edit mode, it is supposed to give the focus
to the first field, or, to a field tagged 'default_focus'.
2017-04-24 10:19:18 +02:00
Géry Debongnie d8261d1162 [FIX] web: fix issues when deleting records
This commit solves two issues with deletion:
- deleting the last record in a form view now triggers a history_back
  action, which means that the view will be changed back to the main
  view (a list view for example), instead of staying in form view
- deleting a record did reload the view twice in some cases.
2017-04-24 10:13:54 +02:00
Géry Debongnie 1561165fe2 [FIX] web: properly format dates in context
When evaluating a context, we need to use the server format for dates,
because the context will ultimately be sent do the server.  Also, moment
objects are not known by pyeval, so they simply cause a crash (for
example, see bank statements form view, edit it, click on 'add an item')

With this commit, we make sure that the evaluation context is correct,
with respect to dates (we use the toJSON method, because that is the way
we get the server compatible date)
2017-04-24 10:12:47 +02:00
Géry Debongnie 329c2ded24 [FIX] web: in x2manys, do not do onchange if invalid line
In general, with the new views, we execute immediately and recursively
all onchanges, even from a x2many in a form view.  It allows for nice
interactivity, for example, recomputing immediately a total or a tax in
a sale order when an order line changed.

However, we are used to treat x2manys in a slightly weird way: for
example, if you add a line in a one2many, then click elsewhere, most of
the time, it is validated.  But if the line is 'incomplete' (I mean, if
a required field is not set), the line will not be validated, but be
automatically discarded.  If it was dirty, a confirm dialog will open.

So, to keep in line with that semantic, we have decided that onchange
will just not be done until the line is 'valid'.  This will avoid
trouble when someone add a line, it triggers some onchange which changes
some values in the form, then click somewhere else, the line is
discarded, but the changed values persist.  Most of the time, it
probably won't be a problem, because another onchange will be triggered,
but it is some useless work anyway.
2017-04-24 10:09:30 +02:00
Joren Van Onder 272e2cb048 [FIX] point_of_sale,pos_*: correct arguments of rpc fail callbacks
The introduction of the new RPC framework (see
0df9968433,
e574027056 and
2106e3dd2e) replaced RPC calls made with
web.DataModel by web.rpc. The arguments in the fail callbacks for
these are different.

For web.DataModel an error object and a jQuery event are passed. The
jQuery event had to be DefaultPrevented to avoid web.session from
trying to show a traceback dialog.

For web.rpc an error type and an error object are passed. This caused
errors because the code was calling preventDefault on the error
object. Because it bypasses web.session entirely a traceback dialog is
never shown, so we don't have to worry about preventing it anymore.
2017-04-23 19:17:35 -07:00
dut-odoo 817fafb66f [IMP] sales_team: handle 'unassigned' in graphs
show not defined instead of false when groupby salesperson
2017-04-21 18:37:55 +02:00
dut-odoo 732306cf39 [IMP] sales_team: show graphs to own documents users
Now that users with restricted access can view the dashboard graphs,
access rules need to be applied upon fetching the data.

This commit also adds the missing access rules on sale reports.
2017-04-21 18:37:55 +02:00
Denis Vermylen ee4495228f [REF] crm,sale,*: dashboard_graph_model values
rename values of selection field to actual model names.

this prevents the need of a separate function to get the sql table
and allows to get direct access to the model.
(needed for the next commit)
2017-04-21 18:37:55 +02:00
dut-odoo 48e843aa8d [IMP] sales_team: improve sale channel settings
Current sales channel configuration for graphs is complicated for users.

This commit attempts to simplify the form view by renaming labels on
selections depending on the chosen graph model.

It also adds the option to group by stage for the pipeline graph and
hides the team members for the POS and eBay sales channel.

- swap `groupby` with `period`
- for `sale` and `invoice` graphs:
  - rename label: `period` -> `scale`
  - rename graph periods' selection items: `This Month/ This Week/ This Year` -> `Last Month/ Last Week/ Last Year`
- for `pipeline` graph:
  - rename label: `period` -> `expected to close`
  - rename graph periods' selection items: `This Month/ This Week/ This Year` -> `Within a Month/ Within a Week/ Within a Year`
  - rename graph groupbys: `Day/Week/Month` -> `Expected Closing Day/ Expected Closing Week/ Expected Closing Month`
  - add new graph groupby: `Stage`
- remove lead management fields for ebay and pos channels
  - hide `Assignation` page and `Domain`, `Assigned Leads Count` and `Minimum Score` fields
  - in dashboard page, make content field readonly
2017-04-21 18:37:55 +02:00
Mehul Patel 1face40a57 [IMP] website: Remove margins around the todo bar in dashboard
Purpose
=======

todo bar shouldn't have margins around. It makes it look unaligned with the blocks below.
2017-04-21 15:45:18 +02:00
Aslam Shaikh 8540e3c836 [IMP] mail: move Discuss search on top of channels
Indeed when having a lot of available channels searchbox is displayed
quite low in the screen. This is annoying. This commit improves that
behavior by putting the searchbox above channels.
2017-04-21 15:32:26 +02:00
Dhawal Limbuwala c9686df1d0 [IMP] base: Reorganise General Settings
Purpose
=======

Clean the menu on Settings as some the items are really advanced

Specification
=============

- Keep Menu : Dashboard - Users & Company - Translations - General Settings

- Google drive is already on General Settings - no need to repeat Remove

- and add to debug menu + : Postal Printings - Database anonymization
2017-04-21 15:27:51 +02:00
Neha Patel bcf8c8c86e [IMP] mail: hide 'mark all read' button in inbox when small device
Zizisse someutch uzabiliti.
2017-04-21 14:49:56 +02:00
Géry Debongnie fb06850e49 [FIX] web: prevent onchanges with invalid values
Before this commit, when a field was changed, it always triggered a
field_change event, with the new value, even if that value is not valid.
As a result, it could happen that an onchange was sent to the server
with a string as the value of a float field.

What we do in this commit is making sure that invalid values do not
escape the confine of a field, by returning immediately after detecting
that a value is not valid.
2017-04-21 13:58:57 +02:00
David Monjoie a6c64399d2 [FIX] web: look for nolabel in attributes rather than options 2017-04-21 13:25:37 +02:00
David Monjoie 5401c15dd7 [FIX] website_event_track: fix state_selection widgets in views
Also add a deprecated fallback for similar widget calls in partner
code.
2017-04-21 13:25:36 +02:00
David Monjoie 25f5f556c8 [FIX] web: fix expand all button in pivot view
Also took this opportunity to refactor the code of pivot to adapt
the parts that were not up to date and remove the useless deferred
in sortRows, courtesy of aab.

The exportData function still needs reworking.
2017-04-21 13:25:36 +02:00
David Monjoie 2d251a6c28 [FIX] web: use momentjs for default filter value
The format methods of the date/datetime type expect a momentjs date
so it can call its 'format' method. Since we were not giving it a
momentjs date, the call to 'format' was crashing.
2017-04-21 13:25:35 +02:00
Haresh Shyara c9c05e54e5 [IMP] project: improve automatic following of projects
This commit proposes to improve the way people follow project with two
additions

 * project manager is now automatically follower of his project
 * customer is now automatically follower of customer projects. Those
   projects are meant to be used with external people and access rights
   are based on followers. Adding the customer in followers allow him
   to see and participate in the project tasks and/or issues.
2017-04-21 11:53:30 +02:00
Pratima Gupta 36c102694b [IMP] website_project(_issue): improve search on website page for tasks and issues
This commit improves the various way of searching tasks and issues in
website pages for tasks and issues. As for other website apps it is now
possible for the customer to search in name, description, stage or
discussion thread.
2017-04-21 11:41:18 +02:00
Chirag Vaghela 1eaf428069 [IMP] hr: improve labeling of public / private data
It is currently not clear what adresses and tabs in employee form view
are about, especially concerning public, work and private data. This task
improves the labeling of the home address (private one) and public and
personal tabs (work and private actually).
2017-04-21 11:38:04 +02:00
Christophe Matthieu 414eb53d01 [FIX] web: can open a record with a virtual id
Before this change, the switch view open a create form instead of open the
record.
eg: click to open a recurrent event in calendar list view
2017-04-20 17:07:37 +02:00
Christophe Matthieu 817873ad33 [FIX] web: fix various bugs with context
* should use the optional context when opening a formViewDialog
* calendar must send the context for writing or creating records
2017-04-20 17:07:37 +02:00
Christophe Matthieu 30bb41d588 [FIX] models.py, all: lang in context can be None
Different method use self._context.get('lang', 'en_US') to get the lang
value but, the lang in the context can be set to None (eg: copy method).
When the context is used with a lang=None, the method can have a
unexpected behavior or crashed (eg: if you try to format a datetime with a
locale=None)lang can be None
2017-04-20 17:07:37 +02:00
Christophe Matthieu 19eef5d658 [FIX] web: allow virtual ids for integer fields
Before this change, the redering throw an exception when we try to open
a form view with a virtual id.
eg: recurrent event in calendar
2017-04-20 17:07:37 +02:00
fwi-odoo 86af036ea1 [FIX] web: fix various bugs when fetching x2manys in form views
- When an one2many is displayed in a list view, the field data are not fully loaded
since only the number of record is displayed. Then when the related form view
is opened the one2many fields displayed need to be loaded.

- Optimized the fetch of x2manys without doing an useless rpc
if we don't need all the fields but only the relation records ids and adapt
the tests for this optimisation.

- Fix wrong inheritance for kanbanmany2many_tags
2017-04-20 16:41:59 +02:00
Aaron Bohy 6da35f7140 [FIX] web: FormView: send correct context on create
'this.context' doesn't exist anymore, 'record.getContext()', where
record is a model's dataPoint, should be used instead.
2017-04-20 14:16:26 +02:00
Aaron Bohy 78709e6b14 [FIX] web: BasicModel: context when creating a record
Before this rev., the context sent when creating (or saving) a
record was incomplete. Thus, the created record might be incorrect.

For example, go to Sales, open a team's pipeline, click on 'Create'.
The created record should belong to the selected team, thanks to
some keys specified in the context. This wasn't the case before
this rev.
2017-04-20 13:56:53 +02:00
Aaron Bohy 51beb6a0ad [FIX] web: JournalDashboardGraph: empty $el at rerendering
The '_render' function of field widgets can be called several
times in the widget's life cycle (each time its value changes).
The JournalDashboardGraph appends a new 'svg' to its the $el at
each rendering, so it must empty its $el at the beginning of each
rendering.

Before this fix, several graphs were displayed in the same kanban
card in the Sales dashboard when, e.g., the user changed the color
of the card.
2017-04-20 13:12:50 +02:00
Aaron Bohy e61454f148 [FIX] web: BasicRenderer: don't reset this.defs too soon
The 'defs' attribute of the BasicRenderer is used to push the
rendering deferred of asynchronous fields. It is set to an empty
array before the rendering, and for each asynchronous field, its
deferred is pushed in the array, so that the renderer can wait for
all its fields to be rendered (no flickering).

The function '_applyModifiers' is called during the whole view
rendering (for each field in the view), and when some fields
change, as the modifiers are then re-evaluated.

As it is called during the whole view rendering, it can't delete
the 'defs' attribute, otherwise it will crash if one of the
remaining fields in the view uses an asynchronous widget (trying
to push a deferred in an undefined variable).

This rev. moves the deletion of 'defs' to the function that is
called when all modifiers are re-evaluated and applied.
2017-04-20 13:12:50 +02:00
Aaron Bohy 6a5f18f970 [FIX] web: AceEditor tests: don't try to remove libs
... to clean up once the test is finished, because it doesn't
work.

The previous solution to clean up only deleted ace and require
from window, but doing this didn't force a reload of the libs for
a potential second test using ace (because the scripts were still
in the page). Trying to remove the scripts from the page doesn't
work either because the loadJS function uses an internal cache
to prevent from loading twice the same lib.

So if we want to have more than one test on ace, we can't clean up
the libs.
2017-04-20 13:12:50 +02:00
Adrien Dieudonne ef3200f940 [FIX] web: BasicModel: id in evalContext
The evalContext contains the current data of a record
(the value of the fields that have been fetched,
i.e. the ones referenced in the view).
However, 'id' is a particular field that should always
be in the evalContext, even if not in the view
(as we always know its value).

Before this rev., 'id' was in the evalContext if
the record already existed, but not on new records, so it crashed
on new records if 'id' was used in the context defined on a field's node.
2017-04-20 13:08:14 +02:00
Thibault Delavallée e18c63e007 [IMP] mail: rename schedule an activity button
Zizisse uzabiliti.
2017-04-20 10:43:02 +02:00
Thibault Delavallée 1f34c6703c [REM] crm: remove activity stmart button
Because with new activities it does not make sense to have a button
completely crm-related although activities are now cross apps.
2017-04-20 10:38:00 +02:00
Thibault Delavallée de62bfb565 [IMP] project: merge followers when merging tasks 2017-04-20 10:36:22 +02:00
Thibault Delavallée ad92c84be4 [MERGE][ADD] mass_mailing_event(_track): add mass mailing shortcuts on attendees and track speakers
This commit merged remote-tracking branch 'dev/master-event-mm-tde'.
2017-04-20 10:29:48 +02:00
Richard Mathot 8f199e4f20 [FIX] lunch: avoid unassigned variable
Since 54245deebd, when you clicked twice
on the button "Confirm" on a slow connection, you could get an error as
values is not always defined.

This commit fixes the bad indentation level :)
2017-04-20 09:16:03 +02:00
Martin Geubelle 841af2acb3 [FIX] web: data_manager: replace call_kw session.rpc
`rpc.query` is an helper for `call_kw` session.rpc.

This helper will, for example, add the mandatory `kwargs`.
2017-04-19 17:49:36 +02:00
Martin Geubelle a18ab5d713 [FIX] web: replace forgotten get_context on controller
The method is now called `getContext`.
2017-04-19 17:49:36 +02:00
Martin Geubelle 625a7438f0 [FIX] web: do not apply impossible onchanges
Before this commit, all onchanges were applied if the field
was known on the model.

However it's not possible to apply onchanges on x2many not in
the view as we don't know their fieldsInfo.
2017-04-19 17:49:36 +02:00
Martin Geubelle f57932b932 [FIX] web: add missing handler on quick_create
The custom event `quick_create` was linked to `_onQuickCreate`
which didn't exist on the FieldMany2One.
2017-04-19 17:49:36 +02:00
Martin Geubelle a495bc4a52 [FIX] web: adapt export data to new views
This commit just fixes the traceback due to the new views.
Another commit to refactor the whole widget will follow.
2017-04-19 17:49:35 +02:00
Martin Geubelle 5dfd3a9d7c [FIX] web: List: archive record
The method `update_state` doesn't exist anymore and has been
replaced by `update`.
2017-04-19 17:49:35 +02:00
Martin Geubelle 8535050c64 [FIX] fleet: do not specify a label for an inexisting field
The field `modelname` doesn't exist on the model.
2017-04-19 17:49:35 +02:00
Martin Geubelle 3b828104b6 [FIX] *: remove many2many_kanban widget occurences
This widget doesn't exist anymore as it has been factorized. Remove the
attribute widget will use the correct widget `many2many`.
2017-04-19 17:49:35 +02:00
Martin Geubelle 3b3e71c2dd [FIX] web_kanban: remove add new column on 'Discard'
The 'Add New Column' was still in `folded` mode after clicking on 'Discard'
because the mode was toggle two times: one by `_cancel` and another one by
`_onClick` which already toggles the mode.
2017-04-19 17:49:34 +02:00