Commit Graph
1893 Commits
Author SHA1 Message Date
Aaron Bohy b0e51ffade [FIX] mail: Chatter: crash when mentionning non followers
Caused by a stupid programming error.

Also refactor a bit the code that performs mention RPCs (that are
throttled) to allow to override the throttling value for the tests.
2017-05-16 11:16:03 +02:00
Thibault Delavallée 803d5cf048 [IMP] mail: add view reload option on chatter
Purpose is to be able to reload the view after posting a
message using the chatter. Reason behind that move is that
records can be updated after processing message_post and
this is the easiest solution to enable the reload feature
without having an event-based chatter.
2017-05-04 14:15:33 +02:00
Thibault Delavallée 0389b3043b [FIX] mail: fixe issue with suggested recipients introduced with new views
Somewhere in the new views refactoring, between file splitting and rpc
engine quadruple refactoring, a deferred was lost. Due to this chatter
does not have correct information about message recipients.

This commit fixes it by putting the deferred back.
2017-05-04 14:15:11 +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
Fabien Pinckaers a97cb66961 [IMP] mail: less visible when no activity scheduled 2017-05-02 09:12:32 -07:00
Fabien Pinckaers a5cf0cc8b4 [IMP] mail: spacing around the next activity icon 2017-05-02 09:05:56 -07:00
Aaron Bohy 790206d12c [FIX] mail: followers: don't list followers twice
Before this rev., if concurrent calls to 'read_follower' were
performed, it might happen that the read followers appearead twice
in the follower dropdown.

This was for example the case when validating an invoice: the
customer was listed twice as follower.

Note: in this particular case, the record shouldn't be reloaded
twice: this is another bug to adress.
2017-04-27 15:53:16 +02:00
Martin Trigaux de4a2216b9 [IMP] mail: change smiley
Critical improvement, 
`:)` was making a laughing guy that could be considered as mockery.
This smiley is way more friendly and should improve support feedback by at
least an order of magnitude better, maybe two.

Closes #16672
2017-04-27 12:29:47 +02:00
Aaron Bohy b25ba51e6f [FIX] mail: client action: listen to search view changes
When the user changes the filters in the search view, this one
triggers up an event to notify its environment that its state
changed. This came with the new views, as before the search view
triggered an event on itself (i.e. used 'trigger' instead of
'trigger_up'). At some point, 'trigger' will be deprecated and
'trigger_up' will be used instead, everywhere.

The code in mail hasn't been updated accordingly, so the thread
wasn't updated when the user changed the filters.
2017-04-25 08:58:34 +02:00
Aaron Bohy 764127357c [FIX] mail: re-bind handlers on chatter buttons
When a user opens a record in a form view, the chatter is
displayed. Then, if he clicks on 'Create', the chatter is removed
from the DOM (there is no chatter in create mode). After saving
the newly created record, the chatter is displayed again, but the
same widget's instance is kept.

However, when being removed from the DOM, the event handlers bound
on elements of the chatter (e.g. 'New Message', 'Log a Note'...
buttons) are automatically unbound.

So before this rev., the buttons didn't work anymore once the form
view had switched to create mode. In this commit, we detach the
chatter's $el before updating the view, so that its handlers aren't
unbound when the old content is replaced by the new one.
2017-04-25 08:07:17 +02:00
Siddharth Gajjar bd5709c1d5 [ADD] mail: re-introduce recommended next activity
Activities now have recommended next activities. Based on next activities
configured on activity types, it allows to implement light workflows
using next activities feature.

This feature was removed when refactoring crm activities to generic
activities. People asking to remove it were visibly wrong and it is
now implemented back as it was in v10.
2017-04-24 12:31:43 +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
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
Thibault Delavallée e18c63e007 [IMP] mail: rename schedule an activity button
Zizisse uzabiliti.
2017-04-20 10:43:02 +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 Simonis 39ab200cd3 [MERGE] forward port branch saas-15 up to 780064ea89 2017-04-18 18:37:24 +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
Nicolas Lempereur 671bd703bf [FIX] mail: error notification safari iphone 7
On safari iphone 7 (and possibly other browsers) we could have an error
by referencing to an undeclared Notification variable.

opw-726084
2017-04-13 13:56:57 +02:00
Aaron Bohy 3d959382fd [FIX] web,mail: one2many records: multiple views
A record of the basic model may need to be displayed in different
views (e.g. a o2m record is displayed in the, e.g., Kanban view
inside the main form view, and if clicked, it is also displayed
in the form view opened in a dialog). However, the fields present
in those views may differ.

The previous implementation of fieldsInfo in the record didn't
handle that, as it was a dict whose keys were field names. With
this commit, the fieldsInfo is dict whose keys are view types, and
the values are dicts whose keys are field names (the fields of
the corresponding views, with they attrs in the view).

This allows to create multiple o2m records in a row in a form view.
2017-04-11 19:44:38 +02:00
Aaron Bohy 11a17f7bb9 [FIX] mail: activity feedback: port odoo/odoo@63167fc5
to the new views
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
Christophe Matthieu eaa66d1156 [REF] web: change internal representation of fields and view meta datas
* Data manager load_view returns a viewInfo object
* ViewInfo contains: the arch, fields and fieldsInfo objects, and some extra informations
* The fields come from the server and are frozen, without any view attributes (depend of the model).
* The fieldsInfo contains every view attributes and informations.
2017-04-11 19:44:38 +02:00
qsm-odoo 49f7a9f657 [REF] web, mail: use field registry in views, not renderers
Before this commit, the AbstractField specialization to use to
instantiate a field was determined in the renderers. Now this is
regrouped in BasicView.

