Commit Graph
121865 Commits
Author SHA1 Message Date
Olivier Colson 7754416cd8 [FIX] account: fix "post at bank reconciliation" option of bank journals
Before that, with "post at bank reconciliation option" activated on bank journal, the following scenarii did not work as expected:

1. When creating an invoice, making two payments for it, and then matching only one of them with a bank statement
=> the invoice was marked as 'paid' while it should have staid 'in payment' until the second payment gets a bank statement.

2. When directly reconciling a bank statement with an invoice for its full amount
=> the invoice staid in "in payment" state, while it should have been "paid"

[IMP] account: add tests for the aforementioned cases

closes odoo/odoo#28428
2018-11-07 09:18:51 +00:00
Nicolas Seinlet e1c9efb2d2 [FIX] sale: ensure a non null date
Sometimes, a sale.order in the SALE state doesn't have a confirmed date,
which can cause a traceback. To avoid this, when confirmation_date is
null, use the write_date, which is never NULL when sale.order is in sale
state.
In migration, we will try to populate the confirmation date with
the mail.message subtype. As ultimate fallback, we will take
the write_date.

closes odoo/odoo#28296
2018-11-08 16:15:54 +00:00
len-odoo 8f39509d27 [FIX] hr_holidays: copy accrual fields when creating child allocations
Create an accrual leave, and set it e.g. by employee tag.
For each employee having the tag, a child allocation will be created.
When doing so, it will prepare the values for these creations.
However the relevant fields for accrual leaves were missing from these values.

opw 1906476

closes odoo/odoo#28492
2018-11-08 07:59:21 +00:00
Antoine Prieels (ANP) 96a795f177 [FIX] partner_autocomplete : Do not crash other tests when partner_autocomplete server fails
Add a check to see if we're in test mode that returns an InsufficientCreditError to avoid failing other tests if partner_autocomplete server fails

closes odoo/odoo#28324
2018-10-31 16:11:31 +00:00
Romain Derie 7aa2136938 [FIX] website: avoid using self if not an existing view
web_editor dirty elements are saved by calling the ir.ui.view `save()` method.
As this method is called through call_kw _rpc on the ir.ui.view model, self
is binded to the view which has the `id` sent in the request.

In some cases, when editing a field for example, the id sent is the id of the
field's record (eg: product.template for price field).

In that case, the view binded on self will be the view with the id of the
field's record being edited.

If there is no ir.ui.view with the same ID as the field's record, self won't
exists.
This misbehavior resulted in no error luckily since we only use self to call
ir.ui.view methods without ever using self properties.

Since multi-website 47b00c5d53 overrided the `save()` method and used self.key
it was crashing when the self record did not exists.

This commit will fix that by doing the multi-website check only when it is a
view and not a field that is being edited. (We know that if xpath is set)

opw-1904637

Step to reproduce:
  - Go to a product on ecommerce, eg product.template 13013
  - Edit the product price field, the oe-id attribut is 13013
  - Delete the ir.ui.view that has the same ID than the product (13013)
  - Save -> It will crash since self is binded to "ir.ui.view(13013,)" but it
    does not exists and we try to access key

closes odoo/odoo#28469
2018-11-08 10:52:44 +00:00
Goffin Simon 47959438b6 [FIX] sale_stock: Impossible to ship a kit with different uoms
Steps to reproduce the bug:

- Let's consider three products P1(in Unit), P2(in kg), P3(in Unit)
- Create a BOM kit for P1 whit 1kg of P2 and 1 Unit of P3 as components
- Create a SO with P1 and validate it
- Go to the shipment and validate

Bug:

An error was raised saying:

The unit of measure kg defined on the order line doesn't belong to the same
category than the unit of measure Unit defined on the product. Please
correct the unit of measure defined on the order line or on the product,
they should belong to the same category.

PS: The quantity delivered on a SO line must only be computed for the product
defined on the SO line. Otherwise with a BOM kit, the sum of all its components
was done instead.

opw:1905223

closes odoo/odoo#28460
2018-11-07 08:12:38 +00:00
Julien (juc) Castiaux 60d519b890 [FIX] web: format function missing in percentage widget
The format function was missing for the percentage widget type, so
`field_utils.parse[this.formatType]` (see [1]) resolved as
`undefined` which is not a function and so raised an error when
the user was trying to update the field.

This PR add that parsing function. Both `xx%` and `0.xx` are
understood by the parser and resolve to the correct float value.

opw-1895979

[1] https://github.com/odoo/odoo/blob/e220721a8ee80c02fe5aba5ed8c9f3f4ae54ea97/addons/web/static/src/js/fields/abstract_field.js#L399

closes odoo/odoo#28431
2018-11-08 09:51:38 +00:00
qsm-odoo 566cece592 [FIX] website, *: review auto light and dark colors
* web, web_editor

The logic which chose if the user text color was supposed to be used as
bootstrap "dark" text color or bootstrap "light" text color
(https://github.com/odoo/odoo/commit/8b2dbd1441d6713d9072db03e8d3cb6c2246410f)
was fine when using the default theme with default bootstrap but was not
working as intended in some themes.

This commit also introduces a more accurate and complex method to
determine the correct contrasted color in most cases.

closes odoo/odoo#28468
2018-11-07 17:41:08 +00:00
Julien (juc) Castiaux 8108a60dc3 [FIX] purchase: access forbidden for product image on order line
When a user accesses a PO through the portal thanks to an access token
(without being connected), the product image on each order line is
rendered using the image placeholder with a size of 48x48.

This raises a 403 Forbidden at image retrieval since the access token is
not passed as a parameter. This commit corrects that behavior by sending
the resized image along with the rendering of the template instead of an
url.

Another solution could be to generalize the access token check to any
model in:
https://github.com/odoo/odoo/blob/12.0/odoo/addons/base/models/ir_http.py#L303-L311

But this seems overkill regarding this specific error.

opw-1902741

closes odoo/odoo#28479
2018-11-08 07:37:23 +00:00
Nicolas Martinelli 99a7b44a06 [FIX] sale: reference for Wired Transfer
- Configure custom payment instructions
- Create a SO, send it by email to the client (do not validate)
- As the client, open the link received by email and 'Accept & Sign'
- Click on 'Pay Now', choose 'Wire Transfer'

The page reloads and shows the message:
> Pending... The order will be validated after the payment.

along with the custom payment instructions. However, no communication is
provided for the payment.

First, the `reference` is never set when calling the
`payment_confirmation_status` template, as it is done in
`portal_invoice_page_inherit_payment`. Moreover, in this workflow, the
reference is never set on the SO because of an incorrect filtering in
`_set_transaction_pending`.

opw-1906464

closes odoo/odoo#28466
2018-11-07 10:37:49 +00:00
Sébastien Theys 45dec698ee [FIX] product: pricelist item deterministic order
Following commit b43151c11c

The order of the pricelist items on the interface was made deterministic, but
there was still a problem with the actual computation because the SQL was
created manually and used a different order than the _order of the model.

Moreover, it is better to use id DESC instead of ASC to make sure the
automatically created default rule matching everything is actually applied last.

PR: #28476
2018-11-07 14:30:06 +00:00
qsm-odoo 0662a1948b [FIX] website: recompute carousel item heights on image loading
Some code is in charge of setting the same min-height for all items of
a carousel to the natural height of the tallest item, once the page is
loaded. This code was not working correctly in the case the natural
height of this tallest item depends on the height of one of its inner
image, as we have to wait for the image to be loaded in that case.

closes odoo/odoo#28159
2018-11-07 09:43:22 +00:00
Nicolas Lempereur 81b6adcda7 [FIX] mail: traceback reply button typo cd34f6de72
There was a typo with msgID at one part called messageID in another.

opw-1904029
closes #28465
2018-11-07 10:38:14 +00:00
Nicolas Lempereur 233bae7de9 [FIX] translate.py: fallback on base lang if noterm
When there is a language and its base language translation files in a
module, in 12.0 an empty translation in the language translation file
will not fallback on the base language.

eg.

 fr.po : {'one': 'un', 'seventy': 'soixante-dix'}
 fr_BE.po: {'one': '', 'seventy': 'septante'}

 => the translation in fr_BE will be {'one': '', 'seventy': 'septante'}

 but before 7288b477 it would have been {'one': 'un', 'seventy': 'septante'}

With this commit, an empty translation is no longer created so does not
override base language.

Also the intention of d84b795b0a that was also lost is restored by
upserting only noupdate==false translation, and inserting the other
ones.

opw-1904638
closes #28297
2018-11-07 09:07:02 +00:00
David Beguin d63e72853b [FIX] mass_mailing : restore import mass_mailing.contact into mass_mailing.list
Since the opt out per mailing list, the intermediate model was used
to list all the recipient of a mailing list. The side effect was that
importing new contacts into mailing list was not possible anymore.
Also, creation of a new contact into a mailing list was made indirectly
by creating a new many2many record between contaxct and list, which was
not really user friendly.

This commit restores the mailing contact model as the view of the mailing
list recipients. In other terms, the contact import is restored.
An opt-out computed field as been added to be able to filter on opted out
contact inside the mailing list recipients view.
This opt_out field SHOULD NOT be used in a form view as it need the active
mailing list id in the context in order to be computable and searchable.
This field has no sense without this active mailing list id context.

Task ID 1891228
Linked with blacklist and opt out per mailing task (ID 33224)
Closes PR #27632
2018-11-05 15:15:43 +00:00
Christophe Simonis d226f8b4ff [FIX] hr_holidays: set leave types as noupdate
They should not be updated using current year.
2018-11-06 20:02:06 +01:00
Nicolas Martinelli 3a74a56b0b [FIX] account: invoice paid at reconciliation
Move the option to `account_accountant`, since there is no way to do it
in `account`, leaving unpaid invoices.

opw-1906544

closes odoo/odoo#28440
2018-11-06 14:24:56 +00:00
Antoine Prieels (ANP) c4270135ef [FIX] snailmail_account: fix error when sending invoice
A compute function was removed in c2b55f3e0c
thus breaking the modal. A test will follow.

closes odoo/odoo#28439
2018-11-06 14:54:24 +00:00
Nicolas Martinelli 0f2e3ab711 [FIX] snailmail_account: do not send by default
Since most of clients don't have any credit, deactivate this by default.

opw-1906566

closes odoo/odoo#28438
2018-11-06 14:01:07 +00:00
Sylvain Van Hoof e07ec6cdb5 [CLA] sign CLA for Okia SPRL
closes odoo/odoo#28415
2018-11-05 15:20:56 +00:00
Pierre Paridans dd70c68426 [FIX] mail: content override toolbar in mobile landscape
On mobile (specifically in landscape orientation as the height of the
viewport is narrower), the content appear over the bottom toolbar
instead of going below.
Solution is in 2 parts:
* raise the toolbar way above the content
* make the toolbar opaque

closes odoo/odoo#28429
2018-11-06 13:06:16 +00:00
Christophe Simonis 3b3a65bef0 [MERGE] forward port branch saas-11.4 up to dc35de9d30 2018-11-06 14:12:51 +01:00
Robot Odoo e220721a8e [FIX] web: accept field name as a groupby descriptor
In some cases, and for historical reasons, the groupby property can be
expressed as a string (for example, 'stage_id') instead of a list of
strings (for example, ['stage_id']).

However, the support was not complete. A crash could happen in some
cases. For example, if there is a group_by: 'stage_id' property in the
context of an action, it works in list view, but adding that view to the
dashboard would result in a crash, without this commit.

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#28408
2018-11-06 12:51:37 +01:00
Andrey Troitskiy 764bd645fc [FIX] hw_scale: added field 'disable' to namedtuple 'ScaleProtocol'
Introduced at bb015818ea
Getting error
TypeError: __new__() got an unexpected keyword argument 'disable'

closes odoo/odoo#28202
2018-11-06 10:12:50 +00:00
Géry Debongnie 6e9c1d92d7 [FIX] board: use correct context in sub board views
Before commit 60f143c8e7, the dashboard
parameters did not use the parameters from the action, so some important
information could be lost.

However, in this same commit, the action context overrides the context
from the user defined views, which means that some information is lost.
For example, customized group bys are ignored.

This commit fixes the issue with some careful context manipulation.
Some special care was done to remove the groupby from the action context
if it is not empty, because that same logic is used in views.
2018-11-06 09:17:05 +00:00
Christophe Simonis dc35de9d30 [MERGE] forward port branch saas-11.3 up to f66a9cdbcf 2018-11-06 10:16:30 +01:00
Goffin Simon 7f5180578f [FIX] sale: Changement of behavior from 11.0
Introduced by: 3d46887d38

Before this commit, creating an invoice from a SO always chose
the payment_method=all when the number of invoice linked to the SO >0
OR all the lines of the SO were with invoice_policy = 'order'

After this commit, creating an invoice from a SO just choose the payment_method=all
when the number of not canceled invoice linked to the SO > 0 AND when there are at
least one downpayment in the SO

SO:

Steps to reproduce the changement of behavior:

- Create a SO for 10 units (invoicing policy based on ordered quantities)

- Create the invoice for 10 units (from SO) and validate it

- Change ordered quantities to 5 units

- Click on create invoice on the SO

The payment method chosen was delivery instead of all. So choosing the default option
lead to a user error saying: there are no invoicable line instead of creating a credit note.

opw:1904258

closes odoo/odoo#28426
2018-11-06 09:15:53 +00:00
Géry Debongnie baeb1a1938 [FIX] web: accept field name as a groupby descriptor
In some cases, and for historical reasons, the groupby property can be
expressed as a string (for example, 'stage_id') instead of a list of
strings (for example, ['stage_id']).

However, the support was not complete. A crash could happen in some
cases. For example, if there is a group_by: 'stage_id' property in the
context of an action, it works in list view, but adding that view to the
dashboard would result in a crash, without this commit.
2018-11-06 08:53:21 +00:00
Romain Derie f9e34d98f1 [FIX] web_unsplash: do not fetch app_id if no Unsplash images
As empty arrays are considered truthy, the call to `/web_unsplash/get_app_id`
would always be performed even if no Unsplash images.

closes odoo/odoo#28421
2018-11-05 17:02:34 +00:00
Christophe Simonis f66a9cdbcf [MERGE] forward port branch 11.0 up to bab5ccfdd7 2018-11-05 17:51:04 +01:00
Christophe Simonis bab5ccfdd7 [MERGE] forward port branch saas-15 up to ca2b46c2d1 2018-11-05 15:52:38 +01:00
Christophe Simonis ca2b46c2d1 [MERGE] forward port branch saas-14 up to 03a35392da 2018-11-05 15:09:30 +01:00
Jigar Vaghela 4f8ed012c4 [FIX] stock: Hide Reserved column in done stage.
Before this commit:
    Reserved column appeared with 0 qty when Delivery Order goes to done Stage
After this commit:
     Hide Reserved column when Delivery Order goes to done stage.

This task is related to #1888361
Closes: #27223

closes odoo/odoo#28409
2018-11-05 13:33:14 +00:00
Nicolas Martinelli 656c1123d3 [FIX] sale: 'My Quotations' default filter
The filter should not filter on the state.

opw-1906405

closes odoo/odoo#28406
2018-11-05 13:36:38 +00:00
Christophe Simonis 03a35392da [MERGE] forward port branch 10.0 up to d3b86ab930 2018-11-05 14:11:40 +01:00
Mohammed ShekhaandPriyanka Kaakdiya 006c31b955 [FIX] web: re-evaluate column_invisible after onchange
Let's assume a form view with field A and B (a one2many list), with
a column with attrs column_invisible depending on A.

If the user sets A manually, everything works fine (the column is
hidden/shown directly). However, if A is updated by an onchange
(e.g. depending on the number of rows in B), it doesn't. This
rev. fixes that issue.

Related to Issue: 1851451

Co-authored-by: Priyanka Kaakdiya <pka@odoo.com>
2018-11-05 13:57:39 +01:00
Andreas Perhab d3b86ab930 [FIX] purchase_requision: fix syntax error
payment_term.id, creates a tuple wich works if payment_term.id is set
in case payment_term.id is False this creates the tuple (False,) which
is then converted by the Odoo ORM to a account.payment.term(False, )
record set, which in term may cause weird behaviour as this value does
not eval to false in cases like `if self.payment_term_id:`

Closes odoo/odoo#28397
2018-11-05 13:06:33 +01:00
Olivier Colson 714bf1b0ab [FIX] account: reconcile each account only once when reversing an entry
Before that, when reversing an account.move, if two lines of the move shared the same account, we tried reconciling them once for each line: it worked the first time but triggered an error message the second, since the lines had already been reconciled.
2018-11-05 12:29:08 +01:00
Arnold Moyaux ba239e4cac [FIX] mrp: subproduct price + rounding
On the BoM structure report the price on line with a
child BoM is inchoerent. Also the sum of all lines in
the report is not always equals to the total of the parent
line.

For the first issue, it happens due to commit 17b6256955
that use the number of operation cycle as quantity.
The second issue happens because sometimes the rounding is not done
at the smallest level and thus the rounding of the sum is different than
the sum of the rouding.
2018-11-05 10:02:09 +01:00
Odoo Translation Bot 60cdd13eb3 [I18N] Update translation terms from Transifex 2018-11-04 06:02:25 +01:00
Odoo Translation Bot 79b701230d [I18N] Update translation terms from Transifex 2018-11-04 03:16:30 +01:00
Olivier Colson 053a023fc7 [FIX] account: apply correct currency rate for taxes at account move creation
Before that, taxes were only applied with the most recent currency rate, which caused problems in multi currencies, when reconciling statement lines made in the past with invoices, causing the amount currencies in the payment account.move to be wrong.

//Scenario to reproduce the issue (from customer ticket 1903497):

(for a company with USD as base currency)

1. Create a new bank journal for EUR payments

2. Create a new customer invoice for 90€

3. Create a new tax for the reconciliation model, price-included and amounting to 15%

4. Create a new reconciliation model using this tax

5. Use the currency rates from the demo data, add one that is closer to current date than the most recent one.

6. Create a new bank statement for the created EUR bank journal. Make sure that the transaction is less than the actual amount due on the invoice so that we can apply the reconciliation model. Also make sure to set a date on the transaction that lies in the past at some point when the currency rate was (significantly) different.

7. Hit the reconcile button, select the amount due from the invoice and apply the discount reconciliation model(take note of the amount on the created tax move line). Now reconcile.

What is the current behavior that you observe?

Now go back to the bank statement and check the created journal entries. You will see a difference in the amount currency values of the payment and the tax account move line. This difference should not exist.
2018-11-02 17:25:44 +01:00
Nicolas Martinelli bbeb126cf8 [FIX] sale_timesheet: UOM
Revert commits da2140b726, e65c8826ef and 06cd145a79. They
introduce an incorrect UOM.

The original issue was an `AccessError` due to the fact that the
employee chosen was not in the same company than the user. Therefore,
instead of changing the logic of the UOM selection, we make sure to
select the employee in the appropriate company first, then fall back on
any company then.

opw-1888299
2018-11-02 13:48:05 +01:00
Yoshi Tashiro 09a81894b1 [FIX] product: respect received args value instead of overriding it (#26594)
When doing a name_search, if a current search is already specified through args,
do not replace it

Closes #26594
2018-11-02 13:38:11 +01:00
Olivier Dony 717b7249d5 [FIX] server: always consume wakeup bytes from signals
Due to the implementation of PEP-475[1] in Python 3.5, revision
e98e8e9b1b used the recommended technique
of wakeup file descriptors in order to detect interruption of sleep() and
select() by signals, when running in multi-process mode (workers > 0).

The technique works well, however the initial patch never bothered to
read the byte that is written to the wakeup pipe when a signal is
processed. This does not matter when the signal is meant to shut down
the server, but it matters when the signal is SIGQUIT: it simply prints
thread dumps, and continues operating normally.
As a consequence, that byte remains in the wakeup pipe forever, causing
all the subsequent select/sleep calls to return immediately because
the wakeup fd *is* already ready. The symptom was that worker
processes would start cycling their main run loop very fast after
receiving a SIGQUIT signal, eating 100% CPU.

This patch ensures we always empty the wakeup pipe after an interruptible
call, to avoid this effect. It also refactors another occurrence of the
"empty pipe" pattern, in the PreforkServer, and incidentally uses readable
aliases for the file descriptors bound to the ends of the wakeup pipe
(wakeup_fd_r / wakeup_fd_w).

[1] https://www.python.org/dev/peps/pep-0475

closes odoo/odoo#28356
2018-11-02 11:04:35 +00:00
Yoshi Tashiro 7d2bc7d35a [FIX] website_sale: reset cart if checkout was done in another session
This commit extend commit https://github.com/odoo/odoo/commit/ef48b81ab127dd717a4a9d106edd5c51121bc8f7
When you have a cart on multiple session and confirm the card in one of them,
you could still access your cart from other session (note that you could not do
anything with it as it would be reset when adding product or changing qty).

Closes #28210
2018-11-02 11:10:52 +01:00
Romain Derie 3457d1a74b [FIX] website_sale_options: prevent other session crash after checkout
Check commit https://github.com/odoo/odoo/commit/ef48b81ab127dd717a4a9d106edd5c51121bc8f7

This commit is doing the same for website_sale_option as the optional product
is calling another route to add the product to the cart.
That route needed to be fixed too.

Closes #28209, related to #27508
2018-11-02 11:10:50 +01:00
Moises Lopez 8f36b246d0 [I18N] clean es_MX old translations
Only keep the useful ones

closes odoo/odoo#28351
2018-11-02 09:38:23 +00:00
jem-odoo 2aa87253d1 [FIX] sale_purchase: disable PO stat button on SO
Creating a service and stockable that create a PO on SO confirmation
(with different suppliers) will indeed work, but the status button
will only display 1 PO. The problem is that stock is not linking
the SO line with the PO line.
Thus, we prefer desactivated the button displaying the wrong value, as
it brings confusion to the user.
A proper bugfix should be done in master, to correctly link SO line with
PO line making the PO count correct.

opw-1905189

closes odoo/odoo#28410
2018-11-05 12:58:29 +00:00
Martin Trigaux 00626905af [FIX] sale: use name_search on product search
Before 762adedece the search was done on the related field product_id
This was equivalent to make a search on the records order_line.product_id
and to use the name_search of product to find it.

With the filter order_line.product_id.name, it was explicitly searching on the
name of the template

Fixes odoo/odoo#28344

closes odoo/odoo#28390
2018-11-05 10:07:17 +00:00