Commit Graph
117975 Commits
Author SHA1 Message Date
mreficent 3754280a05 [FIX] account: don't require a company in tax_templates
We want to force the tax template to be blank always, because multiple companies can potentially use this template to create taxes. We want consistency company-wise.
2018-04-04 16:16:34 +02:00
Arnaud Baes 438006b56d [ADD] stock: replenish wizard
This wizard allows the stock users to replenish a product using the
routes applied to this product. A specific route can also be applied
to bypass the default route.

This replaces the "request procurement" wizard from v10, lost during the
stock refactoing.

Task ID: 47938
related to #22041
2018-04-04 16:06:19 +02:00
Bogdan Lisnenko df3192ef87 [FIX] l10n_ca: fixed account type in template
Canadian chart of account template contained incorrect account types for Tax receivable and Tax to pay.
This was fixed. Related issue #8934
2018-04-04 15:46:51 +02:00
mreficent bcad465c93 [FIX] purchase & stock_dropshipping: fix some tests
Related to commit https://github.com/odoo/odoo/commit/0e881fcd3a5671c4fe84b2a47c9d3611e4b823a1
2018-04-04 15:45:52 +02:00
Haresh Shyara 2c1611da29 [IMP] stock: putaway strategies by product
This commit allows to define a putaway strategy by product. Before
this commit, it was only possible to define a putaway strategy by
category.

We add a second one2many on the model 'product.putaway': the original
(fixed_location_ids) is used for the putaway per category, the new one
(product_location_ids) is used for the putway per product.

The two one2many are displayed on the putaway strategy and a domain on
the fields is used to filter the records between them. Inline tree view
add a required on the product_id on the one2many per product and a
required on category_id on the one2many per category.

If a putaway strategy per product AND per category match for a product,
the putaway per product takes precedence

This task also reword some tooltips.

We add some testcases to display the behaviour
- when a putaway per product is applied
- the conflict between a putaway per product and category
- the fallback to the category when nothing is found on the product

Task 23495
PR #20143
2018-04-04 14:22:00 +02:00
Géry Debongnie d86eb9e1a0 [FIX] web,doc: fix errors that prevented doc from building 2018-04-04 14:11:48 +02:00
xmo-odoo 14840d2064 [IMP] core: modernize tgz translations export
* don't use FS to do export
* update translations export dialog to fix outdated links (launchpad
  & 6.1 translations doc)

Note: can't use ``TarFile.gettarinfo`` to create the TarInfo object
because it wants an actual file object with a ``name`` attribute and
possibly even an fd.

closes #22798
2018-04-04 13:12:33 +02:00
Jeremy Kersten 5ba05f2ba4 [FIX] web, website: fix font path for bootstrap
Before this commit, if you or a lib uses Glyphicons, the font was loaded from
/web/content/fonts/ (or /web/static/src/less/fonts/ in debug=assets)

It is because bootstrap is imported from /web/static/src/less/import_boostrap.less
not directly from /web/static/lib/bootstrap/less/bootstrap.less

Now, we use absolute path to load font, overriding the variable define in
variables.less from bootstrap.
2018-04-04 13:02:21 +02:00
Martin Geubelle 4fc170e0fe [FIX] survey: submit a survey with empty date
Since rev. odoo/odoo@cd05983 it was not possible to submit a survey if a date
field was empty (trying to set `toJSON` on `null`).

The datepicker `date` function returns `null` if no date has been selected.

opw-1832381
2018-04-04 12:55:55 +02:00
len-odoo b6c962e62a [FIX] calendar: fix event sorting function
When sorting events according to some property that is not defined for all
events, Odoo would give a traceback as it would try to compare a boolean to some
other type.
We simply lift every value to a (boolean, X) tuple for any type X in the
sorting key function, thus having values of homogenous type.

opw 1831457
2018-04-04 12:45:40 +02:00
Martin Trigaux cc5dc8bfc5 [IMP] .github: avoid to titleize the PR content
Avoid reports like #23893 where the text is too close to the -- mark
2018-04-04 12:23:41 +02:00
Robinet Denis (ACSONE) bff47822f8 [CLA] add RobinetDenisAcsone into Acsone CLA
Closes #23967
2018-04-04 12:14:38 +02:00
Andreas Perhab 96c1530eaa [FIX] doc: corrected bootstrap documentation link
The global link was redirecting to http://getbootstrap.com/components/ (without
the fragment identifier).
Moreover, now that Bootstrap 4.0 is released, this URL may be broken in a close
future.

Closes #24031
2018-04-04 12:04:22 +02:00
Christophe Simonis a2165a04c3 [FIX] website: less specific xpath pattern
Allow more liberty in layout modifications
2018-04-04 11:37:26 +02:00
Yannick Tivisse 9999a54028 [FIX] fleet: Add missing dependencies on compute fields 2018-04-04 11:32:56 +02:00
Yannick Tivisse 3eb328cdc5 [IMP] fleet: Track changes on license_plate and total_depreciated_cost 2018-04-04 11:32:56 +02:00
Nicolas Martinelli 31f68563e0 [FIX] product_email_template: use regular HTML widget
The widget text was set when CKEditor was used, in order to avoid
breaking the template. This is not necessary anymore.

opw-1833484
2018-04-04 11:02:42 +02:00
Nicolas Martinelli 81e9b6d213 [FIX] sale_timesheet: undefined variable
Make sure `line_revenue` is always defined.

opw-1829893
2018-04-04 10:12:57 +02:00
Nicolas Lempereur cbff414cea [FIX] marketing_campaign: traceback on install 9.0
When installed, marketing_campaign shows the root "Marketing" menu by
default but this menu is not an action and just contain a
"Configuration" submenu without action as well.

Thus in community we got on a page without content, and on enterprise we
got a JS error.

note: only happen in 9.0

fixes #21898
opw-1802936
closes #24026
2018-04-04 09:59:37 +02:00
Lucas Perais (lpe) 72254129db [FIX] mail_activity: state of activity is TZ dependent
Have your user and your system in timezone Sao Paolo
When it is 2200 TZ time, UTC is the day after 0100

Have a activity schedule for today

Before this commit the activity was flagged as overdue.
This was because we compared the date deadline of the activity (no TZ)
to the date.today() in Python
While date do not have TZ legitimately, the moment (and place) you create them matters
Thus, we compared the date of the server (UTC -- day +1) to a date set by the user (TZ -- day -1)

After this commit we make up a date according to the user's tz
And the activity is not overdue, but in state 'today' as it should

OPW 1827920
closes #23969
2018-04-04 09:49:46 +02:00
Lucas Perais (lpe) 26347fc759 [FIX] web: debug manager: replace tree mode by list
- Open in debug mode the 'beetle'
- Click on open view
- select a Tree view in the list

Before this commit: A traceback appears
This was because while the Tree view per se has been discontinued
the mode 'tree' of an action must be supported
Which was not the case for this particular widget

After this commit: the list view asked for appears

OPW 1833008
closes #23963
closes #24005
2018-04-04 09:45:54 +02:00
mreficent b11621476b [FIX] pos & website_event_sale: fix some tests
Related to commit https://github.com/odoo/odoo/commit/0e881fcd3a5671c4fe84b2a47c9d3611e4b823a1
2018-04-04 09:36:18 +02:00
Nicolas Martinelli 6eefb7fb39 [FIX] base: user.share recomputation
When saving the settings, we perform a `write` on the groups and implied
groups. This will trigger a recomputation of the fields `share` on
`res.users` and `partner_share` on `res.partner`.

On a database with many users, this can lead to a non-negligible time
spent in these methods.

opw-1830145
2018-04-04 09:24:58 +02:00
Thibault Delavallée f9c210923d [MERGE][REF] mail, various: optimize implementation of follower subscription
This merge replaces followers subscription code in order to be optimized
and perform less queries. This improvement is done in several steps :

 * mail followers model has new low-level and optimized methods to compute
   followers to create or update. It uses SQL queries to fetch data in a
   single request;
 * mail thread message_subscribe method is rewritten to use this new method.
   Its API is also simplified and message_subscribe_user is removed to
   simplify the whole subscription API;
 * auto subscription is also rewritten. Fetching subtype data about parent /
   child like project / task is done in a single query that prepares data.
   It then uses new method to create followers;

Various addons are updated because of message_subscribe or auto subscription
change. Functionally behavior should stay the same as purpose is to be
equivalent in term of functional coverage.

