Skip to content

[18.0][ADD] website_sale_checkout_address_no_save: add new module - #1160

Open
eduezerouali-tecnativa wants to merge 2 commits into
OCA:18.0from
Tecnativa:18.0-add-website_sale_dropshipping_address
Open

eduezerouali-tecnativa wants to merge 2 commits into
OCA:18.0from
Tecnativa:18.0-add-website_sale_dropshipping_address

Conversation

@eduezerouali-tecnativa

@eduezerouali-tecnativa eduezerouali-tecnativa commented Feb 10, 2026 •

Copy link
Copy Markdown
Contributor

cc @Tecnativa TT59949
This modulo allows to not store the address on checkout. Once transaction is confirm it will archive the contact. It is meant for customers that are dropshippers and have lots of addresses.
ping @juancarlosonate-tecnativa @sergio-teruel

pending:

  • add test

@pedrobaeza pedrobaeza added this to the 18.0 milestone Feb 10, 2026
@pedrobaeza

Copy link
Copy Markdown
Member

I don't know the exact implementation of this, but the name doesn't seem the best. A more accurate one may be website_sale_checkout_address_no_save or maybe website_sale_checkout_temp_address, but as said, it depends on the implementation.

@eduezerouali-tecnativa please recheck all the sentences, as they contain incorrect English and even your name is not correctly spelled. It's good to read things twice in these cases.

@eduezerouali-tecnativa
eduezerouali-tecnativa force-pushed the 18.0-add-website_sale_dropshipping_address branch from 5d64257 to 1dba586 Compare February 12, 2026 09:11
@eduezerouali-tecnativa eduezerouali-tecnativa changed the title [18.0][ADD] website_sale_not_save_address: add new module [18.0][ADD] website_sale_checkout_address_no_save: add new module Feb 12, 2026
@eduezerouali-tecnativa

Copy link
Copy Markdown
Contributor Author

@pedrobaeza you are right. I changed the name to website_sale_checkout_address_no_save; it seems more accurate.
This module is intended to avoid having too many addresses during checkout. For example, if my customer serves other customers, they might not need to have that address saved, as it may not be a regular customer. In that case, when editing the address, they can choose to archive it after the checkout is completed.

Selección_073

Additionally, when a user enters the details for another address, if the phone, email, ZIP code, and street match an archived contact, the module reactivates that contact instead of creating a new one. Al thought I do not think this will happened very often.

I did add the test but the tour to work depends on this PR #1162.

@eduezerouali-tecnativa
eduezerouali-tecnativa force-pushed the 18.0-add-website_sale_dropshipping_address branch 4 times, most recently from 8c77d33 to 6ef7550 Compare February 19, 2026 17:06
@eduezerouali-tecnativa
eduezerouali-tecnativa force-pushed the 18.0-add-website_sale_dropshipping_address branch 4 times, most recently from 52639b8 to ac31cce Compare February 25, 2026 14:17
@eduezerouali-tecnativa
eduezerouali-tecnativa force-pushed the 18.0-add-website_sale_dropshipping_address branch from ac31cce to 8828e78 Compare March 3, 2026 10:10
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions Bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jul 5, 2026
@pedrobaeza pedrobaeza removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jul 6, 2026
@OCA-git-bot OCA-git-bot added series:18.0 mod:website_sale_checkout_address_no_save Module website_sale_checkout_address_no_save labels Aug 6, 2026

@rrebollo rrebollo left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @eduezerouali-tecnativa — thanks for the module! I've left a few small suggestions inline; none of them is blocking. Would you mind having a look and pinging me once you've considered them, so I can review again?
I think you need to squash your commits into a single one.
In return, would you be so kind as to review my PR? Thank you!
OCA/e-learning#20

@@ -0,0 +1,20 @@
# Copyright 2026 Tecnativa - Eduardo Ezerouali
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AGPL-3.0 is declared in the manifest, but the file headers link to the LGPL text (http://www.gnu.org/licenses/lgpl.html) — the same in __init__.py:2, controllers/__init__.py:2, controllers/main.py:2 and tests/test_checkout_address_no_save.py:2. The URL should match the declared license; the OCA module template uses # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

# Copyright 2026 Tecnativa - Eduardo Ezerouali
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Website Sale Not Save Address",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The module was renamed to website_sale_checkout_address_no_save, but the manifest still carries the old name and a summary with typos:

"name": "Website Sale Not Save Address",
"summary": "Avoid having to many address as dropshipping customer",

Suggest e.g. "name": "Website Sale Checkout Address No Save" and "summary": "Do not keep the addresses created during checkout".



class WebsiteSale(main.WebsiteSale):
@route(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor consistency: @route is used here, while display_status below uses @http.route (line 63).

("street", "ilike", form_data.get("street")),
("zip", "=", form_data.get("zip")),
]
archived_child = Partner.search(domain, limit=1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: reactivating a previously archived contact (searching inactive children by email/phone/street and setting active = True below) isn't mentioned in the README/USAGE. Is it intended as part of this feature, or should it be documented?

]
archived_child = Partner.search(domain, limit=1)
if archived_child:
archived_child.write({"active": True, **form_data})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

archived_child.write({"active": True, **form_data}) spreads the raw form data into res.partner.write. It carries keys that aren't writable fields on res.partner (csrf_token, archive_address) plus the string country_id/state_id, so this raises. Core separates the address fields from the rest before writing — please reactivate with an explicit whitelist of address fields.

)
def display_status(self, **kwargs):
result = super().display_status(**kwargs)
archive_address = request.session.pop("archive_address", False)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: the description says the contact is archived once the transaction is confirmed, but this runs on any /payment/status render — the session flag is popped and sale_last_order_id is used with no check on the related payment.transaction. Could /payment/status be reached without a successful payment (the test at tests/test_checkout_address_no_save.py:123 seems to do just that)? If so, should the archiving be gated on the transaction state?


registry
.category("web_tour.tours")
.add("website_sale_checkout_address_no_save_no_pay", {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This second tour is a near-verbatim copy of the first (tour.esm.js:7): both repeat the search → add-to-cart → fill-address-twice sequence and only differ in the last step (~90 duplicated lines). Consider extracting the shared steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:website_sale_checkout_address_no_save Module website_sale_checkout_address_no_save series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants