Commit Graph
124700 Commits
Author SHA1 Message Date
Nans Lefebvre 7ffedecf82 [FIX] base: put parsing of an email 'from' into a try except block
The "from" of an email is expected to follow the regex
"name <address>(, name <address>)*".
We simply split the from on the commas "," and try to interpret each piece as a
(name, address) pair.
If a "from" contains a name that is not quoted, and contains special characters
before the comma, then we would try to encode that name into an email address,
and fail on a UnicodeEncodeError.

E.g. the following "🐧, <a@a.com>" would be parsed as [('', '🐧'),('', 'a@a.com')]
thus Odoo would crash on trying to use 🐧 as email address.

With this commit we would just mess up the name in these situations,
by ignoring failures.

opw 1923429

closes odoo/odoo#33145

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-03 08:02:32 +00:00
Christian Engelhardt 4dc8318213 [CLA] ecoservice GbR
closes odoo/odoo#33370

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-14 14:46:36 +00:00
Luis aefbd6da12 [CLA] Update CLA from savoirfairelinux
closes odoo/odoo#33343

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-14 11:59:05 +00:00
Yannick Tivisse fba09508b1 [FIX] l10n_be_hr_payroll_fleet: Make contract managers fleet managers
- Install `l10n_be_hr_payroll_fleet`
- Connect as admin
- Change demo user rights:
- Remove fleet (nothing, not user, not manager)
- Set employee Manager.
- Connect as demo
- On an employee, click the "Contracts" smart button.
- Try to create a contract.

Before this revision, access right issues were raised:
- Just after the create, as default values couldn't be computed,
- After the save as well, because of defaults and computed fields.

The real use case here is for our own sake: Dubai HR Officers
do not have access to Fleet as they do not have company cars,
but they can't create contracts for their own employees
without having access to fleet.

closes odoo/odoo#33120

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-14 11:07:46 +00:00
Nans Lefebvre 85cbb070ad [FIX] mail: remove readonly on recommended next activity
Fine-tuning of 463601a384.
It does not make sense to be able to write on mail.activity.type
using the related fields defined on mail.activity.

But this field is not a related one, and it is necessary to be writable to make
the 'recommended next activity' feature work at all.

opw 1974236

closes odoo/odoo#33325

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-13 09:10:56 +00:00
Odoo Translation Bot 5941f00143 [I18N] Update translation terms from Transifex 2019-05-12 03:10:00 +02:00
Geert Janssens 0bf5adaf6c [I18N] l10n_be_invoice_bba: translate missing terms
closes odoo/odoo#33284

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-10 11:51:08 +00:00
Geert Janssens 246e7e730b [CLA] signature for gjanssens
Closes odoo/odoo#33272

closes odoo/odoo#33293

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-10 09:20:23 +00:00
Adrian Torres d47f0ddbe4 [FIX] base: force unlink during uninstall
This commit is a followup to #25854

If a custom relational field is in a view and the field it references is
in another module and this module is uninstalled, the registry will
crash.

This is not because the ORM doesn't properly cascade-delete the field,
it tries to, but since the field is in a not-to-be-deleted view, the
unlinking of the field is interrupted and an error is raised to prevent
the breakage of the view.

However, module install/upgrade/uninstall cannot be stopped by such
errors and once the registry is reloaded, it crashes because it cannot
find the referenced field.

The solution, while not ideal, is to force the deletion of the field if
we're in uninstall mode... This means that the view in question will be
broken until the field is manually removed from the view, but a broken
view can be dealt with more easily than a broken registry.

opw-1974362

closes odoo/odoo#33130

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-03 07:50:02 +00:00
Odoo Translation Bot 27aabeaad5 [I18N] Update translation terms from Transifex 2019-05-05 03:10:58 +02:00
Christophe Simonis 2c68df0ab4 [MERGE] forward port branch 11.0 up to 82c901c937 2019-05-02 10:59:21 +02:00
Nathan de Pryck 0164c9dfcb [FIX] Account:rounding poorly applied
Rounding each element of the sum decrease the
precision and prevent to reconcile large recordset.

closes odoo/odoo#33100

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-05-02 08:26:25 +00:00
Denis Ledoux 5d6656d739 [FIX] mail: avoid concurrent update of notifications
This revision is a backport of revision
56596e5240

As the bug mentioned in the above revision
occurs as well in Odoo 10.0 and 11.0.

opw-1984293

closes odoo/odoo#33382

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-05-15 09:16:23 +00:00
Gert Pellin 928e91c624 [FIX] hw_escpos: cashdrawer doesn't open
With some escpos printers the cash drawer did still not open after
previous fixes. One of the problemetic printers is the Epson TM-m30.

This fix will check the status of the drawer and try to open it up to 5
times. The fix is successfully tested with the TM-m30.

closes odoo/odoo#33328

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-05-13 13:38:20 +00:00
Christophe Simonis 82c901c937 [MERGE] forward port branch saas-15 up to d5a1ad566b 2019-05-02 09:39:20 +02:00
Christophe Simonis d5a1ad566b [MERGE] forward port branch saas-14 up to 5728e39181 2019-05-02 09:31:13 +02:00
Christophe Simonis 5728e39181 [MERGE] forward port branch 10.0 up to 903fec011d 2019-05-02 08:48:46 +02:00
Odoo Translation Bot 903fec011d [I18N] Update translation terms from Transifex 2019-05-01 02:43:48 +02:00
Aurélien Warnon df4dcc8932 [FIX] payment: fix custom payment.transaction create method mechanism
This commit will correctly check for a custom payment.transaction create method
on 'self' instead of the acquirer's provider before calling it.

closes odoo/odoo#33033

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-04-30 07:45:19 +00:00
Christophe Monniez a21db63375 [FIX] packaging: remove jinja2 from py2exe explicit include
Following the fix in 4c35983d0, it appears that the excludes and
packages options are conflicting. py2exe seems smart enough to include
jinja2 package without the explicit include via the 'package' options.

closes odoo/odoo#32991

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-04-26 15:53:53 +00:00
goliveirab e14fd1ae62 [FIX] l10n_mx: fix mexico accounts nature
Fix mexico accounts nature of the following SAT accounts:

- 119.01
- 119.02
- 119.03
- 199.04
- 180.01
- 503
- 505.01
- 505.02
- 607.01
- 610.01
- 612.01

Currently some debit accounts are being labeled as creditors and vice
versa. For example the account 119.01 IVA pendiente de pago should be
labeled as a debit account but is set as a credit account.

closes odoo/odoo#33287

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-26 14:33:52 +00:00
Xavier Morel 8371f08202 [FIX] website_hr_recruitment: don't prefetch website_description
Prefetching it triggers its translation, which quickly becomes most of
the overhead of /jobs despite the field not being displayed on that
page: an empty /jobs takes ~150ms, a /jobs with 99 jobs takes ~2000ms,
>70% of which are spent in html_translate and ultimately
translate.py:process (14600 calls, 60% of runtime, 40% own).

Removing prefetching lowers the runtime to ~700ms.

closes odoo/odoo#32985

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-04-26 12:16:24 +00:00
Lucas Perais (lpe) c6f1921beb [FIX] account_asset: asset report shows only non archived assets
Make a PO then an invoice with a product that will create an asset
cancel the invoice
Open the Assets Analysis report

Before this commit, the asset lines corresponding to the invoice
are shown

After this commit, they are not shown (only non archived assets are by default)

OPW 1974344

closes odoo/odoo#32955

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-25 14:15:50 +00:00
Christophe Monniez 4c35983d08 [FIX] packaging: avoid jinja2 asyncsupport in py2exe
Since 78ba90d5, when building the windows package, py2exe fails to
compiles jinja2 asyncsupport module. Even tough jinja detects the
environement, py2exe tries to compile the async part. The problem comes
from the fact that async keyword was introduced in python 3 and we use
py2exe with python 2.7.

With this commit the async part of jinja is execluded from py2exe.

