Exemple #1
0
 def message_post(self,
                  cr,
                  uid,
                  thread_id,
                  body='',
                  subject=None,
                  type='notification',
                  subtype=None,
                  parent_id=False,
                  attachments=None,
                  context=None,
                  **kwargs):
     if isinstance(thread_id, str):
         thread_id = get_real_ids(thread_id)
     return super(tarun_hotel_activity,
                  self).message_post(cr,
                                     uid,
                                     thread_id,
                                     body=body,
                                     subject=subject,
                                     type=type,
                                     subtype=subtype,
                                     parent_id=parent_id,
                                     attachments=attachments,
                                     context=context,
                                     **kwargs)
Exemple #2
0
 def default_get(self, cr, uid, fields, context=None):
     '''
     in case someone clicked on 'invite others' wizard in the followers widget, transform virtual ids in real ids
     '''
     result = super(invite_wizard, self).default_get(cr,
                                                     uid,
                                                     fields,
                                                     context=context)
     if 'res_id' in result:
         result['res_id'] = get_real_ids(result['res_id'])
     return result
Exemple #3
0
 def write(self, cr, uid, ids, vals, context=None):
     '''
     when posting an attachment (new or not), convert the virtual ids in real ids.
     '''
     if isinstance(vals.get('res_id'), str):
         vals['res_id'] = get_real_ids(vals.get('res_id'))
     return super(ir_attachment, self).write(cr,
                                             uid,
                                             ids,
                                             vals,
                                             context=context)
Exemple #4
0
 def _find_allowed_model_wise(self,
                              cr,
                              uid,
                              doc_model,
                              doc_dict,
                              context=None):
     if doc_model == 'tarun.hotel.activity':
         for virtual_id in self.pool.get(doc_model).get_recurrent_ids(
                 cr, uid, doc_dict.keys(), [], context=context):
             doc_dict.setdefault(virtual_id,
                                 doc_dict[get_real_ids(virtual_id)])
     return super(mail_message,
                  self)._find_allowed_model_wise(cr,
                                                 uid,
                                                 doc_model,
                                                 doc_dict,
                                                 context=context)
Exemple #5
0
 def search(self,
            cr,
            uid,
            args,
            offset=0,
            limit=0,
            order=None,
            context=None,
            count=False):
     '''
     convert the search on real ids in the case it was asked on virtual ids, then call super()
     '''
     for index in range(len(args)):
         if args[index][0] == "res_id" and isinstance(args[index][2], str):
             args[index][2] = get_real_ids(args[index][2])
     return super(ir_attachment, self).search(cr,
                                              uid,
                                              args,
                                              offset=offset,
                                              limit=limit,
                                              order=order,
                                              context=context,
                                              count=count)