@@ -84,7 +84,7 @@ def _generate_code(self):
8484
8585 is_cash_entitlement = fields .Boolean ("Cash Entitlement" , default = False )
8686 currency_id = fields .Many2one ("res.currency" , readonly = True , related = "journal_id.currency_id" )
87- initial_amount = fields .Monetary (required = True , currency_field = "currency_id" )
87+ initial_amount = fields .Monetary (string = "Amount" , required = True , currency_field = "currency_id" )
8888 transfer_fee = fields .Monetary (currency_field = "currency_id" , default = 0.0 )
8989 balance = fields .Monetary (compute = "_compute_balance" ) # in company currency
9090 # TODO: implement transactions against this entitlement
@@ -390,6 +390,29 @@ def _get_approval_definition(self):
390390 self .ensure_one ()
391391 return self .entitlement_approval_definition_id
392392
393+ def _notify_thread_by_email (self , message , recipients_data , ** kwargs ):
394+ """Suppress outgoing email when the parent program has email
395+ notifications disabled. Chatter logging and in-app notifications are
396+ unaffected — only the email dispatch is short-circuited."""
397+ self .ensure_one ()
398+ program = self .cycle_id .program_id
399+ if program and not program ._should_send_email_notifications ():
400+ return
401+ return super ()._notify_thread_by_email (message , recipients_data , ** kwargs )
402+
403+ def _create_approval_activity (self , definition , review ):
404+ """Gate the approver-email path on the parent program's toggle.
405+
406+ spp.approval.mixin schedules a mail.activity for each approver on
407+ submit; the activity dispatch sends email through the assignee's
408+ notification preferences. Skip the scheduling entirely when the
409+ program has email notifications turned off."""
410+ self .ensure_one ()
411+ program = self .cycle_id .program_id
412+ if program and not program ._should_send_email_notifications ():
413+ return
414+ return super ()._create_approval_activity (definition , review )
415+
393416 def action_submit_for_approval (self ):
394417 """Submit entitlement for approval using standardized workflow."""
395418 for record in self :
@@ -885,6 +908,24 @@ def _resolve_approval_definition(self):
885908 self .ensure_one ()
886909 return self ._get_approval_definition ()
887910
911+ def _notify_thread_by_email (self , message , recipients_data , ** kwargs ):
912+ """Suppress outgoing email when the parent program has email
913+ notifications disabled. Chatter logging and in-app notifications are
914+ unaffected — only the email dispatch is short-circuited."""
915+ self .ensure_one ()
916+ program = self .cycle_id .program_id
917+ if program and not program ._should_send_email_notifications ():
918+ return
919+ return super ()._notify_thread_by_email (message , recipients_data , ** kwargs )
920+
921+ def _create_approval_activity (self , definition , review ):
922+ """Gate the approver-email path on the parent program's toggle."""
923+ self .ensure_one ()
924+ program = self .cycle_id .program_id
925+ if program and not program ._should_send_email_notifications ():
926+ return
927+ return super ()._create_approval_activity (definition , review )
928+
888929 def action_submit_for_approval (self ):
889930 """Submit in-kind entitlement for approval using standardized workflow."""
890931 for record in self :
0 commit comments