Skip to content

[16.0][FIX] pos_payment_change: Change of payment should force the session - #1363

Open
etobella wants to merge 1 commit into
OCA:16.0from
dixmit:16.0-fix-change
Open

etobella wants to merge 1 commit into
OCA:16.0from
dixmit:16.0-fix-change

Conversation

@etobella

Copy link
Copy Markdown
Member

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.

@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @legalsylvain,
some modules you are maintaining are being modified, check this out!

@legalsylvain legalsylvain left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 !

@etobella

Copy link
Copy Markdown
Member Author

Sure! Not a problem 😄

@etobella

Copy link
Copy Markdown
Member Author

@legalsylvain can you check it again?

)

def _prepare_refund_values(self, current_session):
session = current_session

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure it will work if the session is closed. A test should be done on state. Dont you think ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@legalsylvain Test added

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@etobella what @legalsylvain means is to check in this method which is the state of the session.

@luisDIXMIT luisDIXMIT left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

@github-actions

Copy link
Copy Markdown

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 Dec 28, 2025
@pedrobaeza pedrobaeza changed the title [FIX] pos_payment_change: Change of payment should force the session [16.0][FIX] pos_payment_change: Change of payment should force the session Dec 29, 2025
@pedrobaeza pedrobaeza added this to the 16.0 milestone Dec 29, 2025
@pedrobaeza pedrobaeza removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Dec 29, 2025
@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown

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 May 3, 2026
@github-actions github-actions Bot closed this Jun 7, 2026
@etobella etobella reopened this Oct 1, 2026
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @legalsylvain,
some modules you are maintaining are being modified, check this out!

@OCA-git-bot OCA-git-bot added series:16.0 mod:pos_payment_change Module pos_payment_change labels Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:pos_payment_change Module pos_payment_change series:16.0 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.

5 participants