Note: renderers are still left free to not use the determined
Class (like Kanban and not editable List which instantiate widgets
only if the "widget" attribute is present).
2017-04-11 19:44:38 +02:00
qsm-odoo 228e18e81a [REF] web, mail: include evaled field options in datapoint
Field options do not depend on any context/data. They can so be
"computed" once and for all in the BasicView implementation instead
of in the AbstractField's one.

Also, remove the flag __always_reload and leave it be in the
options object (always_reload).
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
Géry Debongnie 1ec265eb92 [REF] web: move ServicesMixin out of mixins.js 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 e574027056 [REF] web,*: remove 'web.model' and 'web.dataModel
Use this.rpc instead of Model object, with web.ajax if necessary.

nb: EventDispatcherMixin include now the custom_events managment instead
of widget
2017-04-11 19:44:38 +02:00
Aaron Bohy abce447401 [FIX] mail: use _.str.startsWith (startsWith is ES6) 2017-04-11 19:44:38 +02:00
Géry Debongnie dde1223a14 [REF] *: remove manualDestroy options for tests
With the new JS test framework, we had experimented with an autodestroy
feature, meaning that all views/widgets are automatically destroyed
after a while.  By default, it was 50ms, because we could not hook some
code to run after the end of the current test.

For various reasons, this was not a good idea: some side effects, such
as modifications of the session or of the DOM (with modals) could
interfere with other tests.  This commit disable the feature.

From now on, we will have to destroy each widgets created in a test.
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
Fabrice Henrion 5420c92b89 [IMP] mail: better notification icon
This icon allows to control what types of notifications you want to receive.
That an icon typically used for "notifications" is better than an icon
typically used for "reminders" and "alarms". There is the risk of a wrong
expectation because reminders and alarms have a notion of time associated to
them: reminders in the future or alarms in the future at a given time. In the
case of a follow, there is no "future time" concept, whereas there is a
notification concept. It makes even more sense when we look at the placement of
this icon on the right side of the label "Following".

Closes #16170
2017-04-07 15:40:55 +02:00
Martin Trigaux 2382520c34 [IMP] odoofication 2017-03-30 08:59:13 +02:00
Christophe Simonis fb2504b24c [MERGE] forward port branch saas-15 up to aebd043662 2017-03-28 18:38:49 +02:00
Christophe Simonis 2df5faa551 [MERGE] forward port branch saas-14 up to 2f68e9e93a 2017-03-28 18:05:31 +02:00
Christophe Simonis 2f68e9e93a [MERGE] forward port branch 10.0 up to 72fa3e8bda 2017-03-28 17:27:19 +02:00
Fabien Meghazi 1217ae914b [FIX] web/mail: many2many_tags_email widget returns erratic values (opw: 693067)
The many2many_tags_email's internal value change logic fails to process
all its values. It is not concurrency proof either.

The internal value change logic is now replaced by a mutex and deferreds
are used for the partner's form view popups in order to allow concurrent
events.
2017-03-24 11:31:56 +01:00
Mahendra barad 63167fc51b [IMP] mail: allow users to give schedule and give a feedback on activities
When setting an activity as done in chatter users now have the possibility
to add a feedback. This feedback is added in the generated message that
already contains the activity name and note.

Moreover users now can also immediately schedule a next activity. This is
very useful for chained activities and speeds up activities use.
2017-03-23 17:39:18 +01:00
Thibault Delavallée 9c42c699f5 [CLN] mail: lint activity widget 2017-03-23 17:39:18 +01:00
Nicolas Martinelli 0e7ced70c1 [FIX] mail: reply message type
- On a model, log a note and ping User A
- Go in the inbox of User A, and reply to the message

The reply is a comment (therefore sent to all followers of the
document), not a note.

opw-710326
2017-03-23 11:14:42 +01:00
Christophe Simonis 65a5ced979 [MERGE] forward port branch saas-14 up to 777a87cde8 2017-03-13 17:37:20 +01: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
Denis Ledoux 466e2b8c9f [FIX] mail: URL regex to make links clickable in chatter messages
The former URL took way too many steps to resolve
`www.odoo.com(odoo-odoo-odoo)`, more than 1 minute
according to the case, and it stucked the web client
(the entire browser actually),
and it ended matching the whole sentence as a link,
included `(odoo-odoo-odoo)`

This new regex is much simpler, resolve the above case,
and does not match `odoo-odoo-odoo` as part of the link

opw-715797
2017-03-10 17:09:11 +01:00
Thibault Delavallée 856335ddb4 [REV] mail: remove unnecessary override to add filter in JS
This reverts commit 96b9d28351.
2017-03-06 12:04:43 +01:00
Mahendra barad 26940f8de4 [IMP] mail: remove duplicated logs when scheduling activities and improve template
Currently when scheduling activities, duplicate logs are created. Indeed
a message is posted when scheduling an activity, editing it and marking it
as done. This leads to a lot of noise being created on records.

This commit remove logs when scheduling and updating an activity. A sole
message is posted when the activity is marked as done.

Scheduled activity display in chatter is also improved to better
differentiate the user creating the activity from the user who is
assigned to the activity.
2017-03-03 11:40:50 +01:00
Christophe Simonis 68176d80ad [MERGE] forward port branch saas-14 up to eddefc9948 2017-03-01 16:49:15 +01:00