From 57788ddb6714f8bd42d3a2399352fe261a47cb61 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Wed, 20 Jul 2016 14:03:31 +0200 Subject: [PATCH 1/9] [FIX] stock: add missing context when creating procurement order Closes #12858 --- addons/stock/wizard/make_procurement_product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/wizard/make_procurement_product.py b/addons/stock/wizard/make_procurement_product.py index bef04a3db68..7fd7f44c740 100644 --- a/addons/stock/wizard/make_procurement_product.py +++ b/addons/stock/wizard/make_procurement_product.py @@ -77,7 +77,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') From 4f6e4bb28e113e47038a1a1ff1947a94c178b39d Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Tue, 8 Mar 2016 18:37:58 +0100 Subject: [PATCH 2/9] [FIX] account: use code from defaults dict if present Do not force a ugly '... (copy)' code if provides one. Closes #11260 --- addons/account/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 2bae5c5c7e4..e1d41fe919e 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -642,7 +642,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: From f6692139da96bf25ed0699157e53254373607415 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 3 Aug 2016 10:48:53 +0200 Subject: [PATCH 3/9] [FIX] event: add missing name attribute This breaks nothing, but allows to enable this filter by default. Closes #12997 --- addons/event/event_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 3ee33e011b6..bf713b49fe4 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -273,7 +273,7 @@ - + @@ -424,7 +424,7 @@ - + From 13ed92c6d80e7e4ef45e368a5cd35c71f099c572 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 14 Dec 2016 15:53:03 +0100 Subject: [PATCH 4/9] [FIX] payment_transfer: untranslated string Replaces and closes #12787 --- .../payment_transfer/i18n/payment_transfer.pot | 17 +++++++++++++++-- .../payment_transfer/models/payment_acquirer.py | 4 ++-- 2 files changed, 17 insertions(+), 4 deletions(-) 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 2abdb541f1e..e2d9e0cefc6 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, } From 450f7df00d49d3a9a7dc810e6744292600ea8091 Mon Sep 17 00:00:00 2001 From: Jordan Vrtanoski Date: Sat, 7 May 2016 15:54:32 +0400 Subject: [PATCH 5/9] [FIX] web: transfer context to underlying many2one in reference field Fixes #11955 (loss of context in many2one subwidget) Closes #11957 --- addons/web/static/src/js/view_form.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 1555caf454e..3d84cd44c9a 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -5570,6 +5570,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")); From 8e3e7874ad140c0e8676d6998aa8f3cb306979c2 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 15 Dec 2016 09:52:21 +0100 Subject: [PATCH 6/9] [FIX] models: allow constraint methods triggered by function fields --- openerp/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/models.py b/openerp/models.py index 3b1b46dedb8..f20eae7ecf5 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -749,7 +749,7 @@ class BaseModel(object): for name in func._constrains: if name not in cls._fields: _logger.warning("method %s.%s: @constrains parameter %r is not a field name", cls._name, attr, name) - if not cls._fields[name].store: + if not cls._fields[name].column: _logger.warning("method %s.%s: @constrains parameter %r is not stored", cls._name, attr, name) methods.append(func) From 64249936e82926353350a0db8490eb6b17fe5941 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 15 Dec 2016 11:08:13 +0100 Subject: [PATCH 7/9] [FIX] models: allow constraint methods triggered by function fields --- openerp/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openerp/models.py b/openerp/models.py index f20eae7ecf5..b13139de47f 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -747,10 +747,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].column: - _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 From c7fc8e172240f72cdd6f89a246fd9122323257f6 Mon Sep 17 00:00:00 2001 From: Hans Henrik Gabelgaard Date: Fri, 6 May 2016 14:39:53 +0200 Subject: [PATCH 8/9] [CLA] signature for hhgabelgaard cf #11947 --- doc/cla/individual/hhgabelgaard.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/cla/individual/hhgabelgaard.md 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 From 638989b84e1119e10e6b2f2d33aab683ceef4aa5 Mon Sep 17 00:00:00 2001 From: Hans Henrik Gabelgaard Date: Fri, 6 May 2016 09:32:19 +0200 Subject: [PATCH 9/9] [FIX] mail: keep recipients after saving a template When sending an email via the mail.compose wizard, the selected partners are stored in the context (`active_ids`). If the composed message is saved (button "save template"), the context is lost in the _reopen action. The active_ids content of the new context is the id of the newly created mail template and is used as the id of a res.partner (sending the email to a different contact). Keep the context during the reopen to avoid losing active_ids. Closes #11947 --- .../email_template/wizard/mail_compose_message.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/email_template/wizard/mail_compose_message.py b/addons/email_template/wizard/mail_compose_message.py index 60b3b0d3af0..fcc4441abf1 100644 --- a/addons/email_template/wizard/mail_compose_message.py +++ b/addons/email_template/wizard/mail_compose_message.py @@ -23,18 +23,17 @@ from openerp import tools from openerp.osv import osv, fields -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, } @@ -148,7 +147,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) #------------------------------------------------------ # Wizard validation and send