Skip to content

Commit

Permalink
Sale orders with state cancel now also removed by abandoned_carts
Browse files Browse the repository at this point in the history
  • Loading branch information
ozoromo committed Jul 24, 2024
1 parent 2edd484 commit ad41bc6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 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:b2bb1241a503d410a6cd3968a08bfd8862738faaa20fb4bc813277877c2afa0d
!! source digest: sha256:fb4138f2fc2971fec299a8ed6402ebb4f0d234d4c1835ef022c7a0ca9a98b24b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -43,7 +43,7 @@ Algorithm

This module identifies orders as abandoned (and to be deleted) if all of the following is true:

`("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"`
`("state = draft" or "state = sent" or "state = cancelled") 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.

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 @@ -13,7 +13,7 @@ Algorithm

This module identifies orders as abandoned (and to be deleted) if all of the following is true:

`("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"`
`("state = draft" or "state = sent" or "state = cancelled") 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.

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:b2bb1241a503d410a6cd3968a08bfd8862738faaa20fb4bc813277877c2afa0d
!! source digest: sha256:fb4138f2fc2971fec299a8ed6402ebb4f0d234d4c1835ef022c7a0ca9a98b24b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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 @@ -380,7 +380,7 @@ <h1 class="title">Abandoned Carts</h1>
<div class="section" id="algorithm">
<h1>Algorithm</h1>
<p>This module identifies orders as abandoned (and to be deleted) if all of the following is true:</p>
<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><cite>(“state = draft” or “state = sent” or “state = cancelled”) 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” and “payment_transaction = 0”</cite></p>
Expand Down
2 changes: 1 addition & 1 deletion abandoned_carts/wizard/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def default_get(self, fields):
res = super().default_get(fields)
system_user = self.sudo().env.ref("base.user_root", False)
domain = [
("state", "in", ["draft", "sent"]),
("state", "in", ["draft", "sent", "cancel"]),
("create_date", "<", date.strftime(DF)),
("website_id", "!=", False),
]
Expand Down

0 comments on commit ad41bc6

Please sign in to comment.