Commit Graph
110165 Commits
Author SHA1 Message Date
Odoo Translation Bot 8d9b196145 [I18N] Update translation terms from Transifex 2019-02-01 02:44:47 +01:00
Olivier Colson 5a8e35dc7a [FIX] account: properly manage multi currencies in invoices' outstanding payments
Before that, having a payment with amount_residual=0, but amount_residual_currency!=0 did not display it.

Also, 'outstanding credits/debits' label was displayed in case amount_residual was != 0 with an amount_currency=0 (and of course, a currency_id value was set on the aml). This could for example happen in case of partial reconciliation, were the amount_residual field is used to keep track of what will have to be written in the exchange rate difference entry when the reconciliation becomes full.

closes odoo/odoo#30362
2019-01-31 12:16:34 +00:00
Moens Alexandre 877fe07f74 [FIX] base: optimize the reading of many2one property fields
back port of commit 9820191d33f773ae21ca405da0e1226b6657ef5b
(made for v11)

project : Performance Issues
task : Geostaff : Success Pack 5 (100h) (opw-1912303)

closes odoo/odoo#29689
2019-01-29 13:12:49 +00:00
Moens Alexandre 917127ff70 [FIX] product: batch process _compute_product_pricelist
back port of commit 961a171341dabf428d5e86753b520481fd194558
(made for v11)

project : Performance Issues
task : Geostaff : Success Pack 5 (100h) (opw-1912303)
2019-01-29 13:12:21 +00:00
Moens Alexandre 26e5d0f219 [FIX]performance issue: _compute_sale_order_count
This commit simplifies the code and improves the performance
of _compute_sale_order_count.

execution time from O(n^2) to pretty close to O(n)

Project : Performance Issues
Task : Geostaff : Success Pack 5 (100h)  (opw-1912303)
2019-01-29 13:08:43 +00:00
qsm-odoo cc4d57ff14 [FIX] website_event: restore country events option
With https://github.com/odoo/odoo/commit/ac8b0fcfc5299b5ea62543b8382cb419fed4868e,
the 'country_events' class was renamed to 'oe_country_events'. This was
done correctly for JS animations and snippets but not for the 'Country
Events' option in the customize menu. This made the option useless.

This commit solves the problem by supporting the two classes (as it
is a stable fix).

closes odoo/odoo#30662
2019-01-29 15:50:07 +00:00
Lucas Perais (lpe) 4a5862a492 [FIX] point_of_sale: offline invoicing => backend printing
In a pos session:
OFFLINE
make an order with invoicing , try to validate
    The order stays there because it needs to be validated by the server
make another non invoiced order, validate

ONLINE
make another order
    At validation, all orders will be pushed to the server

Before this commit, when trying to validate the invoiced order
the report download couldn't find the order id, and crashed
This was because the order in question was already pushed
but treated as a non invoiced order

After this commit, an "warning" message is displayed to the customer
saying he/she has to print the invoice from the backend.
In most cases it is enough and acceptable, since a customer would actually leave the premises
and come back later for the invoice
It is also safer in terms of data consistency to keep pushing all orders once the connection is back

OPW 1918044

closes odoo/odoo#30485
2019-01-28 12:14:30 +00:00
Géry Debongnie dc751f20a2 [FIX] web: add exponential backoff strategy for lost connection
Before this commit, the web client had a naive strategy to handle lost
connections: it tried to poll the server every 2 seconds until a rpc
succeeds.

This works quite well from the perspective of the user, but may be a problem
from the perspective of the server.  If a server is down for a longish period,
then each users active tabs will then perform a request every 2 seconds. This
means that the server will be progressively hammered by many requests, which
will clutter the logs, and make it more difficult to gracefully recover.

With this commit, we simply exponentially increase the delay each time, and add
a little jitter to give a better distribution.

Cherry-pick of 4a3f04bcc5

closes odoo/odoo#30136

closes odoo/odoo#30596
2019-01-28 10:55:53 +00:00
Lucas Perais (lpe) 7ab26999be [FIX] account: tax in right refund account
Have a tax that has a different account for refunds
make an invoice and its refund

Before this commit, the refund's tax is still in the old account

After this commit, the refund's tax is in the account for refund defined on the tax

OPW 1907950

closes odoo/odoo#30325
2019-01-28 10:53:01 +00:00
Nicolas Martinelli 93a767a678 [FIX] pos_discount: error if misconfigured product
In case the discount product is misconfigured and therefore not loaded
by the POS, a traceback appears when applying a discount.

Add a comprehensive error message instead.

Closes #30574
opw-817527

closes odoo/odoo#30582
2019-01-28 07:46:51 +00:00
Aurélien Warnon 5a6c523cc7 [FIX] website_slides: prevent slide download for public users
Task #1930691

Purpose
=======

If the download security is set to 'Authenticated users', the route should prevent public users
from downloading the slides.

closes #30281

closes odoo/odoo#30399
2019-01-21 07:02:58 +00:00
Martin Trigaux f63569beef [I18N] base: export source terms
Fixes odoo/odoo#30483

closes odoo/odoo#30488
2019-01-23 16:37:22 +00:00
qsm-odoo caacd95a87 [FIX] web: allow to open community website menu on iOS
Before this commit, the menu to go into the backend from the website was
not possible to open on iOS without opening the right menu first. This
was because position: fixed is not able to counter overflow: hidden in
iOS. This is the fix for stable versions, the proper solution will be
done in master.

Closes https://github.com/odoo/odoo/issues/29390
task-1923151

closes odoo/odoo#30507
2019-01-24 10:55:18 +00:00
Adrian Torres f3de712d76 [FIX] ir_model: add constraint on domain field
Previous to this commit, if one were to create an ir.model.field with a
poorly constructed domain (read: SyntaxError), the server would properly
send an error message stating that an Error occurred, however this would
be too late as the registry with the bad code would have already been
reloaded, this meant that the registry would be left in an unstable
state (read: crashed).

With this commit, a constraint on the domain is added so that we confirm
that the code in the domain field is properly constructed, thus no need
to reload the registry and therefore no crash.

closes odoo/odoo#30157
2019-01-14 08:30:56 +00:00
Nicolas Lempereur 90c1af1151 [FIX] web: no chrome autocompete on many2one widget
For editing many2one fields (and partially many2many) most widget show
an autocompleting list of targeted records.

They thus have `autocomplete="off"` to prevent browser completion.

But chromium has an history of breaking `autocomplete="off"`, see:

- https://caniuse.com/#search=autocomplete
- https://crbug.com/468153
- https://crbug.com/587466
- https://crbug.com/914451
- https://crbug.com/923895

It seems that since chromium 71, the heuristic to ignore
`autocomplete="off"` has become more aggressive and for example if there
is at least 3 fields like an address in a page, chromium will ignore
`autocomplete="off"` for the fields like an address.

So for example the eidting the many2One field with placeholder "Country"
in a contact page now has a browser autocomplete menu that is:

- hidding the many2one autocomplete
- going to save empty country it appeared visually filled if the
  autocomplete result was selected.

With this changeset, the placeholder in the many2one instance is
interspersed with U+FEFF charcters (ZERO WIDTH NO-BREAK SPACE) so the
browser does enable the autocomplete feature by force.

This should thus remove the issue (until it is fixed by chromium) in the
case of field named "Country" or matching other regexes in this file:

https://github.com/chromium/chromium/blob/cdb1b2073f12/components/autofill/core/common/autofill_regex_constants.cc

U+FEFF has been chosen instead of more recommended characters because
other have been shown erroneous for printing in some windows
configuration (see cb2a3afa7).

10.0 version of #30439
opw-1930588
closes #30439
closes #30449
2019-01-23 01:09:22 +00:00
Florent de Labarre d3affc5798 [FIX] sale: don't send duplicate email
closes odoo/odoo#30455
2019-01-23 07:31:50 +00:00
Denis Ledoux a409627602 [FIX] ir_ui_view: do not change view mode when just changing the inherit
Some views have the primary mode while having an inherit_id view
In such views, if the user wants to change the inherit_id,
the mode must remain primary.

The use case behind this is a user who want to change
the inherit_id view of the view
product.product.form (product.product_normal_form_view)
to another view.
This view is in primary mode while having an inherit_id
(product.product_template_form_view).
In such a case, the primary mode must remain,
otherwise the view will no longer be opened by default
when opening a product.
Indeed, when searching the default form view of a model,
it only searches for primary mode views for this model.

The `all` is there because this is an `api.multi` method.
We could consider adding a `self.ensure_one`,
but it breaks the API if someones calls this method with multiple records.
This is likely to happen, as this method is used
in `write` which is likely to be called with multiple records.

In my opinion, in master, this should be replaced by an
onchange so the user can see the change of mode
when he adds or remove an inherit_id for a view.

opw-1916324

closes odoo/odoo#30241
2019-01-15 16:43:08 +00:00
qdp-odoo c5a8e39758 [FIX] l10n_be_intrastat: adapt to new regulation for belgian intrastat
This is essentially a backport of module l10n_be_intrastat_2019 made for
Enterprise v12 + the refactoring needed on the original v10 module to
allow the changes to apply where needed.

Was requested by opw-1887019

closes odoo/odoo#30400
2019-01-22 07:22:59 +00:00
Christophe Simonis a909bb3391 [FIX] bus: correctly compute presence of partners with multiple users
closes odoo/odoo#30344
2019-01-18 10:39:00 +00:00
Filippo Iovine 169843d8d3 [CLA] add Filippo Iovine to levelprime CCLA
closes odoo/odoo#29072
2019-01-14 14:51:23 +00:00
wan 50bae1c0c5 [FIX] account: journal dashboard graph wrong value
OPW 1918926

Current behavior:
  The sql query groups by date,id in a intermediary table instead of the result. This allows to get data in the wrong order if the statements were not produced sequentially. The fill values are computed in the wrong order and may override correct values.

Desired behavior:
  There is no override of the values correctly computed.

closes odoo/odoo#29936
2019-01-17 12:37:36 +00:00
Lucas Perais (lpe) ba39efdfc6 [FIX] base: merge contacts linked to by an o2m field with caps
Define a field on a model as:
- o2m to res.partner
- the field's column, hence its name, has capital letters in it
(studio does that)

create two objects of that class, each one linked to a different partner with the new o2m

merge the partners

Before this commit, the object linked to the second partner, was deleted
This was because merge partner sql requests did not quote the column name

After this commit, the second object still exists

This commit is tested in v12.0 with PR #30300 only. In v10.0 it is not testable as
the model concerned is in CRM, and that no new fields in business modules can be added in stable

OPW 1925060

closes odoo/odoo#30301
2019-01-17 09:59:23 +00:00
Julien (juc) Castiaux 357b374a7e [FIX] mail: URL with semi-colon
When posting a URL containing a semicolon, odoo stops the link
before the semicolon instead of continuing the link to the end
although it is a valid characters in URL (see RFC-3986)

e.g. the url "example.com&foo;bar" matches "example.com&foo"
     instead of the whole link

opw-1918367

closes odoo/odoo#30198
2019-01-15 09:02:12 +00:00
Nicolas Martinelli 180ace7b1b [FIX] product: unwanted attribute values in name
- Create the following attributes with values:
  Size: S, M, L, XL
  Color: Black, White
- Create a product template with the following attribute values:
  Size: S, M, L, XL
  Color: Black

The `name_get` of `product.product` returns `Name (SIZE, Black)` while
it should only return `Name (SIZE)`.

When using `attribute_id.value_ids`, the list of values contains all
possible values of the attribute, not only the values which apply to the
given product. In this case, it contains 'Black' and 'White', therefore
the condition `> 1` is verified and the attribute is kept for display.

We go back to the original filtering, and add `attribute_line_ids` in
the list fields read in order to avoid prefetching.

opw-1922140
opw-1922447

closes odoo/odoo#30273
2019-01-16 14:48:33 +00:00
Joren Van Onder 302d8a5264 [FIX] point_of_sale: allow refunds on non-cash journals
Cherry pick of 5b769650d6 in version 11.0

A customer can pay an order with a non-cash journal (e.g. a credit
card through a stand-alone terminal).

When this order has to be refunded later it should be possible to do
so on that same journal.

Some code prevented this from happening, notably a check in
order_is_valid which explicitly prevented this for an unknown
reason. There is no explanation in the
commit (4647f896a4) introducing that.

This commit allows the following:

1. input what you want to refund with a negative qty
2. click 'Payment'
3. click the Credit Card (type Bank) journal
4. (amount is auto-populated)
5. click 'Validate'

opw-805302
opw-1913731

closes odoo/odoo#30218
2019-01-16 14:19:13 +00:00
Nicolas Martinelli 614babd1e7 [FIX] account: bank statement with many AML
- Create a bank statement with more than 80 lines (therefore more than
  80 AML)
- Reconcile the lines
- Go back to the bank statement, and try to add a new line

An error arise:
"You cannot do this modification on a posted journal entry, you can just
change some non legal fields"

The error arise on the `move_line_ids` field on which the web client
tries to write.

Actually, this field is hidden since it is only used in the domain of a
stat button. We can make it read-only.

opw-1921138

closes odoo/odoo#30266
2019-01-16 11:09:21 +00:00
Iryna Vyshnevska 92e4c4c347 [CLA] signature for ivyshnevska
Backport to 10.0 of 3b14a7daa6

closes odoo/odoo#30090
2019-01-16 10:03:03 +00:00
Manuel Vázquez Acosta 6ac32c655e [FIX] survey: don't disclose the survey via print
To avoid bigger changes, only verify if the login is required.
A proper refactoring has been implemented in master at 9771fdfe8f

Closes odoo/odoo#30166
2019-01-16 12:51:43 +01:00
larisa 6edfadbdd2 [FIX] hr_payroll_account: correct account move lines creation
The super call of action_payslip_done executes the method compute_sheet.
Without this compute_sheet call, there is no salary lines and no accounting
move is created.

closes odoo/odoo#29737
2019-01-14 15:16:44 +00:00
Manuel Vázquez Acosta 9c6d969775 [CLA] Add Larisa to Merchise Autrement. 2019-01-14 15:05:40 +00:00
Jeremy Kersten 6e3661d53f [FIX] payment_sips: allow to customize key_version
Some sips provider don't use 2 as key_version.
E.g. mercanet uses '1' as production key.

Now we allow to override it in Ir Config Parameter for stable version.

Todo:
Need to make it customizable by end user into the configuration of acquirer.

Courtesy of BEK for reporting

opw-1916316

closes odoo/odoo#30185
2019-01-14 12:27:09 +00:00
Denis Vermylen e1767490e9 [FIX] purchase: loading time on partners with many children
When loading a partner form view, the ORM prefetches the computed fields
purchase_order_count and supplier_invoice_count for all the related
partners as well (parent, children, ..).

Instead of reading the orders and invoices once per partner, we group
them all together.

opw 1919933

closes odoo/odoo#29788
2019-01-02 16:08:55 +00:00
Raphael Collet 1b434ed8c3 [FIX] models: make prefetching more specific in read()
Commit a07a076c45 restricts the prefetching to
`self` when accessing the fields to return.  This is too restrictive, as it
cancels prefetching of secondary records in computed fields.  In this commit we
limit the scope of the restriction to `self`'s model only; this fixes the
original issue without impacting other models.

closes odoo/odoo#30133
2019-01-11 11:01:22 +00:00
Aurélien Warnon e2bdb65321 [FIX] website_slides: hide slide download button if not available
Task #1923443

Purpose
=======

The slides on the website showed the 'download' button regardless of the value of the 'download_security' field.
If the value is 'none', meaning that the slides are never downloadable, the button should be hidden.

closes #29904

closes odoo/odoo#30051
2019-01-10 14:52:15 +00:00
Christophe Simonis 5f12e244f6 [IMP] base: compute implied groups in SQL
SQL improve the speed of the implied group
VS the orm version.

closes odoo/odoo#30108
2019-01-10 13:48:40 +00:00
Jorge Pinna Puissant b131658966 [FIX] account: error in Base amount tax
opw-1917605

Before this commit, when accounting is set to global rounding, the base
amount per tax is not correctly calculated.

Now, the Base amount per tax is calculated adding the rounded lines.

To test this issue, you need to set to global rounding and create a
customer invoice with the following lines :
line 1 = Qty:40; unit price:2.27; tax:15%; discount: 10%
line 2 = Qty:21; unit price:2.77; tax:15%; discount: 10%
line 3 = Qty:21; unit price:2.77; tax:15%; discount: 10%

When the invoce is printed, you would notice that the amount is 186.43
and it should be 186.42.

closes odoo/odoo#30021
2019-01-08 13:13:36 +00:00
Francisco Fernández d4024a713c [CLA] PlanetaTIC signs Odoo CCLA 2019-01-07 15:34:10 +01:00
Lucas Perais (lpe) 0e0c726805 [FIX] purchase: don't change status when writing a note through the composer
Have a RFQ in draft. Log a note or send a new message, but use the full composer to do it.

Before this commit, the RFQ was set to sent

After this commit, it stays rightfully in draft
It is mark as sent, only if the button SEND RFQ is used

OPW 1908094

closes odoo/odoo#29902
2019-01-04 13:18:14 +00:00
Jorge Pinna Puissant 9cf6662880 [FIX] account: compute_fiscalyear_dates non leap years
Before this commit, when the fiscal year was setting to 29/02.
The function that compute the fiscal year dates gives an error.
This occurs when the date passed as parameter wasn't a leap year.

Now, for the non leap years we use the 28/02.

opw-1917035

closes odoo/odoo#29932
2019-01-04 10:23:44 +00:00
Alexey Pelykh 1ffc485689 [FIX] hr_holidays: extra space in state check
The condition was never validated

closes odoo/odoo#29898
2019-01-04 10:18:30 +00:00
Alexey Pelykh 11e5688d0f [CLA] Brainbean Apps OU signs Odoo CCLA 2019-01-04 10:18:24 +00:00
Raphael Collet a07a076c45 [FIX] models: avoid prefetch hell when reading fields
The method `read()` may be very slow when reading relational fields and
computed fields, because the computed fields can be computed on a recordset
that is larger than expected.

The issue occurs on model 'res.partner' when reading fields 'child_ids' and
'purchase_order_count', for instance.  Suppose we read those two fields on a
partner with 1000 contacts.  First, the one2many field is read from the
database and stored to the cache; the latter adds the value ids to the
prefetching of 'res.partner'.  Then, the fields are fetched from the cache.
When 'purchase_order_count' is accessed on the partner, the field is computed
on all its children as well...

closes odoo/odoo#29867
2019-01-03 12:45:48 +00:00
wan 9ef7802520 [ADD] l10n_nl: tax codes for 9%
closes issue #29352
The Dutch taxes will change the low tax 6% to 9% on 01/01/2019. Please add these tax code in the system and also change the affected fiscal positions. Both 6% and 9% needs to exist during the transition period.

closes odoo/odoo#29374
2018-12-18 09:48:41 +00:00
Odoo Translation Bot 076c835544 [I18N] Update translation terms from Transifex 2019-01-01 02:42:55 +01:00
Thibault Delavallée cc217569b7 [FIX] base: fix name_search on res_partner when searching on linked users
Currently name_search on res_partner holds code to be done by a customized SQL
query allowing to speedup the search [1]. However when dealing with given args
there may be a crash if there is a domain based on user_ids fields.

