Skip to content

Commit

Permalink
Added check for payment_transaction entry to Customer filter in aband…
Browse files Browse the repository at this point in the history
…oned_carts
  • Loading branch information
ozoromo authored and jans23 committed Jul 8, 2024
1 parent b6467e2 commit b4ef515
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions abandoned_carts/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Abandoned Carts
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:36086800288d4ccd5baaf3ede4a2092f0189410265752e244f869ab966c41b6e
!! source digest: sha256:b2bb1241a503d410a6cd3968a08bfd8862738faaa20fb4bc813277877c2afa0d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -48,7 +48,7 @@ This module identifies orders as abandoned (and to be deleted) if all of the fol
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"`
`"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" and "payment_transaction = 0"`

will be displayed in "Abandoned customers" and can be deleted manually.

Expand Down
2 changes: 1 addition & 1 deletion abandoned_carts/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This module identifies orders as abandoned (and to be deleted) if all of the fol
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"`
`"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" and "payment_transaction = 0"`

will be displayed in "Abandoned customers" and can be deleted manually.

Expand Down
4 changes: 2 additions & 2 deletions abandoned_carts/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Abandoned Carts</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:36086800288d4ccd5baaf3ede4a2092f0189410265752e244f869ab966c41b6e
!! source digest: sha256:b2bb1241a503d410a6cd3968a08bfd8862738faaa20fb4bc813277877c2afa0d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/odoo-modules/tree/15.0/abandoned_carts"><img alt="OCA/odoo-modules" src="https://img.shields.io/badge/github-OCA%2Fodoo--modules-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/odoo-modules-15-0/odoo-modules-15-0-abandoned_carts"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/odoo-modules&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to delete Quotations and related partner records when those are older than a definable retention period.</p>
Expand All @@ -383,7 +383,7 @@ <h1>Algorithm</h1>
<p><cite>(“state = draft” or “state = sent”) and “website_id is set” and “(current_time - create_date) &lt; abandoned_carts.order_retention_period” and “create_uid = system_user”</cite></p>
<p>These orders will be displayed in “Abandoned orders” and can be deleted manually.</p>
<p>Customers, which have
<cite>“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”</cite></p>
<cite>“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” and “payment_transaction = 0”</cite></p>
<p>will be displayed in “Abandoned customers” and can be deleted manually.</p>
<p>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.</p>
<p>A cron job can be configured to delete abandoned orders and abandoned customers automatically.</p>
Expand Down
3 changes: 3 additions & 0 deletions abandoned_carts/wizard/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions payment_bitcoin/models/bitcoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions payment_bitcoin/static/src/js/bitcoin.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions payment_bitcoin/static/src/js/countdown.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down

0 comments on commit b4ef515

Please sign in to comment.