- # -----------------------------------------
- # OpenChatter notifications and need_action
- # -----------------------------------------
-
- def _get_document_type(self, type):
- type_dict = {
- # Translation markers will have no effect at runtime, only used to properly flag export
- 'out_invoice': _('Customer invoice'),
- 'in_invoice': _('Supplier invoice'),
- 'out_refund': _('Customer Refund'),
- 'in_refund': _('Supplier Refund'),
- }
- 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_post(cr, uid, [obj.id], body=_("%s <b>created</b>.") % (self._get_document_type(obj.type)),
- subtype="account.mt_invoice_new", 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_post(cr, uid, [obj.id], body=_("%s <b>paid</b>.") % (self._get_document_type(obj.type)),
- subtype="account.mt_invoice_paid", context=context)
-
- def invoice_cancel_send_note(self, cr, uid, ids, context=None):
- for obj in self.browse(cr, uid, ids, context=context):
- self.message_post(cr, uid, [obj.id], body=_("%s <b>cancelled</b>.") % (self._get_document_type(obj.type)),
- context=context)
-