Commit Graph
123940 Commits
Author SHA1 Message Date
Romain Derie c3a81c6c7e [FIX] website_forum, website_slides: correctly check if is admin
Before this commit and since 2f7c03d9ca, the admin user has not ID=1
anymore.

Thus, some old condition were not doing what they were expected to.

Firstly, the admin was not considered as such on the forum, and if its karma
points were not high enough, it would not be possible to do anything for the
admin. Note that it was fixed in saas-12.1 with 1dac413130

Secondly, some _search functions would not return a truthy value anymore.

closes odoo/odoo#33359

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-14 11:17:45 +00:00
Nicolas Martinelli c92b0ce303 [FIX] stock_account: COGS and reconciliation
Commit 98ee15977a made the Stock Interim accounts reconciliable,
and introduced auto-reconciliation of related entries. This has the
advantage to clean-up entries in these accounts. However, since these
accounts are reconciliable, the entries will show up in the manual
reconciliation widget (expected) and the bank reconciliation widget (not
expected).

There are 2 cases where it causes issues:
- after migration from v11, the entries were not reconciliced. Although
this will be fixed in the near future, it is too late for already
migrated databases
- using MRP. A list of components i costing Xi might be used to create a
finished product of cost Y != sum(Xi). Indeed, the routing cost has to
be taken into account. In this case, the entries are not fully
reconcilied.

The result is that the bank reconciliation widget ends up with an
growing number of unreconcilied lines, and in the end making it
impossible to use.

In order to work around the issue, we prevent any account used as a
stock interim account to be included in the bank reconciliation widget.
For performance reasons, we directly search the `ir.property` table for
the corresponding accounts instead of filtering AML thanks to
`excluded_ids`.

Closes #32611

opw-1963025
opw-1967462

closes odoo/odoo#32957

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-14 06:55:04 +00:00
Andrius Laukavičius 476a53bbf0 [FIX] sales_team: ignore inactive team
When using `sales_team.team_sales_department` as fall back default
team, last condition that checks if such team can be default was
incorrect, because `active` value check was mixed with lead type check.

In other words: True or False and False => True
But intention is: (True or False) and False => False

opw 1997715

closes odoo/odoo#33316

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-05-14 10:09:24 +00:00
Damien Bouvy 99a12a94c2 [FIX] point_of_sale: useless field can degrade perfs
The field session_ids is fetched from the server for what seems to be no
good reason at all; for database with a lot of sessions (test case with
40k+ sessions), this can lead to an extremely slow dashboard.

closes odoo/odoo#33303

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-10 14:53:28 +00:00
Parth Choksi c13298fdac [FIX] sale: display right quantity in sales by channel report
By this commit, in sales by channel report of product page we are able to show the quanity of product which is just in 'sale' and 'done' state.

Before this commit, the quantity of product included every state except 'cancel'.

This commit is related to issue: #27643

closes odoo/odoo#28948

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2018-11-22 09:44:21 +00:00
Nicolas Martinelli 3303f87102 [FIX] account: reconciliation multi-company
- Create 2 companies C1 and C2
- Do not share partners between companies
- Create a partner P1 in C1:
Name: PartnerA
AccountNumber: 1234
- Create a partner P2 in C2:
Name: PartnerA
AccountNumber: 1234
- Create an invoice in C2 for P2, validate and pay
- Add the fields `account_number` and `partner_name` to the bank
statement lines for convenience.
- Create a bank statement with a line:
Partner Name: PartnerA
Account Number: 1234
- Run the following query (on which no record rule is applied for bank
statement reconciliation):

```sql
SELECT
st_line.id                          AS id,
COALESCE(p1.id,p2.id,p3.id)         AS partner_id,
p1.id AS p1,
p2.id AS p2,
p3.id AS p3
FROM account_bank_statement_line st_line
LEFT JOIN res_partner_bank bank ON bank.id = st_line.bank_account_id OR bank.acc_number = st_line.account_number
LEFT JOIN res_partner p1 ON st_line.partner_id=p1.id
LEFT JOIN res_partner p2 ON bank.partner_id=p2.id
LEFT JOIN res_partner p3 ON p3.name ILIKE st_line.partner_name
WHERE st_line.id IN (XX);
```

The result is:

|       id |   partner_id|      p1|    p2|    p3|
|----------|-------------|--------|------|------|
|        XX|           P1|    null|    P1|    P1|
|        XX|           P2|    null|    P2|    P1|

P1 should not appear in any of the results. In some configuration, P1
will be selected for matching and will trigger an access error.

Commit 1fc0b08e14 introduced the record
rules for `p3`, but was wrongly set at the end of the query. We
introduce the rules for `p3` as well as `bank`, so the result is now:

|       id |   partner_id|      p1|    p2|    p3|
|----------|-------------|--------|------|------|
|        XX|           P2|    null|    P2|  null|

Which is the expected result.

Fixes #32954
opw-1974649

closes odoo/odoo#33245

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-09 07:19:15 +00:00
Christophe Monniez babef9ecfc [FIX] web: add a small delay before starting clickEverywhere
When the clickEverywhere js test is started with base only, the
web client opens the first app by default (see openFirstApp call in
web_client.js). Unfortunately, the test clicks immediately on the apps
menu and the client does not invalidate openFirstApp.
Then, when trying to click on a filter, it does not exists anymore and
leads to a timeout.

The present timeout should solve the problem without refactoring the web
client.

closes odoo/odoo#33339

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-05-13 13:58:55 +00:00
Christophe Monniez de4278c676 [FIX] server: use SIGXCPU on supported platform only
When Odoo is stopped using CTRL+C on Windows, a Traceback is thrown
because the SIGXCPU signal does not exists on Windows.

With this commit, the check for SIGXCPU only occurs on supported
platforms.

Fixes #33311

closes odoo/odoo#33333

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-13 12:39:15 +00:00
Johan Demaret Rivarola d273bdfed7 [FIX] survey: unregistered tour
This commit aims to make unit tests pass when creating a new database
with only 'survey' installed.

The tour 'test_survey' was not loaded before reaching /survey/start,
causing tests to fail.

The js asset is now loaded within web.assets_common because the tour
should also work with the 'public' user. For this reason,
'web.assets_backend' is not a good fit.

Widget 'root.widget' was undefined too. Appropriate js file is now
loaded.

Closes #33330

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-13 12:25:22 +00:00
Denis Ledoux 611eea839c [FIX] website: don't change public user of website when saving general settings
Before this revision, the public user of your website could be changed
upon saving the general settings if you added users in the public group.

Case:
- Install website
- Add a user in the "public" group,
with a login sorted alphabetically before "public", let's say "1public"
- Open the general settings and save directly
- Notice the public user of the website has been changed to "1public",
and it did not keep "public", while you haven't changed anything
in the settings.

That said, the current heuristic to find the public user of a company
might not be the best, as you could automatically find users in the group
public that you would not like to use as the public user of your website.

In master, maybe a field `public_user_id` could be added on
`res.company`, and the `user_id` of the website could become
a related of the company public user.
In addition, when `_get_public_user` creates a new public user,
it could link it to the company in `public_user_id` field.

closes odoo/odoo#33332

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-05-13 12:25:56 +00:00
Goffin Simon 2368949959 [FIX] mrp_byproduct: Impossible to process a work order
Steps to reproduce the bug:

- Create two storable products A and B
- Create a BOM for A with B as component and A as by product
- Set this BOM as "To manufacture"
- Create a MO for A and try to process it

Bug:

Ensure one error was raised by function check_finished_move_lots defined in module mrp
because the variable produce_move must be one record.

Now, it's not possible to create a MO for A if A has a BOM with A as by product.

opw:1974863

closes odoo/odoo#33280

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-05-13 06:23:12 +00:00
Jorge Pinna Puissant d4317a67d1 [FIX] crm: default probability in crm lead
When creating a new crm lead from the kanban view, using the quick add
button, the default probability is the one of the first stage, and not
the one of the selected stage.

Now, the default probability is the one of the selected stage.

opw-1986047

closes odoo/odoo#33267

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-05-08 13:56:08 +00:00
Odoo Translation Bot 232a7283a5 [I18N] Update translation terms from Transifex 2019-05-12 01:34:58 +02:00
Antoine Prieels 2a99a28004 [FIX] point_of_sale: Taxes absent from sale detail
Since the changes introduced in cdcdebc6cb,
the tax amounts were not showing in the Sale Details Report.

closes odoo/odoo#33007

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-04-29 12:33:10 +00:00
Julien Castiaux 538f99ccce [FIX] web_editor: restoreRange on invalid node
In a web editor, add some text, select the text, add a link and
immediately discard the link modal. Traceback.

The traceback is a DOM `IndexSizeError`, that error is thrown when the
boundaries of a DOM Range (`document.createRange`) are outside of the
ranged elements. In this context, the error happens because the element
is empty and the range has an end bound set to the size of the selected
text.

Odoo wrap code does some text node split in order to attach the link
just on the selected text. If it correctly re-set the underlying
structure, it does not update the $(editable) structure used to restore
ranges.

opw-1981751

closes odoo/odoo#33257

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-05-09 13:53:22 +00:00
Johan Demaret Rivarola e11bacfe51 [FIX] sale_stock: tour dependency on sale_management
Creating a new database with only sale_stock installed will lead the
boot_tests.js test to fail.

That's because commit 033608eb11
introduces an implicit dependency on a sale_management tour. This seems
to be a mistake since sale_stock does not depend on sale_management.

The tour only makes sense if both sale_stock and sale_management are
installed though. That's why the additional steps will be run
conditionally.

After this commit, the extra steps will only be run when sale_management
is installed.

Technically, this is done by checking whether odoo._modules contains
sale_management.

opw-1964469
closes #33275

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-09 15:47:20 +00:00
Martin Trigaux de3a4c2947 [FIX] transifex: correctly escape links
This commit corrects two issues:
- new lines characters are ignored by transifex when searching (searching on
'\n' finds no match)
- quotes are ignored by transifex (it used to be escaped with \\)
- the text:'...' does not need to be escaped, it is the searched string that
must be escaped.

For instance, searching on "\n\nThis addon is already installed"
used to give:
https://www.transifex.com/odoo/odoo-12/translate/#fr/base/42?q=text%3A%27%0A%0AThis+addon+is+already+installed+on+your+system%27

and it now returns:
https://www.transifex.com/odoo/odoo-12/translate/#fr/base/42?q=text:'This+addon+is+already+installed+on+your+system'

Searching on
'%s' does not seem to be a number
used to give:
https://www.transifex.com/odoo/odoo-12/translate/#fr/base/42?q=text:'%5C%27%25s%5C%27+does+not+seem+to+be+a+number+for+field+%5C%27%25%25%28fi'

and it now returns:
https://www.transifex.com/odoo/odoo-12/translate/#fr/base/42?q=text:'%25s+does+not+seem+to+be+a+number+for+field+%25%25%28fi'

closes odoo/odoo#33279

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-09 12:55:04 +00:00
Davor Bojkić a515ee6064 [IMP] base{_address_extended}: update Croatia related data
- specify the correct separators on the language
- add the address format
- add street addres format for croatia

closes odoo/odoo#33205

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-09 13:41:01 +00:00
Martin Trigaux 26d994eadc [FIX] l10n_ch: correct translation of tax label
opw-1986715

closes odoo/odoo#33278

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-09 12:22:39 +00:00
Nicolas Seinletandwilliam-andre dbaef7de17 [IMP] account: faster reconciliation
avoid to get journal_entry_ids, to avoid pushing those ids in cache and
having them read uselessly when accessing an account.move.line
recordset.
Use search and search_read instead of ORM __get__

closes odoo/odoo#33192

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>


Co-authored-by: william-andre <wan@odoo.com>
2019-05-09 10:10:32 +00:00
Christophe Simonis f1d6a6108e [MERGE] forward port branch saas-11.3 up to 825fee2626 2019-05-09 11:12:22 +02:00
Luis González 6afec6b6b8 [I18N] sale: Remove duplicated term from pot
Commit c7773f9f introduced a duplicated term to the file .pot, which
causes the following error when trying to re-load translations:

