diff --git a/addons/account/account.py b/addons/account/account.py
index 8efdcad50eb..a68b65f865a 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -652,7 +652,7 @@ class account_account(osv.osv):
done_list = []
account = self.browse(cr, uid, id, context=context)
new_child_ids = []
- default.update(code=_("%s (copy)") % (account['code'] or ''))
+ default.setdefault('code', _("%s (copy)") % (account['code'] or ''))
if not local:
done_list = []
if account.id in done_list:
diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml
index 9aa98ad2bc2..7f382dd9afd 100644
--- a/addons/event/event_view.xml
+++ b/addons/event/event_view.xml
@@ -231,7 +231,7 @@
-
+
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py
index ac4154e80d0..635b0066ec8 100644
--- a/addons/mail/wizard/mail_compose_message.py
+++ b/addons/mail/wizard/mail_compose_message.py
@@ -33,18 +33,17 @@ from openerp.tools.translate import _
EXPRESSION_PATTERN = re.compile('(\$\{.+?\})')
-def _reopen(self, res_id, model):
+def _reopen(self, res_id, model, context=None):
+ # save original model in context, because selecting the list of available
+ # templates requires a model in context
+ context = dict(context or {}, default_model=model)
return {'type': 'ir.actions.act_window',
'view_mode': 'form',
'view_type': 'form',
'res_id': res_id,
'res_model': self._name,
'target': 'new',
- # save original model in context, because selecting the list of available
- # templates requires a model in context
- 'context': {
- 'default_model': model,
- },
+ 'context': context,
}
@@ -428,7 +427,7 @@ class mail_compose_message(osv.TransientModel):
template_values = record.onchange_template_id(template_id, record.composition_mode, record.model, record.res_id)['value']
template_values['template_id'] = template_id
record.write(template_values)
- return _reopen(self, record.id, record.model)
+ return _reopen(self, record.id, record.model, context=context)
#------------------------------------------------------
# Template rendering
diff --git a/addons/payment_transfer/i18n/payment_transfer.pot b/addons/payment_transfer/i18n/payment_transfer.pot
index c7576b07d9b..21284df9640 100644
--- a/addons/payment_transfer/i18n/payment_transfer.pot
+++ b/addons/payment_transfer/i18n/payment_transfer.pot
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-09-05 12:00+0000\n"
-"PO-Revision-Date: 2015-09-05 12:00+0000\n"
+"POT-Creation-Date: 2016-12-14 14:52+0000\n"
+"PO-Revision-Date: 2016-12-14 14:52+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -15,6 +15,18 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
+#. module: payment_transfer
+#: code:addons/payment_transfer/models/payment_acquirer.py:32
+#, python-format
+msgid "
\n"
+"
Please use the following transfer details
\n"
+"
%(bank_title)s
\n"
+"%(bank_accounts)s\n"
+"
Communication
\n"
+"
Please use the order name as communication reference.
\n"
+"
"
+msgstr ""
+
#. module: payment_transfer
#: model:payment.acquirer,pre_msg:payment_transfer.payment_acquirer_transfer
msgid "Transfer information will be provided after choosing the payment mode.
\n"
@@ -45,6 +57,7 @@ msgstr ""
#. module: payment_transfer
#: code:addons/payment_transfer/models/payment_acquirer.py:19
+#: model:payment.acquirer,name:payment_transfer.payment_acquirer_transfer
#, python-format
msgid "Wire Transfer"
msgstr ""
diff --git a/addons/payment_transfer/models/payment_acquirer.py b/addons/payment_transfer/models/payment_acquirer.py
index 92b9fc9c70e..667d12fc341 100644
--- a/addons/payment_transfer/models/payment_acquirer.py
+++ b/addons/payment_transfer/models/payment_acquirer.py
@@ -29,13 +29,13 @@ class TransferPaymentAcquirer(osv.Model):
accounts = self.pool['res.partner.bank'].name_get(cr, uid, bank_ids, context=context)
bank_title = _('Bank Accounts') if len(accounts) > 1 else _('Bank Account')
bank_accounts = ''.join([''] + ['- %s
' % name for id, name in accounts] + ['
'])
- post_msg = '''
+ post_msg = _('''
Please use the following transfer details
%(bank_title)s
%(bank_accounts)s
Communication
Please use the order name as communication reference.
-
''' % {
+
''') % {
'bank_title': bank_title,
'bank_accounts': bank_accounts,
}
diff --git a/addons/stock/wizard/make_procurement_product.py b/addons/stock/wizard/make_procurement_product.py
index 3cd492311f0..415c7d77de2 100644
--- a/addons/stock/wizard/make_procurement_product.py
+++ b/addons/stock/wizard/make_procurement_product.py
@@ -78,7 +78,7 @@ class make_procurement(osv.osv_memory):
'warehouse_id': proc.warehouse_id.id,
'location_id': wh.lot_stock_id.id,
'company_id': wh.company_id.id,
- })
+ }, context=context)
procurement_obj.signal_workflow(cr, uid, [procure_id], 'button_confirm')
id2 = data_obj._get_id(cr, uid, 'procurement', 'procurement_tree_view')
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js
index bf181bf3909..34f3e3a4988 100644
--- a/addons/web/static/src/js/view_form.js
+++ b/addons/web/static/src/js/view_form.js
@@ -5612,6 +5612,7 @@ instance.web.form.FieldReference = instance.web.form.AbstractField.extend(instan
this.m2o = new instance.web.form.FieldMany2One(fm, { attrs: {
name: 'Referenced Document',
modifiers: JSON.stringify({readonly: this.get('effective_readonly')}),
+ context: this.build_context().eval(),
}});
this.m2o.on("change:value", this, this.data_changed);
this.m2o.appendTo(this.$(".oe_form_view_reference_m2o"));
diff --git a/doc/cla/individual/hhgabelgaard.md b/doc/cla/individual/hhgabelgaard.md
new file mode 100644
index 00000000000..e873ef3f5e4
--- /dev/null
+++ b/doc/cla/individual/hhgabelgaard.md
@@ -0,0 +1,11 @@
+Denmark, 2016-05-06
+
+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,
+
+Hans Henrik Gabelgaard hhg@gabelgaard.org https://github.com/hhgabelgaard
\ No newline at end of file
diff --git a/openerp/models.py b/openerp/models.py
index b15276eaf46..2be7bf34723 100644
--- a/openerp/models.py
+++ b/openerp/models.py
@@ -741,10 +741,11 @@ class BaseModel(object):
methods = []
for attr, func in getmembers(cls, is_constraint):
for name in func._constrains:
- if name not in cls._fields:
+ field = cls._fields.get(name)
+ if not field:
_logger.warning("method %s.%s: @constrains parameter %r is not a field name", cls._name, attr, name)
- if not cls._fields[name].store:
- _logger.warning("method %s.%s: @constrains parameter %r is not stored", cls._name, attr, name)
+ if not (field.store or field.column and field.column._fnct_inv):
+ _logger.warning("method %s.%s: @constrains parameter %r is not writeable", cls._name, attr, name)
methods.append(func)
# optimization: memoize result on cls, it will not be recomputed