Commit Graph
126167 Commits
Author SHA1 Message Date
Martin Trigaux 00ef2653da [MERGE] Forward port of 12.0 to saas-12.2 up to 3b1d00acda
closes odoo/odoo#34732

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-10 10:14:06 +00:00
Martin Trigaux 3b1d00acda [MERGE] Forward port of saas-11.3 to 12.0 up to db5261b19e
closes odoo/odoo#34723

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-10 08:27:12 +00:00
Martin Trigaux db5261b19e [MERGE] Forwardport of 11.0 to saas-11.3 up to 198b5ecce2
closes odoo/odoo#34719

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-10 07:14:38 +00:00
Martin Trigaux 198b5ecce2 [MERGE] Forwardport of saas-15 to 11.0 up to 239af6ee99 2019-07-10 08:58:50 +02:00
Martin Trigaux 239af6ee99 [MERGE] Forward port of saas-14 to saas-15 up to e5ec5f5f612 2019-07-10 08:46:12 +02:00
Martin Trigaux ce5ec5f5f6 [MERGE] Forward port from 10.0 to saas-14 up to 0ec0a4a32e 2019-07-10 08:35:05 +02:00
Julien Castiaux 5038f777a0 [FIX] web: prevent db_manager modal close on empty pwd
Go to the database manager, configure a password either via the
interface either via the `admin_passwd` `.odoorc` config file. Click on
the backup menu, let the `password` field empty and submit the form. The
modal is closed without any warning and no query is sent.

The problem is that even if the field is marked as `required`, there is
a event listener that catch the `onsubmit` event and close the modal
even if it is not valid.

opw-2031461

closes odoo/odoo#34669

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-07-09 13:44:41 +00:00
Julien Castiaux fa58a842f4 [FIX] mass_mailing: company logo on unsubscribe url
Setup a multi-company account and multiple website (one for each
company), create a mail campaign from a different company than the
superuser, send the emails and unsubscribe, the company logo is the logo
of the company the superuser is in instead of the logo of the company
sending the email.

opw-2026528

closes odoo/odoo#34701

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-09 13:37:53 +00:00
Xavier Morel 3e63d8efce [ADD] core: support for parent.xxx in modifiers of o2m sub-fields
closes odoo/odoo#34699

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-07-09 12:41:41 +00:00
Alexandre Kühn f9ead39f5f [FIX] mail: rename direct message chat
Before this commit, when a direct message chat was renamed, it
crashed with the following error:

`TypeError: Cannot read property 'toLowerCase' of undefined`

This occurs because the name of the dm chat changed from the RPC
response. However, no new name was provided, thus it sets its
name to `undefined`.

Test has been adapted in order to reflect that the server does not
response with new name after RPC `channel_set_custom_name`.

closes odoo/odoo#34641

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-07-09 12:37:07 +00:00
Richard Mathot 0ec0a4a32e [FIX] models: avoid Unicode error when translating that error message
The patch fa492d87f4 has been backported
from Odoo 12.0, that runs on Python 3.

The string '\n\n({} {}, {} {})' to be formatted is a byte-string in
Python 2, while the return value of _() is always a unicode-string.

As format() is (too?) nice, it attempts to convert the unicode-strings
into ascii in order to inject them in the format pattern.
With some languages that are written in ascii, this works -- by chance.
When you use non-ascii languages like Japanese, it fails.

We then fix that issue by using unicode-strings in the formatting
pattern.

#OneCharacterPatch B-)

opw-2032016

-----------------------------

For full technical understanding:

Python 2.7.16 (default, Mar 11 2019, 18:59:25)
[GCC 8.2.1 20181127] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> '{}'.format('test')
'test'
>>> '{}'.format(u'test')
'test'
>>> '{}'.format(u'エ')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\u30a8' in position 0: ordinal not in range(128)
>>> u'{}'.format(u'エ')
u'\u30a8'

closes odoo/odoo#34698

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-07-09 12:26:46 +00:00
Goffin Simon 88a12afdf4 [FIX] purchase: purchase VATs in a multi-company
Steps to reproduce the bug:

- Create two companies C1 and C2 where C2 is the child of C1
- Create two purchase taxes T1 and T2 where T1 is in C1 and C2 is in T2
- Create a prodcuct P with T1 and T2 as supplier taxes
- Be in C1 as current company
- Create a RFQ and add P

Bug:

T1 and T2 were set on the order line of P instead of T1

PS: This fix is insired from product_id_change in model sale.order.line

opw:2032113

closes odoo/odoo#34658

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-08 12:09:51 +00:00
Nans Lefebvre a3e504eff5 [FIX] sale_timesheet: let employees officers/project users access private tasks
Have a user U that is Project User, Timesheets User, Employeed Officer.
Give him access to a private task T (by adding U as a follower of T)
on private project P.
Because of Employeed Officer rights, view_task_form2_inherited is rendered.
This shows field is_project_map_empty, which computation depends on project_id.
If U does not have access to P, then this triggers an access error, so the Task
cannot be displayed.

It is in general a legitimate configuration to allow U to interact with T
without being given full access to P, since it works in all cases but the rights
described above.
Since the computation of is_project_map_empty is the only blocking point,
we put it in sudo.

opw 2031124

closes odoo/odoo#34676

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-07-09 10:34:46 +00:00
Lucas Perais (lpe) 674ee035ca [FIX] account: vendor display name multicompany
In multicompany mode,
/!\ Adress book sharing should be deactivated

User A in company A creates a vendor bill without a partner

User B in company observes the list. The new bill is present

User A changes companies and goes to company B
User B doesn't have access to company B

User B reloads the list

Before this commit, there was an access right error on User B side because the partner associated
with User A changed company, and is now unreadable from User B perspective

After this commit, there is no crash and we have the string: Created By User A in the list
in place of the vendor display name

OPW 2028451

closes odoo/odoo#34668

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-08 15:03:50 +00:00
Jairo Llopis fb95cf7b51 [FIX] mass_mailing: Do not alter method signature
Before this patch, this method was altering the signature of its parent method, moving the position of `failure_type` to 1 and making the other 2 arguments kw-only.

It seems this accidentally didn't break anything because all calls happened to be done in kwarg mode. However, it's very possible that a downstream module that is not based on `mass_mailing` and makes positional calls gets broken when `mass_mailing` is installed.

The fix is to respect original method signature.

closes odoo/odoo#34648

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-07-09 07:14:57 +00:00
Damien Bouvy b5f61bfaad [FIX] payment_authorize: P3 version of 88de931141
closes odoo/odoo#34667

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-08 14:41:41 +00:00
Damien Bouvy 63a5b44380 [FIX] payment_authorize: avoid dismissing callback
The callback will usually check the transaction's state during
its execution, hence it should be executed after the state change

closes odoo/odoo#34666

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-08 14:05:18 +00:00
Julien Castiaux e94a789b13 [I18N] portal: make 'Accept & Sign' translatable
Move inside a node so the term can be exported (t-esc value are not
translatable)
opw-2031550

closes odoo/odoo#34663

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-08 13:20:48 +00:00
Jairo Llopis 743c790fa1 [FIX] mass_mailing: Proper translation string
Computed expressions cannot happen inside a translation string.

closes odoo/odoo#34643

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-08 12:09:13 +00:00
vrenaville 7be62eb852 [FIX] account: do not assing on empty recordset
If a browse record is empty, assigning a value will fail
Introduced at c04065abd8

Closes odoo/odoo#34521

closes odoo/odoo#34654

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-08 11:42:31 +00:00
Jorge Pinna Puissant a8dfc7fb73 [FIX] website_payment: consider authorized transactions as done
Before this commit, when a transaction has as status 'authorized', the
transactions' confirm page gives an error : 'Oops! There was a problem
with your payment.'

Now, the page gives the same message as when the transaction has the
status 'done' : 'Your payment was successful! It may take some time to
be validated on our end.'

opw-1984325

closes odoo/odoo#34652

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-07-08 11:15:44 +00:00
Florent de Labarre fb1839fa17 [FIX] mrp: cancel move when click on Mark Done
[FIX] mrp: Manufacturing cost analysis report

Steps to reproduce the bug:

- Create a finished product P with a manufacturing BOM B
- Set two components on B C1 and C2
- Create a MO with P and process it(plan and produce it)
- Unlock the MO and set the consumed qty of C1 to 0
- Lock and click on Mark as Done
- Click on Cost Analysis

Bug:

C1 was displayed in the report with a qty = 1.0

Fine tuning of this commit: cb4afb263b

opw:2010912

closes odoo/odoo#34642

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-08 09:13:15 +00:00
Romeo Fragomeli 885a7b5689 [FIX] web: jSignature not able to sign on "pen touch" device
Before this commit, on a device with a "pen" (e.g. Surface Pro, ...),
it was not possible to sign a document on some browsers recently
updated (e.g. Chrome, Firefox, ...) only Internet Explorer was working.
Instead of drawing continuous lines only few dots appeared.

For Chrome and Firefox we have to catch events with "addEventListener".
For Edge we add touch-action property to convert touch events into click.

Steps to reproduce:
1) Go to sales app
2) Then go to quotations (menu Sales)
3) Create a new quotation
4) Click on preview
5) Click on the "Accept" button at the end of the preview
6) Use the "pen" to draw the signature (BUG)

We use a custom version of the jSignature lib (c.f. odoo/odoo@eddcb46),
so we have to patch the file in the Odoo repo with a mix of some
pull request found in the official repo and forks.

Link:
https://github.com/brinley/jSignature/pull/109
https://github.com/brinley/jSignature/pull/159
https://github.com/willowsystems/jSignature/pull/96

opw-2029684
2019-07-08 10:23:50 +02:00
Jeremy Kersten 127ada424d [FIX] website: improve test with more precise trigger
Why not... If it can avoid a red branch.

closes odoo/odoo#34626

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-05 15:20:05 +00:00
Lucas Perais (lpe) a0fa785eb5 [FIX] account: auto reconcile model with tax
Set an automatic reconciliation model with a tax
Create a bank statement on which one line will be caught by that model

Click on reconcile to get to the reconciliation widget
Observe the account move lines creates

Before this commit, the move line representing the tax amount
(and in the account for taxes) did not have a tax_line_id, which is
a reference to the tax that made the line exist
This messed up tax reports

After this commit, the move line of the tax has a reference
to the tax it originated from
The tax reports are correct

OPW 2006826

closes odoo/odoo#34627

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-05 15:10:26 +00:00
Odoo Translation Bot 57320593f7 [I18N] Update translation terms from Transifex 2019-07-07 01:19:07 +02:00
Lucas Perais (lpe) ccb8896fe3 [FIX] account: introduce a form view for account.move.line for mobile
On a small display, go to accounting > journal entries > create
In the (now kanban) list of account move lines, click ADD
Then, try to choose an account

Before this commit:
The list of accounts was empty.
This was because the form view spawned was the automatic generic one
The generated view did not have thr necessary structure to get fields' value
from the parent form view.
In this case, the domain of the name_search for account.account was wrong

After this commit:
The flow works on mobile as on desktop. The form view's arch is a 1 to 1
copy of the list view in terms of fields and their definition

OPW 2030837

closes odoo/odoo#34601

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-05 07:31:12 +00:00
Xavier Morel 7b33689b7b [IMP] base: better and less conflicting version of e210faa676
Backport somewhat improved version of this fix (we don't need to check
for the existing extension since we're not doing anything if there is
an extension at all) merged into later branches, to avoid forward-port
conflicts.

closes odoo/odoo#34509

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-07-05 05:53:29 +00:00
Nicolas Martinelli 6cf09b9a3c [FIX] purchase: correct average cost tests
Correctly forward-port baf1580be4 by
backporting 38eb5346c7.
2019-07-04 19:45:25 +02:00
Christophe Simonis 1debaa89f1 [MERGE] forward port branch 11.0 up to 56ce29e71f 2019-07-04 17:35:07 +02:00
Jorge Pinna Puissant 56ce29e71f [FIX] web_editor: tel url in werkzeug parser
Before 8557bcf the URLs were never rewritten for multilang, which was an
error and could duplicated the number of requests on frontend.

Since 8557bcf the URLs are rewritten. In Odoo the werkzeug library is
used to parse the URLs (this is similar to python parsing URL but works
in python2 and python3 the same), and in this particular instance it
chooses that tel:800800 is website http://tel:800800 and not a telephone
number.

The problem is when the url uses the uri 'tel:' and only numbers as a
phone number, if the user uses the global format for telephone number
(with the +) or using a separator for the numbers (e.g. '-' , '/'), in
these cases there are no problems parsing the url (phone number RFC:
https://tools.ietf.org/html/rfc3966).

This commit changes the uri 'tel:' to 'tel://' this one is correctly
parsed by the werkzeug library.

opw-2029844
closes #34306

closes odoo/odoo#34586

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-04 13:50:50 +00:00
Christophe Simonis a3dcde21d5 [FIX] test_rpc: use relative import (P3 compat)
Oversight of previous forward-port.
2019-07-04 11:54:23 +02:00
Christophe Simonis 2c81916f5d [MERGE] forward port branch saas-15 up to aaaf32fedd 2019-07-04 11:39:07 +02:00
Christophe Simonis aaaf32fedd [MERGE] forward port branch saas-14 up to c816efe7de 2019-07-04 10:48:04 +02:00
Christophe Simonis c816efe7de [MERGE] forward port branch 10.0 up to 24b677a359 2019-07-03 19:23:14 +02:00
Christophe Simonis 24b677a359 [FIX] test_rpc: more robust tests
- mute logger to avoid logging bad queries
 - enforce fields strings

These changes will forbid tests to fail in following versions.
2019-07-03 19:20:31 +02:00
Christophe Simonis 565165a6c8 [MERGE] forward port branch 10.0 up to acbdd526e6 2019-07-03 18:32:16 +02:00
Lucas Perais (lpe) 59c663ae42 [FIX] point_of_sale: correct compute fixed tax negative quantity
Have a product with a fixed amount tax.
Make a "return" of that product in the pos (i.e. negative quantity)

Before this commit:
- The amount of the return was `tax_amount + product_amount` instead of `-1 * positive_total_amount`
- The amount differed from what can be observed in sales

This was because the sign of the quantity was applied twice

After this commit,:
- the amounts of positive and negative amounts are symmetrical
- they match the behavior in sale

The logic is very similar to bb72dea98d

OPW 2026278

closes odoo/odoo#34548

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-03 13:25:01 +00:00
Deivis Laya 09b1cd810a [CLA] Update Vauxoo's CLA
Incorporate Deivis Laya (deivislaya) as Vauxoo's contributor
I confirm I have signed the CLA and read the PR guidelines at
www.odoo.com/submit-pr

closes odoo/odoo#34569

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-03 21:24:18 +00:00
Paul Morelle 79ef03d4cc [FIX] base: always send HELO when connecting SMTP
smtplib.SMTP API calls such as .sendmail() or .login() make sure on
their first line that this command is sent, by calling
.ehlo_or_helo_if_needed().

However, test_smtp_connection() does not use SMTP.sendmail() to simulate
sending email, or the email would really be sent.
Instead it uses the low-level API SMTP.mail() which does not make sure
that HELO was sent.

The connection test could be fixed by ensuring that this command was
sent to the server in the test method. However, this could lead to
inconsistent cases where the connection test passes whereas another
usage in the code fails because the command was not sent.
For example, someone could use the low-level API for some reason.

EHLO could have already been sent because if authentication is enabled
smtplib.SMTP.login() calls ehlo_or_helo_if_needed(). Therefore it is
correct to call it ourselves at the end of our connect() method.

STARTTLS sends a first EHLO, negociates the encryption, and leaves the
state without the second EHLO, which should still be sent to the server,
as stated by RFC 3207, in section "4.2 Result of the STARTTLS Command".
https://www.ietf.org/rfc/rfc3207.txt

closes odoo/odoo#34550

Signed-off-by: Julien Legros (jle) <jle@odoo.com>
2019-07-03 11:56:35 +00:00
jev-odoo acbdd526e6 [FIX]l10n_fr_fec: better remove new line
Fix/improve commit d870749d79
that was removing line feed (\n).

In this one, we also remove carriage return (\r)
to address all cases.

closes odoo/odoo#34536

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-03 07:40:43 +00:00
jem-odoo f8e41c6b00 [FIX] sale_expense: avoid breaking "Sale: Own Documents Only" rule when reinvoicing
In sale_expense, there is a rules allowing employee to see all confirmed sales
order. This rule breaks the one from sale "see own document" for salesman user.
The initial goal of this rule is explained in Task-29303: we wanted to ease the
reinvocie flow. For an employee, is it diffuclt to know on which analytic account
the expense should be reinvoice (no knowledge of that, no "analytic rights", ...).

Anyway, this rule brings more problem than expected and prevent people to work.
So, we decided to functionnaly revert the feature by desactivate the rule and hide
the sales order field on expense for user that are not salesperson. Salesperson can
set the SO, and the onchange will set the analytic account. Futher work will be
done in master (for 13.0) in order to solve that matter.
To apply the fix, the rule should be desactivated, and the module sale_expense can
be updated.

opw-2027005
Coming from Task-29303

closes odoo/odoo#34514

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-07-02 14:15:45 +00:00
Christophe Simonis 9c742d0c65 [MERGE] forward port branch saas-11.3 up to 6cf09b9a3c 2019-07-04 20:14:47 +02:00
Christophe Simonis ee28b1bf78 [FIX] test_rpc: adapt test to version 12
In version 12, user 1 is deactivated. Use `base.user_admin` instead.
2019-07-04 20:10:03 +02:00
Christophe Simonis 7b74f4ca9a [MERGE] forward port branch saas-11.3 up to 1debaa89f1 2019-07-04 18:57:17 +02:00
Romain Derie 789aa140b9 [FIX] website, website_sale: correctly set company_id on address
During checkout, the user can create a new billing (only for public user as it
will create a 'normal' `res.partner`), a new shipping, edit its billing (that
will edit himself) or edit its shipping address.

All those cases will go through the exact same methods, public user and logged
in user included.

This previously led to multiple issues and multiple fixes to correctly set
`company_id` and `website_id` on the address (res.partner).

See 44372471ef that fixed the `website_id` part.

See 3a0f05f33 that fixed the multi-company behavior, but needed 2ba71140 to not
modify the company of an already created partner, but was still incomplete as
after that fix a logged in user would still have the admin (sudo) company
instead of the website one as supposed.

This commit will fix that bug and add some tests for all mentionned issues.

Related to #28853 as we want to backport the mentionned commit but needed to be
fix first.

closes odoo/odoo#34596

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-04 13:58:23 +00:00
Abridbus 1c57d5edcf [FIX] mail: use server mail on template
Sending an email wasn't taking the outgoing mail server into account.
Adding it in the 'account_invoice_send_views' to use it in the wizard.

opw-2030717

closes odoo/odoo#34593

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-07-04 13:03:11 +00:00
qdp-odoo 90334b7db0 [FIX] account: aged partner balance with private partners
When hr is installed, with 'private' type, you should be member of
hr/officer group to read them, or you'll face an access right error.

closes odoo/odoo#34587

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-07-04 12:30:44 +00:00
Lucas Perais (lpe) 356b2ae43e [FIX] hr_holidays: report summary has a wizard as model
Before this commit, the report Leave Summary had hr.leave as its model
implicitly meaning that a report could be printed from an hr leave.

Since the report actually is a view which aggregates data, and not a document
representing a leave, it should have its wizard (the only entry point for that report)
as its model

OPW 2029699

closes odoo/odoo#34507

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-07-04 08:14:58 +00:00
Lucas Perais (lpe) 65648ab4d0 [FIX] base: action reports have direct ref to model
Before this commit, action report had their model referenced only with a char field
which made impossible to elaborate domain based on the model

After this commit, a new computed field, depending on that char field allows to do that

OPW 2029699
2019-07-04 08:14:58 +00:00