Performance counters show this optimized code works well when dealing with
large set of followers to subscribe or update. Most tests perform better
of a few queries. Most complex ones involving (auto) subscription of several
followers perform way better. About 30% of query are saved in the three top
tests, aka between 80 and 90 queries with auto subscription of 10 followers.
On overall community runbot we have a gain of about 11K queries. As Odoo
data has few followers impact on runbot is probably less interesting than
impact on real-life use case.

Thanks to @rco-odoo for reviewing, and cheers !
2018-04-03 18:07:21 +02:00
Rémi Rahir f1a884e046 [FIX] web,account,google_calendar: correcting previous commit
corrects error added in c3d1eda017 .
Non-breaking spaces were explicitely added in the tests. This commit
restores the proper behaviour.
2018-04-03 18:05:52 +02:00
jem-odoo 35a4263f0a [FIX] calendar: comparing timezoned datetimes
We transform the rrule stored as a string into a real
rrule object using 'rrule.rrulestr'. The 'UNTIL' parameter
of the rrule might not be timezoned. So the '_until' property
of the rrule object will be a naive datetime.

Later in the '_get_recurrent_date_by_event', we add the recurring
date in the '_exdate' property, but those dates are timezoned.

When iterating on the rrule set (its a set since forceset=True), the
until date and exdate are compared, but it cause crashes as we can not
compare offset-naive and offset-aware datetimes.

This commit make the rrule use only naive or aware datetimes for its
'until' and '_exdate' properties depending on the 'until' property
of calendar.event rrule field.

opw-1825679
closes #24010
2018-04-03 17:54:12 +02:00
Thibault Delavallée 2dbcbdd3f2 [REM] mail: remove now unused add_followers_command
All code using it has been gradually replaced. It can be safely removed.
2018-04-03 17:50:51 +02:00
Thibault Delavallée ee64e8104c [REF] hr_expense: use new implementation for auto subscription
Expense report has custom code to add people as followers. This code has
several issues, notably in some cases it could try to add several times
same people, leading to crash and issues.

As auto subscription has been cleaned let us clean the code in hr expense.
Using _message_auto_subscribe_followers it is now simpler to automatically
add follower to expense reports. It is not necessary to add hackish custom
code in create and write.

One change is done in this commit. Some people are set as follower after
record creation and not before. However this was necessary when tracking
messages were not correctly triggered or auto subscription done after
tracking. As process is now 1/ create 2/ auto subscribe 3/ tracking, messages
linked to tracking will be correctly push to recipients automatically added
as followers.
2018-04-03 17:47:32 +02:00
Thibault Delavallée 1eba78381d [REF] mail: improve implementation of auto subscription
This commit refactors mail.thread message_auto_subscribe method. Purpose
of this method is to automatically subscribe people to documents in several
scenarios

 * followers from an umbrella record to sub-records, like followers of project
   added to tasks;
 * responsible of documents, in addition to sending notifications to newly
   added responsibles;
 * some specific use case depending on some applications like managers
   for expense reports;

New auto subscription now uses the recently introduced method optimized to
compute new or to-update followers. It is also rewritten so that overriding
it is easier. Indeed simply overriding _message_auto_subscribe_followers is
now sufficient to add new followers to a record, depending on some updated
values. It is also now possible to specify a template to use for some
specific notification, if requested.

Fetching auto-subscription data in subtype is also optimized. It is now done
in a single SQL query. All data related to parent (like project) and child
(like task) as well as default and internal-only data is prepared in a single
query and given back to auto subscription process. This allows to gain
queries in auto subscription based on subtype like project / task use case.

This commit has a great impact on performance counters. Complex use cases
involving tracking and responsible notifications gain about 30 queries which
is about 15% of their total query count.
2018-04-03 17:47:26 +02:00
Thibault Delavallée b6d2351df4 [REF] mail: improve implementation of message subscribe
This commit refactors mail.thread message_subscribe method. It is done for two
purposes. First one is to optimize performance by using the new followers
computation methods introduced recently. Second purpose is to clean the API
of message_subscribe to make it simpler to use.

This commit splits message_subscribe in two main parts :

 * _message_subscribe is a private method calling the follower new
   subscription methods and updating the record set;
 * message_subscribe is a public wrapper on _message_subscribe that adds
   access rights checks;

