From b4ef5152ddafd4246c740a7136f94849fe2b4cc3 Mon Sep 17 00:00:00 2001
From: Lorenzo Romero This module allows to delete Quotations and related partner records when those are older than a definable retention period. (“state = draft” or “state = sent”) and “website_id is set” and “(current_time - create_date) < abandoned_carts.order_retention_period” and “create_uid = system_user” These orders will be displayed in “Abandoned orders” and can be deleted manually. Customers, which have
-“lead = 0” and “meetings = 0” and “is_employee = false” and “helpdesk_tickets = 0” and “newsletter_subscriptions = 0” and “phonecalls = 0” and “orders = 0” and “account moves = 0” and “tasks = 0” and “portal or user account = 0” and “parent_id = NULL” and “is_company = false” and “create_uid = system_user”Abandoned Carts
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:36086800288d4ccd5baaf3ede4a2092f0189410265752e244f869ab966c41b6e
+!! source digest: sha256:b2bb1241a503d410a6cd3968a08bfd8862738faaa20fb4bc813277877c2afa0d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
Algorithm
will be displayed in “Abandoned customers” and can be deleted manually.
Child partner records (e.g. delivery addresses) of deleted records will remain and don’t get deleted implicitly. However, in subsequent executions they may fulfill all criteria and get deleted too.
A cron job can be configured to delete abandoned orders and abandoned customers automatically.
diff --git a/abandoned_carts/wizard/customer.py b/abandoned_carts/wizard/customer.py index 3c853581..23fcabb2 100644 --- a/abandoned_carts/wizard/customer.py +++ b/abandoned_carts/wizard/customer.py @@ -98,6 +98,9 @@ def set_fix_customer(self): where gid = (select id from res_groups where id=%s) and uid=ru.id ) and + NOT EXISTS ( + SELECT 1 FROM payment_transaction pt WHERE pt.partner_id = p.id + ) and p.parent_id is NULL and p.is_company = False and p.customer_rank > 0 and diff --git a/payment_bitcoin/models/bitcoin.py b/payment_bitcoin/models/bitcoin.py index 62c98592..578a3292 100644 --- a/payment_bitcoin/models/bitcoin.py +++ b/payment_bitcoin/models/bitcoin.py @@ -180,7 +180,7 @@ def cnvrt_list_to_string(self, ldata): return ", ".join([str(data) for data in ldata]) @api.model - def cron_bitcoin_payment_reconciliation(self): + def cron_bitcoin_payment_reconciliation(self): # noqa: C901 acquirer_obj = self.env["payment.acquirer"].search( [("provider", "=", "bitcoin")] ) @@ -437,7 +437,7 @@ class BitcoinRate(models.Model): ) @api.model - def get_rate( + def get_rate( # noqa: C901 self, order_id=False, order_ref=False, invoice_id=False, invoice_ref=False ): # function returns bitcoin rate and address for the order currency diff --git a/payment_bitcoin/static/src/js/bitcoin.js b/payment_bitcoin/static/src/js/bitcoin.js index ae1d4558..94483fc3 100644 --- a/payment_bitcoin/static/src/js/bitcoin.js +++ b/payment_bitcoin/static/src/js/bitcoin.js @@ -1,4 +1,6 @@ odoo.define("payment_bitcoin.bitcoin", function (require) { + "use strict"; + var ajax = require("web.ajax"); var core = require("web.core"); var _t = core._t; @@ -25,7 +27,9 @@ odoo.define("payment_bitcoin.bitcoin", function (require) { order_ref: $order_ref, }).then(function (data) { if (data === false) { + /* eslint-disable no-alert */ alert(_t("Payment method Bitcoin is currently unavailable.")); + /* eslint-enable no-alert */ $(ev.currentTarget) .find('input[name="o_payment_radio"]') .attr("disabled", "disabled"); diff --git a/payment_bitcoin/static/src/js/countdown.js b/payment_bitcoin/static/src/js/countdown.js index 3010fb57..5c42590d 100644 --- a/payment_bitcoin/static/src/js/countdown.js +++ b/payment_bitcoin/static/src/js/countdown.js @@ -1,4 +1,6 @@ odoo.define("payment_bitcoin.duration", function (require) { + "use strict"; + var publicWidget = require("web.public.widget"); publicWidget.registry.reloadDuration = publicWidget.Widget.extend({