Commit Graph
127478 Commits
Author SHA1 Message Date
fja-odoo 4ebda2ec2b [FIX] web_editor, web_unsplash: fix nested div
The div that is replaced with the existing.attachments template was not
the right target and kept nesting div into each other.
The parent div of the existing.attachments now has the
o_we_existing_attachments class (the target to be replaced by itself).

Part of #33983
2019-06-19 14:55:30 +00:00
Hetal Dhanak 16ee1966af [FIX] point_of_sale: Traceback while printing sales details
Traceback appeared due to incorrect syntax in expression.AND. The function
was called with separate arguments instead of array of arguments.

Task-2017568

closes odoo/odoo#34216

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-19 12:26:23 +00:00
William Henrotin 894ca01048 [FIX] mrp: wrong index into inverse function
The first occurence of the set was wrongly place on the date field
instead on the recordset

Task: 2024628

closes odoo/odoo#34230

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-06-19 07:47:43 +00:00
Raphael Collet c65325b5c4 [FIX] mail: setting template to False in composer clears attachments
closes odoo/odoo#34104

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-06-13 15:27:18 +00:00
Raphael Collet be560c2828 [FIX] models: new() cannot not trigger any recomputation
Set the flag `validate=False` to prevent `convert_to_cache` on x2many
fields from triggering recomputations with command 1 (update).
2019-06-13 15:01:29 +00:00
Raphael Collet 26bf8ca880 [FIX] fields: x2many value overrides default value on new records
When instantiating a new record, the commands of an x2many field apply
on an empty recordset instead of the field's default value.  This is
less bug-prone, and avoids an infinite recursion in `convert_to_cache`.
2019-06-13 15:01:29 +00:00
Raphael Collet ef3a2118f6 [FIX] models: inverse field when setting changed x2many in onchange 2019-06-13 15:01:29 +00:00
Raphael Collet c22912ec42 [FIX] models: convert values to cache in the right order
When updating the cache of a record, convert currency fields before
monetary fields in order to enable proper rouding.
2019-06-13 14:46:21 +00:00
Raphael Collet fb04afb15d [FIX] fields: avoid infinite recursion in convert_to_write 2019-06-13 14:39:13 +00:00
Raphael Collet e0e9ae1edd [FIX] *: special cases for new records 2019-06-13 14:39:13 +00:00
Raphael Collet 59b2e29a9c [FIX] models: multiple x2many fields in onchange
When the model has several x2many fields which are non-disjoint, the web
client sometimes invokes `onchange` with inconsistent data: a line
appearing in two x2many fields with different values for a subfield.
The method must deal with that inconsistency and return correct data to
the client.
2019-06-13 14:39:13 +00:00
Olivier Colson 819514309b [FIX] account: make tax report compatible with new multicompany implementation
[IMP] account: make all tax report lines accessible in every company

The former implementation, with a record rule, did not support the new multicompany implementation. Furthermore, making the tax reports accessible by every company whatever their contries is more consistent with the way other accounting reports work.

