summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-08-10 11:26:29 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-08-10 11:26:29 +0700
commitddc94ab173b4bf01de9dfa900f951eed56fe77b6 (patch)
treeb86576bdf2b236d5b9d6d60412221da4dcceb9ea /indoteknik_custom/models
parent7b4f47e43d6485bb7822f1eb21497e68ab782ab1 (diff)
Update website user cart mail template
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/website_user_cart.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/indoteknik_custom/models/website_user_cart.py b/indoteknik_custom/models/website_user_cart.py
index 13bad358..bf7016f8 100644
--- a/indoteknik_custom/models/website_user_cart.py
+++ b/indoteknik_custom/models/website_user_cart.py
@@ -14,12 +14,12 @@ class WebsiteUserCart(models.Model):
('add_to_cart', 'Add To Cart'),
('buy', 'Buy')
], 'Source', default='add_to_cart')
- other_carts = fields.One2many('website.user.cart', 'id', 'Other Products', compute='_compute_other_carts')
+ user_other_carts = fields.One2many('website.user.cart', 'id', 'Other Products', compute='_compute_user_other_carts')
- def _compute_other_carts(self):
+ def _compute_user_other_carts(self):
for record in self:
others = self.search([('user_id', '=', record.user_id.id)])
- record.other_carts = others
+ record.user_other_carts = others
def get_product(self):
user_data = {
@@ -94,4 +94,8 @@ class WebsiteUserCart(models.Model):
def action_mail_reminder_to_checkout(self, id):
template = self.env.ref('indoteknik_custom.mail_template_user_cart_reminder_to_checkout')
- template.send_mail(int(id), force_send=True) \ No newline at end of file
+ template.send_mail(int(id), force_send=True)
+
+ def format_currency(self, number):
+ number = int(number)
+ return "{:,}".format(number).replace(',', '.') \ No newline at end of file