summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-01-25 13:04:50 +0100
committerChristophe Simonis <chs@odoo.com>2017-01-25 13:04:50 +0100
commit3e31dc0ba4ebe9884c080a3ec261c8c051ce5d3c (patch)
treec1e2a1da486295dc63fe0091b9fe362bfff20c53
parent1d089833b47fe740d6dfaea89f94b1c9d1946c1e (diff)
parent09f7916f48e12d9ace4f7a2f83f43beaa449c1b3 (diff)
[MERGE] forward port branch saas-6 up to 09f7916f48e
-rw-r--r--addons/account/models/account_invoice.py2
-rw-r--r--addons/mail/models/mail_message.py2
-rw-r--r--doc/cla/individual/sergiocorato.md9
3 files changed, 11 insertions, 2 deletions
diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py
index 83b3faa19d8..e3bceea033a 100644
--- a/addons/account/models/account_invoice.py
+++ b/addons/account/models/account_invoice.py
@@ -393,7 +393,7 @@ class AccountInvoice(models.Model):
default_model='account.invoice',
default_res_id=self.id,
default_use_template=bool(template),
- default_template_id=template.id,
+ default_template_id=template and template.id or False,
default_composition_mode='comment',
mark_invoice_as_sent=True,
)
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py
index aa10557d583..d155ef11065 100644
--- a/addons/mail/models/mail_message.py
+++ b/addons/mail/models/mail_message.py
@@ -857,7 +857,7 @@ class Message(models.Model):
def _invalidate_documents(self):
""" Invalidate the cache of the documents followed by ``self``. """
for record in self:
- if record.res_id:
+ if record.model and record.res_id:
self.env[record.model].invalidate_cache(ids=[record.res_id])
@api.model
diff --git a/doc/cla/individual/sergiocorato.md b/doc/cla/individual/sergiocorato.md
new file mode 100644
index 00000000000..5ac26c3f7ea
--- /dev/null
+++ b/doc/cla/individual/sergiocorato.md
@@ -0,0 +1,9 @@
+Italy, 2017-01-24
+
+I hereby agree to the terms of the Odoo Individual Contributor License Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this declaration.
+
+Signed,
+
+Sergio Corato sergiocorato@gmail.com https://github.com/sergiocorato