Conversation
|
Hi @legalsylvain, |
legalsylvain
left a comment
There was a problem hiding this comment.
I'm more in favor to reuse core feature.
something like
def _prepare_refund_values(self, current_session):
session = current_session
if force_session_id in self.env.context:
session = self.env["pos.session"].browse(self.env.context.get("force_session_id")
return super()._prepare_refund_values(session)
Then : only replace refund_result = self.refund() by refund_result = self.with_context(force_session_id=self.session_id.id)).refund()
Otherwise, LGTM. Thanks !
411ea0b to
4b1d248
Compare
|
Sure! Not a problem 😄 |
|
@legalsylvain can you check it again? |
| ) | ||
|
|
||
| def _prepare_refund_values(self, current_session): | ||
| session = current_session |
There was a problem hiding this comment.
I'm not sure it will work if the session is closed. A test should be done on state. Dont you think ?
There was a problem hiding this comment.
@etobella what @legalsylvain means is to check in this method which is the state of the session.
4b1d248 to
21fd7be
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. |
|
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. |
|
Hi @legalsylvain, |
21fd7be to
49cb6bf
Compare
Otherwise, something weird might happen. For example, if we have a rescue session and we try to do the change, the refund is assigned to another session, no the rescue one.