-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
[9.0][ADD] website_sale_checkout_skip_payment: New module to skip pay ment step in checkout process #193
[9.0][ADD] website_sale_checkout_skip_payment: New module to skip pay ment step in checkout process #193
Conversation
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.
Almost perfect, only some details. Please rebase to include 6f15c68 and fix travis and runbot.
================================== | ||
|
||
This module allows to logged users buy without payment step. | ||
The sale order is confirmed on ckeckout payment. |
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.
"on checkout without payment" maybe?
@@ -0,0 +1,23 @@ | |||
# -*- coding: utf-8 -*- | |||
# © 2017 Sergio Teruel <sergio.teruel@tecnativa.com> |
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.
Use Copyright instead of ©️ : OCA/maintainer-tools#197
'name': 'Website Sale Checkout Skip Payment', | ||
'summary': 'Skip payment for logged users in checkout process', | ||
'version': '9.0.1.0.0', | ||
'category': 'E-commerce', |
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.
"Website" (that's website_sale
's category)
partner = self.env['res.users'].browse( | ||
request.session.uid).partner_id | ||
if partner.skip_website_checkout_payment: | ||
rec.checkout_skip_payment = True |
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.
You can do rec.checkout_skip_payment = partner.skip_website_checkout_payment
for rec in self: | ||
if request.session.uid: | ||
partner = self.env['res.users'].browse( | ||
request.session.uid).partner_id |
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 think you can do request.env.user.partner_id
instead.
@@ -0,0 +1,19 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<!-- © 2017 Sergio Teruel <sergio.teruel@tecnativa.com> |
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.
Copyright
@@ -0,0 +1,19 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<!-- © 2017 Sergio Teruel <sergio.teruel@tecnativa.com> | |||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). --> |
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.
Wasn't this LGPL?
</div> | ||
</div> | ||
</div> | ||
</t> |
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.
Please use consistent indentation.
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.
Please add WEBSITE_REPO="1"
to travis global variables to make us able to test runbot.
<div id="wrap"> | ||
<div class="container oe_website_sale"> | ||
<div class="alert alert-danger" role="alert"> | ||
<strong>Error!</strong> An error occurred when try to |
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.
trying
@yajo Shall I do it in a different PR or in this one |
This one is OK |
e7b065b
to
88b9e74
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.
Couldn't test on runbot due to OCA/maintainer-quality-tools#471; cc @moylop260 @lasley any ideas?
Code 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.
I miss configuration part in the README saying that you mark the partners you want to allow to skip checkout.
It's under usage, isn't it? |
Well, it should be configuration then, and it's the contrary: you should activate it, not deactivate it. |
Yes, although I can extend the explanation a bit more. |
Hmm not sure, maybe somebody wants to enable this by default... Can you do it with partner custom default values? Or should we add a config parameter? Or am I saying something absurd? 😆 |
If you need this module is because by default you want to skip payment for all registered customers (remember if not registered normal process apply). Registered customers doesn't mean that a res.partner exists, means that a res.partner has access to portal -> has a res.user associated. So this module is for skip payment for all customers which has access to the portal. So I don't think adding the Checkbox "Skip Website Checkout Payment" to the partner and activating by default it the correct way. Better as said, all res.partner with res.user skip the payment. If you think is needed a check-box for exceptions, then add it, but unable by default (false) and enable it for the exception. |
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 will test in runbot
This module allows to logged users to checkout with no payment step. At the | ||
end of the checkout proccess the quotation is sent to the user email address | ||
and set to *Qoutation Sent* state. | ||
|
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.
Add: "The quotation created in the website_sale will be the same as if it would be created in backend, so all fields from the partner will be in the sale order as "pricelist" "payment term" "sales person", etc..."
================================== | ||
Website Sale Checkout Skip Payment | ||
================================== | ||
|
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.
This module wants to cover the situation that you current customers could make their own orders maintaining their payment term and payment mode and not paying with a bank transfer, PayPal or similar.
|
||
You can deactivate this option for a particular partner unchecking | ||
"Skip Website Checkout Payment" field. | ||
|
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.
Remember that if you customer is not registered it will go though the standard process
I don't agree. The check should be False by default. |
Could we assume that travis is nor related?
|
About #193 (comment)
I agree. The check should be False by default. 👍 (that's what I said) But enabling it to True will indicate that the partner doesn't skip payment. |
IMHO adding true values for false results is misleading, so it's OK as it is: true-> skip, false-> don't skip. About the default value, I guess you can add an |
About travis, rebuilding now that OCA/maintainer-quality-tools#471 is fixed. |
fdd3039
to
d95e8e6
Compare
There is some issue with this repo's runbot 😖
|
That happens randomly on mine too. Rebuilding doesn't seem to help, but an amend and force push does |
c23eb0a
to
6e762f1
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.
Code OK, couldn't test in runbot. Can you rebase and see if last MQT patches work please?
6e762f1
to
5d80d71
Compare
@yajo Still the same compass issue |
Yes, I guess we won't be able to test until #195 gets fixed 😢 |
I just have created a commit for this branch with the fix: 563b540 |
Now the CIs are green And using ssh connection to the build#3300622 of runbot: Running with
|
@moylop260 to the rescue! 🎉 |
|
Thanks, guys! 😄 👍 |
563b540
to
d6a7b3d
Compare
CC @Tecnativa