```
ON CONFLICT DO UPDATE command cannot affect row a second time
HINT:  Ensure that no rows proposed for insertion within the same
command have duplicate constrained values.
```

This commit removes on eof the duplicates, leaving only the valid one.

In addition, field string is modified to match the one defined at the
`website_sale` module, to prevent this from happening again, as had also
in 6af6da5c.

closes odoo/odoo#33223

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-08 21:35:02 +00:00
Christophe Simonis 825fee2626 [MERGE] forward port branch 11.0 up to d01db48087 2019-05-08 18:29:32 +02:00
Christophe Simonis d01db48087 [MERGE] forward port branch saas-15 up to 82f88478cf 2019-05-08 17:27:30 +02:00
Christophe Simonis 82f88478cf [MERGE] forward port branch saas-14 up to 98b10f98bb 2019-05-08 17:13:30 +02:00
Christophe Simonis 98b10f98bb [MERGE] forward port branch 10.0 up to a48318cb33 2019-05-08 17:09:40 +02:00
Jorge Pinna Puissant 2c366acbf0 [FIX] hr_holidays: leave type in hours in new leave request
When a new request of leave is created, some fields are computed to
calculate if it's possible or not, to take the leave
(virtual_remaining_leaves, leaves_taken, remaining_leaves and
max_leaves).

These fields are computed using the fields :
allocation : hr_leave_allocation.number_of_days.
and request : hr_leave.number_of_days.

When a leave type is in hours, both of these fields are calculated
differently:
allocation: The allocation field is calculated dividing the number of
hours registered by the user per the average hour per working day.
(https://github.com/odoo/odoo/blob/d809b476819968837b61bdd78fbf101caac73adc/addons/hr_holidays/models/hr_leave_allocation.py#L236)
request : The request field is calculated by finding the real number of
requested days.
(https://github.com/odoo/odoo/blob/d809b476819968837b61bdd78fbf101caac73adc/addons/hr_holidays/models/hr_leave.py#L360)
If in the company each day have different working hour, then the number
of days calculated with the average hours didn't represent the real
number of days that the employee can take. This issue can avoid the
employee to take a leave even if he has the correct number of hours to
take it.

Now, the fields (virtual_remaining_leaves, leaves_taken,
remaining_leaves and max_leaves) are calculated using either the days
fields or the hours fields depending on the leave type.

opw-1972133

closes odoo/odoo#33244

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-08 13:12:09 +00:00
Jorge Pinna Puissant 5c33ebef5f [FIX] hr_holidays: allocation list with leave type in hours
When a leave type is in hours, before this commit, in the allocation
list the allocation is shown in days. The problem is that the number of
days its calculated with the average hour per day. If in the company
each day have different working hour, then the number of days calculated
with the average didn't represent the actual number of days that the
employee can take.

Now, in the allocation list, the allocation is shown either with days or
hours depending on the leave type.

opw-1972133
2019-05-08 13:12:04 +00:00
Nicolas Martinelli 709e59b4e9 [FIX] account: analytic account and cash basis
- Activate cash basis
- Set a tax
Tax Due: Based on Payment
Include in Analytic Cost: true
- Create an invoice, add the tax and an analytic account on the invoice
line
- Validate and pay

The analytic account is correctly set on the tax line, but it is not set
on any of the cash basis entries.

Partial backport of 079a13a349.

opw-1971751

closes odoo/odoo#33236

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-08 12:41:00 +00:00
Julien Castiaux fe6d9ed343 [FIX] calendar: getting recurrent_ids twice
The `_search` is override in `calendar.event` to return both ids and
virtual ids of recurrent events. Calling `.get_recurrent_ids` after the
search is wrong.

The entire request has been copied from the original
`_find_allowed_model_wise` function defined in `mail.message` to ensure
his correctness.

The purpose here is to ensure every virtual event id is mapped to the
real event id so the original function doesn't throw KeyErrors for
virtual ids.

opw-1972563

closes odoo/odoo#33246

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-05-08 09:56:32 +00:00
Nicolas Martinelli 6ff5498fc0 [FIX] base: barcode fallback
- Set a product barcode to a 8 letters value, e.g. 'AAAAAAAA'
- Print 'Product Barcode (PDF)' (or any other report containing the
barcode)

The barcode doesn't print.

All templates assume that:
- a 13 characters barcode is EAN13
- a 8 characters barcode is EAN8

But this assumption is too restrictive: one could want to generate
barcodes with such length without following the EAN13 or EAN8 structure.

We fall back on Code128 when the barcode generation fails.

Backport of 06cfdbaab8
opw-1981988

closes odoo/odoo#33240

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-08 09:02:45 +00:00
Nicolas Lempereur f89d2f3599 [FIX] hw_blackbox_be: typo e8574502e1
There was a syntax improvment in the commit merged but it was not
intended to be unfinished.

fixes #33228
opw-1981839
closes #33239

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-05-08 08:55:41 +00:00
Joren Van Onder 41871bf562 [FIX] payment: prevent duplicate payments with payment tokens
When paying an eCommerce order with an acquirer which doesn't
redirect (payment_flow: s2s) the "Pay Now" button is correctly
disabled after clicking it. This prevents a user from clicking it
multiple times and being charged multiple times.

When paying with an existing payment token however the button was not
disabled and the user gets no feedback his request is being
processed. Charging an existing payment token takes a while (~5
seconds with Authorize) and so it's possible users will hit the button
multiple times.

This disables the button when reusing an existing payment
token. Additionally it now uses the correct font awesome icon (fa-lock
instead of fa-plus-circle).

opw-1981064

closes odoo/odoo#33196

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-07 17:42:33 +00:00
Nicolas Lempereur b87454ee1b [FIX] hw_blackbox_be: adapt code to posbox 17 py3
Python2 uses byte strings by default and python3 text string, so adapt
the code communicating with blackbox to still only use bytestring.

Also raspbian image has been updated in posbox 17 to Raspbian 9
(stretch) so ifconfig command returns has different format output (
`ether {MAC address}` instead of `HWAddr {MAC address}`) so the way we
get the MAC address is changed.

opw-1981839
closes #33150

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-05-07 12:39:51 +00:00
Pedro M. Baeza a48318cb33 [CLA] update Tecnativa signature
Remove Tecnativa's old employees, add new ones

closes odoo/odoo#33197

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-07 08:03:28 +00:00
Nicolas Martinelli d809b47681 [FIX] web: month view drop
- Install the 'Maintenance' app
- Create a maintenance request, set a day and a duration of 6 hours
- Go the calendar view, month mode
- Move the maintenance request from one day to another

The duration is changed with a non-sense value.

In month mode, the hours are not represented in the calendar so it is
not possible to compute the `date_delay`. Moreover, when a record is
moved from one date to another (`_onDropRecord`) in month mode, there is
actually no point recomputing the duration; the `date_start` is enough.

Note that `date_delay` is used (at the time of writing) in 2 views and
absolutely not tested.

opw-1984637

closes odoo/odoo#33193

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-06 15:59:13 +00:00
Lucas Perais (lpe) 6368971ba0 [FIX] sale: invoice multiple SO: right sequence
Have sections order lines on each Sale Order
Have multiple Sale Orders on which the action "invoice order" is triggered
(to make one invoice for all of them)

Before this commit, the real invoice lines were not under their respective
section line
This was because we kept the sequence of the order line when making the order line
which makes little sense in a case where we merge the orders

After this commit, the invoice lines are under their respective section

OPW 1985080

closes odoo/odoo#33219

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-05-07 12:50:52 +00:00
Lucas Perais (lpe) b3864b8b4a [FIX] point_of_sale: connection failure right before pdf download
ONLINE:
make an order, chose a customer, click on "invoice"
Make the payment, validate

Just **before** the request to download the pdf of the invoice
go OFFLINE
(to achieve this, just put a debugger before the do_action() fires, and kill the server)

Before this commit, the button validate on the payment screen stayed inactive forever
This was because the deferred representing the invoicing flow was still pending

After this commit, we handle the case to invite the waiter to print the invoice
from the backend

OPW 1972301

closes odoo/odoo#33188

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-05-06 13:05:42 +00:00
Romain Derie fb5015d5fc [FIX] website_sale_delivery: show correct fixed price
There was 2 issues regarding delivery price when the delivery was set to fixed
price and free over a certain amount.

1. On /shop/payment step, such deliveries would have the fixed price shown on
   the badge, even if the sale order amount exceed the free over threshold.
2. When clicking on a delivery carrier, it is supposed to compute all the SO
   costs (delivery, taxes..) and display them.
   The delivery price selector would try to get the 'badge.hidden' element
   which never exists for fixed prices. Thus, it would not update the delivery
   badge price.

Now:
1. If the free over threshold is met, we display 0$ instead of the fixed price
   by calling `rate_shipment`.
   Note that `rate_shipment` can't fail in case of a fixed rate (see method).
   The only failing case is if the customer country does not match the delivery
   allowed country, but such a flow is not possible as delivery shown during
   cart payment are already filtered by allowed countries.
2. The delivery value returned after clicking on the carrier is correctly
   updated on the badge.

Fixes #31502

closes odoo/odoo#32938

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-06 14:51:43 +00:00
Manuel Vázquez AcostaandNicolas Lempereur 08425316d3 [FIX] stock: rewrite search override style for RPC
Putting *args and **kwargs confuses the function `odoo.api.split_context`.
This causes that a call to `search` via XMLRPC gets the wrong argument: takes
the first argument of ``args`` as the context.

Example which ignores the `count=True`::

```
api.call_kw(self.env['product.product'], 'search', (
    [], False, False, None, True, {'lang': 'en_US'}
), {})
```

would ignore the `count=True` and use the wrong argument for context.

Issue introduced in commit 15ea753a.

Since:

`def search(self, model=None, *args, **kwargs)`

is equivalent to:

`def search(self, args, offset=0, limit=None, order=None, count=False):`

because the call to the super will anyway call the parent method, we can
change the method arguments.

note: this is only for [10.0,saas-14] where 15ea753a is.

closes #33147

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>


Co-authored-by: Nicolas Lempereur <nle-odoo@users.noreply.github.com>
2019-05-06 11:45:49 +00:00
Nans Lefebvre 2ff0ebd63b [FIX] website_sale: render mail template when sending only one mail
The email_compose_message_wizard_form takes a default_composition_mode.
If it is 'mass_mail', the used mail template is not rendered.
Since this is basically unreadable for a normal user, this can be confusing.
Note that this is even the case if the mail is being sent on only one record.

We use the 'comment' composition mode if there is only one target record so that
the template is rendered in that case.

opw 1984381

closes odoo/odoo#33173

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-06 08:34:03 +00:00
Lucas Perais (lpe) 9cb9e227c9 [FIX] mail: ir_action have a stored field containing the model name
Make a CRM lead, assign it to a portal user
Have an automated action which add followers on create and write
From the portal, edit the lead

Before this commit, it crashed because a portal user doesn't have access to ir.model
(4a18d5744e)

After this commit, the flow works, because we use the stored model name on the action
instead of trying to read ir.model

OPW 1985570

closes odoo/odoo#33211

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-07 09:07:20 +00:00
Goffin Simon b80a6df68a [FIX] sale_timesheet: Wrong remaining value in Project overview
Steps to reproduce the bug:
- Create a project called "R&D"
- Create two service products P1 and P2 with 'Timesheets on tasks' and
'Create a task in an existing project' for project 'R&D'
- Create a SO1 with 5 P1 and SO2 with 10 P2 and confirm SO1 and SO2
- Deliver 1 hour for P1 and 2 hours for P2 (with timesheets)
- Click on "Project Overview" button

Bug:

The remaining hours for SO1 was 12 hours instead of 4 hours and the remaining hours
for SO2 was 12 hours instead of 8 hours

opw:1981903

closes odoo/odoo#33183

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-05-06 11:29:47 +00:00
Lucas Perais (lpe) ddb8fc1f62 [FIX] web: checkbox in favorites menu: don't close on click
Following f4fbaf1efa
which changes the label/checkbox structure into:
```
<div class="custom-control custom-checkbox">
    <input type="checkbox" class="custom-control-input" id="customCheck1">
    <label class="custom-control-label" for="customCheck1">...</label>
</div>
```

So, before this commit, there may have been multiple input with the same Id.
The consequence is that, when clicking on a label, the browser would take the first Id it found
which was erroneous, because all checkboxes in Favorites menu had the same Id
In reality, the use case goes as:
- open a x2m,
- search more
- Favorites > Save current search
> click on one the two checkboxes
> The dropdown closed, without checking the box

After this commit, when clicking on the checkbox in the favorites menu
the checkbox is toggled and the dropdown stays. Also, the checkboxed have now unique ids

OPW 1974587

closes odoo/odoo#33032

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-05-06 15:33:48 +00:00
Julien Castiaux 1d7a544d95 [FIX] calendar: browse record using IrRules
This reverts commit 9c4b52000f.

The fix of opw-1974599 is wrong. As the fix was fixing a corner case, it
is better to revert this one as it is breaking all recurrent events.

opw-1985498
opw-1985552

closes odoo/odoo#33206

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-07 07:55:27 +00:00
Xavier Morel 2b28dd89b8 [FIX] doc: Sphinx 2.0 compatibility
* order of parameters to translator swapped
* context['meta'] always set, defaulting to None if the document has no
  metadata
* [3.0 prep] modifying script_files deprecated, use add_javascript /
  add_js_file
* remove deprecated call to l_ (which was useless anyway as the documentation
  is not translated)

Fixes #33107

closes odoo/odoo#33187

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-05-06 13:55:44 +00:00
Martin Trigaux 07224616fa [FIX] doc: avoid duplicated reference
The status link was duplicated, making it skipped during rendering
Use correct indent

closes odoo/odoo#32843

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-06 13:38:37 +00:00
Parth Choksi 4c95cb7899 [FIX] digest: tips will be displayed properly
Currenly in the digest when you send the template, tips are not being seen.

The reason for this is, we are getting tips from the context but we dont have it in the context.
Instead, we are fetching the tips by calling the compute_tips method and assigning it to 'tips'.

Hence, this commit will remove the usage of context to get the tips as we are getting it
from the method and not from the context.

Task ID: #1918364

closes odoo/odoo#33186

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-05-06 12:41:47 +00:00
Aaron Bohy 32d696ec43 [FIX] web: blurry menu dropdown on chrome when zoom != 100%
This rev. disables Popper.js 3d transformation for positioning
bootstrap dropdowns in navbar, as this transformation causes a
rendering issue on webkit-based browsers (the text in the dropdown
is blurry).

See https://github.com/twbs/bootstrap/issues/23590

Note that it has already been disabled for the other menu dropdowns
(user menu, debug menu) by rev. 5373db1.

Another solution would have been to override the default value in
our bootstrap.js extension file, but for dropdowns that aren't in
the navbar, the dynamic positionning could be interesting.

Fixes #33096

closes odoo/odoo#33174

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-06 13:07:09 +00:00
Julien Castiaux da13c70484 [FIX] google_account: error type on wrong request
Configure google to be synchronized with Odoo, create a contact with a
wrong email address (I used `foo@.test.`), create an event in the
calendar, add the contact as attendee, sync with google. Traceback.

The traceback is a `request.exception.HTTPError` reraise by
`_do_request` in the `google.service` model on several HTTP errors, 400
amoung them. The real error is "Invalid attendee email." but the
information is lost in the error message.

The error hanlding has been rethink so it raise a user friendly error
via the UserError modal with just the error message sent by the Google
API. The logged error has been rethink to pretty print both the request
and the response.

opw-1974295

closes odoo/odoo#33058

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-05-06 12:47:04 +00:00