Commit Graph
117975 Commits
Author SHA1 Message Date
Goffin Simon c471ca22be [FIX] purchase: Procurement rule Buy missing when installing Purchase
When installing Purchase, the procurement rule Buy for My Company, Chicago
was missing.

opw:1835411
2018-04-11 14:28:09 +02:00
Mathieu Duckerts-Antoine 96867cb0e3 [DOC]: doc: amelioration of dashboard view documentation
No mention of the group_operator attribute was made in the dashboard view documentation.
This fixes remedies this situation and slightly ameliorates the previous documentation.
2018-04-11 13:53:29 +02:00
Richard Mathot 79447255f4 [FIX] google_calendar: broken link to docs 2018-04-11 13:51:17 +02:00
Thibault Delavallée 79daa2e262 [IMP] test_mail: follow activities in performance tests
Commit 07ae0ccc4e set activities as not followed by default on records.
However this has an impact on performance test that should not happen.
Indeed performance tests should be based on technical decisions, not business
decisions. We therefore set activities as followed by default in some advanced
performance tests to always have results that can be compared.
2018-04-11 13:33:38 +02:00
jem-odoo 3be7c23900 [FIX] hr_timesheet: analytic account generation
'allow_timesheet' is true by default, but when installing hr_timesheet for already
created project, populating the column does not use write method, and so, no
analytic account is generated for existing project.
It is required to use the same mecanism as in resource (calendar generation),
and to do so, rewrite part of create/write method of project.project.

This commit also add an onchange, to maintaint consistency about having
no analytic account does not allow timesheet on project.
2018-04-11 13:23:41 +02:00
Toufik Benjaa fc6d98df24 [FIX] account_asset: Allow accountant to validate invoices
- When validating an invoice, the create method of the model account.asset.asset is called.
  Accountant have the access rights to create account.asset.asset object, but they do not have the rights to write on them.
  The issue here is that the create of the account.asset.asset is done, but right after a right is done in the same object, which trigger an AccessError.
  To fix this issue, we make the write using the admin env. This doesn't cause security issues since the user needs the create accesses.

OPW-1832797
2018-04-11 12:39:48 +02:00
Toufik Benjaa 0c9eabb0a9 Revert "[FIX] account_payment: Restrain access to invoice's partner"
This reverts commit 55878df5ff.
2018-04-11 12:26:41 +02:00
Parth Patel 7516d9bb7f [FIX] website_sale: make shipping address group-option valid for all user groups
Indeed in website_sale this option is used in templates, meaning public and
portal users should be added or removed from that group accordingly.

This commit is related to task ID 1746668. Closes #22753.
2018-04-11 12:18:53 +02:00
Mathieu Duckerts-Antoine 49662242dd [FIX] web: fix bad types in parameters
This fix allows the documentation to be built again.
2018-04-11 12:00:36 +02:00
Toufik Benjaa 2a09289e32 [FIX] payment_stripe: Create stripe charge with email
- When creating a Stripe charge, we have the possibility to send the customer email.
  This is then used by Stripe to send a payment notification (receipt) to the customer.
  This was never done by Odoo, this commit introduce this feature.

OPW-1829945
2018-04-11 11:58:55 +02:00
Géry Debongnie 86897ca167 [REF] web: remove updateModifiersValue from widget
The keyboard shortcut branch recently added a method
updateModifiersValue on the widget class, which is used to make a widget
aware of its modifier status (in particular, if it is required).  This
is necessary for the proper navigation behaviour on field widgets, but
should not be on the widget class.

The proper fix is, in my opinion, to introduce a AbstractViewWidget
class which would be used for AbstractField and all custom widgets in
views.

Meanwhile, this commit simply protects the call to that method. This is a
refactoring, but can be merged in saas-11.3.
2018-04-11 11:51:49 +02:00
Nicolas Martinelli 33ba61bfdb [FIX] web: domain evaluation
To reproduce the error, go to Accounting > Import Statement, then
Cancel. An error occurs because `belongs_to_company` is not in the data.
Indeed, it is directly set on the action
`open_account_journal_dashboard_kanban`.

Commit 9961bbf4eb re-evaluates if a record should be displayed in the
Kanban view after applying an action (in particular, archive a record).
However, the domain evaluated might contain values which are not in the
data. This is for example the case if there is a domain on an action.

Fixes #24142
opw-1835216
opw-1835123
2018-04-11 11:24:02 +02:00
Hiral Bhavsar ac0ac23cdc [FIX] account: prevent tax recurrency
We now prevent users from defining group taxes using the current tax as
its children taxes.

Fixes #19997
task# 1819407
2018-04-11 10:02:57 +02:00
Luis González c62caf9b52 [FIX] web: Order tabbing precedence between top bar's button More&its items
Currently, when the button "More" is opened, the HTML elements of their
items are located before the button, instead of being after. That means,
when navigating using the keyboard, if the button is opened ant `<tab>`
is pressed, the focus will not go to the menu items.

This change causes the HTML elements of the menu items to be moved, from
before to after the button "More".

PR #23865
2018-04-11 09:58:59 +02:00
Goffin Simon 5bb6517072 [FIX] purchase: Wrong Fiscal position in multicompany
Steps to reproduce:

 -Create company A
 -Create company B
 -Admin user with both companies but currently in company B
 -Create Demo user only with company B
 -Create fiscal position A to company A
 -Create fiscal position B to company B
 -Create vendor with fiscal position A with company A and the same vendor with fiscal position B in company B
 -Create product and add the vendor created before
 -Set like Create a draft purchase order
 -Logging with Demo user
 -Create sale order with one sale order line with route make to order
 -Validate sale order

Bug:

 The purchase order created by sale order had the fiscal position company A.

Closes #23561
opw:1825098
2018-04-11 09:11:55 +02:00
Nicolas Lempereur b79d8b99ff [FIX] base: amount_to_text possible difference
In 79038055 amount_to_text was refactored and improved, but there is a
drawback.

ie. if we have .29 cents with two decimals, `Twenty-Eight` was displayed
because `int(0.29 * 100) == 28` due to floating-point representation.

This commit keeps the improvements and fix this issue by using string
formatting of float as was done before.

opw-1829924
closes #24161
2018-04-11 08:57:20 +02:00
Joren Van Onder 7805825941 [FIX] pos_mercury: allow test transactions again
It used to be possible to run test transactions against mercurypay.com
using a regular swiper device, test credentials and test cards
provided by Mercury.

Mercury has recently disabled this saying this feature did not adhere
to certain PCI regulations.

It means that currently on the regular mercurypay.com network only
real cards (and thus real money) can be used.

Because we require a way to test without spending money this commit
allows to switch to the test network (mercurycert.net). It uses a
system parameter because we cannot introduce a Boolean on
pos_mercury.configuration in a stable release. It also changes the
test credentials to some that work on mercurycert.net.

Note that the regular 'production' swiper devices can not be used on
this test environment. This results in:

Error 004118: Failed to decrypt

The swiper contains embedded cryptographic keys specific to
mercury*pay*.net. Instead a specific 'development' swiper device with
embedded keys for mercurycert.net is required.

opw-1832156 (this is necessary to test that issue)
2018-04-10 12:05:00 -07:00
stefanorigano f39b1bb446 [REF] website_sale: multi-image modal design 2018-04-10 18:05:52 +02:00
stefanorigano 8d2d774e67 [REF] website_sale: multi-image notebook design 2018-04-10 18:05:41 +02:00
Christophe Monniez b696fa1b72 [REL] saas-11.3 2018-04-10 17:58:06 +02:00
stefanorigano 472b2a57ff [REF] website_sale: multi-image modal design 2018-04-10 17:54:11 +02:00
stefanorigano 8bda69b02b [REF] website_sale: multi-image notebook design 2018-04-10 17:54:11 +02:00
Alexandre Kühn 4f6f562c97 [IMP] base: generic Edit View menu item text in debug mode
With this commit, the menu item for editing a view in debug mode has been
changed.

Instead of "Edit List View", it is now "Edit View: List".

That way, the code is shorter, generic, and translatable.

Exception to above changes: search view, which is unchanged
(it remains "Edit Searchview")
2018-04-10 17:41:12 +02:00
Géry Debongnie 270dd268bf [DOC] doc: add dashboard view documentation
This commit add the reference documentation for the new dashboard view.
In an ideal world, this should be done in the enterprise repository, but
our documentation system is not extensible that way.
2018-04-10 17:41:12 +02:00
Alexandre Kühn 8dbc1d95c3 [IMP] web: many2one as measure in graph & pivot only when desirable
With this commit, the fields many2one are not always measures in pivot
and graph views. By default, they are *not* measures.

In order to have them as measures, we should pass `additionalMeasures`
as a param to any of the views, which contains a list of fields to consider
as measures.

example:

    Suppose a model with the following fields:

        - `product_id` (many2one)
        - `categ_id` (many2one)
        - `sold` (float)

    By default, only the field `sold` is a measure
    in a graph or pivot view.

    In order to pass `product_id` as a measure of
    a graph view, you should instantiate this view
    as follow:

``
    var viewInfo = /* ... */;
    var params = {
        additionalMeasures = ['product_id'],
    };
    var graph = new GraphView(viewInfo, params);
``

An exception to the rule above is when the many2one field is of type `measure`
in the arch: this field is set as the default measure of the view, therefore
it is implicitly added as an additional measure.
2018-04-10 17:41:12 +02:00
Géry Debongnie 36b4468d15 [FIX] web: prevent crash in graph when grouping/aggregating on m2o
We recently added the possibility of aggregating the graph view on a
many2one field (with count distinct operator).  This is useful, but then
a rare situation could happen: the view could be grouped by the same
field.

In that case, there is a name clash in the read_group, and the result
will be that the [id, nameget] of a m2o field will be used as an
aggregate.

The readgroup method should be improved (its API is a mess), but
meanwhile, we have a solution for this issue: if we group by a m2o, then
it is guaranteed that each group has an aggregate value of 1 for the
same field.
2018-04-10 17:41:12 +02:00
Mathieu Duckerts-Antoine 47395c6e51 [IMP] web: allow using many2one as measure in pivot view
With this commit, we add the possibility of using many2ones as measure.
The way a many2one is aggregated is by using the count distinct
operator.

Some care had to be done to gracefully support the situation when a
pivot view is grouped by a m2o field F, and the same field F is used as
a measure.
2018-04-10 17:41:12 +02:00
Thibault Delavallée 742476fb20 [IMP] hr_expense: auto subscribe only employee and its (expense) manager on reports
Currently a lot of people are automatically added as followers of expense
reports. However most of them (managers notably) can choose what to follow
using subtypes on the department. We should avoid adding too much people
as following records should stay an active choice made by users.

From now on auto subscription works on
 * employee of the expense report, if he has an user;
 * responsible of the expense report, that is the expense manager or the
   manager of the employee;

Expense report creator is not follower of the expense report by default
anymore, as previous values should be sufficient to ensure people having
to work on the expense report are already followers.

This commit is related to task ID 1819541.
2018-04-10 17:16:10 +02:00
Thibault Delavallée 3f7c75ef1f [IMP] mail: display white background for user notifications in chatter
User notifications are defined as
 * notes;
 * pushed to user Inbox or email through classic notification process;
 * not linked to any document, meaning model and res_id are void;

When pushed in user's Inbox they are currently displayed with a gray
background like all notes. However UX experts think it should use a white
background to be easier to spot in chatter. This commit makes it work.
From now on discussion and user's notifications are displayed using a white
background. This commit is related to task ID 1829872.
2018-04-10 17:15:26 +02:00
Thibault Delavallée 07ae0ccc4e [IMP] mail: do not follow activities by default
Activities are quite personal and linked to daily jobs of people using it.
Being notified of all activities is therefore not considered as default
behavior and should be a choice done by users. Subtype linked to logged
activities is now not followed by default anymore. It is still configurable
through subscription widget or parent subscription (project/task for example).

This commit is linked to task ID 1824141.
2018-04-10 17:14:42 +02:00
Goffin Simon 8d851e4a17 [FIX] mrp_repair: repair fee lines without product_id filled
It's impossible to add a repair fee line without a product because the
product uom is required.

opw:1833233
2018-04-10 16:47:26 +02:00
Swapnesh Shah d805354123 [FIX] google_calendar: redirect to proper setting
Added the context key in action to open the General Setting menu instead of the
first configuration page (e.g. CRM)

Closes #24144
2018-04-10 16:43:30 +02:00
Romain Derie 0879cb88fe [FIX] payment: make the error handler works for non s2s acquirer
Before this commit, error handling would not work for non s2s payment acquirer
since it would always check for `o_payment_add_token_acq_[id]` in the DOM but
this is only present for s2s acquirer.
Non s2s acquirer got `o_payment_form_acq_[id]` in the DOM.

Now, we retrieve the correct DOM element depending if s2s is enabled for this
payment acquirer or not.

task-1825701
2018-04-10 16:10:59 +02:00
Nicolas Martinelli b7462ca224 [FIX] payment_authorize: number of decimals
- Create a SO of 56.16
- Send the payment link to the customer

At payment, the transaction is refused by Authorize because of an
invalid amount.

When looking closely, the data sent to Authorize contains the amount
56.160000000001. This is due to the float representation. To avoid this,
we use `float_repr` instead of `str`.

opw-1832468
2018-04-10 16:05:23 +02:00
Thibault Delavallée 2d19c4c6b8 [FIX] mail: raise a missing email error instead of crash when logging without email
Currently when posting a message if the author has no email address an user
error is raised. Indeed as posting a message goes through the process of
creating notifications and sending emails an email address is required on
the user.

In saas 11.2 a _message_log shortcut has been added to log notes. This
method should have the same behavior when author has no email. Currently
there is a crash when trying to encode its email. After this commit an
exceptions is raised like classic post.

This commit is related to task ID 1823990 .
2018-04-10 14:45:33 +02:00
Nikunj Ladava b7f43f265d [FIX] mass_mailing: allow multiple recipients in mailing
Commit 0cd656b5af improved onboarding of mass mailing application. Notably
mailing domain computation has been improved. However rewriting has not been
done correctly as there were strange formatting and encoding. This commit
fixes the issue and correctly uses a list to format a domain like expected.

This commit is related to task Id 1831211. Closes #23883 .
2018-04-10 14:09:17 +02:00
Thibault Delavallée 95d5020ff7 [FIX] mail: raise a missing email error instead of crash when logging without email
Currently when posting a message if the author has no email address an user
error is raised. Indeed as posting a message goes through the process of
creating notifications and sending emails an email address is required on
the user.

In saas 11.2 a _message_log shortcut has been added to log notes and in saas
11.3 a message_notify has been added to notify peopel of a custom content.
Those methods should have the same behavior when author has no email.
Currently there is a crash when trying to encode its email. After this commit
an exceptions is raised like classic post.

This commit is a manual forward-port of 3a978cc64e6b1d8aca7cfd5d4e319bcb302dd262 as well as an improvement
to fix the newly-introduced message_notify method.
2018-04-10 14:06:00 +02:00
Thibault Delavallée 4859b642d8 [FIX] test_mail: add forgotten margin on activity test
Those are notoriously prone to have a one query more-or-less behavior.
2018-04-10 12:37:29 +02:00
Thibault Delavallée 55c6f9eece [MERGE][IMP] mail: limit cache invalidation
This merge goes through various cache invalidation done in mail application
in order to effectively limit it to records and/or fields to invalidate.
Purpose is to avoid having too much cache invalidation that causes to
fetch data again, therefore adding computation and queries to various mail
features. See sub commits for more details about the changes.

