diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 8a7251b3856..b8f3a9071a0 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -395,18 +395,23 @@ class account_invoice(osv.osv): template_id = template and template[1] or False res = mod_obj.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form') res_id = res and res[1] or False - ctx = dict(context, active_model='account.invoice', active_id=ids[0]) - ctx.update({'mail.compose.template_id': template_id}) + ctx = dict(context) + ctx.update({ + 'default_model': 'account.invoice', + 'default_res_id': ids[0], + 'default_use_template': True, + 'default_template_id': template_id, + }) return { - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'mail.compose.message', - 'views': [(res_id, 'form')], - 'view_id': res_id, - 'type': 'ir.actions.act_window', - 'target': 'new', - 'context': ctx, - 'nodestroy': True, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'mail.compose.message', + 'views': [(res_id, 'form')], + 'view_id': res_id, + 'type': 'ir.actions.act_window', + 'target': 'new', + 'context': ctx, + 'nodestroy': True, } def confirm_paid(self, cr, uid, ids, context=None): diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index d2976882981..05a75f5847d 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1045,6 +1045,8 @@ class account_voucher(osv.osv): # if the amount encoded in voucher is equal to the amount unreconciled, we need to compute the # currency rate difference if line.amount == line.amount_unreconciled: + if not line.move_line_id.amount_residual: + raise osv.except_osv(_('Wrong bank statement line'),_("You have to delete the bank statement line which the payment was reconciled to manually. Please check the payment of the partner %s by the amount of %s.")%(line.voucher_id.partner_id.name, line.voucher_id.amount)) currency_rate_difference = line.move_line_id.amount_residual - amount else: currency_rate_difference = 0.0 diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 776df713b4e..250ad98a603 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -96,22 +96,6 @@ class account_analytic_account(osv.osv): res[row['id']][field] = row[field] return self._compute_level_tree(cr, uid, ids, child_ids, res, fields, context) - def name_get(self, cr, uid, ids, context=None): - if isinstance(ids, (int, long)): - ids=[ids] - if not ids: - return [] - res = [] - for account in self.browse(cr, uid, ids, context=context): - data = [] - acc = account - while acc: - data.insert(0, acc.name) - acc = acc.parent_id - data = ' / '.join(data) - res.append((account.id, data)) - return res - def _complete_name_calc(self, cr, uid, ids, prop, unknow_none, unknow_dict): res = self.name_get(cr, uid, ids) return dict(res) diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py index e7348acb675..fa7a929a543 100644 --- a/addons/mail/__openerp__.py +++ b/addons/mail/__openerp__.py @@ -61,7 +61,6 @@ The main features of the module are: 'website': 'http://www.openerp.com', 'depends': ['base', 'base_tools', 'base_setup'], 'data': [ - 'wizard/invite_view.xml', 'wizard/mail_compose_message_view.xml', 'mail_message_subtype.xml', 'res_config_view.xml', diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 9e228083b1b..8e40ae37546 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -148,7 +148,7 @@ class mail_message(osv.Model): def _message_dict_get(self, cr, uid, msg, context=None): """ Return a dict representation of the message browse record. """ - attachment_ids = self.pool.get('ir.attachment').name_get(cr, uid, [x.id for x in msg.attachment_ids], context=context) + attachment_ids = [{'id': attach[0], 'name': attach[1]} for attach in self.pool.get('ir.attachment').name_get(cr, uid, [x.id for x in msg.attachment_ids], context=context)] author_id = self.pool.get('res.partner').name_get(cr, uid, [msg.author_id.id], context=context)[0] author_user_id = self.pool.get('res.users').name_get(cr, uid, [msg.author_id.user_ids[0].id], context=context)[0] partner_ids = self.pool.get('res.partner').name_get(cr, uid, [x.id for x in msg.partner_ids], context=context) @@ -307,15 +307,15 @@ class mail_message(osv.Model): def unlink(self, cr, uid, ids, context=None): # cascade-delete attachments that are directly attached to the message (should only happen - # for mail.messages that act as parent for a standalone mail.mail record. + # for mail.messages that act as parent for a standalone mail.mail record). attachments_to_delete = [] - for mail in self.browse(cr, uid, ids, context=context): - for attach in mail.attachment_ids: - if attach.res_model == 'mail.message' and attach.res_id == mail.id: + for message in self.browse(cr, uid, ids, context=context): + for attach in message.attachment_ids: + if attach.res_model == self._name and attach.res_id == message.id: attachments_to_delete.append(attach.id) if attachments_to_delete: self.pool.get('ir.attachment').unlink(cr, uid, attachments_to_delete, context=context) - return super(mail_message,self).unlink(cr, uid, ids, context=context) + return super(mail_message, self).unlink(cr, uid, ids, context=context) def notify(self, cr, uid, newid, context=None): """ Add the related record followers to the destination partner_ids. diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 48a178732b0..92ead6f2432 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -96,6 +96,10 @@ width: 120px; } +.openerp button.oe_mail_button_followers { + display: inline; +} + .openerp button.oe_mail_button_mouseout { color: white; background-color: #8a89ba; diff --git a/addons/mail/static/src/js/mail_followers.js b/addons/mail/static/src/js/mail_followers.js index b1d62b76a62..9a823df0369 100644 --- a/addons/mail/static/src/js/mail_followers.js +++ b/addons/mail/static/src/js/mail_followers.js @@ -85,7 +85,7 @@ openerp_mail_followers = function(session, mail) { var node_user_list = this.$el.find('ul.oe_mail_followers_display').empty(); this.$el.find('div.oe_mail_recthread_followers h4').html(this.options.title + ' (' + records.length + ')'); _(records).each(function (record) { - record.avatar_url = mail.ChatterUtils.get_image(self.session.prefix, self.session.session_id, 'res.partner', 'image_small', record.id); + record.avatar_url = mail.ChatterUtils.get_image(self.session, 'res.partner', 'image_small', record.id); $(session.web.qweb.render('mail.followers.partner', {'record': record})).appendTo(node_user_list); }); if (this.message_is_follower) { diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index bf339f21f1c..4d3b56cf62f 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -114,7 +114,7 @@