Commit Graph
111138 Commits
Author SHA1 Message Date
Christophe Simonis 044ab92270 [MERGE] forward port branch saas-11 up to f081f19fb8 2017-07-18 20:09:37 +02:00
Christophe Simonis f081f19fb8 [MERGE] forward port branch 9.0 up to ba294a397e 2017-07-18 19:45:42 +02:00
Christophe Simonis ba294a397e [MERGE] forward port branch saas-6 up to 3228694bdd 2017-07-18 19:18:59 +02:00
Christophe Simonis 12fdf46a5b [FIX] mass_mailing: avoid creating mass mailing for messages posts
In case a default value is set for the field `mass_mailing_name` of the
mail composer, the automatic messages sent via message_post_with_* are
considered as a mass mailing. It may also create an AccessError if the
current user is not a mass mailing user.

In the case of the "assign user" email (for auto-subscribed users), the
url wasn't shorten, which resulted in invalid links (opw-752941) (fixed
by 3228694bdd)
2017-07-18 19:00:08 +02:00
Christophe Simonis 3228694bdd [FIX] mass_mailing: only track shorten links
It may happen that some mails attached to a mailing contains non
shorten links.
2017-07-18 18:36:21 +02:00
pashute b237c3e25e [IMP] doc: move demonstration path
To show forward slash in paths are needed and to use path guidelines

Closes #17989
2017-07-18 17:25:16 +02:00
Fabien Pinckaers 9bb696e13a [REF] stock: quant: remove _decrease_xxx_quantity method
To increase or decrease the reserved or available quantity,
`stock.quant` exposes two methods: _increase_xxx_quantity and
_decrease_xxx_quantity. This could be confusing and could lead to
unexpected result when overriding one or the other.

We remove the _decrease_xxx_quantity method and rename
_increase_xxx_quantity by _update_xxx_quantity, as it supports a signed
float anyway.
2017-07-18 17:24:57 +02:00
Richard Mathot 861343821d [FIX] delivery: typo in method names 2017-07-18 17:14:04 +02:00
Jarmo Kortetjärvi 2550cc08c3 [CLA] signature Oy Tawasta OS Technologies Ltd.
Done at #18301
2017-07-18 16:40:40 +02:00
Martin Trigaux 01b8f6be99 [I18N] website_sale: export source terms
To include 6d7648e9f0
2017-07-18 16:29:20 +02:00
Rakesh Sindhav 6d7648e9f0 [FIX] website_sale: don't transalte CSS classes
Closes #18000
2017-07-18 16:27:36 +02:00
Rakesh Sindhav f0c9275e35 [CLA] Signature for sindhav
Done at #18000
2017-07-18 16:27:36 +02:00
David Monjoie efd1585234 [FIX] web: fix action context
Previously, we had to filter the context values to exclude some
erroneous values we propagated earlier.

This commit removes the earlier propagation of wrong values (the
current record context when executing an action) and thus also
removes the filtering of those values, which was actually removing
useful values from the action context.

The bug could be seen by following these steps:
- Install crm and sale
- Go to My Pipeline
- Open an opportunity which has a customer set
- Click on "New Quotation" action button
- See that the customer is not set on the new quotation, it should
  be set by the default_partner_id value in the action context
2017-07-18 15:59:48 +02:00
David Monjoie 1ceb201d5e [FIX] web: fix boolean fields display in calendar
Since formatBoolean returns a jQuery object, boolean fields were
displayed as [Object object] in calendar view.

This is a fix for stable version. The real fix would be to get rid
of the jQuery object returned by formatBoolean but the change is
not trivial.
2017-07-18 15:59:48 +02:00
David Monjoie bce3defc8c [FIX] web: fix calendar server values parsing
The record data given to fullCalendar to use in the renderEvent
function was not parsed like it is in basic model for example.