Simplification comes by removing message_subscribe_users that was a
shortcut to message_subscribe. Having a method to subscribe partners and
channels is sufficient as we would like to avoid bloating the public API
of mail.thread. A force parameter is also removed from message_subscribe
as this implementation detail can be induced in the computation.

Various addons using the removed methods are updated in order to use the new
subscription API. They have the same functional behavior.

This commit has a great impact when subscribing several followers. In a more
general way all code using message_post is also optimized as posting a message
generally implies subscribing followers. It also improves activity use as
posting a message and subscribing new followers are common process in
activities.
2018-04-03 17:11:43 +02:00
Thibault Delavallée 301f140cb6 [REF] mail: use new followers command when subscribing record creator
Override of create in mail.thread now uses the recently introduced
_add_default_followers to add the record's creator in the followers.

It allows to save one query when creating new records. It means for simple
models we approach the bottom limit in term of generated queries which is
quite a good news.
2018-04-03 17:10:54 +02:00
Thibault Delavallée 86bf50db05 [IMP] mail: introduce a new computation for subscribing followers
This commit adds new methods to add or update followers to documents. Purpose
is to have new optimized methods that perform less queries. It is based on
experience and use cases of various addons in Odoo using it.

Technically two main methods are given on mail.followers model

 * _add_followers: this method generates values required to create new
   followers or update existing one. It takes several parameter controlling
   how to deal with existing followers. This is used notably when auto
   subscription should not erase existing subscriptions;
 * _insert_followers: this method creates or updates followers for a given
   set of documents. It uses result from _add_followers;

Performance gain come from the use of a SQL query to fetch followers data
as well as less use of record sets. Code can be more low-level in some
places. Purpose is to avoid browse and prefetch and just fetch data once
and use it in various computation.

New implementation is equivalent to the old one. It offers more flexibility
as caller can either receive values for followers or directly have records
created and updated. Various parameter allow to tune computation depending
on each specific call to the new follower methods.

Future commits will gradually replace the use of old _add_follower_command
by the new methods. Purpose is to replace them one by one in order to see
the gain in term of performance one replacement at a time.
2018-04-03 17:08:51 +02:00
Dharmraj JhalaandJérémy Kersten 3d6f9b5e0b [IMP] website, website_sale: improve magnify feature
Move zoom next the original picture
Disable it if same img and max size with ratio < 1.5
Allow to enable zoom automatically
...

Task-33499

Co-authored-by: Jérémy Kersten <jke@odoo.com>
2018-04-03 16:25:18 +02:00
Goffin Simon ce162fae3e [FIX] account_analytic_default: Default analytic account in multi company
Steps to reproduce the bug:

- Set your user in multi company
- Set a default analytic account A for product P with your company
- Create a PO with P and deliver it
- Generate the invoice.

Bug:

The analytic account A was not set on the line.

opw:1831998
2018-04-03 16:09:01 +02:00
Rémi Rahir c3d1eda017 [FIX] web,account,google_calendar: chasing breaking spaces
Before this commit, some breaking spaces were present in the js code.
Such spaces are misinterpreted and worked by luck.

This has become a problem with exported js bunldes (e.g. the
external_lib bundle in im_livechat).

