diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-08-10 05:02:39 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-08-10 05:02:39 +0000 |
| commit | 9f8664c33429e41c6133ba2b325662245ffbc92d (patch) | |
| tree | bce73d880f28edb48810fe263c8bcd717339b9be /indoteknik_custom/models | |
| parent | 1e3ea5f5df6794ffb5712389deca6d0d868cfc0a (diff) | |
| parent | 659268250145b51e8700bc01871ae3bba34f76f3 (diff) | |
Merged in change/feature/voucher (pull request #96)
Change/feature/voucher
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/website_user_cart.py | 16 |
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 |
