summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/res_users.py
diff options
context:
space:
mode:
authortrisusilo48 <tri.susilo@altama.co.id>2024-10-02 09:44:39 +0700
committertrisusilo48 <tri.susilo@altama.co.id>2024-10-02 09:44:39 +0700
commit2739d3040a69228192096ee16373610149a2fb47 (patch)
tree545aa797d7407e8f22250dff15648495b891928f /indoteknik_custom/models/res_users.py
parent4d3d219b5f1002822a16067a28261fd59b170ff8 (diff)
parent7d3780ede67579b5891218efc370dc82eef510a1 (diff)
Merge branch 'production' of https://bitbucket.org/altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/res_users.py')
-rwxr-xr-xindoteknik_custom/models/res_users.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/indoteknik_custom/models/res_users.py b/indoteknik_custom/models/res_users.py
index 33f64ce3..5e16aad1 100755
--- a/indoteknik_custom/models/res_users.py
+++ b/indoteknik_custom/models/res_users.py
@@ -11,6 +11,8 @@ class ResUsers(models.Model):
activation_token = fields.Char(string="Activation Token")
otp_code = fields.Char(string='OTP Code')
otp_create_date = fields.Datetime(string='OTP Create Date')
+ payment_terms_id = fields.Many2one('account.payment.term', related='partner_id.property_payment_term_id', string='Payment Terms')
+
def _generate_otp(self):
for user in self:
@@ -28,7 +30,22 @@ class ResUsers(models.Model):
user._generate_otp()
user._generate_activation_token()
template.send_mail(user.id, force_send=True)
-
+
+ def send_company_request_mail(self):
+ template = self.env.ref('indoteknik_custom.mail_template_res_user_company_request')
+ for user in self:
+ template.send_mail(user.id, force_send=True)
+
+ def send_company_request_approve_mail(self):
+ template = self.env.ref('indoteknik_custom.mail_template_res_user_company_request_approve')
+ for user in self:
+ template.send_mail(user.id, force_send=True)
+
+ def send_company_request_reject_mail(self):
+ template = self.env.ref('indoteknik_custom.mail_template_res_user_company_request_reject')
+ for user in self:
+ template.send_mail(user.id, force_send=True)
+
def get_activation_token_url(self):
base_url = self.env['ir.config_parameter'].get_param('site.base.url')
return f'{base_url}/register?activation=token&amp;token={self.activation_token}'