Commit Graph
109543 Commits
Author SHA1 Message Date
Aaron Bohy 18c3dbc2e9 [FIX] web: FieldMany2Many with editable lists: save changes
This rev. fixes 2 issues about many2many fields displayed with
an editable list view, occuring when the user edited some values
in the list.

First, the many2many field was re-rendered each time one of its
sub-widgets triggered a 'field_changed' event, and thus the row
the user was editing was no more in edition and the focused field
was no more focused. This was quite annoying.

Second, when the user saved changes made in the editable list view,
only a command 6 (REPLACE_ALL) was sent, so updates of subrecords
were never saved.
2017-05-05 13:31:48 +02:00
Aaron Bohy e8f9bb683d [FIX] web: DebouncedField: notify changes only when changed
Before this rev., if you opened a form view with, e.g. a float
field, that is unset, and then click on edit, then save, it
actually saved the new value for the float field (being 0),
whereas it shouldn't do any RPC as nothing changed.

This is because the former code couldn't detect if the value "0"
in the input is there because the field is still unset or if the
user simply set it to 0.
2017-05-05 13:31:46 +02:00
Mehul Patel 47305199a8 [FIX] base_import: fix broken rpc calls
PR #16762
2017-05-05 12:55:55 +02:00
Yannick Tivisse 26b851e541 [IMP] sale_timesheet: Move timesheet_revenue computation in a separate method
Will be used in migration scripts to saas~16 to compute this value for all the invoices that have been validated
2017-05-05 11:05:39 +02:00
Géry Debongnie 2febb8778f [FIX] web: use action context in evaluation contexts
The process of evaluating a domain is not really difficult, but the hard
part is getting the evaluation context right.  The evaluation context is
supposed to contain informations coming from various sources (active id/ids,
session context, ...).  Before this commit, we just ignored the context coming
from the action.

This could cause many problems. For example, in the Inventory
application: create a picking, add 10 ice cream in initial demand, force
assign, click on scrap.  A form view should be opened (with the context
coming back from the button_scrap method).  In that formview, there is a
many2one Product.  Clicking on it should perform a name_search with a
domain looking like ['id', 'in', [64]].  This domain is the result of
the evaluation of "[('id', 'in', context.get('product_ids', []))]".
Before this commit, product_ids was ignored, so the domain was always
['id', 'in', []].

In this commit, we simply add the element context in the list of sources
when computing the evaluation context (the element context is the
context given to the view, which is the way an action give a context to
a view)

In short, handling context is hard...
2017-05-05 10:45:50 +02:00
Pierre Masereel 2c84ecc92f [IMP] delivery: put in pack wizard
If the picking has no carrier set, do not open the put in pack wizard
and keep the behavior of a classic picking. Also, filter the delivery
packages according to the carrier (note: this doesn't work at the moment
because of a bug in the new views, but it'll be fixed very soon, so we
merge anyway).

Also, remove an harmless typo in `manage_package_type` method.
2017-05-04 18:06:20 +02:00
Simon Lejeune 1cef8b4ad1 [IMP] sale_stock: hide packaging field if no product is selected 2017-05-04 18:06:14 +02:00
Pierre Masereel 90da529eb7 [REF] delivery, product, stock: packaging naming
"product packaging" -> "product packages"
"delivery packaging" -> "delivery packages"

Also adapt and simplify stock settings.
2017-05-04 18:06:08 +02:00
Christophe Simonis f62facde1d [FIX] sale_timesheet: keep name when replacing view part
Allow other inherited views to still working.
2017-05-04 17:58:58 +02:00
Christophe Matthieu 37f6aa6b67 [FIX] web: should remove all unused tags when using datepicker
before this fix, a tag is added in the body but never removed
2017-05-04 17:19:25 +02:00
Christophe Matthieu 8ed4513a0a [FIX] web: add translate button for char and text fields
The button allowing the user to translate fields (existing in
previous versions) was not present.
2017-05-04 17:19:25 +02:00
Christophe Matthieu 9ba0767f98 [FIX] web: unable to open User FormView from Settings
Uncaught TypeError: Cannot read property 'split' of undefined.
Crash when the value of widget 'timezone_mismatch' is false in form view.
2017-05-04 17:19:25 +02:00
Christophe Matthieu 5dd23f7de2 [FIX] web_editor: prevent crash when publishing a payment in edit mode
When updateStyleInfo is called, the options is not necessarily on
editable area (eg: when update the toolbar for image)
2017-05-04 17:19:25 +02:00
Christophe Matthieu 9500f8d3f7 [IMP] web: add 'event_open_popup' option on calendar view
If the option 'event_open_popup' is set to true, then the calendar view will open events (or records) in a FormViewDialog. Otherwise, it will open events in a new form view (with a do_action)
2017-05-04 17:19:25 +02:00
Christophe Matthieu 27ff895dfd [IMP] web: extend qweb to allow dynamic templates in t-call
Before this change the t-call can use only receive a literal as parameters:
<t t-call="template.name17" />
This call render the template 'template.name17' with the current context.

Now, we can defined an expression with braces (same syntax that t-attf):
<t t-call="template.name{{ 10 + 7 }}" />
This call render the template 'template.name17' with the current context.

This change allows for greater flexibility for applications using qweb.
(The performance due to this change is unchanged during rendering time.)
2017-05-04 17:19:25 +02:00
Jérome Maes 34e4f99548 [MERGE] sale_timesheet: revenue and overview
These commit are the 3rd part of improvements
of Services flows.

It introduces 2 important parts
- timesheet revenue: how much the timesheet bring back
money.
- timesheet overview: a kind of dashboad to see the financial
state of a project, grouped by employee or billable type

Other improvements are UX, adding missing settings, hide
some technical fields, ... to ease the configuration and
day-to-day usage.
2017-05-04 16:35:01 +02:00
Jérome Maes 11b14ff77c [IMP] sale_timesheet: add timesheet overview
This commits add the timesheet overview on the project
kanban. Instead of redirecting to timesheet list, the user
will see a more detailled view.
The timesheet dashboard shows the amount per billable types,
the numbers of hours provided per employee and per billable
types, ...

This view is integrated with the search view : changing the
filter will shows you the informations for your selection.

The purpose is to give the user a global view of the project
(or other timesheet) financial situation in the same place.

This overview is made to be extended in enterprise to add
a section to compare past (timesheets) and futures (forecasts)
activities.
2017-05-04 16:15:42 +02:00
Jérome Maes 7c3f774d1c [IMP] sale,project,sale_timesheet: config settings
The purpose is to ease timesheet configuration by
adding missing settings: 'invoicing policy' setting
exists in sale config. This commit duplicate it
into timesheet config.

It also add settings in project, sale and timesheet
to configure more easily the service products (time
and material, and fixed price), by adding filter for
services.
2017-05-04 16:15:42 +02:00
Jérome Maes 227f8ab116 [IMP] sale_timesheet: introduce timesheet revenue
This commit introduces the concept of timesheet
revenue, aka how much the timesheet bring back
money.
If the timesheet is not invoiced yet, the computed
revenue is theorical, based on the billable type
(if your product is Time and Material, or Fixed Price).

The formulae use at the timesheet line creation is

     If product on delivered quantity:
        timesheet hours * (SO Line Price) * (1- discount),
     elif product on ordered quantities & create task:
         min (
            timesheet hours * (SO Line unit price) * (1- discount),
            TOTAL SO - TOTAL INVOICED - sum(timesheet
                revenues with invoice_id=False)
         )
     else: (non billable case)
        0

When the timesheet is invoiced, the revenue is recomputed
based on the prorata of the invoice amount : prorata of
number of hours for 'time and material' product,
prorata of the theorical revenue for 'fixed price' product.

The timesheet revenue is expressed in the currency of the
company (Monetary field, based on the company_currency_id field
of account.analytic.line) to ease reporting.
This feature normally can handle multi currency (different currency
from SO, INV, and analytic account).
2017-05-04 16:15:42 +02:00
Jérome Maes 12866bd614 [IMP] hr_timesheet: privacy of some field on employee form view 2017-05-04 16:15:42 +02:00
Jérome Maes b6d697a1e9 [IMP] project_timesheet_holidays: hide internal project/task on leave type form
Since it is advanced feature, you should be in debug mode to configure them.
2017-05-04 16:15:42 +02:00
dbh 4b074ca11c [IMP] account: rename 'Refund' to 'Credit Note' 2017-05-04 16:05:32 +02:00
Aaron Bohy 32d669da1f [FIX] web: correctly parse monetary fields
Before this rev., the function that parses monetary fields (i.e.
the one that converts the string value of the input into a
numerical value) totally ignored the sign of the value.

Actually, parsing a monetary field is exactly the same as parsing
a float field, so we simply use the same function.
2017-05-04 15:48:44 +02:00
fwi-odoo 794345bad1 [FIX] web: fix toolbar test (should not depend on document)
Unit tests are executed after module installation, which is sometimes
challenging when some part of the UI is modified by another module.
In this case, a test in module web/ was implicitely relying on a behaviour
introduced by the module document.
So, the test failed when document was not installed.

Since the installation of ´document´ module changes the toolbar display,
we check in the test if the module is installed to do the correct assertion.
2017-05-04 15:33:04 +02:00
fwi-odoo e52fc1f1c4 [FIX] web: hide search view on dashboard
Before this commit, the parameter ´searchview_hidden´ was not used anymore
when it was defined for some views.
After this commit, the search view is hidden when it needs to be, e.g.
the helpdesk dashboard.
2017-05-04 15:32:57 +02:00
Thibault Delavallée 69e54dcac2 [MERGE] mail, various: update record when creating a customer from chatter suggestion
Currently using chatter it is possible to create customers directly when
posting a message. Unknown email addresses are proposed to the user that
can create customers directly in the posting process.

However the record is not updated. Several models like lead, issue, ticket
or event track have a customer (partner_id) field that is not updated even
when a customer is created from the chatter. Users have to update records
manually.

This merge automates it by updating the record through a post process
hook on message_post that is used in main customer-based addons. A small
improvement is done in the chatter to reload the record once posting a
message to a new customer.
2017-05-04 14:16:01 +02:00
Thibault Delavallée 2090986b06 [IMP] event: update attendee and track after creating a partner from chatter suggestion
When a message is posted through the chatter and creates a new partner
the attendee or track is now updated so that the partner field is correctly
set to the newly-created partner.

Chatter on attendee or track 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 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