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
@mihien mihien force-pushed the 16.0-mig-pos_customer_required branch from bf006cf to 37a84e9 Compare January 5, 2026 10:36
@mihien
Copy link
Author

mihien commented Jan 5, 2026

@huguesdk I've applied all you suggestions and added a test to increase coverage. The only thing left is this remark:

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)?

It doesn't work when require_customer is set to payment and the changes to make it so aren't that obvious to me. So I've left it as is, since it's also how it works in 12.0

@mihien mihien requested a review from huguesdk January 5, 2026 13:00
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.

i’ve just functionally tested the module, and the fact that it is not possible to close the partner selection screen is actually annoying and confusing (in my opinion), especially when the mode is not order: if one clicks on the customer selection button and doesn’t want to select a customer, the only way to go back is to select one, then re-opening the same screen and unselect the customer. i think that the button should stay, and a pop-up should appear in case a customer is mandatory.

an opinion from the users of the module in previous versions would be useful.

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