[IMP] Improve ospp_base and ospp_slide modules
							parent
							
								
									724d4a7754
								
							
						
					
					
						commit
						ab8c4ebce6
					
				|  | @ -34,6 +34,8 @@ class SlideChannel(models.Model): | |||
| 
 | ||||
|             partner_ids = partner_obj.search([('channel_id', '=', rec.id)]) | ||||
| 
 | ||||
|             rec.message_unsubscribe(partner_ids=[x.partner_id.id for x in partner_ids]) | ||||
| 
 | ||||
|             if not rec.instance_ids: | ||||
|                 if rec.instance_arrangement in ['share', 'both']: | ||||
|                     vals = [] | ||||
|  | @ -160,6 +162,7 @@ class ChannelInstance(models.Model): | |||
|     is_notified = fields.Boolean('Is Notified', default=False) | ||||
| 
 | ||||
|     def action_post_instance(self): | ||||
|         partner_obj = self.env['slide.channel.partner'].sudo() | ||||
|         for rec in self: | ||||
|             subject = f"通知: 《{rec.channel_id.name}》实训环境已经生成" | ||||
|             html_body = f""" | ||||
|  | @ -171,6 +174,9 @@ class ChannelInstance(models.Model): | |||
|              | ||||
|             <div>预祝学习愉快!</div> | ||||
|             """ | ||||
|             partner_ids = partner_obj.search([('channel_id', '=', rec.channel_id.id)]) | ||||
|             rec.message_unsubscribe(partner_ids=[x.partner_id.id for x in partner_ids]) | ||||
| 
 | ||||
|             partner_ids = [x.partner_id.id for x in rec.user_scope] | ||||
|             kwargs = {} | ||||
|             rec.channel_id.with_context(mail_create_nosubscribe=True).message_post( | ||||
|  | @ -185,7 +191,6 @@ class ChannelInstance(models.Model): | |||
|             rec.is_notified = True | ||||
|             return True | ||||
| 
 | ||||
| 
 | ||||
|     def action_generate_instance(self): | ||||
|         for rec in self: | ||||
|             if rec.instance_created: | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Oliver Yuan
						Oliver Yuan