Commit Graph
111279 Commits
Author SHA1 Message Date
Denis Ledoux 6fd092e131 [MERGE] forward port branch 10.0 up to 4730a884b4 2019-04-23 17:16:26 +02: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
Christophe Simonis 6b87c851b9 [MERGE] forward port branch 10.0 up to 78ba90d548 2019-04-15 11:58:47 +02:00
Olivier Dony 78ba90d548 [FIX] requirements: bump up jinja2 reqs
Recommended by GitHub's repository alerts.

We normally stick as close as possible to the version we depend
on in the official DEB packages. This in turn depends on the version of
Debian stable at the time of release - for 10.0 that would be Debian 8
(jessie) and thus Jinja 2.7.3 (albeit with security backports).

However Jinja2 before 2.10.1 suffers from a few issues that could lead
to crashes of Odoo processes.

It seems it's worth an exception to our rule for pip users, similarly to
previous bump up at d2605bccdb.

closes odoo/odoo#32602

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-04-10 17:45:06 +00:00
Denis Ledoux 39fd19ffd7 [FIX] point_of_sale: lost pos orders on IntegrityError
This revision is similar to
605b94e64c

except that instead of an OperationalError
(e.g. a conccurent update),
this is an IntegrityError which is raised,
an sql constraint which is not met,
e.g. a unique or required constraint.

In the case of this opw,
this is the picking name unique constraint
which was not met,
the picking sequence number has somehow been re-used.

Both
`psycopg2.OperationalError`
and
`psycopg2.IntegrityError`
inherits from
`psycopg2.DatabaseError`

We therefore choose to use this Exception class,
to include all kind of psycopg2 exceptions that prevent
the transaction to be committed.

opw-1965679

closes odoo/odoo#32577

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-04-10 09:28:16 +00:00
Thibault Delavallée 32c2af2376 [FIX] mass_mailing: correctly find partner email in mass mailing
In mass mailing access to partners when performing a mass mailing has been
done in batch to speedup computation [1]. Emails are put into a dictionary
allowing to find back the email based on partner_id.

However the matching between the partner and its emails is done using a
shortcut using the current document ID as partner ID. It works when performing
a mass mailing on partners but fails when performing a mass mailing on models
having message_get_default_recipients not returning only emails. Currently
in saas-14 main models return only emails (crm, event, mailing contacts) but
other models may encounter issues (applicants, tickets).

This commit fixes it by correctly matching partner id and its found email.

[1] See 65ed4553a5
2019-04-08 15:18:18 +02:00
Christophe Simonis e831064d93 [MERGE] forward port branch 10.0 up to 6431e366a8 2019-04-08 15:12:52 +02:00
SimoRubi 6431e366a8 [FIX] web: call method with correct record
_compute_website_url can only be called on singletons
It should not be called with self but the record we are iterating on

closes odoo/odoo#32369

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-08 09:26:01 +00:00
Adrian Torres 3f3d2b2773 [FIX] base: prevent module operations while cron is running
closes odoo/odoo#32234

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-05 13:10:35 +00:00
Damien Bouvy a25abec95c [FIX] orm: don't crash on index creation
For existing installations, creating indices might not always be
possible, e.g. if you have a Text/Char field that has an index=True
set on it in a field override and pre-existing rows longer than
the pg supported size , the index creation will fail.

Instead of failing miserably during the schema modification, simply
log the problem instead and keep going.

closes odoo/odoo#32442

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-05 07:53:07 +00:00
Christophe Simonis 6e0c89867e [MERGE] forward port branch 10.0 up to 60592561d7 2019-04-04 18:33:42 +02:00
qsm-odoo 60592561d7 [FIX] web_editor: support youtube-nocookie.com
closes odoo/odoo#32332

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-04-04 09:21:09 +00:00
Goffin Simon 94d15e037c [FIX] account_set: Wrong recomputation of the depreciation lines
When a asset is confirmed, it's not allowed to link it to an invoice.
Side effect, it recomputed the depreciation lines of the confirmed asset.

opw:1961468

closes odoo/odoo#32388

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-04 07:02:53 +00:00
Nicolas Lempereur e14c386a19 [FIX] point_of_sale: allow connect proxy https error
Since 79af654fc61 if we had unexpected configuration of usage such as
being in HTTPS, having a POS hardware in HTTPS but an error is received
(eg. the device is closed) => the POS interface can't be opened being
blocked on an error:

 Https connection to IoT Box failed
 Make sure you are using IoT Box v18.10 or higher.

 Navigate to {proxy_ip} to accept the certificate of your IoT Box.

With this changeset, we have a popup that does not prevent to open the
point of sale interface (and  the red disconnected status in the top
left allow to retry connection as before) on first load.

opw-1934413
closes #32306

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-03 10:39:37 +00:00
Christophe Simonis d158a8ffbf [MERGE] forward port branch 10.0 up to 2d30bd9698 2019-04-02 12:28:19 +02:00
Nicolas Martinelli 9f2dd49c57 [FIX] product, purchase: seller in multi-company
- Create 2 companies A & B
- For a product P, create a supplier info for each company using the
  same partner, with a different price and delay.
- Order the supplier so that the one for A has a higher priority than
  the one for B.
- Create a reordering rule for P in company B.
- Run the scheduler as admin (e.g. thanks to the cron).

The price taken is the price for company A instead of B.

`_select_seller` is not company-aware, therefore the first matching
supplier is chosen.

opw-1959263

closes odoo/odoo#32328

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-02 08:33:15 +00:00
Jigar Vaghela 9fc21c9b61 [FIX] l10n_pl: incorrect command
The `(6,0,[*])` command is missing from `vs_kraj_7`.

closes odoo/odoo#32358

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-03 06:05:50 +00:00
Odoo Translation Bot 2d30bd9698 [I18N] Update translation terms from Transifex 2019-04-01 02:44:26 +02:00
Nans Lefebvre 6b9b9d8997 [FIX] base_geolocalize: raise a helpful error to configure the Google account
Google maps used to be free, but became a paid API.
Technically, the usage could be part of the free offer,
but to benefit from it the account needs to have billing enabled.
Since it's a paid feature security had to be ramped up,
so now APIs have to be explicitly enabled (here geolocating/geocoding).
All this makes it so that the Google account has to be properly configured
before the calls to the Maps API can work.
As a result we add an explicit UserError if the request fails,
to help the user configure the Google account
(before the error was entirely hidden as to give the user no chance at all).

Also exports transaltions, including for commit e6ca846c65
which raised a similar error message if no API key was found.

opw 1946485
opw 1947292
opw 1947337

closes odoo/odoo#32162

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-29 11:33:00 +00:00
Christophe Simonis 7dd2a642ed [MERGE] forward port branch 10.0 up to 14a8148e8d 2019-03-28 16:52:53 +01:00
Christophe Simonis 14a8148e8d [FIX] hw_escpos: define used variable
Oversight of #32079
2019-03-28 16:50:16 +01:00
Christophe Simonis 78f01e3609 [MERGE] forward port branch 10.0 up to 6814f27bbc 2019-03-28 15:46:04 +01:00
Olivier Colson e0ba54331a [FIX] l10n_ca: add missing child to tax group
closes odoo/odoo#32144

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-27 09:21:55 +00:00
Gert Pellin 41137c304f [FIX] point_of_sale: fix decimal point
Before this fix there was no check if there was already a decimal point
in the value when using the onscreen keypad.

Fixes #32034

Steps to reproduce:

* Open up POS interface
* Add an item
* Press the decimal point button multiple times (2 or more)
* Note that pressing additional number keys do not display
* Backspace must be pressed for the number of digits entered,
  plus the multiple decimal points, to clear
  all the hidden characters in the value buffer
* Same behavior occurs with the Discount and Price
  values

Current behavior:
Multiple decimal point characters can be
"entered" and are inserted into value buffer
(Qty, Disc, or Price), but do not display on
screen.
Additional digits entered after multiple decimal
point presses are inserted into buffer, but do
not display on screen.
Additional digits entered after the last valid
digit on the screen are also inserted into the
buffer.
Backspace must be used to remove the invisible
characters from the value buffer.

Expected behavior:
The value buffer for Qty, Disc, or Price should
more closely match what is displayed on the
screen.
Characters which are invalid and aren't
displayed on the screen, should not be inserted
into the value buffer, including the decimal
point button.

closes odoo/odoo#32089

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-04-09 09:39:03 +00:00
Christophe Simonis 3c7be1e88f [MERGE] forward port branch 10.0 up to a95811eee2 2019-03-25 13:30:34 +01:00
Gert Pellin 6814f27bbc [FIX] hw_escpos: opening pulse cashdrawer
Some cashdrawers will not open when the command is send. This can be
solved by sending a longer opening pulse.

Used fix of newer library:
https://github.com/python-escpos/python-escpos/blob/0a89ee2b8610452f18b521af71b1ab1af7932894/escpos/constants.py#L40
Explanation for command:
http://www.beaglehardware.com/howtoprogramcashdrawer.html

closes odoo/odoo#32079

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-25 10:03:54 +00:00
Christophe Simonis cded89b531 [MERGE] forward port branch 10.0 up to f1c72ee8ee 2019-03-22 13:25:55 +01:00
Denis Vermylen a95811eee2 [FIX] mail: tests: exclude domain from message_id
If the database name contains one of the tested strings, it can render
the assertion of the test invalid or inconclusive. Ensure we strip it
away during the tests.

opw: 1957055

closes odoo/odoo#31987

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-20 14:18:36 +00:00
Fabien Meghazi f1c72ee8ee [FIX] base: fix ir.logging database locking when using --log-db
Before this patch, the ir.logging's write_uid field was a many2one which
could cause a module install/update to hang when the module is changing
the res.users model schema and when this module causes to orm to warn
through the logger. (eg: declaring two res.users fields with the same
string attribute)

In such situation the transaction cursor that is processing the
res_users table alteration will be granted an exclusive postgresql lock
hence causing the ir_logging insertion to block because of the write_uid
foreign key to res_users.

This issue has never been raised by runbot as it is using a remote
database with --log-db

Note: the write_uid conversion from m2o to int was left over in commit e6a5d82

closes odoo/odoo#32015

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-18 16:11:25 +00:00
Christophe Simonis 5162ca7be7 [MERGE] forward port branch 10.0 up to 36ba37a7a1 2019-03-18 10:20:06 +01:00
Denis Vermylen 744bdd275e [FIX] server.py: stop the FSWatcher when stopping the server
Avoid potential tracebacks from the FSWatcher's thread being killed.

Drawback: Server shut down can have an extra small delay

(only applies when the --dev=reload option is given)

closes odoo/odoo#31855

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-15 14:18:11 +00:00
Denis Vermylen 7b6cfc412e [IMP] server.py: --dev=reload with inotify
Add the alternative of inotify instead of watchdog to watch the addons
paths the server was started with.

Reason: watchdog spawns 2 threads per path to watch. When there are a
lot of addons paths, this can become too costly. With inotify we watch
all the repositories in a single thread.

https://github.com/dsoprea/PyInotify

installation:

    pip install inotify
2019-03-15 14:18:09 +00:00
Nicolas Martinelli 36ba37a7a1 [FIX] base: default rate
We set the default rate to be 1.0 instead of 0.0, since a rate of 0.0
doesn't make sense.

Partial backport of 298491597c

opw-1949866

closes odoo/odoo#31866

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-15 09:58:51 +00:00
Denis Vermylen 83b2d2e1b5 [FIX] server.py: don't start multiple FSWatcher in multiworker mode
Before this commit every worker would start his own FSWatcher.
2019-03-14 14:37:57 +00:00
Denis Vermylen a1fa9faa31 [FIX] server.py: FileNotFoundError doesn't exist in P2
Python2 uses IOError instead.

/!\ DO NOT FORWARD PORT AFTER 11.* /!\
2019-03-14 10:06:04 +00:00
Christophe Simonis d5a8b238fa [MERGE] forward port branch 10.0 up to 49ca43d75c 2019-03-13 13:23:43 +01:00
Denis Vermylen 791a38a655 [FIX] web: qweb2: allow null values in a foreach iteration
Before this commit iteration in a t-foreach containing null or
undefined values crashed because they have no attributes.

closes odoo/odoo#31828

Signed-off-by: Fabien Meghazi <amigrave@users.noreply.github.com>
2019-03-12 16:15:39 +00:00
Nicolas Lempereur 79d5d57d0a [FIX] l10n_be_intrastat: typo EXTRF now 29/19
Intrastat was modified on january 2019 to backport some features for new
regulation of belgian intrastat in c5a8e3975.

There was a coding typo so EXTRF was <Report/> code attribute instead.

sources:
 https://www.nbb.be/doc/dq/e_pdf_ex/docxml-en.pdf
 https://www.nbb.be/doc/dq/f_pdf_ex/docxml-fr2019.pdf

opw-1948336
closes #31875

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-15 12:28:07 +00:00
Antoine Prieels fa10ba3416 [FIX] hw_screen: Use full width of display
The customer display used only a small part of the available width.

closes odoo/odoo#31865

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-03-15 09:24:28 +00:00
Toufik Ben Jaa 7ac7c97762 [FIX] portal: Portal User creation login check
- When creating a user from the "Grant Portal Access" wizard, the code
  checks for duplicate users.
  It does so by checking if there is a user with the same login as the
  one we want to create.

  The check is case sensitive which could lead to issues.
  For example a mistyped email (with a uppercase somewhere) could fail
  the duplicate user check.
  Since emails are not case sensitive, we want the check to be case
  insensitive too.

  OPW-1932918

