@@ -71,7 +71,10 @@ def _send_confirmation_email(self):
7171 for rec in self :
7272 if rec .picking_type_id .mail_template_id :
7373 try :
74- rec .message_post_with_source (rec .picking_type_id .mail_template_id )
74+ rec .with_context (
75+ email_notification_force_header = True ,
76+ email_notification_force_footer = True ,
77+ ).message_post_with_source (rec .picking_type_id .mail_template_id )
7578 except Exception as error :
7679 title = _ ("ERROR: Picking was not sent via email" )
7780 rec .message_post (
@@ -88,7 +91,11 @@ def _send_confirmation_email(self):
8891 super (StockPicking , self )._send_confirmation_email ()
8992
9093 def _action_done (self ):
91- for rec in self .with_context (mail_notify_force_send = False ).filtered ("picking_type_id.mail_template_id" ):
94+ for rec in self .with_context (
95+ mail_notify_force_send = False ,
96+ email_notification_force_header = True ,
97+ email_notification_force_footer = True ,
98+ ).filtered ("picking_type_id.mail_template_id" ):
9299 try :
93100 rec .message_post_with_template (rec .picking_type_id .mail_template_id .id )
94101 except Exception as error :
@@ -97,7 +104,7 @@ def _action_done(self):
97104 body = "<br/><br/>" .join (
98105 [
99106 "<b>" + title + "</b>" ,
100- _ ("Please check the email template associated with" " the picking type." ),
107+ _ ("Please check the email template associated with the picking type." ),
101108 "<code>" + str (error ) + "</code>" ,
102109 ]
103110 ),
0 commit comments