Skip to content
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

10.0 porting website_sale_checkout_skip_payment #203

Closed

Conversation

eLBati
Copy link
Member

@eLBati eLBati commented Sep 4, 2017

No description provided.

@eLBati eLBati mentioned this pull request Sep 4, 2017
15 tasks
@yajo yajo added this to the 10.0 milestone Sep 5, 2017
Website Sale Checkout Skip Payment
==================================

This module allows to logged users to checkout with no payment step. At the
Copy link
Contributor

Choose a reason for hiding this comment

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

"allows logged users"

Copy link
Member Author

Choose a reason for hiding this comment

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

@simahawk done

@@ -0,0 +1,63 @@
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg
Copy link
Contributor

Choose a reason for hiding this comment

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

png

Copy link
Member Author

Choose a reason for hiding this comment

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

@simahawk readme files re-created with new fragments

{
'name': 'Website Sale Checkout Skip Payment',
'summary': 'Skip payment for logged users in checkout process',
'version': '10.0.0.1.0',
Copy link
Contributor

Choose a reason for hiding this comment

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

10.0.1.0.0

Copy link
Member Author

Choose a reason for hiding this comment

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

@simahawk done

'summary': 'Skip payment for logged users in checkout process',
'version': '10.0.0.1.0',
'category': 'Website',
'website': 'https://www.tecnativa.com',
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

@simahawk done


@http.route()
def payment_get_status(self, sale_order_id, **post):
# When skip payment step, the transaction not exists so only render
Copy link
Contributor

Choose a reason for hiding this comment

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

transaction does not exists

Copy link
Member Author

Choose a reason for hiding this comment

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

@simahawk done

@api.multi
def _compute_checkout_skip_payment(self):
for rec in self:
if request.session.uid:
Copy link
Contributor

Choose a reason for hiding this comment

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

just checking: is 100% that this is going to be recomputed for each user?
I'd rather use a std model method to get it not cached.

Copy link
Member Author

Choose a reason for hiding this comment

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

@simahawk just tested with 2 different users on 2 different browsers: it works

@grindtildeath
Copy link
Contributor

I get this error when confirming an order through web shop :

2018-04-27 09:50:45,531 1 ERROR bssfw-24 odoo.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/opt/odoo/src/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/src/odoo/http.py", line 677, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/src/odoo/http.py", line 333, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/src/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/src/odoo/http.py", line 326, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/src/odoo/http.py", line 935, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/src/odoo/http.py", line 506, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/external-src/e-commerce/website_sale_checkout_skip_payment/controllers/main.py", line 35, in payment_get_status
    'message': request.website._render(
AttributeError: 'website' object has no attribute '_render'

@rafaelbn
Copy link
Member

Hi @eLBati thanks for this migration! Please could you check comments? Thanks

@rafaelbn
Copy link
Member

rafaelbn commented Oct 6, 2018

Hello @eLBati could you review comments? Are you interested in continuing this PR?

Let me know! 😃

@eLBati
Copy link
Member Author

eLBati commented Oct 9, 2018

@grindtildeath can you describe the steps to reproduce the error? I am not able to reproduce it in a standard scenario

@eLBati
Copy link
Member Author

eLBati commented Oct 9, 2018

@rafaelbn thanks, #223 is already included with e26b2c5

@eLBati eLBati force-pushed the 10.0-mig-website_sale_checkout_skip_payment branch from e26b2c5 to 6f67dbc Compare October 9, 2018 12:56
Copy link
Contributor

@grindtildeath grindtildeath left a comment

Choose a reason for hiding this comment

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

@eLBati Tested again and seems to work, so approved.

@grindtildeath
Copy link
Contributor

@eLBati My bad, but while switching off my local instances, I just see I had the same error in my server logs, I'll try to give it another look tomorrow.

@grindtildeath
Copy link
Contributor

@eLBati Just tested again and this happens when confirming the order on the webshop with a user having skip payment activated. The UX looks ok, but we get this error in the logs.

FIX
website_sale_checkout_skip_payment/controllers/main.py", line 35, in payment_get_status
    'message': request.website._render(
AttributeError: 'website' object has no attribute '_render'
@eLBati eLBati force-pushed the 10.0-mig-website_sale_checkout_skip_payment branch from 6f67dbc to e0f9216 Compare October 11, 2018 08:04
@eLBati
Copy link
Member Author

eLBati commented Oct 11, 2018

@grindtildeath thanks, fixed

Copy link
Member

@fuentes73 fuentes73 left a comment

Choose a reason for hiding this comment

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

Using it in production since a while and everything works OK.

@rafaelbn
Copy link
Member

rafaelbn commented Oct 2, 2019

/ocabot merge

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 10.0-ocabot-merge-pr-203-by-rafaelbn-bump-no, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Oct 2, 2019
Signed-off-by rafaelbn
@OCA-git-bot
Copy link
Contributor

@rafaelbn your merge command was aborted due to failed check(s), which you can inspect on this commit of 10.0-ocabot-merge-pr-203-by-rafaelbn-bump-no.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

@zeroheure
Copy link
Contributor

Why this was never merged ?

@github-actions
Copy link

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 Mar 27, 2022
@github-actions github-actions bot closed this May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet