summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-05-17 13:19:49 +0200
committerChristophe Simonis <chs@odoo.com>2018-05-17 13:19:49 +0200
commit16552029241b3a7a3d9a40b8b7399da6ee415be4 (patch)
tree476f735d8d3a2732a139e143981e46b1a18ae70f /addons
parentfc3177af9eb9355f41955b581149a80c22b8b2b0 (diff)
parent59a8a1cd8eec1af59df2d62d7c3b10b7cff3dfc9 (diff)
[MERGE] forward port branch 11.0 up to 59a8a1cd8ee
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account.py2
-rw-r--r--addons/account/static/src/js/reconciliation/reconciliation_model.js1
-rw-r--r--addons/auth_signup/controllers/main.py1
-rw-r--r--addons/auth_signup/data/auth_signup_data.xml1
-rw-r--r--addons/auth_signup/i18n/af.po1
-rw-r--r--addons/auth_signup/i18n/am.po1
-rw-r--r--addons/auth_signup/i18n/ar.po1
-rw-r--r--addons/auth_signup/i18n/auth_signup.pot1
-rw-r--r--addons/auth_signup/i18n/bg.po1
-rw-r--r--addons/auth_signup/i18n/bs.po1
-rw-r--r--addons/auth_signup/i18n/ca.po1
-rw-r--r--addons/auth_signup/i18n/cs.po1
-rw-r--r--addons/auth_signup/i18n/da.po1
-rw-r--r--addons/auth_signup/i18n/de.po1
-rw-r--r--addons/auth_signup/i18n/el.po2
-rw-r--r--addons/auth_signup/i18n/en_GB.po1
-rw-r--r--addons/auth_signup/i18n/es.po1
-rw-r--r--addons/auth_signup/i18n/es_AR.po1
-rw-r--r--addons/auth_signup/i18n/es_BO.po1
-rw-r--r--addons/auth_signup/i18n/es_CL.po1
-rw-r--r--addons/auth_signup/i18n/es_CO.po1
-rw-r--r--addons/auth_signup/i18n/es_CR.po1
-rw-r--r--addons/auth_signup/i18n/es_DO.po1
-rw-r--r--addons/auth_signup/i18n/es_EC.po1
-rw-r--r--addons/auth_signup/i18n/es_PE.po1
-rw-r--r--addons/auth_signup/i18n/es_PY.po1
-rw-r--r--addons/auth_signup/i18n/es_VE.po1
-rw-r--r--addons/auth_signup/i18n/et.po1
-rw-r--r--addons/auth_signup/i18n/eu.po1
-rw-r--r--addons/auth_signup/i18n/fa.po1
-rw-r--r--addons/auth_signup/i18n/fi.po1
-rw-r--r--addons/auth_signup/i18n/fo.po1
-rw-r--r--addons/auth_signup/i18n/fr.po1
-rw-r--r--addons/auth_signup/i18n/fr_CA.po1
-rw-r--r--addons/auth_signup/i18n/gl.po1
-rw-r--r--addons/auth_signup/i18n/he.po1
-rw-r--r--addons/auth_signup/i18n/hr.po1
-rw-r--r--addons/auth_signup/i18n/hu.po1
-rw-r--r--addons/auth_signup/i18n/id.po1
-rw-r--r--addons/auth_signup/i18n/it.po1
-rw-r--r--addons/auth_signup/i18n/ja.po1
-rw-r--r--addons/auth_signup/i18n/ka.po1
-rw-r--r--addons/auth_signup/i18n/kab.po1
-rw-r--r--addons/auth_signup/i18n/ko.po1
-rw-r--r--addons/auth_signup/i18n/lo.po1
-rw-r--r--addons/auth_signup/i18n/lt.po1
-rw-r--r--addons/auth_signup/i18n/lv.po1
-rw-r--r--addons/auth_signup/i18n/mk.po1
-rw-r--r--addons/auth_signup/i18n/mn.po1
-rw-r--r--addons/auth_signup/i18n/nb.po1
-rw-r--r--addons/auth_signup/i18n/ne.po1
-rw-r--r--addons/auth_signup/i18n/nl.po2
-rw-r--r--addons/auth_signup/i18n/nl_BE.po1
-rw-r--r--addons/auth_signup/i18n/pl.po1
-rw-r--r--addons/auth_signup/i18n/pt.po1
-rw-r--r--addons/auth_signup/i18n/pt_BR.po2
-rw-r--r--addons/auth_signup/i18n/ro.po1
-rw-r--r--addons/auth_signup/i18n/ru.po1
-rw-r--r--addons/auth_signup/i18n/sk.po1
-rw-r--r--addons/auth_signup/i18n/sl.po1
-rw-r--r--addons/auth_signup/i18n/sq.po1
-rw-r--r--addons/auth_signup/i18n/sr.po1
-rw-r--r--addons/auth_signup/i18n/sr@latin.po1
-rw-r--r--addons/auth_signup/i18n/sv.po1
-rw-r--r--addons/auth_signup/i18n/th.po1
-rw-r--r--addons/auth_signup/i18n/tr.po1
-rw-r--r--addons/auth_signup/i18n/uk.po1
-rw-r--r--addons/auth_signup/i18n/vi.po1
-rw-r--r--addons/auth_signup/i18n/zh_CN.po1
-rw-r--r--addons/auth_signup/i18n/zh_TW.po1
-rw-r--r--addons/auth_signup/models/res_partner.py1
-rw-r--r--addons/event/models/event_mail.py50
-rw-r--r--addons/mail/models/mail_message.py12
-rw-r--r--addons/mail/models/mail_thread.py8
-rw-r--r--addons/point_of_sale/static/src/js/models.js5
-rw-r--r--addons/stock/models/stock_move.py6
-rw-r--r--addons/stock_account/models/stock.py8
-rw-r--r--addons/stock_account/tests/test_stockvaluation.py33
-rw-r--r--addons/test_mail/data/test_mail_data.py242
-rw-r--r--addons/test_mail/tests/test_mail_gateway.py8
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js14
-rw-r--r--addons/web/static/tests/fields/relational_fields_tests.js37
82 files changed, 411 insertions, 87 deletions
diff --git a/addons/account/models/account.py b/addons/account/models/account.py
index cde55f97bf4..fca7147514e 100644
--- a/addons/account/models/account.py
+++ b/addons/account/models/account.py
@@ -802,7 +802,7 @@ class AccountTax(models.Model):
tag_ids = fields.Many2many('account.account.tag', 'account_tax_account_tag', string='Tags', help="Optional tags you may want to assign for custom reporting")
tax_group_id = fields.Many2one('account.tax.group', string="Tax Group", default=_default_tax_group, required=True)
# Technical field to make the 'tax_exigibility' field invisible if the same named field is set to false in 'res.company' model
- hide_tax_exigibility = fields.Boolean(string='Hide Use Cash Basis Option', related='company_id.tax_exigibility')
+ hide_tax_exigibility = fields.Boolean(string='Hide Use Cash Basis Option', related='company_id.tax_exigibility', readonly=True)
tax_exigibility = fields.Selection(
[('on_invoice', 'Based on Invoice'),
('on_payment', 'Based on Payment'),
diff --git a/addons/account/static/src/js/reconciliation/reconciliation_model.js b/addons/account/static/src/js/reconciliation/reconciliation_model.js
index 0df19adea56..cdd3cc154ea 100644
--- a/addons/account/static/src/js/reconciliation/reconciliation_model.js
+++ b/addons/account/static/src/js/reconciliation/reconciliation_model.js
@@ -804,6 +804,7 @@ var StatementModel = BasicModel.extend({
model: 'account.tax',
method: 'json_friendly_compute_all',
args: args,
+ context: $.extend(self.context || {}, {'round': true}),
})
.then(function (result) {
_.each(result.taxes, function(tax){
diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py
index b8bdb9787b3..871847cb7b1 100644
--- a/addons/auth_signup/controllers/main.py
+++ b/addons/auth_signup/controllers/main.py
@@ -42,7 +42,6 @@ class AuthSignupHome(Home):
template.sudo().with_context(
lang=user_sudo.lang,
auth_login=werkzeug.url_encode({'auth_login': user_sudo.email}),
- password=request.params.get('password')
).send_mail(user_sudo.id, force_send=True)
return super(AuthSignupHome, self).web_login(*args, **kw)
except UserError as e:
diff --git a/addons/auth_signup/data/auth_signup_data.xml b/addons/auth_signup/data/auth_signup_data.xml
index b9f88893d2a..b3364a51658 100644
--- a/addons/auth_signup/data/auth_signup_data.xml
+++ b/addons/auth_signup/data/auth_signup_data.xml
@@ -116,7 +116,6 @@
<p>
Your login: ${object.email}
<br/>
- Your password: ${ctx['password']}
</p>
<p>
To gain access to your account, you can use the following link:
diff --git a/addons/auth_signup/i18n/af.po b/addons/auth_signup/i18n/af.po
index e95f0c01e3a..8fe284f2eb6 100644
--- a/addons/auth_signup/i18n/af.po
+++ b/addons/auth_signup/i18n/af.po
@@ -109,7 +109,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/am.po b/addons/auth_signup/i18n/am.po
index 884e96a66f0..7ed08db42cb 100644
--- a/addons/auth_signup/i18n/am.po
+++ b/addons/auth_signup/i18n/am.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/ar.po b/addons/auth_signup/i18n/ar.po
index aec6d4ea4b9..b379535575d 100644
--- a/addons/auth_signup/i18n/ar.po
+++ b/addons/auth_signup/i18n/ar.po
@@ -115,7 +115,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/auth_signup.pot b/addons/auth_signup/i18n/auth_signup.pot
index 3ca1e3ccc53..379775c2600 100644
--- a/addons/auth_signup/i18n/auth_signup.pot
+++ b/addons/auth_signup/i18n/auth_signup.pot
@@ -102,7 +102,6 @@ msgid "<div style=\"padding:0px;width:600px;margin:auto;background: #FFFFFF repe
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/bg.po b/addons/auth_signup/i18n/bg.po
index 5da9afc881c..96d4cbe6673 100644
--- a/addons/auth_signup/i18n/bg.po
+++ b/addons/auth_signup/i18n/bg.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/bs.po b/addons/auth_signup/i18n/bs.po
index e30567817fb..72953b3e2fb 100644
--- a/addons/auth_signup/i18n/bs.po
+++ b/addons/auth_signup/i18n/bs.po
@@ -109,7 +109,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/ca.po b/addons/auth_signup/i18n/ca.po
index 4154a0f8705..0d58beeaac2 100644
--- a/addons/auth_signup/i18n/ca.po
+++ b/addons/auth_signup/i18n/ca.po
@@ -134,7 +134,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/cs.po b/addons/auth_signup/i18n/cs.po
index bc6da8dee7c..48609ed8491 100644
--- a/addons/auth_signup/i18n/cs.po
+++ b/addons/auth_signup/i18n/cs.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/da.po b/addons/auth_signup/i18n/da.po
index 3613885ead3..9af60c059ef 100644
--- a/addons/auth_signup/i18n/da.po
+++ b/addons/auth_signup/i18n/da.po
@@ -111,7 +111,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/de.po b/addons/auth_signup/i18n/de.po
index c3fd7bc24bf..21e05ff6e1a 100644
--- a/addons/auth_signup/i18n/de.po
+++ b/addons/auth_signup/i18n/de.po
@@ -162,7 +162,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/el.po b/addons/auth_signup/i18n/el.po
index 527e38d061c..bdd6ddbfdeb 100644
--- a/addons/auth_signup/i18n/el.po
+++ b/addons/auth_signup/i18n/el.po
@@ -165,7 +165,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
@@ -199,7 +198,6 @@ msgstr ""
" <p>\n"
" Email/Όνομα χρήστη: ${object.email}\n"
" <br/>\n"
-" Κωδικός Πρόσβασης: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" Για να αποκτήσετε πρόσβαση στο λογαριασμό σας, ακολουθήστε τον παρακάτω σύνδεσμο:\n"
diff --git a/addons/auth_signup/i18n/en_GB.po b/addons/auth_signup/i18n/en_GB.po
index c533eb0e2c3..e9d962451fc 100644
--- a/addons/auth_signup/i18n/en_GB.po
+++ b/addons/auth_signup/i18n/en_GB.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es.po b/addons/auth_signup/i18n/es.po
index 774a8396e23..3579dd699f2 100644
--- a/addons/auth_signup/i18n/es.po
+++ b/addons/auth_signup/i18n/es.po
@@ -174,7 +174,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es_AR.po b/addons/auth_signup/i18n/es_AR.po
index 8013046ee26..52cff67e109 100644
--- a/addons/auth_signup/i18n/es_AR.po
+++ b/addons/auth_signup/i18n/es_AR.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es_BO.po b/addons/auth_signup/i18n/es_BO.po
index 8d0148b3dfe..b1147946e82 100644
--- a/addons/auth_signup/i18n/es_BO.po
+++ b/addons/auth_signup/i18n/es_BO.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es_CL.po b/addons/auth_signup/i18n/es_CL.po
index 5a81f205342..b5a6207ef21 100644
--- a/addons/auth_signup/i18n/es_CL.po
+++ b/addons/auth_signup/i18n/es_CL.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es_CO.po b/addons/auth_signup/i18n/es_CO.po
index b0585f4fa38..9cdb25ddfcb 100644
--- a/addons/auth_signup/i18n/es_CO.po
+++ b/addons/auth_signup/i18n/es_CO.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es_CR.po b/addons/auth_signup/i18n/es_CR.po
index d137efbae8a..2ed09011556 100644
--- a/addons/auth_signup/i18n/es_CR.po
+++ b/addons/auth_signup/i18n/es_CR.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es_DO.po b/addons/auth_signup/i18n/es_DO.po
index 77358762009..5972a4bbd7a 100644
--- a/addons/auth_signup/i18n/es_DO.po
+++ b/addons/auth_signup/i18n/es_DO.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es_EC.po b/addons/auth_signup/i18n/es_EC.po
index fd7782eadce..c8c9bc51c10 100644
--- a/addons/auth_signup/i18n/es_EC.po
+++ b/addons/auth_signup/i18n/es_EC.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es_PE.po b/addons/auth_signup/i18n/es_PE.po
index 9ee0f51c41e..919743b749a 100644
--- a/addons/auth_signup/i18n/es_PE.po
+++ b/addons/auth_signup/i18n/es_PE.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es_PY.po b/addons/auth_signup/i18n/es_PY.po
index 0d37ff54c50..c4dfea726cf 100644
--- a/addons/auth_signup/i18n/es_PY.po
+++ b/addons/auth_signup/i18n/es_PY.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/es_VE.po b/addons/auth_signup/i18n/es_VE.po
index efbe4c21be1..96b47c37681 100644
--- a/addons/auth_signup/i18n/es_VE.po
+++ b/addons/auth_signup/i18n/es_VE.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/et.po b/addons/auth_signup/i18n/et.po
index c2d8db1e7dd..e21bd45495d 100644
--- a/addons/auth_signup/i18n/et.po
+++ b/addons/auth_signup/i18n/et.po
@@ -111,7 +111,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/eu.po b/addons/auth_signup/i18n/eu.po
index 9c44dafbd60..035159ebbc5 100644
--- a/addons/auth_signup/i18n/eu.po
+++ b/addons/auth_signup/i18n/eu.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/fa.po b/addons/auth_signup/i18n/fa.po
index b768510a3af..94919a982a4 100644
--- a/addons/auth_signup/i18n/fa.po
+++ b/addons/auth_signup/i18n/fa.po
@@ -111,7 +111,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/fi.po b/addons/auth_signup/i18n/fi.po
index 1c2f0091215..c2367709374 100644
--- a/addons/auth_signup/i18n/fi.po
+++ b/addons/auth_signup/i18n/fi.po
@@ -114,7 +114,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/fo.po b/addons/auth_signup/i18n/fo.po
index c2b513c1339..47a4304b83d 100644
--- a/addons/auth_signup/i18n/fo.po
+++ b/addons/auth_signup/i18n/fo.po
@@ -105,7 +105,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/fr.po b/addons/auth_signup/i18n/fr.po
index 5d19c895961..345b07411ed 100644
--- a/addons/auth_signup/i18n/fr.po
+++ b/addons/auth_signup/i18n/fr.po
@@ -168,7 +168,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/fr_CA.po b/addons/auth_signup/i18n/fr_CA.po
index 469fd480492..516ffa5ceaa 100644
--- a/addons/auth_signup/i18n/fr_CA.po
+++ b/addons/auth_signup/i18n/fr_CA.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/gl.po b/addons/auth_signup/i18n/gl.po
index d3ba0b2ac14..7e3f96ee07e 100644
--- a/addons/auth_signup/i18n/gl.po
+++ b/addons/auth_signup/i18n/gl.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/he.po b/addons/auth_signup/i18n/he.po
index d4adca058c8..5010a56142a 100644
--- a/addons/auth_signup/i18n/he.po
+++ b/addons/auth_signup/i18n/he.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/hr.po b/addons/auth_signup/i18n/hr.po
index 7ea2aa5a4db..5fe6dfa95cf 100644
--- a/addons/auth_signup/i18n/hr.po
+++ b/addons/auth_signup/i18n/hr.po
@@ -144,7 +144,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/hu.po b/addons/auth_signup/i18n/hu.po
index d88f6f7e87f..242590a5d8c 100644
--- a/addons/auth_signup/i18n/hu.po
+++ b/addons/auth_signup/i18n/hu.po
@@ -165,7 +165,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/id.po b/addons/auth_signup/i18n/id.po
index 6a1a3ff1898..3105d982405 100644
--- a/addons/auth_signup/i18n/id.po
+++ b/addons/auth_signup/i18n/id.po
@@ -112,7 +112,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/it.po b/addons/auth_signup/i18n/it.po
index f590d160d73..4c18b8d3b20 100644
--- a/addons/auth_signup/i18n/it.po
+++ b/addons/auth_signup/i18n/it.po
@@ -109,7 +109,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/ja.po b/addons/auth_signup/i18n/ja.po
index 3e28504326f..6824517fdc1 100644
--- a/addons/auth_signup/i18n/ja.po
+++ b/addons/auth_signup/i18n/ja.po
@@ -165,7 +165,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/ka.po b/addons/auth_signup/i18n/ka.po
index c484d9eb5ed..f61eb2cd8fb 100644
--- a/addons/auth_signup/i18n/ka.po
+++ b/addons/auth_signup/i18n/ka.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/kab.po b/addons/auth_signup/i18n/kab.po
index 0dec5bea4da..0e670472029 100644
--- a/addons/auth_signup/i18n/kab.po
+++ b/addons/auth_signup/i18n/kab.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/ko.po b/addons/auth_signup/i18n/ko.po
index d29991121f5..42dba965809 100644
--- a/addons/auth_signup/i18n/ko.po
+++ b/addons/auth_signup/i18n/ko.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/lo.po b/addons/auth_signup/i18n/lo.po
index e7bb5b2769a..8ae06fffbc2 100644
--- a/addons/auth_signup/i18n/lo.po
+++ b/addons/auth_signup/i18n/lo.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/lt.po b/addons/auth_signup/i18n/lt.po
index 31c1bc8ff2a..2ff10d5155a 100644
--- a/addons/auth_signup/i18n/lt.po
+++ b/addons/auth_signup/i18n/lt.po
@@ -112,7 +112,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/lv.po b/addons/auth_signup/i18n/lv.po
index 9b1970fc14b..1f493481075 100644
--- a/addons/auth_signup/i18n/lv.po
+++ b/addons/auth_signup/i18n/lv.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/mk.po b/addons/auth_signup/i18n/mk.po
index 723427f51d1..2bb3dadd211 100644
--- a/addons/auth_signup/i18n/mk.po
+++ b/addons/auth_signup/i18n/mk.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/mn.po b/addons/auth_signup/i18n/mn.po
index 2ac736ff37e..e2ab4e9d82e 100644
--- a/addons/auth_signup/i18n/mn.po
+++ b/addons/auth_signup/i18n/mn.po
@@ -105,7 +105,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/nb.po b/addons/auth_signup/i18n/nb.po
index e16abb8be70..0732fbeafc3 100644
--- a/addons/auth_signup/i18n/nb.po
+++ b/addons/auth_signup/i18n/nb.po
@@ -110,7 +110,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/ne.po b/addons/auth_signup/i18n/ne.po
index 8937826cf50..b05079f39bf 100644
--- a/addons/auth_signup/i18n/ne.po
+++ b/addons/auth_signup/i18n/ne.po
@@ -105,7 +105,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/nl.po b/addons/auth_signup/i18n/nl.po
index 2fae789bf5f..94ba16c4dd4 100644
--- a/addons/auth_signup/i18n/nl.po
+++ b/addons/auth_signup/i18n/nl.po
@@ -167,7 +167,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
@@ -201,7 +200,6 @@ msgstr ""
" <p>\n"
" Uw login: ${object.email}\n"
" <br/>\n"
-" Uw wachtwoord: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" Om toegang te krijgen tot uw account, kan u de volgende link gebruiken::\n"
diff --git a/addons/auth_signup/i18n/nl_BE.po b/addons/auth_signup/i18n/nl_BE.po
index 405e872d815..85eb30d00cd 100644
--- a/addons/auth_signup/i18n/nl_BE.po
+++ b/addons/auth_signup/i18n/nl_BE.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/pl.po b/addons/auth_signup/i18n/pl.po
index fbb0f81860f..314a2b54cb9 100644
--- a/addons/auth_signup/i18n/pl.po
+++ b/addons/auth_signup/i18n/pl.po
@@ -114,7 +114,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/pt.po b/addons/auth_signup/i18n/pt.po
index e1e03417c01..ba4833e46b5 100644
--- a/addons/auth_signup/i18n/pt.po
+++ b/addons/auth_signup/i18n/pt.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/pt_BR.po b/addons/auth_signup/i18n/pt_BR.po
index 3b2b3c0b29b..0375c301797 100644
--- a/addons/auth_signup/i18n/pt_BR.po
+++ b/addons/auth_signup/i18n/pt_BR.po
@@ -167,7 +167,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
@@ -201,7 +200,6 @@ msgstr ""
" <p>\n"
" Seu login: ${object.email}\n"
" <br/>\n"
-" Sua senha: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" Para acessar sua conta, você pode acessar o seguinte link:\n"
diff --git a/addons/auth_signup/i18n/ro.po b/addons/auth_signup/i18n/ro.po
index 70f19bf3768..5178308b08a 100644
--- a/addons/auth_signup/i18n/ro.po
+++ b/addons/auth_signup/i18n/ro.po
@@ -139,7 +139,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/ru.po b/addons/auth_signup/i18n/ru.po
index 64d0fa145bc..8a9cd8d9bae 100644
--- a/addons/auth_signup/i18n/ru.po
+++ b/addons/auth_signup/i18n/ru.po
@@ -173,7 +173,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/sk.po b/addons/auth_signup/i18n/sk.po
index 5eb7f676417..5138b206acf 100644
--- a/addons/auth_signup/i18n/sk.po
+++ b/addons/auth_signup/i18n/sk.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/sl.po b/addons/auth_signup/i18n/sl.po
index e887136c172..ffc11c07444 100644
--- a/addons/auth_signup/i18n/sl.po
+++ b/addons/auth_signup/i18n/sl.po
@@ -105,7 +105,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/sq.po b/addons/auth_signup/i18n/sq.po
index 164fdf95948..0bcff3b0ad8 100644
--- a/addons/auth_signup/i18n/sq.po
+++ b/addons/auth_signup/i18n/sq.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/sr.po b/addons/auth_signup/i18n/sr.po
index 39bcf501d75..6a1f8a51afb 100644
--- a/addons/auth_signup/i18n/sr.po
+++ b/addons/auth_signup/i18n/sr.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/sr@latin.po b/addons/auth_signup/i18n/sr@latin.po
index 0efb9c4cfda..0a9f5db16b1 100644
--- a/addons/auth_signup/i18n/sr@latin.po
+++ b/addons/auth_signup/i18n/sr@latin.po
@@ -109,7 +109,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/sv.po b/addons/auth_signup/i18n/sv.po
index d3b6c33642c..aa14a9b4a39 100644
--- a/addons/auth_signup/i18n/sv.po
+++ b/addons/auth_signup/i18n/sv.po
@@ -109,7 +109,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/th.po b/addons/auth_signup/i18n/th.po
index 16eaf1167ef..46fe1210082 100644
--- a/addons/auth_signup/i18n/th.po
+++ b/addons/auth_signup/i18n/th.po
@@ -108,7 +108,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/tr.po b/addons/auth_signup/i18n/tr.po
index 00fbe962c82..17d13118d7c 100644
--- a/addons/auth_signup/i18n/tr.po
+++ b/addons/auth_signup/i18n/tr.po
@@ -171,7 +171,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/uk.po b/addons/auth_signup/i18n/uk.po
index 51df9435a86..83cfb0e5b94 100644
--- a/addons/auth_signup/i18n/uk.po
+++ b/addons/auth_signup/i18n/uk.po
@@ -167,7 +167,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/vi.po b/addons/auth_signup/i18n/vi.po
index 4fd58b26cfa..84d5bab21b7 100644
--- a/addons/auth_signup/i18n/vi.po
+++ b/addons/auth_signup/i18n/vi.po
@@ -109,7 +109,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/zh_CN.po b/addons/auth_signup/i18n/zh_CN.po
index db90fbcb26e..bd89431a070 100644
--- a/addons/auth_signup/i18n/zh_CN.po
+++ b/addons/auth_signup/i18n/zh_CN.po
@@ -140,7 +140,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/i18n/zh_TW.po b/addons/auth_signup/i18n/zh_TW.po
index 150c5b36fd4..a92edce19b1 100644
--- a/addons/auth_signup/i18n/zh_TW.po
+++ b/addons/auth_signup/i18n/zh_TW.po
@@ -109,7 +109,6 @@ msgid ""
" <p>\n"
" Your login: ${object.email}\n"
" <br/>\n"
-" Your password: ${ctx['password']}\n"
" </p>\n"
" <p>\n"
" To gain access to your account, you can use the following link:\n"
diff --git a/addons/auth_signup/models/res_partner.py b/addons/auth_signup/models/res_partner.py
index 9fbcd27872f..17171c645f6 100644
--- a/addons/auth_signup/models/res_partner.py
+++ b/addons/auth_signup/models/res_partner.py
@@ -32,6 +32,7 @@ class ResPartner(models.Model):
signup_url = fields.Char(compute='_compute_signup_url', string='Signup URL')
@api.multi
+ @api.depends('signup_token', 'signup_expiration')
def _compute_signup_valid(self):
dt = now()
for partner in self:
diff --git a/addons/event/models/event_mail.py b/addons/event/models/event_mail.py
index 1013f5a083b..680e1d4ba8a 100644
--- a/addons/event/models/event_mail.py
+++ b/addons/event/models/event_mail.py
@@ -4,7 +4,12 @@ from datetime import datetime
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, tools
+from odoo.tools import exception_to_unicode
+from odoo.tools.translate import _
+import random
+import logging
+_logger = logging.getLogger(__name__)
_INTERVALS = {
'hours': lambda interval: relativedelta(hours=interval),
@@ -115,12 +120,51 @@ class EventMailScheduler(models.Model):
return True
@api.model
+ def _warn_template_error(self, scheduler, exception):
+ # We warn ~ once by hour ~ instead of every 10 min if the interval unit is more than 'hours'.
+ if random.random() < 0.1666 or scheduler.interval_unit in ('now', 'hours'):
+ ex_s = exception_to_unicode(exception)
+ try:
+ event, template = scheduler.event_id, scheduler.template_id
+ emails = list(set([event.organizer_id.email, event.user_id.email, template.write_uid.email]))
+ subject = _("WARNING: Event Scheduler Error for event: %s" % event.name)
+ body = _("""Event Scheduler for:
+ - Event: %s (%s)
+ - Scheduled: %s
+ - Template: %s (%s)
+
+ Failed with error:
+ - %s
+
+ You receive this email because you are:
+ - the organizer of the event,
+ - or the responsible of the event,
+ - or the last writer of the template."""
+ % (event.name, event.id, scheduler.scheduled_date, template.name, template.id, ex_s))
+ email = self.env['ir.mail_server'].build_email(
+ email_from=self.env.user.email,
+ email_to=emails,
+ subject=subject, body=body,
+ )
+ self.env['ir.mail_server'].send_email(email)
+ except Exception as e:
+ _logger.error("Exception while sending traceback by email: %s.\n Original Traceback:\n%s", e, exception)
+ pass
+
+ @api.model
def run(self, autocommit=False):
schedulers = self.search([('done', '=', False), ('scheduled_date', '<=', datetime.strftime(fields.datetime.now(), tools.DEFAULT_SERVER_DATETIME_FORMAT))])
for scheduler in schedulers:
- scheduler.execute()
- if autocommit:
- self.env.cr.commit()
+ try:
+ with self.env.cr.savepoint():
+ scheduler.execute()
+ except Exception as e:
+ _logger.exception(e)
+ self.invalidate_cache()
+ self._warn_template_error(scheduler, e)
+ else:
+ if autocommit:
+ self.env.cr.commit()
return True
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py
index cee1c692632..6a6735f3d66 100644
--- a/addons/mail/models/mail_message.py
+++ b/addons/mail/models/mail_message.py
@@ -412,8 +412,18 @@ class Message(models.Model):
subtypes = self.env['mail.message.subtype'].sudo().browse(subtype_ids).read(['internal', 'description','id'])
subtypes_dict = dict((subtype['id'], subtype) for subtype in subtypes)
xml_comment_id = self.env.ref('mail.mt_comment').id
+
+ # fetch notification status
+ notif_dict = {}
+ notifs = self.env['mail.notification'].sudo().search([('mail_message_id', 'in', list(mid for mid in message_tree)), ('is_read', '=', False)])
+ for notif in notifs:
+ mid = notif.mail_message_id.id
+ if not notif_dict.get(mid):
+ notif_dict[mid] = {'partner_id': list()}
+ notif_dict[mid]['partner_id'].append(notif.res_partner_id.id)
+
for message in message_values:
- message['needaction_partner_ids'] = self.env['mail.notification'].sudo().search([('mail_message_id', '=', message['id']), ('is_read', '=', False)]).mapped('res_partner_id').ids
+ message['needaction_partner_ids'] = notif_dict.get(message['id'], dict()).get('partner_id', [])
message['is_note'] = message['subtype_id'] and subtypes_dict[message['subtype_id'][0]]['internal']
message['is_discussion'] = message['subtype_id'] and subtypes_dict[message['subtype_id'][0]]['id'] == xml_comment_id
message['subtype_description'] = message['subtype_id'] and subtypes_dict[message['subtype_id'][0]]['description']
diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py
index f675f147cb1..c3936238f2f 100644
--- a/addons/mail/models/mail_thread.py
+++ b/addons/mail/models/mail_thread.py
@@ -1366,7 +1366,13 @@ class MailThread(models.AbstractModel):
located in tools. """
if not body:
return body, attachments
- root = lxml.html.fromstring(body)
+ try:
+ root = lxml.html.fromstring(body)
+ except ValueError:
+ # In case the email client sent XHTML, fromstring will fail because 'Unicode strings
+ # with encoding declaration are not supported'.
+ root = lxml.html.fromstring(body.encode('utf-8'))
+
postprocessed = False
to_remove = []
for node in root.iter():
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 6a303b508a8..3a636bc3225 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -260,6 +260,7 @@ exports.PosModel = Backbone.Model.extend({
// we attribute a role to the user, 'cashier' or 'manager', depending
// on the group the user belongs.
var pos_users = [];
+ var current_cashier = self.get_cashier();
for (var i = 0; i < users.length; i++) {
var user = users[i];
for (var j = 0; j < user.groups_id.length; j++) {
@@ -277,6 +278,8 @@ exports.PosModel = Backbone.Model.extend({
// replace the current user with its updated version
if (user.id === self.user.id) {
self.user = user;
+ }
+ if (user.id === current_cashier.id) {
self.set_cashier(user);
}
}
@@ -630,7 +633,7 @@ exports.PosModel = Backbone.Model.extend({
// changes the current cashier
set_cashier: function(user){
this.set('cashier', user);
- this.db.set_cashier(this.cashier);
+ this.db.set_cashier(this.get('cashier'));
},
//creates a new empty order and sets it as the current order
add_new_order: function(){
diff --git a/addons/stock/models/stock_move.py b/addons/stock/models/stock_move.py
index cdf318c3b51..e59af341990 100644
--- a/addons/stock/models/stock_move.py
+++ b/addons/stock/models/stock_move.py
@@ -425,10 +425,10 @@ class StockMove(models.Model):
if propagated_date_field:
current_date = datetime.strptime(move.date_expected, DEFAULT_SERVER_DATETIME_FORMAT)
new_date = datetime.strptime(vals.get(propagated_date_field), DEFAULT_SERVER_DATETIME_FORMAT)
- delta = relativedelta.relativedelta(new_date, current_date)
- if abs(delta.days) >= move.company_id.propagation_minimum_delta:
+ delta_days = (new_date - current_date).total_seconds() / 86400
+ if abs(delta_days) >= move.company_id.propagation_minimum_delta:
old_move_date = datetime.strptime(move.move_dest_ids[0].date_expected, DEFAULT_SERVER_DATETIME_FORMAT)
- new_move_date = (old_move_date + relativedelta.relativedelta(days=delta.days or 0)).strftime(DEFAULT_SERVER_DATETIME_FORMAT)
+ new_move_date = (old_move_date + relativedelta.relativedelta(days=delta_days or 0)).strftime(DEFAULT_SERVER_DATETIME_FORMAT)
propagated_changes_dict['date_expected'] = new_move_date
#For pushed moves as well as for pulled moves, propagate by recursive call of write().
#Note that, for pulled moves we intentionally don't propagate on the procurement.
diff --git a/addons/stock_account/models/stock.py b/addons/stock_account/models/stock.py
index 113ff99b87a..2a7cb101c4e 100644
--- a/addons/stock_account/models/stock.py
+++ b/addons/stock_account/models/stock.py
@@ -372,6 +372,7 @@ class StockMove(models.Model):
product_tot_qty_available = move.product_id.qty_available + tmpl_dict[move.product_id.id]
rounding = move.product_id.uom_id.rounding
+ qty_done = 0.0
if float_is_zero(product_tot_qty_available, precision_rounding=rounding):
new_std_price = move._get_price_unit()
elif float_is_zero(product_tot_qty_available + move.product_qty, precision_rounding=rounding):
@@ -379,10 +380,11 @@ class StockMove(models.Model):
else:
# Get the standard price
amount_unit = std_price_update.get((move.company_id.id, move.product_id.id)) or move.product_id.standard_price
- qty = forced_qty or move.product_qty
- new_std_price = ((amount_unit * product_tot_qty_available) + (move._get_price_unit() * qty)) / (product_tot_qty_available + move.product_qty)
+ qty_done = move.product_uom._compute_quantity(move.quantity_done, move.product_id.uom_id)
+ qty = forced_qty or qty_done
+ new_std_price = ((amount_unit * product_tot_qty_available) + (move._get_price_unit() * qty)) / (product_tot_qty_available + qty_done)
- tmpl_dict[move.product_id.id] += move.product_qty
+ tmpl_dict[move.product_id.id] += qty_done
# Write the standard price, as SUPERUSER_ID because a warehouse manager may not have the right to write on products
move.product_id.with_context(force_company=move.company_id.id).sudo().write({'standard_price': new_std_price})
std_price_update[move.company_id.id, move.product_id.id] = new_std_price
diff --git a/addons/stock_account/tests/test_stockvaluation.py b/addons/stock_account/tests/test_stockvaluation.py
index 50cc57885bb..0450d66e9a1 100644
--- a/addons/stock_account/tests/test_stockvaluation.py
+++ b/addons/stock_account/tests/test_stockvaluation.py
@@ -2489,6 +2489,39 @@ class TestStockValuation(TransactionCase):
move2.move_line_ids.qty_done = 0
self.assertEqual(self.product1.stock_value, -187.5)
+ def test_average_perpetual_4(self):
+ self.product1.product_tmpl_id.cost_method = 'average'
+
+ move1 = self.env['stock.move'].create({
+ 'name': 'Receive 1 unit at 10',
+ 'location_id': self.supplier_location.id,
+ 'location_dest_id': self.stock_location.id,
+ 'product_id': self.product1.id,
+ 'product_uom': self.uom_unit.id,
+ 'product_uom_qty': 1.0,
+ 'price_unit': 10,
+ })
+ move1._action_confirm()
+ move1._action_assign()
+ move1.move_line_ids.qty_done = 1.0
+ move1._action_done()
+
+ move2 = self.env['stock.move'].create({
+ 'name': 'Receive 3 units at 5',
+ 'location_id': self.supplier_location.id,
+ 'location_dest_id': self.stock_location.id,
+ 'product_id': self.product1.id,
+ 'product_uom': self.uom_unit.id,
+ 'product_uom_qty': 3.0,
+ 'price_unit': 5,
+ })
+ move2._action_confirm()
+ move2._action_assign()
+ move2.move_line_ids.qty_done = 1.0
+ move2._action_done()
+
+ self.assertAlmostEqual(self.product1.standard_price, 7.5)
+
def test_average_negative_1(self):
""" Test edit in the past. Receive 10, send 20, edit the second move to only send 10.
"""
diff --git a/addons/test_mail/data/test_mail_data.py b/addons/test_mail/data/test_mail_data.py
index ef55fb82be9..adf963fcd7b 100644
--- a/addons/test_mail/data/test_mail_data.py
+++ b/addons/test_mail/data/test_mail_data.py
@@ -432,3 +432,245 @@ Web: <a class="moz-txt-link-freetext" href="http://www.odoo.com">http://www.odoo
--------------1F2D18B1129FC2F0B9EECF50--
--------------A6B5FD5F68F4D73ECD739009--"""
+
+
+MAIL_XHTML = """Return-Path: <xxxx@xxxx.com>
+Received: from xxxx.internal (xxxx.xxxx.internal [1.1.1.1])
+ by xxxx (xxxx 1.1.1-111-g972eecc-slipenbois) with LMTPA;
+ Fri, 13 Apr 2018 22:11:52 -0400
+X-Cyrus-Session-Id: sloti35d1t38-1111111-11111111111-5-11111111111111111111
+X-Sieve: CMU Sieve 1.0
+X-Spam-known-sender: no ("Email failed DMARC policy for domain"); in-addressbook
+X-Spam-score: 0.0
+X-Spam-hits: ALL_TRUSTED -1, BAYES_00 -1.9, FREEMAIL_FROM 0.001,
+ HTML_FONT_LOW_CONTRAST 0.001, HTML_MESSAGE 0.001, SPF_SOFTFAIL 0.665,
+ LANGUAGES en, BAYES_USED global, SA_VERSION 1.1.0
+X-Spam-source: IP='1.1.1.1', Host='unk', Country='unk', FromHeader='com',
+ MailFrom='com'
+X-Spam-charsets: plain='utf-8', html='utf-8'
+X-IgnoreVacation: yes ("Email failed DMARC policy for domain")
+X-Resolved-to: catchall@xxxx.xxxx
+X-Delivered-to: catchall@xxxx.xxxx
+X-Mail-from: xxxx@xxxx.com
+Received: from mx4 ([1.1.1.1])
+ by xxxx.internal (LMTPProxy); Fri, 13 Apr 2018 22:11:52 -0400
+Received: from xxxx.xxxx.com (localhost [127.0.0.1])
+ by xxxx.xxxx.internal (Postfix) with ESMTP id E1111C1111;
+ Fri, 13 Apr 2018 22:11:51 -0400 (EDT)
+Received: from xxxx.xxxx.internal (localhost [127.0.0.1])
+ by xxxx.xxxx.com (Authentication Milter) with ESMTP
+ id BBDD1111D1A;
+ Fri, 13 Apr 2018 22:11:51 -0400
+ARC-Authentication-Results: i=1; xxxx.xxxx.com; arc=none (no signatures found);
+ dkim=pass (2048-bit rsa key sha256) header.d=xxxx.com header.i=@xxxx.com header.b=P1aaAAaa x-bits=2048 x-keytype=rsa x-algorithm=sha256 x-selector=fm2;
+ dmarc=fail (p=none,d=none) header.from=xxxx.com;
+ iprev=pass policy.iprev=1.1.1.1 (out1-smtp.xxxx.com);
+ spf=softfail smtp.mailfrom=xxxx@xxxx.com smtp.helo=out1-smtp.xxxx.com;
+ x-aligned-from=pass (Address match);
+ x-cm=none score=0;
+ x-ptr=pass x-ptr-helo=out1-smtp.xxxx.com x-ptr-lookup=out1-smtp.xxxx.com;
+ x-return-mx=pass smtp.domain=xxxx.com smtp.result=pass smtp_is_org_domain=yes header.domain=xxxx.com header.result=pass header_is_org_domain=yes;
+ x-tls=pass version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128;
+ x-vs=clean score=0 state=0
+Authentication-Results: xxxx.xxxx.com;
+ arc=none (no signatures found);
+ dkim=pass (2048-bit rsa key sha256) header.d=xxxx.com header.i=@xxxx.com header.b=P1awJPiy x-bits=2048 x-keytype=rsa x-algorithm=sha256 x-selector=fm2;
+ dmarc=fail (p=none,d=none) header.from=xxxx.com;
+ iprev=pass policy.iprev=66.111.4.25 (out1-smtp.xxxx.com);
+ spf=softfail smtp.mailfrom=xxxx@xxxx.com smtp.helo=out1-smtp.xxxx.com;
+ x-aligned-from=pass (Address match);
+ x-cm=none score=0;
+ x-ptr=pass x-ptr-helo=out1-smtp.xxxx.com x-ptr-lookup=out1-smtp.xxxx.com;
+ x-return-mx=pass smtp.domain=xxxx.com smtp.result=pass smtp_is_org_domain=yes header.domain=xxxx.com header.result=pass header_is_org_domain=yes;
+ x-tls=pass version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128;
+ x-vs=clean score=0 state=0
+X-ME-VSCategory: clean
+X-ME-CMScore: 0
+X-ME-CMCategory: none
+Received-SPF: softfail
+ (gmail.com ... _spf.xxxx.com: Sender is not authorized by default to use 'xxxx@xxxx.com' in 'mfrom' identity, however domain is not currently prepared for false failures (mechanism '~all' matched))
+ receiver=xxxx.xxxx.com;
+ identity=mailfrom;
+ envelope-from="xxxx@xxxx.com";
+ helo=out1-smtp.xxxx.com;
+ client-ip=1.1.1.1
+Received: from xxxx.xxxx.internal (gateway1.xxxx.internal [1.1.1.1])
+ (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
+ (No client certificate requested)
+ by xxxx.xxxx.internal (Postfix) with ESMTPS;
+ Fri, 13 Apr 2018 22:11:51 -0400 (EDT)
+Received: from compute3.internal (xxxx.xxxx.internal [10.202.2.43])
+ by xxxx.xxxx.internal (Postfix) with ESMTP id 8BD5B21BBD;
+ Fri, 13 Apr 2018 22:11:51 -0400 (EDT)
+Received: from xxxx ([10.202.2.163])
+ by xxxx.internal (MEProxy); Fri, 13 Apr 2018 22:11:51 -0400
+X-ME-Sender: <xms:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
+Received: from [1.1.1.1] (unknown [1.1.1.1])
+ by mail.xxxx.com (Postfix) with ESMTPA id BF5E1111D
+ for <catchall@xxxx.xxxx>; Fri, 13 Apr 2018 22:11:50 -0400 (EDT)
+From: "xxxx xxxx" <xxxx@xxxx.com>
+To: "xxxx" <catchall@xxxx.xxxx>
+Subject: Re: xxxx (Ref PO1)
+Date: Sat, 14 Apr 2018 02:11:42 +0000
+Message-Id: <em67f5c44a-xxxx-xxxx-xxxx-69f56d618a94@wswin7hg4n4l1ce>
+In-Reply-To: <829228111124527.1111111602.256611118262939-openerp-129-xxxx.xxxx@ip-1-1-1-1>
+References: <867911111953277.1523671337.187951111160400-openerp-129-xxxx.xxxx@ip-1-1-1-1>
+ <867911111953277.1523671337.256611118262939-openerp-129-xxxx.xxxx@ip-1-1-1-1>
+Reply-To: "xxxx xxxx" <xxxx@xxxx.com>
+User-Agent: eM_Client/7.0.26687.0
+Mime-Version: 1.0
+Content-Type: multipart/alternative;
+ boundary="------=_MB48E455BD-1111-42EC-1111-886CDF48905E"
+
+--------=_MB48E455BD-1111-42EC-1111-886CDF48905E
+Content-Type: text/plain; format=flowed; charset=utf-8
+Content-Transfer-Encoding: quoted-printable
+
+xxxx
+
+
+------ Original Message ------
+From: "xxxx" <xxxx@xxxx.com>
+To: "xxxx" <xxxx@xxxx.com>
+Sent: 4/13/2018 7:06:43 PM
+Subject: xxxx
+
+>xxxx
+
+--------=_MB48E455BD-1111-42EC-1111-886CDF48905E
+Content-Type: text/html; charset=utf-8
+Content-Transfer-Encoding: quoted-printable
+
+<?xml version=3D"1.0" encoding=3D"utf-16"?><html><head><style type=3D"text/=
+css"><!--blockquote.cite
+{margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:=
+ 0px; border-left-width: 1px; border-left-style: solid; border-left-color:=
+ rgb(204, 204, 204);}
+blockquote.cite2
+{margin-left: 5px; margin-right: 0px; padding-left: 10px; padding-right:=
+ 0px; border-left-width: 1px; border-left-style: solid; border-left-color:=
+ rgb(204, 204, 204); margin-top: 3px; padding-top: 0px;}
+a img
+{border: 0px;}
+body
+{font-family: Tahoma; font-size: 12pt;}
+--></style></head><body><div>this is a reply to PO200109 from emClient</div=
+><div id=3D"signature_old"><div style=3D"font-family: Tahoma; font-size:=
+ 12 pt;">-- <br /><span><span class=3D"__postbox-detected-content __postbox=
+-detected-address" style=3D"TEXT-DECORATION: underline; COLOR: rgb(115,133,=
+172); PADDING-BOTTOM: 0pt; PADDING-TOP: 0pt; PADDING-LEFT: 0pt; DISPLAY:=
+ inline; PADDING-RIGHT: 0pt" __postbox-detected-content=3D"__postbox-detect=
+ed-address"></span>xxxx<br />xxxx<br /><b=
+r />xxxx</span></=
+div></div><div><br /></div><div><br /></div><div><br /></div>
+<div>------ Original Message ------</div>
+<div>From: "xxxx" &lt;<a href=3D"mailto:xxxx@xxxx.com">xxxx=
+@xxxx.com</a>&gt;</div>
+<div>To: "xxxx" &lt;<a href=3D"mailto:xxxx@xxxx.com">a=
+xxxx@xxxx.com</a>&gt;</div>
+<div>Sent: 4/13/2018 7:06:43 PM</div>
+<div>Subject: xxxx</div><div><br /></div=
+>
+<div id=3D"x00b4101ba6e64ce"><blockquote cite=3D"829228972724527.1523671602=
+.256660938262939-openerp-129-xxxx.xxxx@ip-1-1-1-1" type=3D"cite"=
+ class=3D"cite2">
+<table border=3D"0" width=3D"100%" cellpadding=3D"0" bgcolor=3D"#ededed"=
+ style=3D"padding: 20px; background-color: #ededed" summary=3D"o_mail_notif=
+ication">
+ <tbody>
+
+ <!-- HEADER -->
+ <tr>
+ <td align=3D"center" style=3D"min-width: 590px;">
+ <table width=3D"590" border=3D"0" cellpadding=3D=
+"0" bgcolor=3D"#875A7B" style=3D"min-width: 590px; background-color: rgb(13=
+5,90,123); padding: 20px;">
+ <tbody><tr>
+ <td valign=3D"middle">
+ <span style=3D"font-size:20px; color:whit=
+e; font-weight: bold;">
+ mangez des saucisses
+ </span>
+ </td>
+ <td valign=3D"middle" align=3D"right">
+ <img src=3D"http://erp.xxxx.xxxx/logo.png=
+" style=3D"padding: 0px; margin: 0px; height: auto; width: 80px;" alt=3D=
+"xxxx" />
+ </td>
+ </tr>
+ </tbody></table>
+ </td>
+ </tr>
+
+ <!-- CONTENT -->
+ <tr>
+ <td align=3D"center" style=3D"min-width: 590px;">
+ <table width=3D"590" border=3D"0" cellpadding=3D=
+"0" bgcolor=3D"#ffffff" style=3D"min-width: 590px; background-color: rgb(25=
+5, 255, 255); padding: 20px;">
+ <tbody>
+ <tr><td valign=3D"top" style=3D"font-family:A=
+rial,Helvetica,sans-serif; color: #555; font-size: 14px;">
+ <p style=3D"margin: 0px 0px 9px 0px; font-s=
+ize: 13px; font-family: &quot;Lucida Grande&quot;, Helvetica, Verdana, Aria=
+l, sans-serif">xxxx.=20
+,</p>
+<p style=3D"margin: 0px 0px 9px 0px; font-size: 13px; font-family: &quot;Lu=
+cida Grande&quot;, Helvetica, Verdana, Arial, sans-serif">
+xxxx.
+</p>
+
+<p style=3D"margin: 0px 0px 9px 0px; font-size: 13px; font-family: &quot;Lu=
+cida Grande&quot;, Helvetica, Verdana, Arial, sans-serif">You can reply =
+to this email if you have any questions.</p>
+<p style=3D"margin: 0px 0px 9px 0px; font-size: 13px; font-family: &quot;Lu=
+cida Grande&quot;, Helvetica, Verdana, Arial, sans-serif">Thank you,</p>
+ </td>
+ </tr></tbody>
+ </table>
+ </td>
+ </tr>
+
+ <!-- FOOTER -->
+ <tr>
+ <td align=3D"center" style=3D"min-width: 590px;">
+ <table width=3D"590" border=3D"0" cellpadding=3D=
+"0" bgcolor=3D"#875A7B" style=3D"min-width: 590px; background-color: rgb(13=
+5,90,123); padding: 20px;">
+ <tbody><tr>
+ <td valign=3D"middle" align=3D"left" style=
+=3D"color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;"=
+>
+ xxxx<br />
+ +1-801-980-4240
+ </td>
+ <td valign=3D"middle" align=3D"right" style=
+=3D"color: #fff; padding-top: 10px; padding-bottom: 10px; font-size: 12px;"=
+>
+ <a href=3D"http://erp.xxxx.xxxx/info@xxxx-a=
+aa.com" style=3D"text-decoration:none; color: white;">info@aust-mfg.com</a>=
+<br />
+ <a href=3D"http://www.xxxx=
+.com" style=3D"text-decoration:none; color: white;">
+ http://www.xxxx.com
+ </a>
+ </td>
+ </tr>
+ </tbody></table>
+ </td>
+ </tr>
+ <tr>
+ <td align=3D"center">
+ Powered by <a href=3D"https://www.odoo.com">Odo=
+o</a>.
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ =20
+ <pre style=3D"white-space: pre-wrap">xxxx.
+</pre>
+</blockquote></div>
+</body></html>
+--------=_MB48E455BD-2850-42EC-B1CA-886CDF48905E--"""
+
diff --git a/addons/test_mail/tests/test_mail_gateway.py b/addons/test_mail/tests/test_mail_gateway.py
index f07a21bcaf6..327a0c7f007 100644
--- a/addons/test_mail/tests/test_mail_gateway.py
+++ b/addons/test_mail/tests/test_mail_gateway.py
@@ -7,7 +7,7 @@ from email.utils import formataddr
from odoo.addons.test_mail.data.test_mail_data import \
MAIL_TEMPLATE, MAIL_TEMPLATE_PLAINTEXT, MAIL_MULTIPART_MIXED, MAIL_MULTIPART_MIXED_TWO, \
- MAIL_MULTIPART_IMAGE, MAIL_SINGLE_BINARY, MAIL_EML_ATTACHMENT
+ MAIL_MULTIPART_IMAGE, MAIL_SINGLE_BINARY, MAIL_EML_ATTACHMENT, MAIL_XHTML
from odoo.addons.test_mail.tests.common import BaseFunctionalTest, MockEmails
from odoo.tools import mute_logger
@@ -85,6 +85,12 @@ class TestMailgateway(BaseFunctionalTest, MockEmails):
self.env['mail.thread'].message_process('mail.channel', MAIL_EML_ATTACHMENT)
@mute_logger('odoo.addons.mail.models.mail_thread')
+ def test_message_parse_xhtml(self):
+ """ Test that the parsing of mail with embedded emails as eml(msg) which generates empty attachments, can be processed.
+ """
+ self.env['mail.thread'].message_process('mail.channel', MAIL_XHTML)
+
+ @mute_logger('odoo.addons.mail.models.mail_thread')
def test_message_process_cid(self):
record = self.format_and_process(MAIL_MULTIPART_IMAGE, to='groups@example.com')
message = record.message_ids[0]
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js
index f7ef80cb2c6..8b266d8ffef 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -4105,10 +4105,20 @@ var BasicModel = AbstractModel.extend({
var r2 = self.localData[record2ID];
var data1 = _.extend({}, r1.data, r1._changes);
var data2 = _.extend({}, r2.data, r2._changes);
- if (data1[order.name] < data2[order.name]) {
+
+ // Default value to sort against: the value of the field
+ var orderData1 = data1[order.name];
+ var orderData2 = data2[order.name];
+
+ // If the field is a relation, sort on the display_name of those records
+ if (list.fields[order.name].type === 'many2one') {
+ orderData1 = orderData1 ? self.localData[orderData1].data.display_name : "";
+ orderData2 = orderData2 ? self.localData[orderData2].data.display_name : "";
+ }
+ if (orderData1 < orderData2) {
return order.asc ? -1 : 1;
}
- if (data1[order.name] > data2[order.name]) {
+ if (orderData1 > orderData2) {
return order.asc ? 1 : -1;
}
return compareRecords(record1ID, record2ID, level + 1);
diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js
index febb7795e7b..23e7aedb0eb 100644
--- a/addons/web/static/tests/fields/relational_fields_tests.js
+++ b/addons/web/static/tests/fields/relational_fields_tests.js
@@ -2272,6 +2272,43 @@ QUnit.module('relational_fields', {
form.destroy();
});
+ QUnit.test('x2many list sorted by many2one', function (assert) {
+ assert.expect(3);
+
+ this.data.partner.records[0].p = [1, 2, 4];
+ this.data.partner.fields.trululu.sortable = true;
+
+ var form = createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ arch: '<form>' +
+ '<field name="p">' +
+ '<tree>' +
+ '<field name="id"/>' +
+ '<field name="trululu"/>' +
+ '</tree>' +
+ '</field>' +
+ '</form>',
+ res_id: 1,
+ });
+
+ assert.strictEqual(form.$('.o_data_row .o_list_number').text(), '124',
+ "should have correct order initially");
+
+ form.$('.o_list_view thead th:nth(1)').click();
+
+ assert.strictEqual(form.$('.o_data_row .o_list_number').text(), '412',
+ "should have correct order (ASC)");
+
+ form.$('.o_list_view thead th:nth(1)').click();
+
+ assert.strictEqual(form.$('.o_data_row .o_list_number').text(), '214',
+ "should have correct order (DESC)");
+
+ form.destroy();
+ });
+
QUnit.test('many2many list add *many* records, remove, re-add', function (assert) {
assert.expect(5);