closes odoo/odoo#34154

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-06-14 15:13:23 +00:00
Christophe Simonis 618ea1ab67 [FIX] test_mail: bump query count
For unknown reason (I didn't manage to find the culprit), the previous
forward-port generate more queries than before.
2019-06-17 18:27:28 +02:00
Christophe Simonis 0da246ef55 [FIX] core: not all falsy objects have an origin attribute
It avoid `X.browse([0]).exists()` to blow up.
2019-06-17 14:44:25 +02:00
Christophe Simonis 93b0f9ad2a [FIX] uom: define reference UoM first 2019-06-17 14:15:58 +02:00
Christophe Simonis 8fa477cbd9 [FIX] web_editor: use only ES5 compatible code 2019-06-17 14:10:03 +02:00
Christophe Simonis b6f7fe9a81 [IMP] test_lint: correctly format es-check error message 2019-06-17 14:09:31 +02:00
Christophe Simonis 65cc06e3ab [FIX] mail: use defined variable
Oversight of previous forward-port.
2019-06-17 14:08:45 +02:00
Christophe Simonis 25e3f27062 [MERGE] forward port branch saas-12.3 up to 48a9f5a633 2019-06-17 13:20:35 +02:00
Odoo Translation Bot 48a9f5a633 [I18N] Update translation terms from Transifex 2019-06-16 06:15:35 +02:00
Christophe Simonis ced0e5becf [FIX] test_lint: also ignore js files in static/src/tests directory 2019-06-14 18:09:58 +02:00
Christophe Simonis 131e478ae6 [FIX] account: avoid usage of this in closure
Oversight of previous forward-port.
2019-06-14 17:29:51 +02:00
Christophe Simonis 34a8754d4f [MERGE] forward port branch saas-12.2 up to 498b4b4350 2019-06-14 15:20:01 +02:00
sri-odoo 498b4b4350 [FIX] website_slides: add missing <h1> tag (seo)
closes odoo/odoo#34137

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-14 10:16:58 +00:00
Jeremy Kersten 856685d640 [FIX] website_slides: use bigger image for shared content
Before this commit, share a slide was done with a small picture and so ugly

closes odoo/odoo#34133

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-14 09:42:03 +00:00
Christophe Simonis 5b2f64fd5d [MERGE] forward port branch 12.0 up to 4870251f0b 2019-06-14 10:15:49 +02:00
Sébastien Theys 382989c341 [FIX] product: remove useless create_from_tmpl context change
Since 0477bdb75a

The last use of `create_from_tmpl` was removed therefore it is better to not
change the context for no reason.

closes odoo/odoo#34107

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-06-13 13:59:04 +00:00
rhe 6a2f83a08e [FIX] point_of_sale: fix binding model reference
You are not able to install pos_sale because of a wrong reference to a
model in the action "pos_session_action_from_crm_team".

It was referencing the module 'crm' instead of 'sales_team'.

Thi behavior has been introduced in the revision: 10f1a1a0c4

closes odoo/odoo#34119

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-06-14 08:16:52 +00:00
Nicolas Martinelli 4870251f0b [FIX] payment: save credit card
- Set a payment provider with:
'Save Cards': 'Always'
'Payment Flow': 'Redirection to the acquirer website'
- Process an order on the eCommerce

The payment token is not saved.

The `save_token` value is based on the checkbox which is only added in
'ask' mode:

https://github.com/odoo/odoo/blob/4b8f72eb2315e675ca6d5a0d0961272fc024c475/addons/payment/static/src/js/payment_form.js#L162

We hide and pre-check the checkbox in this case.

opw-2008441
opw-2008275

closes odoo/odoo#34106

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-13 13:52:03 +00:00
Nicolas Martinelli 5af6928107 [FIX] google_spreadsheet: boolean
It seems that Google Spreadsheet only recognizes `true` and `false` as
valid boolean values.

opw-2000623

closes odoo/odoo#34100

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-13 12:10:20 +00:00
Christophe Simonis a526ff3f70 [FIX] mail: use correct variable
Oversight of previous forward-port.
2019-06-13 18:20:47 +02:00
Christophe Simonis a0a11fd5e2 [MERGE] forward port branch saas-11.3 up to 8a19a6a2a3 2019-06-13 18:18:17 +02:00
Christophe Simonis 8a19a6a2a3 [MERGE] forward port branch 11.0 up to ec8c66991d 2019-06-13 16:52:40 +02:00
Christophe Simonis ec8c66991d [MERGE] forward port branch saas-15 up to 641ca4f7f4 2019-06-13 16:22:23 +02:00
Christophe Simonis 641ca4f7f4 [MERGE] forward port branch saas-14 up to 6a247212f8 2019-06-13 15:32:55 +02:00
Christophe Simonis 6a247212f8 [MERGE] forward port branch 10.0 up to 818d34630d 2019-06-13 15:25:43 +02:00
Julien Castiaux dad9265d69 [FIX] project: correct filename on portal attachment
Create a project visible to a portal customer, create a task and attach
an attachment. As a portal user, go to the task and download the
attachment, the downloaded filename is the numeric identifier of the
document instead of the document filename.

The `?download=true` force the download of the attachment and correctly
set the filename.

opw-2008517

closes odoo/odoo#34098

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-06-13 13:22:22 +00:00
Nans Lefebvre ea064c81c9 [FIX] website: fix access error at settings save
Let a database with company C1, C2,
and a website W belonging to C1, used for both companies.
Settings in C2 cannot be saved without setting a website.
At settings load W is removed from C2 because it belongs to C1.
So reset C2's website to W.
This triggers a (useless) write of company_id (C1.id) on W.
Then we have w.user_id.company_id.id != self.env.user.company_id.id, (C1 != C2).
So if contacts are not shared, then accessing w.user_id.company_id would cause
an access error because of record rules, preventing the save.
As a result, settings are unusable for company C2.

opw 2008887

closes odoo/odoo#34102

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-06-13 12:41:15 +00:00
Olivier Colson 13f5dc905b [IMP] l10n_lu: remove unnecessary space at the end of some tax report line name
closes odoo/odoo#34094

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-13 10:59:05 +00:00
Aurélien Warnon bf1149c1b6 [FIX] crm: fix 'Won' filter in 'Activities' reporting view
The 'predictive lead scoring' task (#1925439) changed the way stages are marked as 'won'.
This introduced a bug in the 'Won' filter of the crm 'Activites' reporting view.

This commit correctly applies the domain on the 'is_won' property of the crm.stage.

Task #2009515

closes odoo/odoo#34087

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-06-13 07:53:18 +00:00
Nicolas Vannieuwerburgh 818d34630d [IMP] stock: noupdate on stock location
Stock.locations should be in no-update:
Limit the impact of recompute fields during the upgrade of stock module. (especially method _compute_product_availability)
Limit the impact on migration

Method _compute_product_availability is triggered during an upgrade of module and during migrations.
This may take a lot of time of big databases

closes odoo/odoo#34074

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-13 07:09:42 +00:00
Parth Choksi 2f8f832cee [FIX] mail: traceback on opening chat full composer
When full composer is opened it checks for partner information by calling
get_partner_info controller, if information are missing then it opens missing
partner information popup to fill missing partner information,
currently if partner information is missing and if try to open full composer it
throws traceback, this is due to commit:
https://github.com/odoo/odoo/commit/957c99abd53b42fa82903ad7ad03300797a706cf
here this._rpc is used in inner function which is wrong, it should be self._rpc

Scenario: we go to an opportunity and set the email but
we do not set a customer, and then when we open the chat composer
by sending a message, we're getting the traceback.

It will be fixed in this commit.

task-2005890

closes odoo/odoo#34084

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-13 05:07:43 +00:00
Christophe Simonis efc64edf70 [MERGE] forward port branch 11.0 up to 242e485b4a 2019-06-12 19:18:42 +02:00
wan d215bd81ca [IMP] account: update the journal items lists
Task 2003965
*** New menuitems for the accounting menu:
Miscellaneous
Journal Entries       (default search on misc op journal, like in v12)
Journal Items         (debug mode, same as V12)

Journals                (=journal items)
Sales                 (group by entry, filter sales journal)
Purchase              (group by entry, filter purchase journal)
Bank & Cash           (group by entry, filter bank,cash journal)
Miscellaneous         (group by entry, filter misc journal)

Ledgers                 (=journal items)
General Ledger        (group by account)
Partner Ledger        (group by partner)
Taxes                 (no group by)

*** Expand group by by default
*** Adapt the name of the groups for group by moves
*** Fold the attachment viewer
*** Correct the optional tree fields on invoices

closes odoo/odoo#34083

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-06-12 16:13:53 +00:00
wan 79a8269821 [IMP] web: allow to use python expr in tree's expand
Before it was only possible to set 0 or 1 as value for expand. This constrained the creation of adaptable views with regard to to context
2019-06-12 16:13:42 +00:00
Julien Castiaux 306abd0131 [FIX] mail: send same attachment multiple times
In the Discuss app, using Chrome or IE11, try to send the same
attachment to different channels. The first attachment is correctly
detected but not the next ones.

The problem is due to a browser inconsistency, on firefox selecting the
same file in an `<input type=file>` triggers the `change` event. This is
not the case on Chrome/IE, selecting the same file doesn't triggers an
`onchange`.

opw-2006647

closes odoo/odoo#34076

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-06-12 14:36:03 +00:00
sri-odoo ed7b3b0fa4 [FIX] website_slides: design, questions margins
Slightly increase margins between questions in a test.

closes odoo/odoo#34055

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-12 14:09:15 +00:00
Denis Ledoux 242e485b4a [FIX] http: Unreachable server when db_maxconn reached during registry loading
On `WebRequest` `__exit__`, when an exception occured,
(in `self.registry.signal_changes` or `self.registry.reset_changes`)
cursor were left unclosed as `self._cr.close` was not called
in such cases.

Having exceptions in the above mentioned method do not happen
often, but when it does it left unclosed and unusable cursors
in the connection pool, and in the extreme case explained below,
it left the connection pool with only unclosed and unusable cursors.
The entire server was then unusable as it no longer had working cursors.

Case:
- Start a multi-thread server with db_maxconn set to 5
- Ensure you do not send any request to the server,
not even with a left open tab on `http://localhost:8069` in your browser
- Send 6 parallel HTTP requests to `/web/login`
thanks to an external thread python script
(See below, at the end of this long commit message)

According to your registry state (if you have a lot of modules installed or not),
and the native Python Garbage Collecting state,
you might end with
- either warnings telling some unclosed cursor were garbage collected,
and therefore closed (by a kind of luck thanks to the Python garbage collecting),
- either, a server completely blocked not accepting any other request
(you can try for instance `curl http://localhost:8069`
and you end up with a `500 Internal Server Error`

This observed issue looks to appear only in 11.0. Not 10.0 or 12.0.
This is because only 11.0 clear the cache during registry loading:
`https://github.com/odoo/odoo/blob/f1706c848d41c47646dabca771996e9b9f788241/odoo/modules/loading.py#L236`
This cache clearing doesn't happen in 10.0 nor 12.0
(in 12.0, thanks to e181f592f3)

When sending the 6 parallel requests,
it uses instantly all the 5 available cursors of the connection pool to handle these requests,
and when each request exits, in `__exit__`, it calls `self.registry.signal_changes()`
which tries to open a new cursor because of
- `self.cache_invalidated` which is True, for all the 6 requests, thanks to the call to `clear_caches`
explained above during the registry loading and the fact all requests have been treated in parallel,
- `with closing(self.cursor()) as cr:`, `self.cursor()` attempting to use a new cursor
(the `closing(...)` does not have any incidence on this issue, despite it could look like guilty)

The attempt to use a new cursor fails, as there is no more available (`db_maxconn` is reached),
raising a `PoolError('The Connection Pool Is Full')` exception.

In the request `__exit__` method, because of this exception raised when calling `signal_changes`,
`self._cr.close` is never reached, and the parallel request therefore left only unclosed
cursors in the connection pool,
therefore leaving the server in a state where it only has unusable cursors
and therefore can't do anything more.

This might look like really bad luck to land in such a state,
but we observed multiple actual case on Odoo.sh,
the one referenced in this commit (opw-2008340) was because of an Outlook client
which launched 18 parallel requests to fetch the email images,
and the server wasn't spawned, therefore neither was the registry.
The server registry was therefore just loaded when it received the 18 parallel requests,
and it therefore triggered this extreme use case.
The server was left unusable for several minutes, until a forced restart.

For reference, here is the script that has been used to trigger the 6 parallel requests:
```
import requests
import threading

threads = []
for i in range(6):
threads.append(threading.Thread(target=lambda: requests.get('http://localhost:8069/web/login')))
for thread in threads:
thread.start()

```

opw-2008340

closes odoo/odoo#34071

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-06-12 13:10:45 +00:00
Christophe Simonis 92ef6daa19 [MERGE] forward port branch saas-15 up to e14fd457b9 2019-06-12 15:46:40 +02:00
Martin Trigaux 52936ec260 [I18N] *: export saas-12.3 source terms
closes odoo/odoo#34068

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-12 12:39:50 +00:00