summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/website_user_cart.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/indoteknik_custom/models/website_user_cart.py b/indoteknik_custom/models/website_user_cart.py
index 9b82aa93..bf7016f8 100644
--- a/indoteknik_custom/models/website_user_cart.py
+++ b/indoteknik_custom/models/website_user_cart.py
@@ -14,6 +14,12 @@ class WebsiteUserCart(models.Model):
('add_to_cart', 'Add To Cart'),
('buy', 'Buy')
], 'Source', default='add_to_cart')
+ user_other_carts = fields.One2many('website.user.cart', 'id', 'Other Products', compute='_compute_user_other_carts')
+
+ def _compute_user_other_carts(self):
+ for record in self:
+ others = self.search([('user_id', '=', record.user_id.id)])
+ record.user_other_carts = others
def get_product(self):
user_data = {
@@ -84,4 +90,12 @@ class WebsiteUserCart(models.Model):
'has_product_without_weight': any(not product.get('weight') or product.get('weight') == 0 for product in products),
'products': products
}
- return result \ No newline at end of file
+ return result
+
+ 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)
+
+ def format_currency(self, number):
+ number = int(number)
+ return "{:,}".format(number).replace(',', '.') \ No newline at end of file