Commit Graph
127612 Commits
Author SHA1 Message Date
Julien Castiaux 67c281c6a8 [FIX] google_account: use HTTPError over UserError
In an attempt to ease the error reporting, some Google Error were raised
as UserError so they are shown on screen and the user can take immediate
action when the error is their side.

As shown by the different commits bellow, the introduced changes had
some bad side effects. Empty request body, empty response body, non-json
response. The resulting code got complicated.

Apart from the Google API itself, some Odoo module (i.e.
google_calendar) excepted HTTPErrors on some endpoints that are now
raised as incompatible UserErrors. There are no straightforward
solutions for those endpoints.

This commit reverts:
- da13c704
- 9c369a44
- 85ab9238

opw-2000950

closes odoo/odoo#34532

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-07-02 14:55:41 +00:00
Xavier Morel 97f5e2ff0d [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:03:28 +02:00
Xavier Morel a63a39d019 [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:01:31 +02: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
Julien Castiaux 0e2f3b1445 [FIX] website_form: set filename on studio binary
Using studio, add a file field on a form. Using the web form builder,
append that field on a form. Upload a file, `x_field_filename` is left
empty thus the filename is lost.

opw-2028071

closes odoo/odoo#34491

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-07-01 13:20:51 +00: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
David 8c5c4037d2 [FIX] models.py: string format error
closes odoo/odoo#34485

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-01 11:39:37 +00:00
Goffin Simon 5c157c57b0 [FIX] purchase: Wrong RFQ Quantities loaded
Steps to reproduce the bug:
- Create two variants V1 and V2 for procuct template V
- Set supplierinfo on V
- For V1, assign "vendor X" with a minimum order quantity= 10 and price = $10
- For V2, assign "vendor X" with a minimum order quantity= 2 and price = $1
- Create a RFQ for vendor X
- Set V1 on a PO line

Bug:

The minimum quantity of V2 was automatically set (10) instead of the minimum quantity
of V1 (2)

opw:2028527

closes odoo/odoo#34523

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-08 07:24:18 +00:00
Odoo Translation Bot 0f5a08f4df [I18N] Update translation terms from Transifex 2019-07-07 03:07:34 +02:00
Jorge Pinna Puissant 3125a943d5 [FIX] account_voucher: Error in total when rounding globally
1. Create a purchase tax of 24 %;
2. Set rounding to "Round globally";
3. Create a new purchase receipt with two lines; unit price $115.98 and
unit price $69.98 and add 24 % tax on both lines.

Before this commit, the total was wrong $203.60, which generates also an
error message when trying to validate the receipt.

Now, the total is correct $203.59 (115.98 + 69.98 + tax 44.63).

opw-2031731

closes odoo/odoo#34560

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-07-03 13:46:46 +00:00
Cas Vissers 467ac9843d [FIX] hr_holidays: fix leaves count domain
In active leave types should not be considered.

closes odoo/odoo#34475

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-01 09:04:37 +00:00
Nicolas Lempereur 53ef25284f [FIX] web_editor: enter at A edge no dup link
In the editor, when you write a letter at the end or beginning of a link
it is written outside the link. But if you press "Enter", we get on a
newline with an empty link duplicated on the new line.

This is caused by the custom code handling "Enter" keypress.

With this changeset, in this situation we place the range just before
the beginning or after the end of a link.

opw-1724606
opw-2042097
closes #35188

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-26 08:33:27 +00:00
Nicolas Martinelli baf1580be4 [FIX] purchase_stock: average cost
- Create 2 rates:
2019-05-01: 1.0
2019-06-01: 0.5
- Set-up a product A in AVCO
- Create a PO for A on 2019-05-15
- Receive the product after 2019-06-01

The AML are created with a rate of 0.5, but the product cost is updated
with the rate of 1.0.

This is because the stock move date is used when it is still assigned,
and not done yet. As described in:

https://github.com/odoo/odoo/blob/2f789b6863407e63f90b3a2d4cc3be09815f7002/addons/stock/models/stock_move.py#L36

The date is the scheduled date until the move is done, then it is the
date of the actual move processing.

We change the date to today's date, since it is the value used to update
the move date:

https://github.com/odoo/odoo/blob/2f789b6863407e63f90b3a2d4cc3be09815f7002/addons/stock/models/stock_move.py#L1143

opw-2006368

closes odoo/odoo#34446

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-01 08:53:53 +00:00
Moisés López 30a9120346 [FIX] l10n_mx: Set 'reconcile=True' for stock_account
Running the following 12.0 tests: https://github.com/odoo/enterprise/blob/b7768337d88990e403338c39e461ecb1796413ab/l10n_mx_edi_landing/tests/test_landing.py#L126
raise the following error using anglo-saxon:

```bash
File stock_account/models/account_invoice.py, line 60, in invoice_validate
File stock_account/models/account_invoice.py, line 89, in _anglo_saxon_reconcile_valuation
File 10n_mx_edi/models/account_move.py, line 12, in reconcile
File account/models/account_move.py, line 957, in reconcile
File account/models/account_move.py, line 948, in _check_reconcile_validity
odoo.exceptions.UserError: ('Account Mercancías en tránsito (115.05.01) does not allow reconciliation. First change the configuration of this account to allow it.', '')
```

closes odoo/odoo#34463

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-07-01 00:58:51 +00:00
Nans Lefebvre f97b766013 [FIX] mrp: update MO quantity when there are more than one move per line
The production.move_raw_ids usually contains only one move per bom_line_id;
it might not always be the case, as ccbd6712f6 used move[0] to get a singleton.
The following calls to _get_document_iterate_key, _log_activity_get_documents,
also require move to be a singleton, so we use replace move by move[0].

opw 2042099

closes odoo/odoo#35206

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-26 08:28:17 +00:00
Baskhuu Lodoikhuu c9a061b9c0 [FIX] l10n_mn: update author
As the Mongolia localisation was written by BumanIT

closes odoo/odoo#34671

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-25 14:26:16 +00:00
Jorge Pinna Puissant 44e8fd3b18 [FIX] sale: price_unit in portal decimal precision
Before this commit, the unit price in the so's portal, had the same
decimal precision as the currency and not the one specified for the unit
prices.

Now, the portal shows the unit prices with their specific decimal
precision.

related to : a1e6a0f0c5

opw-2042089

closes odoo/odoo#35171

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-25 09:19:14 +00:00
Nans Lefebvre c7beb9994f [FIX] stock: raise a warning if the user deactivates 'lot & serial numbers' settings while products use it
The "lots & serial numbers" feature can be deactivated at any point.
If there are active products that are tracked, either by lot or serial number,
it can be confusing since deactivating it will hide the relevant fields.
Therefore we raise a warning at onchange if there are tracked active products.

opw 2036173

closes odoo/odoo#35108

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-25 14:29:45 +00:00
Odoo Translation Bot 214bbfeb84 [I18N] Update translation terms from Transifex 2019-07-01 02:42:17 +02:00
Odoo Translation Bot eedcaca503 [I18N] Update translation terms from Transifex 2019-06-30 03:07:11 +02:00
Kishan Gajjar 5d4e75ae58 [FIX] web_editor: restore broken VideoDialog options
- To enable loop on a video, only setting the 'loop' URL parameter
to 1 will not work anymore. We also need to set the playlist parameter
to the video ID.

- Sound is no longer allowed in autoplay because of new autoplay
policies of most browsers. To make autoplay work, the video must be
explicitely muted.

closes odoo/odoo#34323

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-28 15:38:31 +00:00
Nicolas Seinlet 2d03ed43a5 [FIX] website: not setting domain is not empty domain
Previous versions of this action were setting a domain. Removing the
domain field, instead of setting it to empty value, have not the same
result for upgraded databases.

closes odoo/odoo#34454

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-28 14:48:33 +00:00
Nans Lefebvre d5688e6ca0 [FIX] account: set bank account when creating invoices programmatically
The bank account field is set up by the default_get of invoice.
Similarly to the application of the onchange in the create,
we add it in the create if it is not already part of the given values.

This will set the bank account for invoices created e.g. from subscriptions.

Note that we extract it in a function to avoid duplicating the logic.

opw 2030562

closes odoo/odoo#34558

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-03 13:33:22 +00:00
Lucas Perais (lpe) 6020f4baf2 [FIX] base_import: support import url images with manual fields
Create a Binary field through the interface.
Try to import records through CSV like file, with a url as the value of that new image field

Before this commit, the url was saved in DB, leading to an error when trying to get
the image at read time (/web/image)
This is due to the fact that before 66f0e26f6f (saas-12.2) , Binary fields
were not attachments by default, thus did not enter the condition that db403e6dd7
introduced

After this commit, the special case of manual fields with url at import is correctly handled

OPW 2024822

closes odoo/odoo#34489

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-01 13:09:38 +00: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 2f2bc67c06 [MERGE] forward port branch 11.0 up to b1d43cc80e 2019-06-27 14:40:32 +02:00
Christophe Simonis b1d43cc80e [MERGE] forward port branch saas-15 up to d090c92782 2019-06-27 14:25:31 +02:00
Nicolas Martinelli 90c2e0c75e [FIX] pos_discount: change customer
- Enable general discounts for POS
- Create a POS session
- Add a product
- Create a general discount of 10%
- Change the customer

The discount is reset to the product price.

When changing the customer, the prices are reset:

https://github.com/odoo/odoo/blob/3b1699e02d4483913159681bf7e10839e6493244/addons/point_of_sale/static/src/js/screens.js#L1251

In the case of a global discount, the price is therefore reset to the
product price in:

https://github.com/odoo/odoo/blob/3b1699e02d4483913159681bf7e10839e6493244/addons/point_of_sale/static/src/js/models.js#L2304

To avoid this, we set the price as manually set. Conceptually, this is
indeed the case since we manually chose the percentage, therefore the
price.

opw-2009761

closes odoo/odoo#34418

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-27 11:55:01 +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
Romain Derie d82b897ea1 [FIX] mail: use base_url helper to be multi website compliant
When an email is sent and is related to a record, there is a header with a
button link to access the record.

Before this commit, that button href was always linking to the base_url URL.

That was an issue on multi-website, since we need to use the website url and
not the base_url if the record is related to a website.
That's the case for a SO eg, after checkout you receive a confirmation email.
In a multi-website environment, we need to access the record website.

To do so, a previous imp/fix was done with c1be1993f9.
But this occurence still needed to be replaced.

Fixes #34309

closes odoo/odoo#34397

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-27 08:42:16 +00:00
Xavier-Do b295723c99 [FIX] core: avoid writting sources during tests
Future runbot improvement may share sources between build,
meaning that sources will be readonly to avoid any interaction.

_touch() was supposed to handle ro filesystem but
f7130556 introduced a new test that was not working
in this case.

Instead of trying to touch file and pseudomocking the result
if the filesystem is readonly, this commit add a real patch
on getmtime.

closes odoo/odoo#34710

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-09 16:29:27 +00:00
Arnold Moyaux cd0b535721 [FIX] mrp: wrong value on cost report
Follow up to:
- commit 4cdcab43ee
- commit cb4afb263b
- commit fb1839fa17

In order to be able to edit a done raw move after the production
and having a correct cost report with consistent values. The
simple rule that a done move should have its quantity equals to
its initial demand. Since report is based on initial demand it
should follow this rule and it's also a good practice because a
lot of computation are based on it (easier than quantity done
because it's already set on the correct quant uom).

opw-2033259

closes odoo/odoo#34695

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-09 12:08:30 +00:00
Goffin Simon d0f3e896d4 [FIX] account: Incorrect due date for credit notes
Steps to reproduce the bug:

- Create an invoice I
- Set the invoice date in the past and  add payment terms
- Validate I
- Create refund from I

Bug:

The invoice date is set as today but the due date was set in the past.

opw:2033438

closes odoo/odoo#34692

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-09 11:53:50 +00:00
Martin Trigaux 2be2f64aeb [FIX] tests: properly log errors
If a test is failing with assertRecordValues, the comparison and the error
logging were not computed the same way.
The _compare_candidate was accessing the record via
record[field_name]
which uses the cache

While the _format_message was doing
records.read(...)
which queries directly the database.

If the test was failing (correctly) because of a wrong cache invalidation
(e.g. update the value directly in SQL without invalidating the cache),
the error message would look like:

AssertionError: Record doesn't match expected values at index 0.
Current values:
{'id': 42, 'name': 'Foo'}
Expected values:
{'name': 'Foo'}

closes odoo/odoo#34589

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-04 13:33:37 +00: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
Priyanka Kakadiya b67a3bb403 [FIX] account_payment: fix payment modal issue
purpose of this commit is to show modal with proper height

before this commit:
currently,  the modal structure was not correct, so it is displaying
modal-content twice in the modal that's why it shows modal with full height.

after this commit:
correct modal structure to show it properly, so payment modal in the portal view
looks like as expected.

task-2025869
closes: https://github.com/odoo/odoo/pull/34334

closes odoo/odoo#34334

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-06-27 06:41:40 +00:00
RomainLibert baa0ce6d15 [FIX] l10n_it_edi: use a valid vat number for italy
closes odoo/odoo#34857

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-07-15 10:43:56 +00:00
Lucas Perais (lpe) 458472485f [FIX] website_slides: statistics recompute when toggle website published
As a portal user, complete some steps within a course
Completing all of them makes the course completion to 100 %

Now, in the backend, unpublish one of these steps

Before this commit, the completion was not taking into account
that a step did not "exist" anymore i.e. has been unpublished,
leading to a completion > 100%

After this commit, we search only for steps that are published
The completion cannot exceed 100%

OPW 2033553

closes odoo/odoo#34800

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-11 13:40:09 +00:00
Antoine Guenet e7828c3627 [FIX] web_editor: properly insert character in empty nested list
Fix a bug that can be reproduced like so:
- Insert list
- Type char
- ENTER
- TAB
- Type char
The character gets inserted _after_ the `br` instead of replacing it.

closes odoo/odoo#34805

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-07-11 14:41:12 +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
Hetal Dhanak 2512dcdd0a [FIX] web: many2many tag doesn't show delete icon when long text
Before this commit, sometimes it was difficult to delete many2many
tag because of X sign not being displayed due to long text of tag.

After this commit, if text is long then it will have ellipsis and
we will always have X icon to delete tag.

task-1986017

closes odoo/odoo#34316

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-06-26 13:40:42 +00:00
Xavier Morel 87e3e840ac [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:06:18 +02:00
RomainLibert 35b5dfa8ea [FIX] hr_recruitment: fix multi company issue
This fix is far from perfect as you still can break things if
you clicked on the menu and change company afterwards
But it should work the first time you click on it

closes odoo/odoo#34488

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-01 12:55:34 +00:00
Pierre Masereel d8a1f4ab03 [FIX] point_of_sale: Ask password after scaning badge
Since changes made on Promises in rev: 5f3b5f0a9d

If a user scans his badge, it's pin code if he has any, is not asked,
and he's imediatly connected to it's employee.

To avoid this behavior, we are handeling correctly the Promise to avoid
this connection shortcut.

closes odoo/odoo#34449

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-01 06:45:04 +00:00
Odoo Translation Bot f2b1d58f9c [I18N] Update translation terms from Transifex 2019-06-30 06:15:32 +02:00