As a result, date(time) fields were string rather than moment
objects, which was triggering the crash that started this commit.
2017-07-18 15:51:49 +02:00
Fabien Pinckaers 669cbe3c36 [REF] stock: quant's company_id
A quant's company_id is now related to the company_id of its location.
We make it store so that filters can work with it. We remove the default
because the location's company_id has one, and it's possible that we
introduce quants in some non-internal locations (like intercompany
transit) that do not have a company_id set.
2017-07-18 15:45:44 +02:00
Fabien Pinckaers a665cab858 [FIX] stock: stock.quant's contraint
Quants should not be create for consumable and services. Adapt the
constraint.
2017-07-18 15:45:44 +02:00
Fabien Pinckaers 56f06f8b01 [REM] stock: quick link to stock.move in variant's kanban
This feature is no longer wanted. The information is available somewhere
else:
  - reception_count is a duplicate implementation of incoming_qty
  - delivery_count is a duplicate implementation of outgoing_qty
2017-07-18 15:45:44 +02:00
Elkasitu e83c3e2678 [FIX] web: Fix actions for widgets w/o controllers
Execution of actions is usually done with trigger_up, which delegates
the action execution to the widget's controller.

This is troublesome for actions done on widgets that have no
controllers, like widgets in Studio for example.

The commit fixes this by adding a standalone option for AbstractFields,
if the flag is true when instantiating a widget, the action will be
called directly from within the widget object and will not be propagated
upwards.

A test to verify that this works properly has been added as well
2017-07-18 15:12:55 +02:00
Raphael Collet 74acfc2054 Revert "[IMP] base: optimize method _add_manual_fields by making less queries"
This reverts commit 8b5257b1e5.
2017-07-18 14:49:38 +02:00
Géry Debongnie f7dd085e80 [FIX] web: mock name search actually evaluates the domain
Before this commit, the _mockNameSearch method of the mock server was
computing by hand the first element of the domain.  This was adhoc and
wrong (for example, the '==' operator).  Also, we actually have a method
designed to just return the records matching a given domain.
2017-07-18 14:45:22 +02:00
Géry Debongnie 5f8dea490a [FIX] web: properly display id in some cases
When a one2many is set through an onchange, the web client did not set
the id field properly.  Because of that, it could not be displayed in a
list. This is due to the fact that the id is given in the command like this:

[1, 53, {...}]

Here, the command is 1 (update), then 53 (id), then some values, which
do not have the id. So, in this specific case, we assumed that all the
new values were in the object, even though we properly set the res_id
property.

We fix this issue at the root: in the _makeDataPoint method, we make
sure that no datapoint can be created with a res_id and without the
corresponding id key.

Note that this issue was not found in a standard installation of Odoo
(but it may be present somewhere), but in some custom code.  It is rare
to actually use the id field in a view, but in this case, we had a
many2many in kanban view, and the id was used to format the url of an
image.
2017-07-18 14:45:22 +02:00
Nicolas Martinelli 957d57eaf7 [FIX] hr_expense: mail to manager
When an employee submits an expense, no mail is sent to the manager.
This should be the case, since it works this way on holidays.

The trick, however, is that the expense is created as submitted, but the
followers are only added afterwards. We need to make sure to add the
followers at creation.

