-
-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[13.0][MIG] website_sale_require_legal: Migration to 13.0 #443
[13.0][MIG] website_sale_require_legal: Migration to 13.0 #443
Conversation
e0ef4d7
to
8cb6f9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tours are failing
<xpath expr="."> | ||
<script | ||
type="text/javascript" | ||
src="/website_sale_require_legal/static/src/js/tour.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move tour.js to a new location: /website_sale_require_legal/static/tests/tours/tour.js
8cb6f9a
to
9f2d564
Compare
@pedrobaeza , I have applied CSS to the label of the checkbox to be in red if it is not checked. I think that with that, we don't have to modify website_legal_page (OCA/website#782) so the translations of this module will not be affected. |
Shouldn't the CSS be applied on parent module? |
I don't think so, In this case the selector of the css rule is based on the input that is created in this module |
cc2f8a9
to
fdec6c1
Compare
Is needed this module?? |
Yes, maybe this module is not necessary. Ping @pedrobaeza . Confirm this to me to do the corresponding changes in OpenUpgrade |
Please show me screenshots of the existing feature and the module to compare |
I think that with the core function it's ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The core function looks good, but we should check if metadata is still being registered (
e-commerce/website_sale_require_legal/controllers/main.py
Lines 37 to 51 in fdec6c1
def _checkout_form_save(self, mode, checkout, all_values): | |
res = super()._checkout_form_save(mode, checkout, all_values) | |
if all_values.get("submitted") and all_values.get("accepted_legal_terms"): | |
environ = request.httprequest.headers.environ | |
metadata = "Website legal terms acceptance metadata: " | |
metadata += "<br/>".join( | |
"{}: {}".format(val, environ.get(val)) | |
for val in ("REMOTE_ADDR", "HTTP_USER_AGENT", "HTTP_ACCEPT_LANGUAGE",) | |
) | |
partner_id = request.env["res.partner"].browse(res) | |
website_user = request.website.salesperson_id.id or SUPERUSER_ID | |
partner_id.with_user(website_user).message_post( | |
body=metadata, message_type="notification" | |
) | |
return res |
@chienandalu What do you propose? |
To check if it's covered. Otherwise, we should do it (maybe in other module) |
@chienandalu , I have reviewed and as I have seen, with the Odoo core functionality, this metadata is not sent either when the address user form is modified or when the payment is done, no matter if the checkbox of the terms and terms is checked. |
I think you haven't showed how standard works (or the video was for the standard?). And if so, how the other works? I want to compare? Anyway, that metadata should be saved, so this module can remain for at least that. |
|
Ok, thanks. Then let's keep this module for recording that metadata. |
fdec6c1
to
af10f0d
Compare
@sergio-teruel @chienandalu @pedrobaeza Ready to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a doubt...
We are going to use the core check but recording the metadata... Is that so?
====================== | ||
|
||
* Shopping terms and conditions are accepted only on user registration or | ||
address edition. So if those terms change after the user signed up, a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the new behavior, the checkbox is displayed in checkout step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sergio-teruel , the Odoo (core) option shows the check box always just before paying, but what this point of the readme refers to is to show that box only if the terms have changed (perhaps to be shown before paying as well). I think they are two different things. And it seems to me that to cover that point (if we needed), we must add the functionality in this module, because the odoo option is not very configurable since it is a template designed to be activated and deactivated by the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think?
@ernestotejeda please check this |
@pedrobaeza @sergio-teruel @chienandalu |
Hi, Any news about this module? Finally we're going to keep it in OCA, right? @pedrobaeza |
857e039
to
8437ce8
Compare
Last commit applies all that has been discussed and tests it. Also, rebased. Please review again. Thanks! |
Travis is red |
8437ce8
to
18f9a6e
Compare
…cope This is what the module does now: - Add the posibility to configure legal terms acceptance requirement before saving a new partner. - Log that acceptance as a note in the partner. - Extend upstream's legal requirement before payment and log that acceptance as a note in the sale order. @Tecnativa TT25963
18f9a6e
to
6b9c2ba
Compare
Thanks, it should be fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Tested
/ocabot merge nobump |
On my way to merge this fine PR! |
Congratulations, your PR was merged at f8749df. Thanks a lot for contributing to OCA. ❤️ |
cc @Tecnativa TT25963