Commit Graph
125603 Commits
Author SHA1 Message Date
Odoo Translation Bot befd048b33 [I18N] Update translation terms from Transifex 2019-05-19 06:07:44 +02:00
Christophe Simonis dd90919c19 [MERGE] forward port branch saas-12.1 up to d785adba6c 2019-05-17 16:32:26 +02:00
Christophe Simonis d785adba6c [MERGE] forward port branch 12.0 up to c545783b95 2019-05-17 15:50:59 +02:00
Nicolas Seinlet 88de76a2c2 [FIX] website_forum: fix typo answer -> object
Closes #33324
2019-05-17 13:58:27 +02:00
Nicolas Seinlet 8968a62010 [FIX] website_forum: fix typo answer -> object
Closes #33324
2019-05-17 10:50:12 +02:00
Nicolas Martinelli c545783b95 [FIX] account: communication size
- Create 5 vendor bills with a long reference (> 1000 characters), for
the same partner.
- Select the bills and register a payment

An error arise: 'psycopg2.OperationalError: index row size 3256 exceeds
maximum 2712 for index "account_move_line_partner_id_ref_idx"'.

As mentioned, the index row size limit is 2712 bytes, which is exceeded
in that use case. Indeed, the reference of the payment is computed based
on the vendor reference of all bills.

We limit the number of characters to 2000. This seems reasonable knowing
that UTF-8 characters use sequences of 1 to 4 bytes [1]. Characters with
a code less than 128 require 1 byte only, and it is expected that most
vendor references will only use these characters. It is indeed unlikely
that special characters (such as Chinese characters, taking up to 4
bytes) are used for such references.

[1] https://tools.ietf.org/html/rfc3629

opw-1998823

closes odoo/odoo#33457

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-17 07:46:54 +00:00
Christophe Simonis 3cf9cfc985 [FIX] test_convert: set a description to new test model
Oversight of previous forward-port.
2019-05-17 13:43:00 +02:00
Christophe Simonis d8c0826b07 [MERGE] forward port branch saas-11.3 up to 37bca6ae50 2019-05-17 12:19:55 +02:00
Christophe Simonis 37bca6ae50 [FIX] test_mail: bump again query count
Enterprise make more queries...
2019-05-17 11:48:43 +02:00
Christophe Simonis 8f6c7c20d6 [FIX] test_mail: bump query count
Oversight of previous forward-port.
2019-05-17 10:51:13 +02:00
Christophe Simonis 5f17daae40 [MERGE] forward report branch 11.0 up to daf9763e6e 2019-05-17 10:00:11 +02:00
Christophe Simonis daf9763e6e [MERGE] forward port branch saas-15 up to 68b7f2a8ef 2019-05-16 21:08:52 +02:00
Christophe Simonis 68b7f2a8ef [MERGE] forward port branch saas-14 up to fe970ad5ae 2019-05-16 21:07:53 +02:00
Christophe Simonis fe970ad5ae [MERGE] forward port branch 10.0 up to 4039fc5201 2019-05-16 21:07:21 +02:00
Christophe Simonis 4039fc5201 [FIX] website_customer: no error-prone xpath expr
closes odoo/odoo#33450

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-16 16:56:34 +00:00
Christophe Simonis 7b9aa21576 [MERGE] forward port branch saas-15 up to cecb1ec77d 2019-05-16 18:19:49 +02:00
Christophe Simonis cecb1ec77d [MERGE] forward port branch saas-14 up to 556b59bce1 2019-05-16 18:11:09 +02:00
Christophe Simonis 556b59bce1 [MERGE] forward port branch 10.0 up to 90d86e07dd 2019-05-16 18:10:33 +02:00
Mohammed ShekhaandDhaval Limbuwala 90d86e07dd [FIX] tools: allow using datetime in function call
Traceback generated when trying to pass a datetime object into a function tag
in xml.

<function name="action_name" model="model_name" eval="datetime.date.today"/>

Used to fail.

With this commit now one can pass time, datetime, timedelta, relativedelta,
version, ref, pytz in function tag in xml

Task-id: 1772614
Closes odoo/odoo#29212

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>


Co-authored-by: Dhaval Limbuwala <dli@odoo.com>
2019-05-16 14:42:41 +00:00
Sébastien Theys 3b3f85670f [FIX] website: prevent crash with image gallery snippet
If destroy is called before start, there will be a crash before this commit.

At the time of this commit, this can be reproduced in master by dropping the
image gallery snippet, clicking on add images (double click, which opens the
media dialog twice for some reason), selecting 2 images to add on the
media dialog, and clicking on add. The error will be in the JS console.

closes odoo/odoo#33440

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-16 14:33:40 +00:00
Nans Lefebvre 516f22c398 [FIX] mail: remove previous attachments when changing template
Open a mail.compose.message wizard.
Select a template that generates an attachment.
Reselect it. A second attachment has been generated.
Can be repeated ad infinitum.

At template onchange, the template is rendered to overwrite the composers values
This includes the attachments.
Let L1 be the list of attachments generated by the template.
When _convert_to_write(values) is called with {'attachment_ids': L1},
it gets self.attachments_ids = L2, and generates a [(6, 0, L1 + L2)] command.
As a result attachments are only added,
the previous ones need to be removed manually.

Since c6d718f, the semantics of _convert_to_write changed.
Before, it always returned an empty list for new records (without an id).
In other words, wa always had L2 == [].
As a result we need to adapt the wizard to keep its old behaviour.

To solve it we bypass the _convert_to_write for 'attachment_ids' and directly
generate the 6 command with the list of ids L1 generated by the template.
We only do this for templates that add attachments to keep the templates
composable (a template only overwrites the values it defines).
Unfortunately, we don't have any way to know which attachments have been added
manually, so we can't preserve these (which was the old behaviour anyway).

opw 1997430
opw 1987169
opw 1998115
opw 1998782

closes odoo/odoo#33387

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-16 13:15:03 +00:00
Denis Ledoux 272359b86c [FIX] mail: accurate message notifications marked as sent
When multiple emails (`mail.mail`) are linked
to the same message (`mail.message`),
all the message notifications were being marked as sent
as soon as one of the mail was sent, and not all of them.

This is indeed possible to have multiple emails linked to a single
message, for instance when there are employees and customers in
the followers of a thread, and some must therefore have
the buttons meant for the employees ("Assign me") and some not.

In other words, it was possible notifications were marked
as sent while their associated email was not sent yet.

This revision also comes as an addition to
5d6656d739

as it was possible to receive a bounce coming from
the previous mail sent which wrote on the same notifications `email_status`
than the current message being sent before we could acquire the lock on
them (see commit message of the above mentioned revision),
as it was writing the `email_status` on more notifications that it
should have, including notifications of the previous email.

e.g
- Mail 1
- Message 1
- Recipient A, B, C
- Mail 2
- Message 1
- Recipient D, E

Let's say recipient A bounces

If the email notifying the bounce arrives during the processing of the "Mail 1",
it will be blocked until we release the lock on the `mail.notification` `email_status`
we acquire thanks to having written `exception` on `email_status` before sending the email.
But, as soon as it is unblocked (after the `cr.commit()`),
it will immediately re-attempt the delivery of the bounce email,
therefore writting "bounced" in `email_status` of recipient A,
while the transaction of the second email already began.
When the second email sending will try to write the `email_status`
of recipient A as well
(as it used to write the `email_status` on all the message notifications,
not just the one related to the current email),
it raised a concurrent update.
Therefore:
1. Interrupting the loop, as psycopg2 exceptions are raised and not passed,
2. Replay the sending of the second email a second time.

opw-1984293

closes odoo/odoo#33431

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-05-16 12:57:57 +00:00
Lucas Perais (lpe) 587357432e [FIX] account: payments cannot be grouped on company
Since cdca5d4751, the field company_id
on account.payment is not stored anymore, so, it doesn't make sense to be able to group on it

OPW 1998427