closes odoo/odoo#32913

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-04-25 08:46:50 +00:00
Lucas Perais (lpe) 7f6309c60c [FIX] account_check_printing: print checks action defaults
Because of c56b746221
server action "state" (what it should execute) defaults to
Update a record

This commit corrects the check printing action accordingly

OPW 1972938

closes #32928
2019-04-25 09:34:14 +02:00
Olivier Colson b1530265e4 [FIX] purchase: anglosaxon accounting: fix wrong computation of prod qty when multiple stock move
Have a PO with a product in automated valorization, and average as method of valorization
Validate and receive *partially* (create backorder)
invoice with a different price than the PO
Receive the backorder
Invoice the rest, also with a different price than the PO

Before this commit, wrong amounts were written in the account.move corresponding to the invoice.
In particular, the payable account's amount was erroneous because it is computed to balance the move
As a result, the bill showed an amount due different from its total, even though nothing was reconciled with it.

After this commit, the payable entry and hence the amount due on the invoice are correct

OPW 1967289

closes odoo/odoo#32920

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-24 13:17:22 +00:00
Denis Ledoux 6fd637e131 [MERGE] forward port branch 11.0 up to b71b78035b 2019-04-24 14:31:10 +02:00
Damien Bouvy 90af6254ba [FIX] mrp_byproduct: missing oldname
Impacts migrations

closes odoo/odoo#32900

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-04-24 08:53:29 +00:00
Denis Ledoux b71b78035b [MERGE] forward port branch saas-15 up to 0c46c8a929 2019-04-24 10:04:05 +02:00
Denis Ledoux 0c46c8a929 [MERGE] forward port branch saas-14 up to 6fd092e131 2019-04-24 09:31:49 +02:00
Denis Ledoux 6fd092e131 [MERGE] forward port branch 10.0 up to 4730a884b4 2019-04-23 17:16:26 +02:00
Nans Lefebvre d6ad22227c [FIX] sale_timesheet: update delivered quantities when changing the sale_line_id
Create a SO with two lines (sol_1, sol_2) selling a given service.
On the corresponding Project/Task, set the partner so that the sale_line_id
can be chosen to one of the lines.
Add an AAL with x hours, save.
This updates the delivered quantity (x) on sol_1.
Edit, change the sale_line_id to the second one:
it updates the delivered quantity on sol_2 (to x) but not on sol_1.
Has a result, the delivered quantity has been doubled.

The issue is that the quantities are only recomputed on the SOL that we write;
instead they should be recomputed on the old one and the new one.

We base ourselves on 371a92fb which solved a similar bug to add the recompute on
both lines.

opw 1959509

11.0-opw1959509-sltmsht-len

closes odoo/odoo#32820

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-19 07:56:17 +00:00
Nicolas Martinelli fccf4f3ca4 [FIX] event_sale: canceled registrations
Fine tuning of ac31252d54

Do not pre-filter on canceled entries since they are used a few lines
below.

opw-1964459

closes odoo/odoo#32835

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-19 12:40:17 +00:00
Lucas Perais (lpe) 4730a884b4 [FIX] website_quote: portal optional products qty change
Have a SO with a quotation template and some optional products set
Display it on the portal
On an optional product, click on the cart icon
to add it to the SO

Modify the quantity of the optional product

Before this commit, the feature was barely working:
- the total price of the optional product did not change
- negative quantities were allowed
- there was no reaction when directly putting a number in the input
- when decrementing the quantity, it crashed
- untaxed and tax amounts were not dynamic

After this commit:
- the total price of the optional product changes as a function of the quantity input
- negative quantities are not allowed
- it is not possible to manually input the quantity with a keyboard
  only +/- buttons are used to change the quantity
- decrementing the quantity works
- untaxed and tax amounts are dynamic

OPW 1947769

closes odoo/odoo#32715

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-19 07:41:40 +00:00
Simon Lejeune aac14d23da [FIX] stock: cache invalidation in _action_assign
`reserved_availability` is a computed field of a move depending on its
move lines. We access this field at each iteration of the loop over the
moves to assign and then we create a new move line for it. This triggers
an invalidation of this field, The next iteration will again access this
field and prefetch it for all the next records.

We read the field out of the loop and don't access it again to prevent
these prefetch/invalidation issues.

Confirmation of a PO of ~800 lines goes from 5 minutes to 1 minute.

opw-1953398

closes odoo/odoo#32774

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>

closes odoo/odoo#32805

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-18 12:55:33 +00:00
Odoo Translation Bot e07ecf298f [I18N] Update translation terms from Transifex 2019-04-21 03:09:35 +02:00
Nans Lefebvre e7ce0b43a6 [FIX] stock_dropshipping: do not merge PO lines coming from a SO
Fine tuning of commit b9e3c153, for the same use-case.
The route may not be passed in values, in which case the bug is still present.
There are two ways to go around that.
We could add the stock.rule in values, which contains the route.
The solution we adopt here is to use the sale_line_id field on the purchase line
If it is present, it was added through _prepare_purchase_order_line,
and thus we want to keep track of the origin.

opw 1957701

closes odoo/odoo#32683

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-18 09:46:22 +00:00
Jairo Llopis ab1bd93dde [FIX] web: Trim spaces when selecting option by text
It's quite common that the `$().text()` method returns lots of random whitespaces at the beginning and end of the string. They're pretty unpredictable (extension views can add or remove them) and invisible to the end user.

This code chunk should allow to select an `<option>` based on its raw text content, but most of them will just fail without this patch. And most chances are that current ones just work equally with this patch.

This will make frontend tours more pleasant to write.

closes odoo/odoo#32791

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-18 09:45:52 +00:00
Pierre Masereel 0f532c3dbf [FIX] delivery: picking weight computation
The depends value on picking weight and package_ids of picking are only
set on the move_line_ids, which lead to compute the value of the picking
weight only when move lines are created or deleted and not when a
package is set on a line, quantity done changed and/or unit of measure
changed.

To fix this issue, we've changed the depends, of thos computed fields.

closes odoo/odoo#33114

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-05-02 13:07:33 +00:00
Nicolas Martinelli bc6d051fca [FIX] account: multi-currency payment matching
- Set the company currency in USD, activate multi-curency
- Create an invoice in EUR
- Create a payment in EUR for less than the invoice
- Open the payment matching => all amounts are in USD
- Create a write-off, reconcile

The write-off amount is incorrectly converted.

The write-off amount is sent in USD, but considered in EUR in the
server since the currency considered is the one of the line. However,
the currency in the widget is computed based on the account currency:

https://github.com/odoo/odoo/blob/b6f55dac5633d8ccb16568e0c85a5c32072e8846/addons/account/models/account_move.py#L654

Note that this is the opposite of commit 1806ea1859,
introduced in v9. Since the widget was refactored in v11, many changes
have been introduced, and we assume that this change is now justified.

opw-1907332

closes odoo/odoo#32723

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-18 08:10:24 +00:00
Nans Lefebvre 500d42ffec [FIX] l10n_in_hr_payroll: fix view inheritance after refactor
Commit d7a3f39d refactored hr views.
This broke the inheritance of the view in that module.

opw 1971570

closes odoo/odoo#32972

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-30 09:23:29 +00:00
Nicolas Martinelli 7b5b41ee88 [FIX] stock: onchange performance on picking
The use case is similar to 084dbf9b8f, but
applied to pickings.

When the picking contains many stock move, the manual edition of the
quantitites is quite slow due to the `onchange` call. In the example of
the OPW with 300 stock moves, the modification of the done quantity
triggers an `onchange` which lasts about 1 second.

The reason is the same than in the mentioned commit: the `onchange` is
triggered on all lines in the case of an inline tree view, and there is
not much we can do to optimize the business logic.

Therefore, the solution is the same: add a stat button to access the
stock moves directly in a tree view instead, to avoid this `onchange`.

opw-1965248

