diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 51e3d2dbe85..1f47a6be9bd 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -127,6 +127,7 @@ class account_bank_statement(osv.osv): _order = "date desc, id desc" _name = "account.bank.statement" _description = "Bank Statement" + _inherit = ['mail.thread'] _columns = { 'name': fields.char('Name', size=64, required=True, states={'draft': [('readonly', False)]}, readonly=True, help='if you give the Name other then /, its created Accounting Entries Move will be with same name as statement name. This allows the statement entries to have the same references than the statement itself'), # readonly for account_cash_statement 'date': fields.date('Date', required=True, states={'confirm': [('readonly', True)]}, select=True), @@ -364,7 +365,7 @@ class account_bank_statement(osv.osv): 'name': st_number, 'balance_end_real': st.balance_end }, context=context) - self.log(cr, uid, st.id, _('Statement %s is confirmed, journal items are created.') % (st_number,)) + self.message_append_note(cr, uid, [st.id], body=_('Statement %s is confirmed, journal items are created.') % (st_number,), context=context) return self.write(cr, uid, ids, {'state':'confirm'}, context=context) def button_cancel(self, cr, uid, ids, context=None): diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index decf9c2aaa6..c6011979f8d 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -982,7 +982,6 @@ class account_invoice(osv.osv): def invoice_validate(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state':'open'}, context=context) - self.invoice_validate_send_note(cr, uid, ids, context=context) return True def line_get_convert(self, cr, uid, x, part, date, context=None): @@ -1046,7 +1045,7 @@ class account_invoice(osv.osv): if obj_inv.type in ('out_invoice', 'out_refund'): ctx = self.get_log_context(cr, uid, context=ctx) message = _("Invoice '%s' is validated.") % name - self.log(cr, uid, inv_id, message, context=ctx) + self.message_append_note(cr, uid, [inv_id], body=message, context=context) return True def action_cancel(self, cr, uid, ids, *args): @@ -1276,7 +1275,7 @@ class account_invoice(osv.osv): # TODO: use currency's formatting function msg = _("Invoice '%s' is paid partially: %s%s of %s%s (%s%s remaining)") % \ (name, pay_amount, code, invoice.amount_total, code, total, code) - self.log(cr, uid, inv_id, msg) + self.message_append_note(cr, uid, [inv_id], body=msg, context=context) self.pool.get('account.move.line').reconcile_partial(cr, uid, line_ids, 'manual', context) # Update the stored value (fields.function), so we write to trigger recompute @@ -1300,10 +1299,6 @@ class account_invoice(osv.osv): for obj in self.browse(cr, uid, ids, context=context): self.message_append_note(cr, uid, [obj.id],body=_("%s created.") % (self._get_document_type(obj.type)), context=context) - def invoice_validate_send_note(self, cr, uid, ids, context=None): - for obj in self.browse(cr, uid, ids, context=context): - self.message_append_note(cr, uid, [obj.id], body=_("%s validated.") % (self._get_document_type(obj.type)), context=context) - def confirm_paid_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_append_note(cr, uid, [obj.id], body=_("%s paid.") % (self._get_document_type(obj.type)), context=context) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 6f982b17480..8254d5183be 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -132,8 +132,6 @@ - -