This commit replaces breaking spaces by regular spaces.
2018-04-03 15:52:17 +02:00
Laurent Smet 34c7fe2e77 [FIX] testing utilities: o2m should not strip readonly fields
In the normal course of saving-action, readonly fields are stripped
out when sending data to the server. The SSF would reuse the same code
when "saving" O2M lines to the parent record however that is not
correct and would lead to misbehaving views as readonly (non-stored)
fields used as "transients" (storing data within the extent of a
record's edition session) would not behave properly.

Fix by overriding the O2M Form's save so that readonly fields are
kept and stored in the parent record.

Closes #23620
2018-04-03 15:46:04 +02:00
Aaron Bohy f5b1d4945c [REF] web: FormRenderer: INNER/OUTER_GROUP_COL params
This rev. extracts two rendering parameters for the groups
corresponding to the default col value to apply (for inner and for
outer groups). This allows to easily override those default values
in extentions of the FormRenderer (for instance, in the renderer
of the new Dashboard view).
2018-04-03 15:19:42 +02:00
Aaron Bohy d4b918f314 [REF] web: BasicView: allow overriding arch parsing
This rev. refactors the way the view's arch is parsed in BasicView,
so that it can be extended specifications of the BasicView to
handle other tagnames that 'field' (which is basically the only
one handled in BasicView).
2018-04-03 15:19:42 +02:00
Aaron Bohy 409e7c18c3 [REF] FormRenderer: renderOuterGroup
This rev. extracts the part of the rendering that renders outer
groups (i.e. groups that contain groups) in its own function. This
allows extentions of the FormRenderer to use it (for instance, the
renderer of the new Dashboard view).
2018-04-03 15:19:42 +02:00
Aaron Bohy 69c9500e35 [IMP] ActionManager: keepSearchView option
This rev. introduces an option to doAction (keepSearchView). If set
to true, the searchView of the current action will be kept and used
by the new action (this only works if there is already an action
with a searchView, and if the new action is stacked over that one).

This is necessary for the new dashboard view.

A better solution would have been to export the state of the
existing searchView, and import it to the new one, but the current
implementation of the searchView doesn't allow to do that easily.
This will be done as soon as the searchView will be rewrote.
2018-04-03 15:19:42 +02:00
Aaron Bohy 5b3cb812be [IMP] web: SearchView: add/remove filter from outside
This rev. allows to add or remove filters to the SearchView from
the outside, and to make it display this new domain. This can be
used by views that trigger domain changes (e.g. this is the case
of the new DashboardView).
2018-04-03 15:19:42 +02:00
Aaron Bohy 3dc48c79c9 [REF] web: lint ir_http.py 2018-04-03 15:19:42 +02:00
Mathieu Duckerts-Antoine 166319fa4a [IMP] web: GraphView: remove hack to render in DOM
The graph view uses the nv(d3) lib to render the graph. This lib
requires that the rendering is done directly into the DOM (so that
it can correctly compute positions). However, the views are always
rendered in fragments, and appended to the DOM once ready (to
prevent them from flickering).

Before this rev., the graph view circumvented this by performing
the rendering in a setTimeout(0), letting the framework append the
widget to the DOM first.

This rev. removes this hack and uses the on_attach_callback hook
instead, which is called when the widget is attached to the DOM.
This ensures that the rendering is always done in the DOM, and we
keep the rendering part synchronous.
2018-04-03 15:19:42 +02:00
Mathieu Duckerts-Antoine 8e017ee296 [IMP] web: add a percentage formatter
This rev. adds a new formatter for numerical values to fieldsUtils.
2018-04-03 15:19:42 +02:00
Christophe Simonis b2e4c34f37 [FIX] sale_{stock,timesheet}: limit field dependence on product itself
This avoid recomputing values in case of product defined via module
data.
2018-04-03 14:25:47 +02:00
Toufik Benjaa 55878df5ff [FIX] account_payment: Restrain access to invoice's partner
- Restrain the creation of transaction for an invoice to the invoice partner.
- Removed the callback_method argument as it was unused.
2018-04-03 14:22:10 +02:00
Nicolas Martinelli dcca2e8b9d [FIX] account: fix test
Complement of 802339c12d
2018-04-03 14:10:09 +02:00
Wolfgang Taferner 0f9bf4b0d0 [CLA] add ap-wtioit to WT-IO-IT's CCLA
Closes #24001
2018-04-03 13:38:19 +02:00
Nicolas Lempereur eca030cc38 [FIX] account: invoice line form ok studio context
Correct account invoice line form view so studio doesn't fail on
something that doesn't seem really correct (and somehow worked thanks
to pyeval implementation or the override from another view type).

opw-1826254
opw-1830171
closes #23997
2018-04-03 13:16:21 +02:00
Lucas Perais (lpe) 691b1f6fa4 [FIX] hr_attendance: fix handling of date objects in greetings
On 'My attendance', do some check-in/out operations
while on the server side, everything was ok, the display had some issues:
On Chrome, that worked well whereas in Safari, it did not
since the Date() implementation only accepts ISO date strings

We take the opportunity of this fix to handle dates with moment.js, which accepts non-ISO formats

OPW 1831555

closes #23962
2018-04-03 04:33:14 -03:00