Indeed this field is defined as auto_join [2]. It means the result of get_sql
returns where parameters based on joined tables. Those tables are not available
in the from clause in the original query.

This commit fixes that issue by correctly taking the from_clause from get_sql.
That way joined tables are available. Small update of the query is necessary
as fields are now res_partner.{id/email/vat/reference} as there may be several
tables linked in the query.

A test has been added to avoid regression.

[1] See https://github.com/odoo/odoo/commit/05ec12692f99b69924765fd0ce384632547f03f9 for a recent modification
    and implementation of this query, even if it exists since a looooong time
[2] See https://github.com/odoo/odoo/commit/db8203c27a21acdbcad2cf1c394b6fea3cf13688 for the auto_join addition

closes odoo/odoo#29827
2018-12-21 15:40:32 +00:00
David Tran 6bf8b25b70 [IMP] base: Vietnam Dong should have 1.00 as rounding.
No decimal part in Vietnam Dong (đ - Việt Nam Đồng)

closes odoo/odoo#29650
2018-12-19 14:24:43 +00:00
Denis Ledoux 5856dab380 [IMP] product: name_get, use mapped to gain some memory
This revision is related to
12df3c6a98

The above revision serve its purpose as well,
but by avoiding to store the result in a variable,
and using the records cache instead,
we gain some memory, which is noticeable
when there are hundred of thousands products.

The sudo() is important, as it must be the
same environment then the above call to read
to use the same cache.
Otherwise the values won't be in the cache
of self (without sudo),
and it will go get it and prefetch other fields
in the database.
2018-12-19 18:49:14 +01:00
Denis Ledoux 12df3c6a98 [FIX] product: name_get, products can share the same template
Oversight in revision
a91ffcf1a7

Multiple products can have the same template.

Passing multiple times the same template id
to the search domain to get the sellers
works, but better avoid the repetition
for the performances.
2018-12-19 18:28:23 +01:00
Denis Ledoux a91ffcf1a7 [IMP] product: product & template name_get performance
By prefetching only the fields required for the `name_get`

`product.product` & `product.template`
have a huge number of fields,
and prefetching them just to compute
the name is overkill.

Especially, as the browse was done using
sudo, the prefetch was a bit useless as
it was stored in the sudo user cache,
which was most-likely not used afterwards
by the callee of name_get

For a database with 50.000 products,
this reduce the processing time
by 15 (from 60 seconds to 4 seconds measured)
2018-12-17 15:00:45 +01:00
Nicolas Martinelli 8373bafbc2 [FIX] account: missing translation
- Install a second language, e.g. French
- Set Parter A language to French
- Create an invoice for A with a date due in the past
- On the partner form view, print the 'Due Payments'

The body of the letter is not translated in French.

Something quite weird appears:
- The corresponding string is exported in the `stock` module
- It is linked to the demo data `stock.res_company_1`, which corresponds
  to 'My Company, Chicago'.

Therefore, the translation cannot be found by the corresponding query
generated in `_generate_translated_field` and `_read_from_database`:
```
SELECT "res_company"."id" as "id",COALESCE("res_company__overdue_msg"."value", "res_company"."overdue_msg") as "overdue_msg" FROM "res_company" LEFT JOIN
                (SELECT DISTINCT ON (res_id) res_id, value
                 FROM "ir_translation"
                 WHERE name='res.company,overdue_msg' AND lang='fr_BE' AND value!=''
                 ORDER BY res_id, id DESC)
             as "res_company__overdue_msg" ON ("res_company"."id" = "res_company__overdue_msg"."res_id")
                        WHERE "res_company".id = 1  ORDER BY "res_company"."sequence" ,"res_company"."name"
```

Indeed, `res_company.id` is 1, while `res_company__overdue_msg.res_id`
is 3.

The root cause has been solved in v11, to we only export the necessary
term.

opw-1908337

closes odoo/odoo#29525
2018-12-13 17:08:15 +00:00