Commit Graph
109216 Commits
Author SHA1 Message Date
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
Martin Geubelle 90d6573579 [FIX] lunch: adapt the code to new views
We also adapt the code to comply to the new guidelines and we have
added some tests.
2017-04-19 17:49:34 +02:00
Martin Geubelle 3445597940 [FIX] web: replace bad use of this
This commit also use `_applyChanges` directly instead
of using `notifyChanges` to avoid the mutex which will
cause a deadlock (we are already in the mutex).
2017-04-19 17:49:34 +02:00
fwi-odoo 10ffcba429 [FIX] web: display stat buttons inline string attribute
Stat buttons of type action have the text that should be displayed
as inline string attribute. This case was no longer supported with the new views.
2017-04-19 17:42:29 +02:00
fwi-odoo 469feaa21d [FIX] web: call the correct format method for the one2many in list view
The one2many fields in list view should render the number of record, like the
many2many fields.
2017-04-19 17:42:21 +02:00
Dharmraj Jhala 7b89b8853a [ADD] web : add isMobile attribute directly in config.js
It is frequently needed whenever we want to make something responsive
Also, we refactor the code to the new coding guidelines (this part was
done by ged)
2017-04-19 15:57:25 +02:00
qsm-odoo c33e535707 [FIX] web: modifiers on <footer/> tag in form
Since the new views, buttons were extracted of the <footer/> tags and
placed directly in the buttons area. While this would be a good idea,
this was ignoring the modifiers placed on the <footer/> tags. Multiple
solutions were possible:

1) Leave the <footer/> tag as it is (like before the new views)

    This creates an useless <footer/> element in the DOM most of the
    time.

2) Propagate the <footer/> modifiers to its children.

    This requires some code to do the propagation and a modifier might
    be evaluated multiple times for nothing (for each child).

3) Allow only one <footer/> tag in form views and divide buttons in
   child <div/> elements.

    Only creates the necessary DOM elements and modifiers are evaluated
    only once.

While the third choice is obviously the better one, this commit is
implementing the first solution. Indeed, changing all the XML views
might not be a good idea in the current state.
2017-04-19 15:33:40 +02:00
Christophe Matthieu 9bf3e2a7fa [IMP] web: add timezone_mismatch field widget
* display a warning when the timezone offset is not the same of the browser
timezone offset
* if different, display the time in the selected timezone
2017-04-19 14:48:07 +02:00
Christophe Matthieu 69ae6e2912 [FIX] web: use correct timezone for date fields
before this commit when toggling allday flag in calendar form view, it was
possible to have one day error.

The input datetime is wrong when the user don't use the datepicker widget
 (insert date by keypress instead of click on datepicker)

sometimes, the value could be null (crash because try to clone false)
2017-04-19 14:48:06 +02:00
qsm-odoo 7ff8aa73e1 [REF] web, *: implement modifiers behaviors
* account, mail, sale

Since the views refactoring, modifiers were not properly handled
anymore (readonly/required not recomputed, use of readonly/required
of "python field" instead of "view field", ...). This commit tries to
implement a system which allows to handle the modifiers (re)computation
the same way for all the basic views.

For this to work, many specialized renderers behaviors have been moved
to the basic renderer so that more mechanisms are shared (especially by
the form renderer and the list editable renderer). The list editable
renderer is hugely impacted by this commit.

Here is a list of key changes:

- The basic renderer now has a `_renderFieldWidget` function which is
  used without modification by the form and the list renderers.

- Modifiers have to be registered thanks to the basic renderer
  `_registerModifiersData` function (this is done automatically for
  fields by the `_renderFieldWidget` function for example).

- All instantiated widgets are accessible, organized by record, and
  ordered in a special basic renderer variable.

- The code which resets the widgets of the form view and the code
  which updates the row of a list editable view is now shared in the
  basic renderer and now also automatically updates the DOM according
  to the reevaluated modifiers.

- The last point has an huge impact on list editable renderer: all the
  widgets have to be instantiated when editing a row (even readonly and
  invisible ones) as they can be switched to editable/visible during
  edition (after a modifiers update).

- `replace_element` and `readonly` options of `AbstractField` are
  useless: widgets are now always replacing the list editable cells
  in edition and the `readonly` widget mechanism is replaced by the
  notion of 'focusable' widgets.
  (see `AbstractField.getFocusableElement`)

- The 'tab' navigation mechanism is impacted by the previous point,
  some code sharing have been done in basic renderer for this too.

- `AbstractField` does not care anymore of the 'required' status, this
  is the view responsability to check that a required field has a set
  value on save.

- Some list editable bug fixing (e.g. it was possible to edit multiple
  rows at the same time, it was not possible to navigate towards the
  previous field, crash on o2m add an item click, ...)

- The mockserver now properly simulates server modifiers computation.

- ...

Note: list editable style may be worse than before this commit but a
CSS update is coming in a few days.
2017-04-19 11:42:01 +02:00
Christophe Matthieu ff86e5b986 [FIX] web: prevent crash when the user doesn't have timezone 2017-04-19 10:14:02 +02:00
Alexandre Fayolle 7ca29909e8 [IMP] hr: split updating manager method
Extract setting the employee's parent when changing the department manager.
This allows customizing the way the managers are handled easily in extension
modules.

Closes #16490
2017-04-19 09:40:47 +02:00
Christophe Simonis 39ab200cd3 [MERGE] forward port branch saas-15 up to 780064ea89 2017-04-18 18:37:24 +02:00
Martin Trigaux 780064ea89 [I18N] export saas-15 source terms 2017-04-18 18:16:42 +02:00
Christophe Simonis 6c02d0de41 [MERGE] forward port branch saas-14 up to 2b3a5c8ec8 2017-04-18 18:16:13 +02:00
Christophe Simonis 2b3a5c8ec8 [MERGE] forward port branch 10.0 up to 72b7eb7e6e 2017-04-18 17:59:08 +02:00
Christophe Simonis 72b7eb7e6e [MERGE] forward port branch saas-11 up to 43bb85a501 2017-04-18 17:08:24 +02:00
Christophe Simonis 43bb85a501 [MERGE] forward port branch 9.0 up to 7591f59c5e 2017-04-18 17:02:13 +02:00
Christophe Simonis 2b68f4341f [FIX] point_of_sale: compute total with taxes in tests 2017-04-18 16:55:02 +02:00
Thibault Delavallée f93c4f4262 [ADD] mass_mailing_event_track: add mass mailing UX on event for track speakers
If the event has some tracks a button is displayed to launch a mass
mailing on those speakers. This button requires a new bridge module
between mass mailing and website_event_track.
2017-04-18 15:33:12 +02:00
Thibault Delavallée 7d3ffc294f [ADD] mass_mailing_event: add mass mailing UX on event for attendees
If the event has some attendees a button is displayed to launch a mass
mailing on those attendees. This button requires a new bridge module
between mass mailing and event.
2017-04-18 15:32:51 +02:00
Martin Trigaux 8fe0639d0a [IMP] point_of_sale: display failing orders
When closing a session is failing, explain which order fails and why.
Allow to quickly see payment or rounding issues.
2017-04-18 15:00:42 +02:00