All performance tests are improved of a few queries as there is less data
to fetch again from database. On overall community runbot this leads to a
gain of about 16K queries when installing all 205 modules. This merge is
related to task ID 1834147. Closes #24061 .
2018-04-10 12:21:32 +02:00
Nicolas Martinelli 076cf05c2e [FIX] mail: composer expand
The expand arrow hides the last characters of the first line, which many
people (and me in particular) find annoying. We put it at the bottom
instead.

opw-1830762
2018-04-10 11:14:52 +02:00
Nicolas Martinelli d64ce53071 [FIX] stock_calendar: scheduled data
- Install stock_calendar
- Create a stockable product
- Add the route "Buy"
- Add a vendor with a delivery lead time of 30 days
- Create a reordering rule for x units
- Run the schedulers

A PO is created, but the scheduled date is set as today, not today + 30
days.

What happens is the following:
1. Since no `calendar_id` is defined on the orderpoint, `_get_group`
   returns `[(now, None)]`
2. `now` is used in the `procurement_values` of the `res_groups` by
   `_procurement_from_orderpoint_get_groups`
3. The `res_groups` values are used in `_procure_orderpoint_confirm`
   when calling `_prepare_procurement_values`.
4. `_prepare_procurement_values` is overridden by `stock_calendar` to
   set a value for `next_delivery_date`. At this point, the `now` value
   is used.
5. Finally, when creating the PO line, `_prepare_purchase_order_line` is
   overridden by `stock_calendar` to set the `next_delivery_date` as
   `date_planned`.

So, `date_planned` becomes `now`.

There should not be any date set when no `calendar_id` is defined.

opw-1828371
2018-04-10 11:10:29 +02:00
Nicolas Martinelli 77bf2c96af [FIX] stock_landed_costs: defer AML creation
In order to improve the speed of landed cost validation, we defer the
creation of AML at the very end of the process. This way, we don't
suffer from various performance issues caused by:
- cache invalidation (use of `with_context`)
- recomputations

opw-1824661
2018-04-10 11:02:36 +02:00
Thibault Delavallée 9f3889eba3 [IMP] mail: limit cache invalidation when managing messages
This commit proposes to limit cache invalidation at some cases that will
trigger some behavior change when dealing with mail messages :

 * creating messages linked to a document;
 * update model or res_id of a message;
 * updating notifications, as notified people could change some computed
   fields on the record;

This commit also invalidates only mail-related fields as updating messages
should not invalidate other things than some computed fields linked to
mail.
2018-04-10 11:01:16 +02:00
Thibault Delavallée bcc6884737 [IMP] mail: limit cache invalidation when subscribing followers
Cache invalidation when subscribing people has been added at e6f038a821.
Indeed subscribing partners to a record may lead to an access right update
as some of them are based on followers. This is why a cache invalidation
is necessary to avoid access rights issues.

However subscribing people to a record should change their rights only on
the records involved in the subscription mechanism. We can therefore give
ids to the cache invalidation to limit to updated records.

Cache invalidation is also limited when writing on followers if writing
on model, res_id or partner_id fields. Indeed changing subtypes or
channel of a subscription should have no impact on cache and access rights.

Cache invalidation done manually in _message_subscribe is not necessary
as subscription create or update mail.followers records since f9c210923d.
Create and write of mail.followers records already ask for cache invalidation.
It is therefore not necessary to invalidate cache twice.

This commit allows to save a few queries on some tests, notably about
activities that deal with subscription and messages. As cache is now kept
it is not necessary to refetch some data, leading to a few query gain. We
gain about 1K queries on com runbot.

