-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: 16.0
Are you sure you want to change the base?
Conversation
75ed802
to
42188f8
Compare
6e36261
to
a615525
Compare
There was a problem hiding this 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.
2d7b59b
to
7ce1aea
Compare
There was a problem hiding this 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 ?
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 | ||
) | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cooperative/cooperator/models/subscription_request.py
Lines 750 to 756 in 7ce1aea
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 ?
@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 ( what should be prevented, though, are these combinations:
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. |
@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:
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? |
Yes it sounds like a good idea ! |
@huguesdk I've implemented your idea. (cf last commit). @carmenbianca |
dbfc4ec
to
9301b2c
Compare
... 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"). |
c98e7ca
to
5afc426
Compare
74ca0af
to
0b9ae56
Compare
Better names, move important fields to the start Signed-off-by: Carmen Bianca BAKKER <[email protected]>
Signed-off-by: Carmen Bianca BAKKER <[email protected]>
Signed-off-by: Carmen Bianca BAKKER <[email protected]>
Signed-off-by: Carmen Bianca BAKKER <[email protected]>
Signed-off-by: Carmen Bianca BAKKER <[email protected]>
Signed-off-by: Carmen Bianca BAKKER <[email protected]>
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'
0b9ae56
to
122f505
Compare
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]>
122f505
to
ab5ce53
Compare
Made some small fixes on top of @victor-champonnois 's work. Ready for review+merge I think |
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. |
Internal task: https://gestion.coopiteasy.be/web#id=11130&action=479&model=project.task&view_type=form&menu_id=536