Commit Graph
112035 Commits
Author SHA1 Message Date
Christophe Simonis aaaf32fedd [MERGE] forward port branch saas-14 up to c816efe7de 2019-07-04 10:48:04 +02:00
Christophe Simonis c816efe7de [MERGE] forward port branch 10.0 up to 24b677a359 2019-07-03 19:23:14 +02:00
Christophe Simonis 24b677a359 [FIX] test_rpc: more robust tests
- mute logger to avoid logging bad queries
 - enforce fields strings

These changes will forbid tests to fail in following versions.
2019-07-03 19:20:31 +02:00
Christophe Simonis 565165a6c8 [MERGE] forward port branch 10.0 up to acbdd526e6 2019-07-03 18:32:16 +02:00
jev-odoo acbdd526e6 [FIX]l10n_fr_fec: better remove new line
Fix/improve commit d870749d79
that was removing line feed (\n).

In this one, we also remove carriage return (\r)
to address all cases.

closes odoo/odoo#34536

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-03 07:40:43 +00:00
Xavier Morel 1f704552ac [FIX] base: don't overwrite existing extensions
The point was to fix files attachments without an extension,
potentially appending to existing extensions was not a smart idea.

See #34299, 5eb15c01b5
2019-07-02 10:00:49 +02:00
Xavier Morel e1d6f18f6d [FIX] base: don't overwrite existing extensions
The point was to fix files attachments without an extension,
potentially appending to existing extensions was not a smart idea.

See #34299, 5eb15c01b5
2019-07-02 09:59:58 +02:00
Xavier Morel e210faa676 [FIX] base: don't overwrite existing extensions
The point was to fix files attachments without an extension,
potentially appending to existing extensions was not a smart idea.

See #34299, 5eb15c01b5
2019-07-02 09:49:18 +02:00
wan 5fef17540c [FIX] account: get credit and debit regarding to company
Detected with OPW 1920765

Reproduce : set multi-companies, install accounting. The due amount for all companies is the sum of the due amount for every single company

Cause : the context for company_id is not set in account.move.line:_query_get

Solution : set it in res.partner:_credit_debit_get in case _query_get is used elsewhere

closes odoo/odoo#30463

closes odoo/odoo#34486

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-01 12:09:01 +00:00
Nans Lefebvre f401d2f3ba [FIX] account: restrict asset difference search to current company
Let contacts be shared in a multi-company setting.
Make a filter on 'Total receivable', e.g. greater than 0.
All contacts that correspond to this clause are show,
even if their Total receivable is nonzero in another company.
It follows that a partner can be shown by the filter with a value 0.

The inconsistency was created by 017184331b, which adapted the compute method
to the multi-company setting, as before the two were summing all companies.

opw 2028660
2019-07-01 12:08:09 +00:00
Odoo Translation Bot 214bbfeb84 [I18N] Update translation terms from Transifex 2019-07-01 02:42:17 +02:00
6b647139b4 [IMP] base: make the integrity constraint violation error messages clearer
When an `IntegrityError` is raised, the user receives a cryptic error
message which doesn't provide much valuable information in order to
solve the problem.

However, such an error is raised in 3 cases:
1. A mandatory field is not provided at creation/update.
2. The deletion of a record makes a mandatory Many2one field NULL on a
referenced table (`ON DELETE SET NULL` on a not nullable field).
3. The deletion of a record raises a `ON DELETE RESTRICT` foreign-key
constaints.

In the first and second cases, we provide the table and field on which
the `NOT NULL` constaint is raised. We also suggest to archive the
record in case of a deletion.

In the third case, we provide the table and the constraint raised. We
also suggest to archive the record.

Notes:
- The IDs of the records causing the issue is not provided since the
information is not provided by PostgreSQL.
- Although cases 2 and 3 have a different root cause, the error
message raised is very similar. Indeed, from an end-user perspective
the solution is identical: archive the record. Another solution would
also be to manually edit the records raising the error, but most of
the time this is not an option: these records are locked and cannot be
edited anymore.

task-1970853
Closes #32949

closes odoo/odoo#33922

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>


Co-authored-by: Sapan Zaveri <sza@odoo.com>
Co-authored-by: Pragya Ladda <pla@odoo.com>
2019-06-28 07:57:26 +00:00
Christophe Simonis d090c92782 [MERGE] forward port branch saas-14 up to 1985a49b92 2019-06-27 12:41:55 +02:00
Christophe Simonis 1985a49b92 [MERGE] forward port branch 10.0 up to 5eb15c01b5 2019-06-27 12:41:15 +02:00
Priyanka Kakadiya 5eb15c01b5 [FIX] base, web: missing extension on binary downloads
It's currently possible for binary downloads to be missing an
extension entirely. Generate an extension from the mimetype and use
that. Also ensure the existing extension (if any) matches the
mimetype.

Warning: this may require adding new mimetype/extensions pairs to the
local mimetype database similar to
f413d155df.

Also fix missing or incorrect filenames on records without a filename
field: in some Odoo versions the client would send a filename of
"null", resulting in a download of e.g. "null.pdf" instead of the
attachment or inferred name.

Task 2025716

closes odoo/odoo#34299

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-27 08:26:49 +00:00
Christophe Simonis cf18c9bae1 [MERGE] forward port branch saas-14 up to 2a89adef2a 2019-06-26 19:26:58 +02:00
Christophe Simonis 2a89adef2a [MERGE] forward port branch 10.0 up to 7b16abbae1 2019-06-26 19:26:33 +02:00
Nicolas Martinelli d870749d79 [FIX] l10n_fr_fec: remove new line
- Make a SO with a product that have a carriage return in its
description
- Export FEC report

The CSV contains new lines and is not correctly formatted.

opw-2026861

closes odoo/odoo#34385

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-26 11:45:57 +00:00
Nicolas Martinelli da986aa479 [FIX] l10n_fr_fec: backport fixes
Backport of:

a3519638a3
fe9e7d47b8

opw-2026861
2019-06-26 11:41:41 +00:00
Christophe Simonis d65953124c [MERGE] forward port branch saas-14 up to 61a51a8651 2019-06-26 11:15:32 +02:00
Christophe Simonis 61a51a8651 [MERGE] forward port branch 10.0 up to ea4ddff117 2019-06-26 11:12:36 +02:00
Christophe Simonis e7fb3e2f1a [MERGE] forward port branch saas-14 up to a7ad19d7fd 2019-06-20 12:05:26 +02:00
Christophe Simonis a7ad19d7fd [MERGE] forward port branch 10.0 up to c5c955db7a 2019-06-20 12:04:52 +02:00
Christophe Simonis 7b16abbae1 [IMP] core: add support for multi-version migration scripts
A special folder named `0.0.0` can contain scripts that are run on
upgrade of any version.
They are useful to make some sanity checks or other verifications to
ensure database consistency.

The first version of this patch used the more eye-catching `any` for
the migration folder, but it was problematic for upgrading from an older
version that doesn't contain this patch.

Using a version "number" containing two dots is required to avoid it
being prefixed with the server version (see `convert_version` method) and
resulting in a version like `10.0.any`.
Such version would have been executed, even without this patch, when
upgrading from an older major server version (9.0.1.0 < 10.0.any).

closes odoo/odoo#34268

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-06-20 10:01:31 +00:00
Nicolas Martinelli ea4ddff117 [FIX] point_of_sale: apply fiscal position
- Create 2 included taxes: 21 % and 6 %
- Create a product A with 21 % as default tax
- Create a fiscal position to map the tax 21 % to tax 6 %
- Allow the fiscal position in the POS
- Add product in a POS order
- Apply the fiscal position

The subtotal is not recomputed correctly. On the other hand, if the
fiscal is first set then the product added, there is no problem.

This is because the `fix_tax_included_price` is only called by
`add_product` and not when changing the fiscal position.

opw-2020755

closes odoo/odoo#34260

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-20 08:16:10 +00:00
Xavier Morel c5c955db7a [FIX] core: work around ir_logging deadlock
DROP CONSTRAINT (even with IF EXISTS is specified) acquires an ACCESS
EXCLUSIVE lock on the table, preventing e.g. inserts in an other
transaction, so ir_logging would systematically deadlock if configured
to the same database and a warning would be triggered during install
or update (if that ran ir.logging's init).

1. hand-roll the "IF EXISTS" bit, to avoid taking an ACCESS EXCLUSIVE
lock on the table if the problematic constraint does not exist and
thus doesn't need to be dropped (which by now should be the vast
majority of cases).

Replacing DROP CONSTRAINT with DISABLE TRIGGER does not fix the
issue as *that* acquires SHARE ROW EXCLUSIVE. While that's less
constraitning than ACCESS EXCLUSIVE, it still conflicts with an
insert's ROW_EXCLUSIVE.

2. add a timeout to the logging INSERT anyway, the deadlock is still
an issue if we're updating a database which does have the
problematic constraint, and we want to preclude the possible
eventual introduction of new deadlocks in the future.

closes odoo/odoo#34243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-19 13:43:53 +00:00
Christophe Simonis ec8cfd5624 [MERGE] forward port branch saas-14 up to 249d09068a 2019-06-18 10:56:48 +02:00
Christophe Simonis 249d09068a [MERGE] forward port branch 10.0 up to 455714c7bf 2019-06-18 10:56:06 +02:00
Yoshi Tashiro 455714c7bf [FIX] base: set cureency position "before" for JPY
As a convention, JPY currency symbol normally shows before the amount.

closes odoo/odoo#34113

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-17 14:16:42 +00: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
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
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
Christophe Simonis e14fd457b9 [MERGE] forward port branch saas-14 up to 348f3d8bbc 2019-06-12 14:35:44 +02:00
Christophe Simonis 348f3d8bbc [MERGE] forward port branch 10.0 up to 271f1ec688 2019-06-12 14:35:04 +02:00
Xavier-Do 271f1ec688 [FIX] test_new_api: move demo_data.xml in demo category
Installing test_new_api without demo will fail since demo_user
does not exists. This is a problem if we want to test migration
with all modules installed. This simple fix solve the problem.

closes odoo/odoo#34065

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-06-12 10:51:32 +00:00
Christophe Simonis 6c6e652673 [MERGE] forward port branch saas-14 up to 757846c591 2019-06-07 11:09:29 +02:00
Christophe Simonis 757846c591 [MERGE] forward port branch 10.0 up to 7746621b92 2019-06-07 11:08:13 +02:00
Nicolas Martinelliandjev-odoo fa492d87f4 [IMP] mail, website_mail, base: extra info on error messages
Display extra information on error messages:
- Access error based on ACLs: user, fields (if applies)
- Access error based on record rules: user, ids
- Missing error: model, operation, user, ids

closes odoo/odoo#33945

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>


Co-authored-by: jev-odoo <jev@odoo.com>
2019-06-07 06:37:25 +00:00
Rishabh Jadia 7746621b92 [FIX] base: prevent renaming the column for non stored field
Before this task, when creating the related field from the studio, it is by
default stored. When we change the field name in 'ir.model.fields' using ORM's
write method, it also renames the column in the table associated with the
field's model.

This is the expected behavior. But when someone tries to change the 'name' of a
non stored field, the column is not available in the associated model, and so
trying to rename the column results into traceback. This issue was probably
there for a while but came into light with the task 1985710. More info can
be found on the chatter of the task.

This commit fixes the issue by adding an extra check before renaming the table
column. The query will be executed only when the field is stored and thus
exists in the table.

closes odoo/odoo#33944

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-06-06 11:47:19 +00:00
Nicolas Martinelli f7b870ca1b [IMP] account: constraint error message
Make SQL constraints errors more accurate.

