Commit Graph
109516 Commits
Author SHA1 Message Date
Thibault Delavallée 7da0ea30fb [IMP] hr_recruitment: update applicant after creating a partner from chatter suggestion
When a message is posted through the chatter and creates a new partner
the applicant is now updated so that the partner field is correctly set
to the newly-created partner.

Chatter on applicant now uses the reload option so that the view is
reloaded after posting a message. The user therefore sees that the record
has been updated accordingly.
2017-05-04 14:15:34 +02:00
Thibault Delavallée 4207b33b88 [IMP] project_issue: update issue after creating a partner from chatter suggestion
When a message is posted through the chatter and creates a new partner
the issue is now updated so that the partner field is correctly set to
the newly-created partner.

Chatter on issue now uses the reload option so that the view is reloaded
after posting a message. The user therefore sees that the record has been
updated accordingly.
2017-05-04 14:15:33 +02:00
Thibault Delavallée 38e6f35283 [IMP] crm: update lead after creating a partner from chatter suggestion
When a message is posted through the chatter and creates a new partner
the lead / opportunity is now updated so that the partner field is
correctly set to the newly-created partner.

Chatter on lead / opportunity now uses the reload option so that the
view is reloaded after posting a message. The user therefore sees that
the record has been updated accordingly.
2017-05-04 14:15:33 +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 ae04ea2bf5 [IMP] mail: add a post-process hook for message post
Models inheriting from mail.thread can override this method and hook
on post message_post event and perform some action depending on the
business flow.

Future commits will use that hook to update the record after posting
a message, like updating the customer.
2017-05-04 14:15:11 +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
Pragnesh Mistry 8bf4cf118b [ADD] project: add my followed task filter
There is currently no 'followed task' filter. Making custom filter does
not work as it erases existing search. When working in some projet context
you do not want to loose your existing search criterions. We therefore
choose to add a new 'my followed task' filter.

We could have made ir.filters not exclusive aka add them to existing
search criterions but "some people" did not want.

Last but not least, we add this filter because FGI requested it.
It seems sufficien to me.
2017-05-04 13:53:16 +02:00
Géry Debongnie 0d5d9fa3f5 [FIX] web: improve editable list view rendering speed
The editable list view may be really new, but it still suffers from a
performance issue.  The problem is that we need to evaluate modifiers
for a (sometimes) large number of fields: a list view with 80 rows and 7
columns has 560 field values.  This is not so large, but each of these
evaluation is still costly.

In particular, it needs to compute the evaluation context.  However, the
evaluation context is the same between all fields of the same record, so
in that case, the web framework does way too much work (with 7 columns,
it is 7 times too much).

This commit does not totally fix the issue, but it helps quite a lot.
What we do is just memoize the evalcontext computation. This means that
it will be evaluated only the first time it is needed, then will be kept
in memory.

Note that this is a fix, not an imp. The list view should be fast...
2017-05-04 13:45:26 +02:00
Aaron Bohy 7d26d244a4 [FIX] web: BasicModel: trigger onchange when x2m is valid
When a record is added in an x2many field with an onchange, the
onchange is only triggered once the new record is valid (i.e. when
all its required fields have a correct value).

However, there was an issue in the code checking the validity of
a record, as it checked, for each required field, that its value
wasn't falsy (!value). This is incorrect for several type of
fields:
 - numerical: a value of 0 is correct
 - boolean: should be always considered as correct
 - x2m: their value is a dataPoint, so it is never falsy, what
   should be check is the number of records inside the dataPoint.

This was an issue for example in the sale.order form view, as the
onchange wasn't triggered when an order line was added (with a set
product), so the total amount wasn't updated correctly.
2017-05-04 12:39:07 +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
Martin Geubelle 8943aae665 [FIX] web: deal wih default_order attribute
One could set the attribute `default_order` in the view arch
(like 'name,id desc'). The records should then be sorted accordingly.

This feature was not implemented in the new views.

This attribute should work on both basic views and embedded views (x2many).
The former uses the `sort` argument in `search_read` while the latter is
sorted client-side.

There is however a potential issue with the latter: as the order is done
client-side with records received by the server, if there are more records
than the limit, the server will send records without any order. The client
side order will thus be done on a fraction of the records.
2017-05-04 11:58:26 +02:00
Martin Geubelle 4a648c227a [FIX] web: Kanban: load more records in column
The method `load_more` has been wrongly removed from the Kanban model.
2017-05-04 11:58:26 +02:00
Martin Geubelle b84137c67f [FIX] web: Kanban: deal with group_create attribute
This attribute is used to determine one can create a new column in
the kanban view.

Before this commit, it was always true and not specified in the
controller `activeActions` (which was causing a bug where the
no content helper was displayed instead of the column quick create).

The controller was also always initiated with false so the column was
only available after an update.
2017-05-04 11:58:26 +02:00
Martin Geubelle 0bc70b64a9 [FIX] gamification: put the correct id in kanban_image
The third argument of kanban_image should be the id of the record and not the
image `raw_value`.

In this case, we want to display the image field of the current model.
2017-05-04 11:58:25 +02:00
Martin Geubelle c6a0ff52f9 [FIX] web: Kanban: fallback on empty array for x2many raw_value
The commit e07f27d has wrongly changed the fallback for one2many raw_value from
an empty array to `false`. This modification brokes a lot of templates where we
assume that the value is always an array.

This commit restores the previous behavior with the fallback on [].
2017-05-04 11:58:25 +02:00
Yannick Tivisse 34cf2bc51c [FIX] website_sale: Pass website_sale_order to the template on each checkout step
The template `wizard_checkout` uses the `website_sale_order` to render the checkout process pages

But this values isn't passed to the template on these staps:
- /shop/checkout/
- /shop/address/
2017-05-04 11:46:53 +02:00
Yannick Tivisse 6d392d97a0 [IMP] website_sale: Enable billing/delivery address on checkout process
Purpose
=======

Address management is not clear. If you use the eCommerce, you can set 2 different addresses (billing / shipping) in the checkout process while the related access right group is not activated (group_sale_delivery_address). So you don't see such dates in the backend, which leads to potential conflicts with customer (if the delivery address is different).

Functional spec
===============

- Hide shipping stuff in checkout if option is not activated:
- When eCommerce is installed, group_sale_delivery_address should be activated automatically.
- If you uncheck it from user access (already it is disable in sale settings) , it has to disappear in both the bakend AND the frontend.
2017-05-04 11:46:53 +02:00
Géry Debongnie e4532cfe51 [FIX] web: various fixes in list view navigation
With this commit, we try to improve the way navigation is done in the
list view.  In particular, we want to make sure that pressing TAB on the
last editable cell move the cursor to the next line (and create a new
line if necessary).

Also, we add a few tests for keyboard navigation (it was almost not
tested before this commit, and while working on this commit, it was
broken at some point).
2017-05-04 10:39:01 +02:00
Denis Vermylen 1314de5098 [IMP] account, sale, web: dashboard graph tooltips
Graph tooltips (found in accounts and sale/crm's dahsboards) are now
rendering a custom template in order to display more relevant and
coherent information about the graph.
2017-05-04 10:35:51 +02:00
Richard Mathot 1ab0910d91 [REF] product: typo in class name
"No, no, I am not the brain specialist. No, no, I am not! Yes. Yes I am."
2017-05-04 10:29:12 +02:00
Denis Vermylen c35c8c5476 [FIX] account: dashboard graph tooltip color
In the accounting graphs, the graph's color and tooltip didn't match
for linecharts. This commit fixes that.
2017-05-04 10:20:09 +02:00
Deepak Geriani 1682106f7d [ADD] web: add Qunit test case for graph widget's tooltip 2017-05-04 09:58:05 +02:00
Mitali Patel f00e9c6453 [IMP] web: custom tooltip in dashboard graph widget 2017-05-04 09:58:04 +02:00
Mitali Patel 15134aa1a9 [IMP] sale, account: display proper names in graph tooltips 2017-05-04 09:58:04 +02:00
Géry Debongnie 91d1fd8701 [FIX] web: prevent double onchange in some cases
When we unselect a line in a one2many list, we ask for all fields to
commit their changes (because many fields are debounced, so we may not
know their current last value).  This is good, except that it could
trigger an extra field change event, which may in turn trigger a second
onchange.

We solve this issue by improving the _setValue method and delegating the
comparison to a new _isSameValue method.

It is particularly relevant for field types such as integer, which are not
stored as a string.
2017-05-04 09:32:24 +02:00
qdp-odoo 7b6c474c20 [FIX] account: avoid invoices paid automatically in some strange use cases.
Invoices were marked as paid as soon as validated, if the income/expenses accounts was reconciliable (for some reason?)

- task https://www.odoo.com/web#id=32324&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720
- PR #16311
2017-05-04 09:16:41 +02:00
Nicolas Lempereur b9ac7090ce [FIX] web_kanban: double click double action
When multiple clicking fast (and with the server not too fast), we could
end up with an error (eg. "Cannot read property 'controller' of null").

Something has been done previously to improve this when switching
between views in: fc8a4b5e. This commit do something similar to limit
multiple click on kanban records (doing it as in 26f91c429).

note: master equivalent of 8f1cc2fa (which is for 10.0 up to saas-15)

opw-705329
closes #16775
2017-05-04 08:20:07 +02:00
Aaron Bohy 5d6412116b [FIX] mrp,website_event_track: handle widget in form
This widget is supposed to be used in list views only (it allows
to re-order the rows by drag-and-dropping them).

Since the new views, the field widgets are shared between all
views, whereas before, each view had its own list of widgets
(and the handle widget was a list view widget).

So if one specifies widget='handle' in a form view, the handle
widget will now be instantiated, whereas before it was ignored.

This rev. fixes two templates making use of the handle widget in
form views.
2017-05-03 20:48:25 +02:00
Aaron Bohy c7fc74fb79 [FIX] web: BasicModel: fetch added x2many records
Suppose that there is a many2many (list) field in a form view,
and there is a many2many (e.g. many2many_tags) field inside the
list.

In edit mode, if the user adds a record in the relation, this
record and its relational data should be fetched.

Before this rev., the relational data wasn't fetched, so the
many2many_tags couldn't be displayed correctly.
2017-05-03 20:48:25 +02:00
Lucas Perais (lpe) d56baebc8e [IMP] l10n_fr: make french localization usable out of the box.
* added some accounts, cash based taxes, DOM-TOM country group...
* improved sale/purchase journal creation for french companies by making sure they have a dedicated sequence for refunds
2017-05-03 16:59:01 +02:00
qdp-odoo 77157c6ddd [IMP] l10n_fr: set one tag per grid in vat report. 2017-05-03 16:59:01 +02:00
qdp-odoo 3bb774d6de [IMP] account: add a default 'cash basis tax journal' upon chart template installation.
This is probably needed by all countries that use caseh basis taxes, and will save them the journal creation + save of the settings.
2017-05-03 16:59:01 +02:00
Raphael Collet 59ee813a82 [IMP] fields: clean up comparisons to False 2017-05-03 15:54:36 +02:00
Raphael Collet 8706a8503b [REF] base: convert python constraint to SQL constraint
The constraint is `UNIQUE(model, name)` on `ir.model.fields`.
2017-05-03 15:52:58 +02:00
Raphael Collet b59318ec12 [REF] registry: always perform registry/cache signaling at the end of request
Problem: the update of custom models/fields is not fully transactional, and may
potentially lead to an inconsistent database.  An other problem is creating two
custom fields by writing on a model: if the second one fails, the first one has
been committed without notice.  Retrying the request will give an unexpected
error (duplicate field name).

Solution: never commit in the middle of a request.  If the changes have an
impact on the registry, then mark it as invalid (with a new flag), and signal
registry invalidation after everything has been committed.  If the request
fails, reset the registry.  Both registry and cache invalidation are handled
the same way.
2017-05-03 15:41:05 +02:00
Raphael Collet 1458f1b313 [REF] registry: delegate addition of custom models/fields
Delegate to models `ir.model` and `ir.model.fields`, so that this functionality
can be extended easily.
2017-05-03 15:41:05 +02:00
Raphael Collet f3f41ec551 [REF] registry: replace partial by attribute registry.loaded 2017-05-03 15:41:05 +02:00
Raphael Collet 5d3474254d [REF] registry: remove deprecated RegistryManager 2017-05-03 15:41:05 +02:00
Géry Debongnie b38137d498 [FIX] web: prevent loss of edits in list view
Before this commit, it was possible to edit something in an editable
list view, then press the DOWN key, then enter some other values.  With
the DOWN key, the focus is supposed to move to the line below, so we
save the current line, in the current state.  This means that the edit
coming after are simply lost (well, just not saved nor displayed).

What this commit does is simply disable all control elements in that
situation.  This prevents uncomfortable situations from occurring.
2017-05-03 15:20:16 +02:00
Christophe Simonis c8dfc701bc [FIX] delivery: force non-inheritance of views 2017-05-03 13:56:44 +02:00
fwi-odoo 1af7864fdf [FIX] web: correct column title when kanban grouped
Before this commit, when a kanban view was grouped by a selection field, the
column were named with the raw value of the selection instead of the display
string.

Furthermore, fix the fact that when the column title was 0 or False,
'undefined' was displayed instead.
2017-05-03 13:41:13 +02:00
fwi-odoo a53335fdb2 [FIX] web, document: adapt toolbar to the new views
- Fix the toolbar behaviour since there is no more dataset in the widget.
- Improve the communication beetwen the controller and the toolbar.
- Move the code linked to the document upload in the right file.
- Adapt the tests to mock the search_read done by ´document´ addon
- Adapt the mock server to be able to give a custom toolbar action
2017-05-03 13:41:07 +02:00
Jérome Maes 30384249e1 [ADD] project_timesheet_holidays: generate timesheet when on leaves
This commit proposes to allow to automatically generate timesheet lines
when an employee is on leaves. Project and task used for timesheeting
is globally configured on the company. Holidays type choose whether to
generate timesheets or not and take the company default configuration.

When an HR officer validates a leave request, analytic lines will be
generated for each day off. The unit amount will be based on the working
calendar of the employee taking the leave. Generated timesheet lines are
attached to the project and task configured on the holidays type.

Configuring timesheet lines generation at holiday type level allows to
tune the use of leave requests. You may have for example "home working"
holiday type that should not generate timesheets while "legal leaves"
should.
2017-05-03 10:15:27 +02:00
Thibault Delavallée 69631078ba [IMP] resource: add iterator on work hours count between two datetimes 2017-05-03 10:13:24 +02:00
Christophe Simonis bf7de4d32f [MERGE] forward port branch saas-15 up to 3f6bb0f544 2017-05-02 18:53:44 +02:00
Christophe Simonis 3f6bb0f544 [MERGE] forward port branch saas-14 up to 6441ea28b3 2017-05-02 18:25:31 +02:00
Fabien Pinckaers a97cb66961 [IMP] mail: less visible when no activity scheduled 2017-05-02 09:12:32 -07:00
Christophe Simonis 6441ea28b3 [MERGE] forward port branch 10.0 up to cc7ae17bd5 2017-05-02 18:12:09 +02:00
Fabien Pinckaers a5cf0cc8b4 [IMP] mail: spacing around the next activity icon 2017-05-02 09:05:56 -07:00
Fabien Pinckaers f72d87ab1a [IMP] hr_recruitment: improved kanban view of applicants
[IMP] hr_org_chart: help sentence
[IMP] sale: search on customer in main search
2017-05-02 09:01:39 -07:00