closes odoo/odoo#33428

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-05-16 11:53:18 +00:00
Christophe Simonis 624c30a3b7 [MERGE] forward port branch saas-14 up to 679a73474e 2019-05-16 11:36:32 +02:00
Christophe Simonis 679a73474e [MERGE] forward port branch 10.0 up to 0164c9dfcb 2019-05-16 11:22:53 +02:00
Olivier Dony 9fc5a4a061 [FIX] ir_mail_server, mail: catch SMTPServerDisconnected exceptions
If the smtp session was dead, it would lead the whole mail batch to fail.

opw 1949270

closes odoo/odoo#32424

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>

closes odoo/odoo#33350

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-16 07:02:06 +00:00
Olivier Dony 11f0d7cefa [FIX] mail: do not shadow SMTP errors with QUIT
When an exception is raised during the course of a normal SMTP session,
smtplib's `sendmail()` method will close the channel automatically,
so any further attempt at sending SMTP commands will fail with an
SMTPServerDisconnected error, even just calling `smtp.quit()`.
This will shadow the original error, and make debugging harder.

Fixes #1493
2019-05-16 07:02:06 +00:00
Lucas Lefèvre 0795b6ba0c [FIX] hr_attendance_presence: Inherit the right kanban view
Commit 0a76be7 fixed a duplicated xml id but forgot
to modify views inheriting the corrected xml id.

closes odoo/odoo#33377

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-15 07:52:10 +00:00
Christophe Simonis a7743e0be8 [MERGE] forward port branch saas-14 up to 64ed30e34b 2019-05-14 13:55:35 +02:00
Christophe Simonis 64ed30e34b [MERGE] forward port branch 10.0 up to 2a14eea095 2019-05-14 13:54:56 +02:00
Johan Demaret Rivarola 2a14eea095 [FIX] website_{crm_partner_assign,customer}: fix 404 when crawling
When website_customer is not installed, some endpoints are not handled
by the router, causing the following tests to fail:

- test_10_crawl_public
- test_20_crawl_demo
- test_30_crawl_admin

Those tests were failing due to /customers responding with 404.

Indeed, the route /customers is defined in website_customer, but had
some usage within website_crm_partner_assign, causing tests to fail when
the former module is not installed.

The new behavior can be explained as follows:

- module website_crm_partner_assign on its own will lose the hyperlink.
- module website_customer will now inherit the view definition in order
to wrap the targeted HTML text elements with an anchor tag.

Closes #33344

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-05-13 16:34:27 +00:00
Toufik Ben Jaa f39a974cc2 [FIX] hr_contract: allow to close employee's contracts
- There's a constraint limiting the number of contracts an employee can
have.

This constraint take in account closed contract which cause issues.
For example if you have to sign a new contract for an employee with a
running contract, you'll have to close the current running contract.
But if this employee already has closed contracts, you won't be able
to close it since they are detected as ""running"" contracts.

closes odoo/odoo#33294

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-10 13:38:36 +00:00
Prakash PrajapatiandMartin Geubelle 330b99f60c [FIX] stock: location and warehouse filter on product
Purpose: filter product by location of warehouse failed due to the
control panel refactoring (odoo#29106). This commit fix the way the
product quantities are computed when location/warehouse into filter
context.

Task:1941639

Co-Authored-By: Martin Geubelle <mge@odoo.com>

closes odoo/odoo#31316

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-10 08:07:01 +00:00
Christophe Simonis cc3a2c1bf3 [MERGE] forward port branch 12.0 up to e11bacfe51 2019-05-09 21:07:44 +02: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
fja-odoo 625eaeecaf [FIX] web_editor: session dependency missing
The session dependency was missing, it is here now.

closes odoo/odoo#33247

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-05-08 12:17:39 +00:00
Pierre Rousseau 05150281db [FIX] snailmail, snailmail_account: do not make RPC call to compute the price
Since c2b55f3e0c, a letter = 1 stamp, so we do not need to make RPC call anymore.

closes odoo/odoo#33417

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2019-05-16 08:46:49 +00:00