opw-751085
2017-07-18 13:53:13 +02:00
Xavier Morel 21eb4db232 [MERGE] P3 semantics fixes
Closes #17114
2017-07-18 11:49:53 +02:00
Xavier Morel e26a212304 [FIX] P3: reorder finders in meta_path
So that was a fun one: mock.patch calls would regularly fail refusing
to find the addon in odoo.addon (e.g. essentially getattr(odoo.addon,
'account_budget' deep within the bowels of mock).

Turns out the answer is that our import hooks would not be used for
many imports: while in Python 2, sys.meta_path is empty and the
default finders are run after all meta_path finders fail as noted by
the documentation[0].

However when the import system was rewritten in Python 3.3[1]
meta_path was "despecialised" and the default finders were moved to
meta_path rather than be a hidden part of the import machinery[2]:

> sys.meta_path and sys.path_hooks now store all of the meta path
> finders and path entry hooks used by import. Previously the finders
> were implicit and hidden within the C code of import instead of
> being directly exposed.

The result of this change is that ``sys.meta_path.append`` means the
default finders should take priority and the custom ones should be
fallback. This is the exact opposite of what we want.

Fix issue by ``sys.meta_path.insert``-ing our finders at the start of
the path rather than appending them at the end. This should change
nothing in Python 2 but seems to fix the issue in P3.

[0]
https://docs.python.org/2/library/sys.html?highlight=meta_path#sys.meta_path
[1] https://docs.python.org/3/whatsnew/3.3.html#importlib
[2] https://docs.python.org/3/whatsnew/3.3.html#visible-changes
2017-07-18 11:49:28 +02:00
Xavier Morel bc3cbe9eca [FIX] P3: surprise, time.time() isn't falsy
https://bugs.python.org/issue13936

That's a pretty sensible change, but it turns out we did have some
bits of resource which implicitly depended on the old behaviour.
2017-07-18 11:49:28 +02:00
Xavier Morel 3cad551a88 [FIX] P3: stupid use of hasattr
In Python 2, hasattr swallows *any* exception raised during the
access. In Python 3, it only swallows AttributeError.

Accessing an attribute on an unbound threadlocal proxy raises
RuntimeError, while running test_ir_http_mimetype ``request`` is
unbound, in Python 2 ``hasattr`` would return ``False`` on an unbound
threadlocal, in Python 3 it lets ``RuntimeError`` pass through blowing
up the test.

Fix this by just checking if the threadlocal is bound by using it as a
boolean…
2017-07-18 11:49:28 +02:00
Xavier Morel 9bd793e1b5 [FIX] P3: / has become 'real division' in all cases 2017-07-18 11:49:28 +02:00
Xavier Morel 17fe075cda [FIX] P3: absolute ordering removed 2017-07-18 11:49:28 +02:00
Xavier Morel ace4ee39e8 [FIX] P3: round() compatibility shim
In Python 3 round:

* rounds half to even (banker's rounding) rather than up
* returns an int if not given a precision (or given a precision of
  None)
* discards the negative sign when rounding to 0

Add a compatibility shim which implements P2 behaviour and at least
allows passing float_utils's tests.

Implementing float_round on top of Decimal was attempted but did not
work: although Decimal.quantize takes a non-integral
Decimal (e.g. ``d.quantize(D('0.001'))``) it only supports integral
powers of 10 and does not support quantizing to e.g. 0.05: while that
will not fail it will just use the exponent for quantization and 0.05
is thus equivalent to 0.01, which is not what we want if e.g. need to
round a value to 5 cents.

This is hinted at but maybe not clearly spelled out by the official
documentation:

> Return a value equal to the first operand after rounding
> and **having the exponent of** the second operand.

Also convert a bunch of hand-rolled currency rounding to just using
the round() method on res.currency.
2017-07-18 11:49:28 +02:00
Richard Mathot 760cffe8e6 [FIX] delivery: sale_id may not be set for a picking 2017-07-18 11:18:18 +02:00
Moisés López c0bdf81a5b [FIX] doc: correct patch line number
to avoid "WARNING: Hunk"

Closes #18286
2017-07-18 11:14:47 +02:00
Thibault Delavallée dc2575b5db [REM] portal: remove pot file probably reintroduced at forward-port
Commit 3e3105151b removed the portal module as its feature are completely
replaced by front-end customer portal or base portal user support in various modules.

However the portal pot file, kicked out of Odoo by the door, tried
to come back through the window. This commit closes the window and
puts this file out again. Let us hope it does not make holes in
the garden or barks at neighbors.
2017-07-18 10:00:37 +02:00
Josse Colpaert 274432ecac [FIX] stock: force orderpoint deactivation
Deactivating product should not be working when you still have active
orderpoints.

Closes #16954
2017-07-18 09:48:02 +02:00
Goffin Simon 61304087e7 [FIX] point_of_sale: Creating pos order line with qty=0
Steps to reproduce:

1.Create pos order with two products.
2.One of the products, must be type="Stockable Product" and quantity=0.
3.Pay order.
4.Check order --> extra info --> picking

Bug:
picking state = Waiting Availability

In 9.0, the picking state is equal to "Done".

Fixes #18089
opw:751565
2017-07-18 09:40:34 +02:00
rar-odoo cb863ed0bb [FIX] gamification: email template for challenges (#18265)
* [IMP] Gamification: email template

- new template for challenges for both personal and ranking mode.
2017-07-17 18:07:48 +02:00
Thibault Delavallée 62de570395 [IMP] base, website: correctly use inheritance when creating qweb rendering context
Base render method now calls a prepare_qcontext method used to prepare
the qweb context used for the rendering. Website override of ir_ui_view
now simply inherits this method to add its own set of values instead of
doing strange things with the base render override.

Qweb context should be the same after this commit, i.e. containing a lot
of duplicated things like a copy of the context. The only change is that
user_id and res_company are now directly supported in base rendering
instead of only in website version of rendering. Future commits will
use those values.
2017-07-17 18:06:37 +02:00
Thibault Delavallée 0908cbd0e8 [IMP] website: ir_http: correctly call super in auth_method_public
Calling super when it is possible it always a good practice. It ensures
to have a basic behavior that is the fallback when the behavior defined
in the inheritance does not apply. Previously the base behavior was done
directly in the inheritance without calling super. This commit improves
that and calls super like a pro.
2017-07-17 17:07:19 +02:00
Thibault Delavallée e66ba3ce1e [CLN] website_payment: remove some unused variables in JS 2017-07-17 17:03:10 +02:00
Alexis de Lattre ad14be036c [FIX] l10n_fr: allow to reconcile on 511xxx accounts
Closes #18152
2017-07-17 16:30:31 +02:00
David Tran 64b378fd2c [IMP] crm: allow crm.activity.report to be extended
Closes #18254
2017-07-17 16:14:03 +02:00
Khoi Nguyen 3dd1c0f87e [FIX] web: undefined group name for group by date:<interval>
Previously, grouping a list by a non-default time interval (e.g.
'creation date:week') yielded a grouped list of records with undefined
group names.
2017-07-17 15:40:44 +02:00
Thibault Delavallée de33a4193c [FIX] (website_)payment: display website_published field of acquirers in payment
As this field is defined directly in payment and is displayed on
acquirer form view let us display it in tree view also directly
in payment instead of website payment.

This is a manual forward-port of commit 5f24bf5df7.
2017-07-17 14:43:31 +02:00
Martin Trigaux f0a03da2b2 [I18N] Update translation terms from Transifex
Not sure why it did not fetched
2017-07-17 13:33:29 +02:00
Thibault Delavallée 5f24bf5df7 [FIX] (website_)payment: display website_published field of acquirers in payment
As this field is defined directly in payment and is displayed on
acquirer form view let us display it in tree view also directly
in payment instead of website payment.
2017-07-17 13:28:07 +02:00
Atul Patel 9f649f3e40 [FIX] pad: Use a post instead of a get on the request
The old code used Request(data=)]( https://github.com/odoo-dev/odoo/blob/723b083cf5e51beec166059350466e5504db46c9/addons/pad/py_etherpad/__init__.py#L39)

Which however means it did a POST:

> the HTTP request will be a POST instead of a GET when the data parameter is provided

yet the code currently uses `requests.get`, so [it looks very much like a mistake when converting from urllib to requests](https://github.com/odoo-dev/odoo/commit/01e35141479b8dfc4a390518f89fc52e7cec5396#diff-3303eb022ac36e1ef7258c28f24f6de6).
2017-07-17 13:18:37 +02:00
Goffin Simon fea5057425 [FIX] account: Unlinking payment term
When unlinking payment terms, the ir.property records linked to
the fields "property_payment_term_id" and "property_supplier_payment_term_id"
were not deleted.

opw:749459
2017-07-17 12:56:57 +02:00
Nikunj Ladava 84be2e076a [FIX] sale: Retrieve correctly the default_deposit_product_id in ICP 2017-07-17 12:52:08 +02:00
Dipali Tank 37fac4c548 [IMP] hr_holidays: relabel 'holidays' to 'leaves' as this is the App name 2017-07-17 12:20:48 +02:00
Axay Javiya 2c9ea8700a [FIX] sale: fix Tax included price in sale configuration 2017-07-17 12:20:13 +02:00