closes odoo/odoo#31818

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-03-13 12:46:21 +00:00
xmo-odoo 747e05db55 [IMP] base: remove prefetch when getting commercial fields
This is related to issue #31549, fixing it in 10 since it's already a
minor issue here (importing 500 partners which all have the same parent,
on my system the import time goes from 2:30 to 2:00).

This is mostly a problem for such fields as `property_product_pricelist`
(added do the commercial fields list by `product`): since we're first
getting it then writing a field it depends on (updating the address,
which contains the country), the field gets invalidated for all records
on each record being imported, so if we're importing a bunch of partners
which all have the same parent (e.g. company employees)
`property_product_pricelist` is going to be re-computed for every
partner imported so far as well as the one parent we're interested in,
for every new partner we're creating.

The problem is much more prevalent with 12.0's batched creates as we're
first creating all the new partners then doing the updates, and thus for
each new partner we're computing `property_product_pricelist` for all
new partners and the one parent we're interested in, roughly doubling
the import time of a series of partners which all have the same parent.

closes odoo/odoo#31804

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-03-13 08:45:11 +00:00
Rémi Rahir 49ca43d75c [FIX] website_sale: filter fiscal positions on company v2
Sequel of cc54194e13.
The mentioned fix only worked when the user was public.

The problem arises when calling the function `_get_fpos_by_region()`
in `sudo` without specifying the company and this happens, for instance,
in every `onchange_partner_*` function of a sale order.

We propose to add the `force_company` key in the context of the sale
order to ensure the right company when selecting the fiscal position.

closes odoo/odoo#31751

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2019-03-11 14:57:21 +00:00
Yoshi Tashiro 084246a54e [FIX] l10n_jp: wrong user type, add accounts
- Fixes incorrect user type assignments on some accounts
- Fixes incorrect account assignments on taxes
- Adds a few accounts that Japanese companies would typically need
- Changes some account codes to make the structure more consistent
- Updates descriptions of some taxes to make them appear more natural
  on PDF reports

closes odoo/odoo#30780

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-11 07:15:54 +00:00
Christophe Simonis b47749effd [MERGE] forward port branch 10.0 up to 88de931141 2019-03-08 13:08:58 +01:00
Romain Derie 88de931141 [FIX] payment_authorize: use SHA-512 instead of MD5 as not supported
Authorize.Net is phasing out the MD5 based hash use for transaction response
verification in favor of the SHA-512 based hash utilizing a Signature Key.

Instead of hashing with md5 the transaction key, it is now required to hash
the signature key (binary format) with SHA-512.

Support for MD5 will be dropped the 7th March 2019 for sandbox environment and
the 28th March 2019 for production environment, initially planned for the 14th.

Note that as of February 11, 2019 authorize removed the ability to configure or
update MD5 Hash setting in the Merchant Interface.
Merchants who had this setting configured have been emailed/contacted.

opw-1943030

Usefull links:
https://developer.authorize.net/support/hash_upgrade/
https://support.authorize.net/s/article/What-is-a-Signature-Key
https://support.authorize.net/s/article/MD5-Hash-End-of-Life-Signature-Key-Replacement
https://support.authorize.net/s/article/Do-I-need-to-upgrade-my-transaction-fingerprint-from-HMAC-MD5-to-HMAC-SHA512-and-how

closes odoo/odoo#31642

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2019-03-08 10:14:57 +00:00
cristinamartinrod ca1b201cec [FIX] website_mass_mailing: translate button
The text was in a value tag, making it untranslatable

Closes odoo/odoo#30774

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-07 15:36:58 +00:00
Pedro M. Baeza 98b2784d1e [CLA] backport of e78af353fc to 10.0
Include cristinamartinrod in CLA of Tecnativa

Needed for odoo/odoo#30774
2019-03-07 15:36:47 +00:00
Rémi Rahir cc54194e13 [FIX] website_sale: filter fiscal positions on company
When creating a cart on the website, the website company was not
considered which could end up with the selection of a fiscal position
linked to a wrong company since the method is called in sudo.

closes odoo/odoo#31673

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2019-03-07 15:38:10 +00:00
Suganthi Karunanithi eb62cd2c2b [FIX] gamification: badge auth for badge no error
To avoid exception:
  TypeError: Mixing apples and oranges: gamification.badge() - gamification.badge.user(1,)

when rule_auth of a badge is set to `having`.

opw-1945440
closes #31436
closes #31595

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-06 18:00:53 +00:00
xmo-odoo 5ec4da2ee2 [IMP] base_module_import: ignore garbage directories
If the zipfile contains some garbage directories (e.g. leftover empty
directories from git, `__MACOSX` metadata folder, …) it seems
unnecessary to log an error, just skip the directory and don't mark it
as a proper / successful module.

closes odoo/odoo#31639

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-03-06 15:02:38 +00:00