Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions website_sale_checkout_address_no_save/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
=============================
Website Sale Not Save Address
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4380ced474aeae5a2124595137ce3a229165290e5bc38877415760efcc0490a3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github
:target: https://github.com/OCA/e-commerce/tree/18.0/website_sale_checkout_address_no_save
:alt: OCA/e-commerce
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_sale_checkout_address_no_save
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Adds a checkbox in /shop/address to avoid having to many address in
/shop/checkout.

**Table of contents**

.. contents::
:local:

Usage
=====

Once module is install you have to go to website edit, an enable
'Archive Address after checkout'. After that, a heckbox will appear on
/shop/address. On the checkout if the payment transaction is valid it
will archive the conctact.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-commerce/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_checkout_address_no_save%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- Eduardo Ezerouali

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/18.0/website_sale_checkout_address_no_save>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions website_sale_checkout_address_no_save/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2026 Tecnativa - Eduardo Ezerouali
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from . import controllers
20 changes: 20 additions & 0 deletions website_sale_checkout_address_no_save/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2026 Tecnativa - Eduardo Ezerouali
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Website Sale Not Save Address",
"summary": "Avoid having to many address as dropshipping customer",
"version": "18.0.1.0.0",
"category": "Website",
"website": "https://github.com/OCA/e-commerce",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["website_sale"],
"data": ["views/website_sale_templates.xml"],
"assets": {
"web.assets_tests": [
"website_sale_checkout_address_no_save/static/tests/tours/*.js",
],
},
}
3 changes: 3 additions & 0 deletions website_sale_checkout_address_no_save/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2026 Tecnativa - Eduardo Ezerouali
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from . import main
74 changes: 74 additions & 0 deletions website_sale_checkout_address_no_save/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright 2026 Tecnativa - Eduardo Ezerouali
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from odoo import http
from odoo.http import request, route

from odoo.addons.payment.controllers import post_processing
from odoo.addons.website_sale.controllers import main


class WebsiteSale(main.WebsiteSale):
@route(
"/shop/address/submit",
type="http",
methods=["POST"],
auth="public",
website=True,
sitemap=False,
)
def shop_address_submit(
self,
partner_id=None,
address_type="billing",
use_delivery_as_billing=None,
callback=None,
required_fields=None,
**form_data,
):
order = request.website.sale_get_order()
parent_partner = order.partner_id
Partner = request.env["res.partner"].sudo().with_context(active_test=False)
domain = [
("active", "=", False),
("parent_id", "=", parent_partner.id),
("type", "=", "other"),
]
if form_data.get("email"):
domain.append(("email", "=", form_data["email"]))
if form_data.get("phone"):
domain.append(("phone", "=", form_data["phone"]))
if form_data.get("street") and form_data.get("zip"):
domain += [
("street", "ilike", form_data.get("street")),
("zip", "=", form_data.get("zip")),
]
archived_child = Partner.search(domain, limit=1)
if archived_child:
archived_child.write({"active": True, **form_data})
partner_id = archived_child.id
if form_data.get("archive_address"):
request.session["archive_address"] = True
return super().shop_address_submit(
partner_id=partner_id,
address_type=address_type,
use_delivery_as_billing=use_delivery_as_billing,
callback=callback,
required_fields=required_fields,
**form_data,
)


class PaymentPostProcessing(post_processing.PaymentPostProcessing):
@http.route(
"/payment/status", type="http", auth="public", website=True, sitemap=False
)
def display_status(self, **kwargs):
result = super().display_status(**kwargs)
archive_address = request.session.pop("archive_address", False)
if archive_address:
sale_order_id = request.session.get("sale_last_order_id")
if sale_order_id:
order = request.env["sale.order"].sudo().browse(sale_order_id)
order.partner_shipping_id.active = False
return result
21 changes: 21 additions & 0 deletions website_sale_checkout_address_no_save/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_checkout_address_no_save
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-25 14:15+0000\n"
"PO-Revision-Date: 2026-02-25 14:15+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: website_sale_checkout_address_no_save
#: model_terms:ir.ui.view,arch_db:website_sale_checkout_address_no_save.archive_address
msgid "This address will be archive after checkout"
msgstr "Esta dirección se archivará después de finalizar la compra"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_checkout_address_no_save
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-25 14:14+0000\n"
"PO-Revision-Date: 2026-02-25 14:14+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: website_sale_checkout_address_no_save
#: model_terms:ir.ui.view,arch_db:website_sale_checkout_address_no_save.archive_address
msgid "This address will be archive after checkout"
msgstr ""
3 changes: 3 additions & 0 deletions website_sale_checkout_address_no_save/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions website_sale_checkout_address_no_save/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Tecnativa](https://www.tecnativa.com):
- Eduardo Ezerouali
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds a checkbox in /shop/address to avoid having to many address in /shop/checkout.
2 changes: 2 additions & 0 deletions website_sale_checkout_address_no_save/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Once module is install you have to go to website edit, an enable 'Archive Address after checkout'. After that, a heckbox
will appear on /shop/address. On the checkout if the payment transaction is valid it will archive the conctact.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading