[IMP] mails

bzr revid: fp@tinyerp.com-20120817125004-wcchhac2cvxuf93i
This commit is contained in:
Fabien Pinckaers 2012-08-17 14:50:04 +02:00
parent 06f60b3517
commit 043dc83d20
4 changed files with 13 additions and 26 deletions

View File

@ -137,13 +137,13 @@ class email_template(osv.osv):
'model': fields.related('model_id','model', type='char', string='Related Document Model',
size=128, select=True, store=True, readonly=True),
# we need a separate m2m table to avoid ID collisions with the original mail.message entries
'attachment_ids': fields.many2many('ir.attachment', 'email_template_attachment_rel', 'email_template_id',
'attachment_id', 'Files to attach',
help="You may attach files to this template, to be added to all "
"emails created from this template"),
#'attachment_ids': fields.many2many('ir.attachment', 'email_template_attachment_rel', 'email_template_id',
# 'attachment_id', 'Files to attach',
# help="You may attach files to this template, to be added to all "
# "emails created from this template"),
# Overridden mail.message.common fields to make tooltips more appropriate:
'subject':fields.char('Subject', size=512, translate=True, help="Subject (placeholders may be used here)",),
#'subject':fields.char('Subject', size=512, translate=True, help="Subject (placeholders may be used here)",),
'email_from': fields.char('From', size=128, help="Sender address (placeholders may be used here)"),
'email_to': fields.char('To', size=256, help="Comma-separated recipient addresses (placeholders may be used here)"),
'email_cc': fields.char('Cc', size=256, help="Carbon copy recipients (placeholders may be used here)"),
@ -151,13 +151,13 @@ class email_template(osv.osv):
'mail_server_id': fields.many2one('ir.mail_server', 'Outgoing Mail Server', readonly=False,
help="Optional preferred server for outgoing mails. If not set, the highest "
"priority one will be used."),
'body': fields.text('Text Contents', translate=True, help="Plaintext version of the message (placeholders may be used here)"),
#'body': fields.text('Text Contents', translate=True, help="Plaintext version of the message (placeholders may be used here)"),
'body_html': fields.text('Rich-text Contents', translate=True, help="Rich-text/HTML version of the message (placeholders may be used here)"),
'message_id': fields.char('Message-Id', size=256, help="Message-ID SMTP header to use in outgoing messages based on this template. "
"Please note that this overrides the 'Resource Tracking' option, "
"so if you simply need to track replies to outgoing emails, enable "
"that option instead.\n"
"Placeholders must be used here, as this value always needs to be unique!"),
#'message_id': fields.char('Message-Id', size=256, help="Message-ID SMTP header to use in outgoing messages based on this template. "
# "Please note that this overrides the 'Resource Tracking' option, "
# "so if you simply need to track replies to outgoing emails, enable "
# "that option instead.\n"
# "Placeholders must be used here, as this value always needs to be unique!"),
# Fake fields used to implement the placeholder assistant
'model_object_field': fields.many2one('ir.model.fields', string="Field",

View File

@ -169,6 +169,7 @@ class mail_message(osv.Model):
self.pool.get(model).check_access_rule(cr, uid, mids, mode, context=context)
def create(self, cr, uid, values, context=None):
print values
newid = super(mail_message, self).create(cr, uid, values, context)
self.check(cr, uid, [newid], mode='create', context=context)

View File

@ -757,7 +757,7 @@ class mail_thread(osv.Model):
context = context or {}
attachments = attachments or {}
if type(res_id) in (list, tuple):
res_id = res_id[0]
res_id = res_id and res_id[0] or False
to_attach = []
for fname, fcontent in attachments:

View File

@ -54,7 +54,6 @@ class procurement_order(osv.osv):
'''
if context is None:
context = {}
try:
if use_new_cursor:
cr = pooler.get_db(use_new_cursor).cursor()
@ -119,19 +118,6 @@ class procurement_order(osv.osv):
offset += len(ids)
if not ids: break
end_date = fields.datetime.now()
if uid:
# Chatter: old res.request is now a chatter on res.users, id=uid
summary = _("""Here is the procurement scheduling report.
Start Time: %s
End Time: %s
Total Procurements processed: %d
Procurements with exceptions: %d
Skipped Procurements (scheduled date outside of scheduler range) %d
Exceptions:\n""") % (start_date, end_date, report_total, report_except, report_later)
summary += '\n'.join(report)
procurement_obj.message_post(cr, uid, ids, body=summary, context=context)
if use_new_cursor:
cr.commit()