closes odoo/odoo#33004

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-29 08:53:49 +00:00
Nicolas Martinelli d9e76c66fe [FIX] account: payment receipt
- Create 2 invoices for a customer:
  Inv 1: 100
  Inv 2: 200
- Register a partial payment of 80 on Inv 1
- Select both invoices and pay the remaining amount (220)
- Print the 'Payment Receipt'

The 'Amount Paid' for Inv 1 is 100, while it should be 20.

This is because the report doesn't take into account which part of the
payment was used in the corresponding invoice.

Closes #32755
opw-1970401

closes odoo/odoo#33012

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-29 12:37:46 +00:00
mreficent c6d718f211 [FIX] In new records *2many, enable to handle multiple RPC inputs
closes odoo/odoo#24458

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-26 13:54:20 +00:00
Odoo Translation Bot 631abaf689 [I18N] Update translation terms from Transifex 2019-04-28 03:09:59 +02:00
Sébastien Theys af02d1da58 [FIX] website_forum: remove unnecessary slow code
Since commit 56645335b7
the subtype `gamification.mt_badge_granted` is not used anymore. Therefore
this method will never return anything.

However, it is very costly on performance, and it is run on every page of the
forum! The problematic performance point is that `needaction` is a computed
field, which implies all existing `mail.message` having the target subtype have
to be fetched to compute this field, which obviously does not scale well at all.

closes odoo/odoo#32861

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-04-23 07:07:57 +00:00
Nicolas Lempereur b09d20ab29 [FIX] web: no ResizeObserver video error on chrome
When displaying a video, with the browser window at a certain size, or
resizing it (or opening developer tools) we could the following error:

 "ResizeObserver loop limit exceeded"

This can be reproduced in chromium just with this JS code:

  window.onerror = function(e){ console.log(e); };
  document.body.innerHTML = '<div><video controls src="v.webm"/>';

The issue only happen if:

- the video server does not support HTTP range requests
- the controls are displayed on the video
- browser size is in problematic size/resized to problematic size

And the error is raised in window.onerror but not displayed in the
developer console.

With this change, we ignore these errors until fixed in chromium.

chromium bug tracker: https://crbug.com/809574

backport of 12.0 535da9e (in pr #30239) since video loader was in 11.0
opw-1928512
closes #32983

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-26 11:53:38 +00:00
Nicolas Martinelli bc27113cf5 [FIX] stock_account: price unit is zero
- Set a product P to average valuation, real time
- Create a PO for 1 unit @ 100, validate the picking
- Create a PO for 1 unit @ 0 (e.g. you receive a free product)

You cannot validate the picking because of the message 'The cost of P is
currently equal to 0...'

This error message is historical, to prevent users from an incorrect
configuration.

Since we still want to prevent misconfiguration, but support the
mentioned use case, we introduce an `ir._config_parameter` for people
who 'know what they are doing'.

opw-1962249

closes odoo/odoo#32550

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

closes odoo/odoo#32951

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-25 12:01:26 +00:00
Julien Castiaux fd03786c2a [FIX] project: useless project chatter on portal
On the portal, in "/my/projects/x" it is possible to send messages in the
"Message and communication history" section. Those messages are attached
to the project model but it is not possible to access those messages
from the backend. The chatter on the project model is just a dummy
chatter with no message/thread capacities.

As messages are not accessible from the backend, the frontend section is
pretty useless. The section is no more present on v12 either.

opw-1970586

closes odoo/odoo#32952

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-25 12:44:12 +00:00
Lucas Perais (lpe) f2528a6924 [FIX] product: template creation packaging_ids
Create a new product, but don't save it just yet
give it a name,
Add some packagings
Save

Before this commit:
- the form to create the packaging had a mandatory product_id field
which is useless in a x2m context (fixed in v11.5 with a6557a2306)
- the packages disappeared after save
This was because at template creation, all "real" fields that are on
its variants must be manually set after the creation, including packaging_ids

OPW 1970589

closes odoo/odoo#32925

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-25 07:30:10 +00:00