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

[IMP] cooperator[_website]: Improve form #116

Open
wants to merge 12 commits into
base: 16.0
Choose a base branch
from

Conversation

carmenbianca
Copy link
Member

Copy link
Member

@victor-champonnois victor-champonnois left a comment

Choose a reason for hiding this comment

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

Functional review

Great, the interface is much better !

Some issues:

  • french translations should be updated, but I think we can fix this afterwards in weblate. We just need to remember it.
  • to me it's weird that the field "existing contact" stays visible even when the type of subscription is "new cooperator". The fact that it's among the first field makes this even more weird. Is there a reason to keep it visible ? This means that the field should be set to null when the type of subscription is set to new cooperator (after having previously selected an "existing contact").

I think, we can also improve significantly the "Subscription Information" section, at low cost. I am writing a commit to do that.

Copy link
Member

@victor-champonnois victor-champonnois left a comment

Choose a reason for hiding this comment

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

I think, we can also improve significantly the "Subscription Information" section, at low cost. I am writing a commit to do that.

done

to me it's weird that the field "existing contact" stays visible even when the type of subscription is "new cooperator". The fact that it's among the first field makes this even more weird. Is there a reason to keep it visible ? This means that the field should be set to null when the type of subscription is set to new cooperator (after having previously selected an "existing contact").

I think this should be considered, I am not sure how the case "existing contact is set" and type of subscription is "new cooperator" is handled, and whether we should prevent it directly from the interface. @huguesdk what do you think ?

Comment on lines 852 to 860
if self.already_cooperator and self.type != "increase":
raise UserError(
_(
"Partner %s is already a cooperator, subscription type"
" must be 'Increase number of shares'."
)
% self.partner_id.name
)

Copy link
Member

Choose a reason for hiding this comment

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

I think this should be considered, I am not sure how the case "existing contact is set" and type of subscription is "new cooperator" is handled, and whether we should prevent it directly from the interface. @huguesdk what do you think ?

nevermind I see it's handled here. It could be nice if it was handled directly in the form, but to me it's OK like this

Copy link
Member

@victor-champonnois victor-champonnois left a comment

Choose a reason for hiding this comment

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

if self.already_cooperator:
raise UserError(
_(
"The checkbox already cooperator is"
" checked please select a cooperator."
)
)

Shouldn't this code be removed or altered now that there is no checkbox ?

@huguesdk
Copy link
Member

@victor-champonnois about the “new cooperator” type for an existing contact: it is counter-intuitive, but it is valid and important: this is to allow to create a subscription (to become a cooperator) for a contact (res.partner) that already exists in the database but is not yet a cooperator.

what should be prevented, though, are these combinations:

  • type is increase, existing contact is none (existing contact must become required in case of increase) or existing contact is not already a cooperator
  • type is new cooperator, existing contact is set to a contact that is already a cooperator

moreover, when an existing contact is selected, all the fields corresponding to the contact properties and not related to the subscription request itself should become read-only, because the contact details will not be updated from the subscription request.

@huguesdk
Copy link
Member

@victor-champonnois @carmenbianca i realize that the subscription type should not be editable: it should be read-only and computed from the existing contact field:

  • if it is set and the contact is already member: increase
  • otherwise: new

it should just be there for information, and i think that a more logical place would be after the existing contact field. what do you think?

@victor-champonnois
Copy link
Member

Yes it sounds like a good idea !

@victor-champonnois
Copy link
Member

@huguesdk I've implemented your idea. (cf last commit). @carmenbianca

@victor-champonnois
Copy link
Member

... and fixed the tests (including some other test errors). Strange, this behavior was in contradiction with one of the test (a sub request for an existing partner that is not yet member was expected to be of type "increase").

@victor-champonnois victor-champonnois force-pushed the 16.0-fix-new-coop-form branch 2 times, most recently from c98e7ca to 5afc426 Compare February 26, 2024 15:51
@carmenbianca carmenbianca force-pushed the 16.0-fix-new-coop-form branch 2 times, most recently from 74ca0af to 0b9ae56 Compare March 4, 2024 13:07
carmenbianca and others added 10 commits March 4, 2024 14:13
Better names, move important fields to the start

Signed-off-by: Carmen Bianca BAKKER <[email protected]>
the field type is computed such that it's 'increase' only if the sub
request is linked with a partner that is a member. This contradicts
previous tests according the which a sub request for a non member
partner should have a type 'increase'
@carmenbianca
Copy link
Member Author

Rebased this on top of 6eef0d9 because otherwise there would be merge conflicts and the tests wouldn't run.

This is dead code since type and already_cooperator are both computed

Signed-off-by: Carmen Bianca BAKKER <[email protected]>
type is computed. This code is now superfluous.

Signed-off-by: Carmen Bianca BAKKER <[email protected]>
@carmenbianca
Copy link
Member Author

Made some small fixes on top of @victor-champonnois 's work. Ready for review+merge I think

Copy link

github-actions bot commented Jul 7, 2024

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 Jul 7, 2024
@carmenbianca carmenbianca added no stale Use this label to prevent the automated stale action from closing this PR/Issue. and removed stale PR/Issue without recent activity, it'll be soon closed automatically. labels Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no stale Use this label to prevent the automated stale action from closing this PR/Issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants