diff --git a/addons/account/models/account.py b/addons/account/models/account.py
index 3dfae4aeda0..9ff2baa2021 100644
--- a/addons/account/models/account.py
+++ b/addons/account/models/account.py
@@ -149,7 +149,7 @@ class AccountAccount(models.Model):
@api.one
def copy(self, default=None):
default = dict(default or {})
- default.update(code=_("%s (copy)") % (self.code or ''))
+ default.setdefault('code', _("%s (copy)") % (self.code or ''))
return super(AccountAccount, self).copy(default)
@api.multi
diff --git a/addons/event/views/event_views.xml b/addons/event/views/event_views.xml
index 91be22c65d5..288229c96a5 100644
--- a/addons/event/views/event_views.xml
+++ b/addons/event/views/event_views.xml
@@ -242,7 +242,7 @@
-
+
diff --git a/addons/mail/wizard/mail_compose_message.py b/addons/mail/wizard/mail_compose_message.py
index 6898341bb7f..50ac534dc18 100644
--- a/addons/mail/wizard/mail_compose_message.py
+++ b/addons/mail/wizard/mail_compose_message.py
@@ -12,18 +12,17 @@ from openerp.tools.safe_eval import safe_eval as eval
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,
}
@@ -397,7 +396,7 @@ class MailComposer(models.TransientModel):
# generate the saved template
record.write({'template_id': template.id})
record.onchange_template_id_wrapper()
- 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 f37857b6e0e..f24c21bc598 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 9.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-09-18 08:11+0000\n"
-"PO-Revision-Date: 2015-09-18 08:11+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
#: code:addons/payment_transfer/models/payment_acquirer.py:68
#, python-format
diff --git a/addons/payment_transfer/models/payment_acquirer.py b/addons/payment_transfer/models/payment_acquirer.py
index a8d47098c6c..8b6ba44f202 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['account.journal'].browse(cr, uid, journal_ids, context=context).mapped('bank_account_id').name_get()
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 d4744efea0e..451dbea23a4 100644
--- a/addons/stock/wizard/make_procurement_product.py
+++ b/addons/stock/wizard/make_procurement_product.py
@@ -53,7 +53,7 @@ class make_procurement(osv.osv_memory):
'location_id': wh.lot_stock_id.id,
'company_id': wh.company_id.id,
'route_ids': [(6, 0, proc.route_ids.ids)],
- })
+ }, 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/views/form_widgets.js b/addons/web/static/src/js/views/form_widgets.js
index 15acd788263..4fb7c220c1b 100644
--- a/addons/web/static/src/js/views/form_widgets.js
+++ b/addons/web/static/src/js/views/form_widgets.js
@@ -1113,6 +1113,7 @@ var FieldReference = common.AbstractField.extend(common.ReinitializeFieldMixin,
this.m2o = new 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 2af2ec78d09..a4404edfa71 100644
--- a/openerp/models.py
+++ b/openerp/models.py
@@ -748,10 +748,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