Skip to content

Conversation

mihien
Copy link

@mihien mihien commented Aug 4, 2025

No description provided.

@mihien mihien force-pushed the 16.0-mig-pos_customer_required branch from 4500b10 to 40ea630 Compare August 22, 2025 19:49
Copy link
Member

@huguesdk huguesdk left a comment

Choose a reason for hiding this comment

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

nice conversion to owl, @mihien! a few remarks, but mostly lgtm.

if i understand correctly, you added the improvement of preventing the user to close or confirm the partner selection screen if no partner has been selected, right? nice addition! does it also work from the payment screen when require_customer is set to payment (or should it not work at that point)?

Copy link
Member

Choose a reason for hiding this comment

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

as the setting is now available from the general configuration, is it still needed here?

Copy link
Author

Choose a reason for hiding this comment

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

Good question, it's probably not but I'll ask an analyst what he thinks


const PosCustomerRequiredPartnerListScreen = (OriginalPartnerListScreen) =>
class extends OriginalPartnerListScreen {
clickPartner(partner) {
Copy link
Member

Choose a reason for hiding this comment

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

a comment would help to understand why this is needed. i looked at the original function and if i understand it correctly, the goal is to prevent to call confirm() if the partner is unselected, right? would it work by overriding confirm() instead to avoid re-implementing the logic?

Copy link
Author

Choose a reason for hiding this comment

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

Both your assumptions are correct, I've moved the change to confirm() (and added a comment)

if( this.env.pos.config.require_customer === "order" ) {
if (this.state.selectedPartner && this.state.selectedPartner.id === partner.id) {
this.state.selectedPartner = null;
this.render(true);
Copy link
Member

Choose a reason for hiding this comment

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

this should not be needed, should it?

Copy link
Author

Choose a reason for hiding this comment

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

this.render(true); was needed to reload the screen to show the user had been unselected. But now that the logic is moved to confirm() this.state.selectedPartner = null; will be handled in clickPartner already, so I've removed it.

@mihien mihien force-pushed the 16.0-mig-pos_customer_required branch from 40ea630 to bf006cf Compare September 15, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants