Commit Graph
111239 Commits
Author SHA1 Message Date
Christophe Simonis 5162ca7be7 [MERGE] forward port branch 10.0 up to 36ba37a7a1 2019-03-18 10:20:06 +01: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
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
qsm-odoo fdb9f8273b [FIX] web_editor: stop using translated versions in HTML editor
Since https://github.com/odoo/odoo/commit/5a030db3eb77b6d80187f8ae1a64303b2f50391d
the HTML editor displayed the translated versions of the templates it
allows to customize. So if the user edited and saved such a template,
the non-translated version was saved with translated-version content.

The behavior before the mentioned commit was:
1) Load all views the HTML editor allows to edit
2) Each time a view is displayed, re-make a RPC to load the view again

The mentioned commit made this simpler by making:
1) Load all views the HTML editor allows to edit
2) Each time a view is displayed, simply show the previously loaded view

... the problem was that the step (2) of the old behavior was
explicitly saying (client-side) to load the view's untranslated content.
This commit makes step (1) always load the untranslated versions of the
views (server-side).
2019-03-04 17:05:01 +01:00
Christophe Simonis 232da9a0ec [MERGE] forward port branch 10.0 up to 0f0c5db49d 2019-03-04 12:02:31 +01:00
Julien Legros 0f0c5db49d [FIX] base: fix parse_version import 2019-03-04 11:24:18 +01:00
Xavier Morel 925385fde6 [FIX] base: properly check werkzeug version
Werkzeug version was being checked to avoid passing quote=True to
werkzeug.utils.escape (as that parameter was changed to `True` *and
deprecated* in 0.9).

However because DeprecationWarning was made silent by default in
Python 3.2 and the way the check is implemented worked for 0.9 it
looks like nobody really noticed it's broken in the usual manner of
half-assed version checks: works for 0.9.0, doesn't work for
0.12.3 (because lexically 0.12.3 < 0.9.0).

Fix by using proper version parsing and comparing the result of that.

See also: odoo/odoo#28116

closes odoo/odoo#31553

Signed-off-by: "Xavier Morel (xmo)" <xmo@openerp.com>
2019-02-27 12:46:02 +00:00
Odoo Translation Bot 5a3ac7dece [I18N] Update translation terms from Transifex 2019-03-01 02:45:39 +01:00
Nicolas Lempereur 15ea753a0f [FIX] stock: show product qty on searched location
The location_id and warehouse_id fields on product.template are just
dummy field intended to add something in the context that will be used
to compute the data being rendered (eg. for location, the quantity
displayed is the quantity of the product in the searched location).

But the feature was broken at a point, and has been solved in 11.0 with
7c7b099273.

This solution was not implemented in 10.0 up to saas-15 since this is
not acceptable for a stable version.

This changeset is only for 10.0 up to saas-15 to implement the fix
differently.

opw-1945417
closes #31475
2019-02-28 12:42:18 +00:00
Christophe Simonis 023dfaeb6b [FIX] core: correct ir.rule domain generation
Since 934c001680, fasly domains are
correctly OR'ed.
Models without group binded rules were then wrongly reduced to an
`AND FALSE` condition.
2019-02-27 12:27:24 +01:00
Christophe Simonis 4c46dd4f9d [MERGE] forward port branch 10.0 up to 2f139632d6 2019-02-27 10:42:03 +01:00
Martin Trigaux 2f139632d6 [CLA] add Dimitar Apostolov to Savoir-faire Linux CCLA
As signed at opw-1944366

closes odoo/odoo#31413
2019-02-26 14:42:08 +00:00
Laurent Mignon (ACSONE) 28f33dc150 [IMP] stock: performance on _compute_product_availability
Improve performance (*3) on _compute_product_availability
`mapped` makes use of orm prefetch, which is inefficient in this use
case when facing high volume.

closes odoo/odoo#30545
2019-02-26 08:32:50 +00:00
Nicolas Lempereur 1c5c762f3c [FIX] point_of_sale: no black bottomed receipt
On some devices and chromium with printing option "Background graphics",
a printed receipt on the point of sale could have a black bottom below
the receipt content.

This is caused by the point of sale black background and happen rarely
because most frequently browser printing remove backgrounds.

opw-1940434
Co-authored-by: Romeo Fragomeli <rfr@odoo.com>
closes #31472
2019-02-28 11:31:01 +00:00
Adrian Torres 934c001680 [FIX] expression: properly handle {TRUE,FALSE}_LEAF
Before this commit, doing expression.OR() with only FALSE_LEAF would
yield [] which is equivalent to TRUE_LEAF and is therefore not correct.

The same happened (to a lesser extent) with expression.AND() within an
expression.OR(), since the former would return a [] which would be
ignored by expression.OR().

See tests for a clearer view of the use cases.

Fixes #30113, #26540

closes odoo/odoo#31202
2019-02-20 10:45:28 +00:00
Julien (juc) Castiaux c7386de1a2 [FIX] website_mail: no publish button for notes
The admin can decide to publish/unpublish messages in the comments
of a product from the website. The button is also shown for notes
even if they are never published.

opw-1935337

closes odoo/odoo#31420
2019-02-26 09:49:19 +00:00
Nicolas Martinelli f886bdfffa [FIX] account: default account
When importing an invoice without specifying the type, the invoice type
is set to `out_invoice`, but the account set is the supplier account.

At this point, the invoice type is simply undefined (`False`). It will
be set by default at creation to `out_invoice`. Therefore, we reach the
`else` condition which uses the supplier info.

We simply inverse the condition, so it creates a consistent object.
However, it raises a bigger question about how the action context should
be kept at invoice. We won't address it :-)

opw-1925547

closes odoo/odoo#30154

closes odoo/odoo#31373
2019-02-22 14:58:51 +00:00
Nicolas Martinelli b431f8eadc [FIX] barcodes, web: float scannable
- Switch to French language
- Go to Inventory > Inventory Adjustment
- Launch an adjustment

The field 'Real Quantity' doesn't follow the float formatting.

This is because the widget is set as `field_float_scannable`, which is
not recognized by the formatting function.

Since the widget descriptor has priority over the type descriptor, we
must explicitly take this widget into account, on top of adding the
`format_value` method.

opw-1940884

closes odoo/odoo#31366
2019-02-22 13:45:30 +00:00
Nicolas Martinelli 264a047a8a [FIX] sale: SO count
Apply e1767490e9 to SO count in order to
take into account all children, and not only direct children.

opw-1941335

closes odoo/odoo#31329
2019-02-21 14:14:17 +00:00
Christophe Simonis 9b735d0057 [MERGE] forward port branch 10.0 up to 6cf4f4924b 2019-02-19 17:08:56 +01:00
Christophe Simonis 6cf4f4924b [FIX] stock: remove domain on stock.location of picking types
There is no `company_id` field on `stock.picking.type`.

Partially revert f221936f8b (#30952)

closes odoo/odoo#31121
2019-02-14 20:25:55 +00:00
Christophe Simonis c1fe9f18d5 [MERGE] forward port branch 10.0 up to 69719f598a 2019-02-14 18:09:24 +01:00
Denis Ledoux 69719f598a [FIX] google_calendar: case insensitive attendee sync
In Odoo, create a user John@example.com (the cap is on purpose)
In Google Calendar, create an event and invite john@example.com

Sync your Google calendar.

Before this revision,
the event created in Odoo did not add John@example.com,
but created a new attendee, john@example.com, because
of the sensitive casing.

Besides, give the priority to partners having
users, so if there are two partners with the same email,
one of them having a user,
e.g. John@example.com (with user) & john@example.com (without user),
set the partner having the user as attendee,
as its the one with the user who use the Odoo calendar,
and potentially the Google sync as well.

opw-1925592

closes odoo/odoo#31111
2019-02-14 11:07:25 +00:00
Raphael Collet cd3790c4ea [FIX] models: check groups on inverse fields
Before this, groups on non-stored inverse fields were not checked upon write.
The impact on existing fields is pretty small, since the inverse methods of
those fields are subject to access rights on the records they use.

closes odoo/odoo#30356
2019-02-13 10:35:09 +00:00
Lucas Perais (lpe) 61623bd17c [FIX] fields: read/write company-dependent fields without ir.property access
This is the first step to a more comprehensive handling of company-dependent
fields which are ir_properties.

With model-specific access rights, users should be able to read/update a
company-dependent field no matter their access rights on ir_property.

Before this commit, a user having access to res.partner, but not to ir.property
couldn't write on property_account_receivable/payable just because he couldn't
write the corresponding ir.property.  After this commit, he can.

OPW 1923345
2019-02-13 09:34:08 +00:00
Lucas Perais (lpe) b62d720c85 [FIX] l10n_it: change website in manifest
openerp-italia.org or odoo-italia.org are not valid websites

changing it to odoo.com

OPW 1940848

closes odoo/odoo#31110
2019-02-14 10:55:36 +00:00
Nicolas Lempereur 0857737f8c [FIX] web_editor: focus lost with inline editor
When an inline editor is eg. in a form view, the focus is always stolen
by it.

This is because we trigger a mouseup on the editor to update its
toolbars values and informations.

note: backport of 11.0's 7a453b0b7a

In 10.0 this trigger could cause a "blur" which in some instance is not
wanted (eg. inside a newline of a list view).

opw-1906581
closes #31078
2019-02-13 17:21:19 +00:00
Nicolas Lempereur 1e43c73a99 [FIX] web_editor: html widget empty value stay empty
The html widget automatically replace an empty field value by
`<p><br></p>` to be able to add content.

But this may cause unintended "onchange", since the value has "changed"
and the onchange themself could cause error when triggered at the wrong
time (eg. inside a list view with required fields).

With this changeset, the onchange is averted when the value was false
and is now `<p><br></p>`.

opw-1906581
closes #31078
2019-02-13 17:11:13 +00:00
Lucas Perais (lpe) 5b37c40cac [FIX] point_of_sale: reconcile cash returns rather than freight returns
Revert commit 296c5a2106
which was half-right: the accounting logic is correct but it overlooked
that it broke the reconciliation of cash returns
i.e. the client gives more money, and you return the change

Given that this latter use case may occur more frequently we focus on that
while we break freight returns
i.e. the client returns a product, and you give the money back

It is not possible to support both use cases because
ultimately we don't know from which order an account.move.line comes

the related PR #23356 should support both use cases
but adds a field on account.move.line

OPW 1925607

closes odoo/odoo#31037
2019-02-12 16:27:51 +00:00
Moens Alexandre 7dea5c418b [IMP] base_import_module: tell user what they actually can import
This commits adds a message to the module import wizard to make it more
clear what kind of modules can be imported through the front end.

project : RD feedback
task : [base_import_module] what it is not for.
opw-1939967

closes odoo/odoo#31057
2019-02-13 11:50:51 +00:00
Denis Ledoux 5ebcd188f3 [FIX] stock: improve performance of product quantity search
Calling `search` on `product.product` without specifying an order
will sort the products by name.

As the product name is a translatable field,
it requires to make a join on the translation table to sort
the product by their translated name.

This join is costly, and in this case it was completely
irelevant to do it, as the goal was simply to compute
a domain with only a list of product ids, for which
the order simply did not matter.

By forcing the order on the id,
we avoid the sort on the product name,
and therefore the join on the translation.
The performance is therefore improved.

opw-1930010

closes odoo/odoo#31066
2019-02-13 12:52:48 +00:00
Toufik Ben Jaa bed3b4a5cb [FIX] hr_*: access rights issues when changing employee's user
- When changing the user of a `hr.employee` record, access rights errors
  could be triggered.

  Those errors are triggered when a record (for example a leave) is
  linked to this employee and the current user has limited write
  accesses by record rules on this record.

closes odoo/odoo#31032
2019-02-12 15:47:02 +00:00
Nicolas Martinelli 0191b65b25 [FIX] stock: inventory value
- Go to Inventory > Reports > Inventory Valuation
- Select the pivot view

The top row (containing the Total) has an empty 'Inventory Value'.

This is because there is no domain on the line, so it is skipped.

We fall back on the global domain instead.

opw-1933191

closes odoo/odoo#31280
2019-02-20 13:39:36 +00:00
Nicolas Lempereur 8183f92de4 [FIX] web: ie11 autocomplete field no open itself
On IE11, in 10.0 up to master in some instance when creating a record
under some conditions the dropdown may be automatically opened and need
to be closed.

This has been pinpointed to 90c1af1151 so it seem that a combination of
fields/code/autocomplete and changing the placeholder at one time causes
the issue.

Since IE11 lie and say it is mozilla 11.0 we just apply the 90c1af1151
when the browser is chrome (we did no did this at first to have the same
behavior accross browsers).

note: there is an opened bug in chromium https://crbug.com/928305 if
solved the hack could be removed completely.

opw-1940592
closes #31271
2019-02-20 10:39:17 +00:00
Jairo Llopis 2b1d3ff82d [FIX] core: log unexpected validation exceptions
Before this patch, any exception raised by a constraint method that
were not of type `ValidationError` were hard to debug, because the
origin line was never logged.

Explicitly logging the error (with traceback) when we catch it
ensures proper contextual info, even in the absence of exception
chaining.

closes odoo/odoo#28612
2019-02-20 09:47:56 +00:00
Nicolas Martinelli f221936f8b [FIX] stock: location company
Force the location and destination location's company to match with the
picking and picking type company. This is to prevent users to move
products between companies without using a transit location, since stock
valuation is not supported.

The record rule `stock_location_comp_rule` gives access to children
companies. The domain added in the view is more restrictive, and allows,
for a company A, transfers from locations:
Company A -> Company A
Company A -> No Company
No Company -> Company A

opw-1893276

closes odoo/odoo#30952
2019-02-11 11:14:26 +00:00
Naglis Jonaitis af95efcfd6 [CLA] signature for naglis
closes odoo/odoo#30978
2019-02-11 07:05:59 +00:00