diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 8254d5183be..957960cceaa 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -144,7 +144,7 @@
-
- + @@ -180,7 +180,7 @@ - + @@ -471,7 +471,7 @@ [('type','=','in_invoice')] {'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'} - With Supplier Invoices you can enter and manage invoices issued by your suppliers. OpenERP can also generate draft invoices automatically from purchase orders or receipts. This way, you can control the invoice from your supplier according to what you purchased or received. + Click here to create Supplier invoice.you can control the invoice from your supplier according to what you purchased or received. OpenERP can also generate draft invoices automatically from purchase orders or receipts. @@ -510,7 +510,7 @@ [('type','=','in_refund')] {'default_type': 'in_refund', 'type': 'in_refund', 'journal_type': 'purchase_refund'} - With Supplier Refunds you can manage the credit notes you receive from your suppliers. A refund is a document that credits an invoice completely or partially. You can easily generate refunds and reconcile them directly from the invoice form. + Click here to create a new supplier refund.Track Refund you receive from your supplier. You can also generate refunds and reconcile them directly from the invoice form diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 9ca30aed099..7b99209b3b5 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -250,6 +250,7 @@ class account_voucher(osv.osv): _name = 'account.voucher' _description = 'Accounting Voucher' + _inherit = ['mail.thread'] _order = "date desc, id desc" # _rec_name = 'number' _columns = { @@ -1249,6 +1250,8 @@ class account_voucher(osv.osv): 'state': 'posted', 'number': name, }) + message = _("voucher '%s' is posted.") % name + self.message_append_note(cr, uid, [voucher.id], body=message, context=context) if voucher.journal_id.entry_posted: move_pool.post(cr, uid, [move_id], context={}) # We automatically reconcile the account move lines. @@ -1257,6 +1260,12 @@ class account_voucher(osv.osv): move_line_pool.reconcile_partial(cr, uid, rec_ids, writeoff_acc_id=voucher.writeoff_acc_id.id, writeoff_period_id=voucher.period_id.id, writeoff_journal_id=voucher.journal_id.id) return True + def create(self, cr, uid, vals, context=None): + voucher = super(account_voucher, self).create(cr, uid, vals, context=context) + if voucher: + self.create_send_note(cr, uid, [voucher], context=context) + return voucher + def copy(self, cr, uid, id, default={}, context=None): default.update({ 'state': 'draft', @@ -1270,6 +1279,21 @@ class account_voucher(osv.osv): default['date'] = time.strftime('%Y-%m-%d') return super(account_voucher, self).copy(cr, uid, id, default, context) + # -------------------------------------- + # OpenChatter methods and notifications + # -------------------------------------- + + def _get_document_type(self, type): + type_dict = { + 'payment': 'Supplier Payment', + 'purchase': 'Purchase Receipt', + } + return type_dict.get(type, 'Invoice') + + def create_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 created.") % (self._get_document_type(obj.type)), context=context) + account_voucher() class account_voucher_line(osv.osv): diff --git a/addons/account_voucher/account_voucher_pay_invoice.xml b/addons/account_voucher/account_voucher_pay_invoice.xml index da669ad04ee..87201b5c3bd 100644 --- a/addons/account_voucher/account_voucher_pay_invoice.xml +++ b/addons/account_voucher/account_voucher_pay_invoice.xml @@ -19,7 +19,7 @@ diff --git a/addons/account_voucher/voucher_payment_receipt_view.xml b/addons/account_voucher/voucher_payment_receipt_view.xml index 5ceee46b2cd..2b4fcbc61b5 100644 --- a/addons/account_voucher/voucher_payment_receipt_view.xml +++ b/addons/account_voucher/voucher_payment_receipt_view.xml @@ -145,7 +145,7 @@
-