Repository navigation
[18.0][ADD] website_sale_checkout_address_no_save: add new module - #1160
eduezerouali-tecnativa wants to merge 2 commits into
Conversation
|
I don't know the exact implementation of this, but the name doesn't seem the best. A more accurate one may be @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. |
5d64257 to
1dba586
Compare
|
@pedrobaeza you are right. I changed the name to
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. |
8c77d33 to
6ef7550
Compare
52639b8 to
ac31cce
Compare
ac31cce to
8828e78
Compare
|
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. |
rrebollo
left a comment
There was a problem hiding this comment.
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). | |||
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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}) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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", { |
There was a problem hiding this comment.
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.

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: