summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-08-10 04:56:36 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-08-10 04:56:36 +0000
commit5ed45c6e91b2b341b5698b4ed6d5de5ab756dbee (patch)
tree91eb1a947c9b7a4aac9871c58b081c79c197dd17 /indoteknik_custom/models
parent4fd0d7f15ee2d7958c6d9c60faf03d1e9915eaef (diff)
parentddc94ab173b4bf01de9dfa900f951eed56fe77b6 (diff)
Merged in feature/email-cart-wishlist (pull request #95)
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