A side effect of limiting cache invalidation is that some unit tests require
a manual cache invalidation to have up to date results. Indeed record not
being up to date in cache was hidden by the invalidation we just removed.
2018-04-10 11:00:41 +02:00
Thibault Delavallée 26d110c472 [IMP] mail: remove cache invalidation when notifying a message with a parent
When notifying partners or channels of a message, a cache invalidation is
currently done if the message has a parent. This invalidation has been done
when migrating the mail module at the new API at 4b122ad41d.

In that time notifying people of a message lead to the creation of
notifications of the parent message, if any. It was due to the chatter
being threaded and therefore displaying message with their header message.
Adding notifications for the parent was necessary to avoid access rights
issues  when fetching parent message data. Indeed as being notified is one
of the rule to see a message record adding notifications was done. A cache
invalidation has therefore been added to clean the message cache and ensure
everything was fine.

Commit 88b8cd0587 changed the way notifications are modeled in Odoo.
Notification on parent message was removed and access rights changed. Threaded
mode for Chatter has also been removed. However cache invalidation has been
kept probably by fear of removing it.

It does not seem to have any viable reason to invalidate cache when a message
has a parent. Posting a message does not push other messages in users's Inbox
meaning there should not be any issue with the cache preventing to see
messages.

Removing this cache invalidation allow to gain queries in performance tests.
It has an impact on each process involving message creation which is quite
common in Odoo.
2018-04-10 10:58:40 +02:00
gustavovalverde 3d653a2c02 [CLA] Update iterativo SRL, adding Jose
Closes #24122
2018-04-10 10:35:28 +02:00
Goffin Simon e62fb90e7d [FIX] point_of_sale: POS anglo-saxon in FIFO
In FIFO, the stock move cost related to the picking of the POS
Order must be used to compute the price.

Fine tuning of this commit: a36ff26ce0

opw:1829801
2018-04-10 10:22:12 +02:00
Vincent Schippefilt fba356c080 [FIX] web_editor: fix crash when hitting SHIFT+TAB on an empty editor
repro : open any editor (like tasks), empty its content and hit SHIFT+TAB
before this fix: you get a traceback
after this fix: you don't get a traceback
2018-04-10 09:39:08 +02:00
Vincent Schippefilt bc1bba446a [IMP] web: keyboard navigation in kanban view
1. Added the ability to navigate within the kanban view using UP,
        DOWN, LEFT and RIGHT keys.
    2. By defaults, the focus should be set on the search input field.
    3. From the search input field, using the DOWN key, the focus goes
        to the first card of the kanban
    4. From the search input field, using TAB key, the focus goes to the
        create button
    5. From the create/import buttons, using TAB or DOWN key goes to the
        first card of the kanban, then UP and DOWN keys moves the focus
        from card to card in the same column or if it is not a grouped
        view from left to right.
    6. In grouped view, LEFT and RIGHT keys moves the focus to the next
        column
    7. When on a card, hitting ENTER opens the view of that card.

Not included in this commit
    1. Memorize the position on the kanban when opening an card, than restoring
        when going back to that kanban
2018-04-10 09:39:08 +02:00
Vincent Schippefilt e0924fd01d [IMP] web: keyboard navigation in form view
1. Added the ability to navigate within the List view using UP and
        DOWN keys.
    2. By defaults, the focus should be set on the search input field.
    3. From the search input field, using the DOWN key, the focus goes
        to the list
    4. From the search input field, using TAB key, the focus goes to the
        create button
    5. From the create/import buttons, using TAB or DOWN key goes to the
        first row of the list, then UP and DOWN keys moves the focus from
        item to item in the list.
    6. When on a row, hitting ENTER opens the view of that row.

Also in this commit
    1. When on the first row, hitting the UP key does nothing
    2. When on the last row, hitting the DOWN key does nothing

Not included in this commit
    1. Memorize the position on the list when opening an row, than
        restoring when going back to that list
    2. Navigation on grouped list using the keyboard
2018-04-10 09:39:08 +02:00