diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-10-08 15:24:18 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-10-08 15:24:18 +0700 |
| commit | 2fcddbb073a04ed6ba0e9666a8ab5082a3ef4073 (patch) | |
| tree | d4a3a423adf53ea8c086397abbcfe05a369fe637 /indoteknik_custom/models/website_user_cart.py | |
| parent | ec1e2331be248a505d89c00244d6b0fe5bd61c26 (diff) | |
| parent | ce1c714c95f68b07f9b891600ba1e3b88288652c (diff) | |
Merge branch 'production' into iman/telegram
# Conflicts:
# indoteknik_custom/models/__init__.py
Diffstat (limited to 'indoteknik_custom/models/website_user_cart.py')
| -rw-r--r-- | indoteknik_custom/models/website_user_cart.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/indoteknik_custom/models/website_user_cart.py b/indoteknik_custom/models/website_user_cart.py index 169f4a6b..76b192c5 100644 --- a/indoteknik_custom/models/website_user_cart.py +++ b/indoteknik_custom/models/website_user_cart.py @@ -173,13 +173,12 @@ class WebsiteUserCart(models.Model): } return result - def action_mail_reminder_to_checkout(self, limit=10): - user_ids = self.search([]).mapped('user_id')[:limit] + def action_mail_reminder_to_checkout(self, limit=250): + user_ids = self.search([('is_reminder', '=', False)]).mapped('user_id')[:limit] for user in user_ids: latest_cart = self.search([('user_id', '=', user.id), ('is_reminder', '=', False)], order='create_date desc', limit=1) - # Proses semua keranjang untuk user tersebut carts_to_remind = self.search([('user_id', '=', user.id)]) if latest_cart and not latest_cart.is_reminder: @@ -191,11 +190,9 @@ class WebsiteUserCart(models.Model): cart.is_selected = False cart.is_reminder = True - # Mengirim email pengingat untuk keranjang terbaru template = self.env.ref('indoteknik_custom.mail_template_user_cart_reminder_to_checkout') template.send_mail(latest_cart.id, force_send=True) - def calculate_discount(self, user_id): carts = self.search([('user_id', '=', user_id)]) voucher = self.env['voucher'].browse(146) |