closes odoo/odoo#33934

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-06 08:34:00 +00:00
Barad Mahendra ef7ae9ae14 [FIX] base: avoid traceback on params field of client action
The content of these fields can't be updated, there's no reason to
even show them. Just remove them from the default / auto-generated
view for client actions.

Task 1772242

closes odoo/odoo#29179

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-06 10:10:12 +00:00
Nathan de Pryck f435c65517 [FIX]account_asset: Increase performance to generate asset entries
For each asset depreciation lines we verify that there are not linked
to a move. This verification was done for each line separately.
Moreover, during the creation of the journal entries, we were writing
on the 'line_ids'. In this case, accessing the move of a line
was invalidating the cache. This fix ensure that this operation is
done out of the loop and the cache is then not invalidated at each
step.

See opw-2000305

closes odoo/odoo#33908

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-05 12:47:02 +00:00
Michele Zaccheddu 6a6471d727 [CLA] signature for MicheleZak
closes odoo/odoo#33880

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-05 06:45:00 +00:00
Christophe Monniez 7cc13e91b6 [FIX] test_lint, test_pylint: reintroduce an empty test_pylint module
Since test_pylint was moved into the test_lint module in commit
b27077bb, this could break Odoo instances where a module has test_pylint in its dependency.

With this commit, the test_pylint module is coming back as an empty
module.

closes odoo/odoo#33871

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-06-04 12:24:29 +00:00
luisiniguezh e88edfc5c5 [CLA] signature for luisiniguezh
closes odoo/odoo#33851

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-04 13:13:03 +00:00
Nicolas Martinelli 25155aa472 [FIX] payment_adyen: empty field
- Activate Adyen
- In the eCommerce, purchase an item
- Change the delivery address
- Pay with Adyen

A internal error is raised.

It is caused by `val.replace(...)` where `val` is `False` ( due to
`shopperEmail`).

We make the code more robust by fallbacking on the billing email, then
on an empty string.

opw-2002974

[1] https://docs.adyen.com/classic-integration/hosted-payment-pages/hpp-payment-response/payment-response-merchantsig-sha-256/

closes odoo/odoo#33840

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-03 13:23:15 +00:00
Christophe Monniez b27077bb0c [MOV] test_pylint, test_lint: add es-check linter
Because Odoo still supports Android Kitkat and Internet Explorer, ES5 is
the highest ECMAScript allowed version.

This commit adds a new test that parses each javascript file found in
addons. The test fails if unsupported js code is found.  As ES6 is
allowed during tests, the files under a path that contains 'static/test'
are just skipped.

This test uses the es-check tool
(https://www.npmjs.com/package/es-check).

If the es-check tool cannot be found, the test is simply skipped.

Also the test_pylint module is renamed to a more generic name test_lint,
that way, every linter test can find a shelter  here.

closes odoo/odoo#33724

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-05-30 11:22:10 +00:00
Priyanka Kakadiya d85451800f [FIX] web_editor: restoreRange on invalid node
In a web editor, add some text, select the text, add a link and
immediately discard the link modal. Traceback.

The traceback is a execute `setEnd` on `Range`, that error is thrown
because editable DIV doesn't save old range

Odoo wrap code does some text node split in order to attach the link
just on the selected text. If it correctly re-set the underlying
structure, it does not update the $(editable) structure used to restore
ranges.

After this commit, editable div will use newly created range for the element

for ex:
-> content: test
-> selected content "test"

when click on link dialog:
ec: test , eo: 4, sc: test, so: 0
selected content  ->  start 0, end 4 -> "test" like this

after clicking on discard:
ec: null text element, eo: 4, sc: null text element, so: 0
selected content  ->  ec and sc both are null, so it will throw an error
while setting cursor position

after applying fix when click on discard:
ec: test, eo: 4, sc: test, so: 0
selected content -> start 0,  end 4 -> "test"

task - 1955863

closes odoo/odoo#33792

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-06-03 05:52:13 +00:00
Christophe Simonis cad0be27e7 [MERGE] forward port branch saas-14 up to 6b6d2c8455 2019-05-28 14:36:59 +02:00