Ejemplo n.º 1
0
    def send(self, auto_commit=False, raise_exception=False):
        for rec in self:
            subject = rec.subject

            if subject == 'Password reset':
                super(MailMail, self).send()
            else:
                row_custom = Util.get_setup(self)
                white_list_email = row_custom.white_list_email
                list_white_list_email = [one.login for one in white_list_email]

                email_list = []
                if rec.email_to:
                    email_list.append(rec.email_to)
                for partner in rec.recipient_ids:
                    email_list.append(partner.email)

                for email in email_list:
                    if email in list_white_list_email:
                        _logger.info('##################Send Email : %s ', email)
                        super(MailMail, self).send()
                    else:
                        _logger.info('##################Blocked Email : %s ', email)
                        # Memastikan tidak ada yang outstanding
                        self.cancel()
                        return False
Ejemplo n.º 2
0
 def default_payment_term_id(self):
     setup = Util.get_setup(self)
     return setup.default_payment_term_id