-
Notifications
You must be signed in to change notification settings - Fork 5
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
[REF] membership changes #80
base: 16.0
Are you sure you want to change the base?
Conversation
78f11d5
to
937a838
Compare
d4a7b44
to
6c40c93
Compare
6c40c93
to
e5b047e
Compare
<field name="active" eval="True" /> | ||
</record> | ||
|
||
<record id="ir_cron_revoke_memberships" model="ir.cron"> |
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.
Duplicate of the above
<field name="date_from" optional="show" /> | ||
<field name="date_to" optional="show" /> | ||
<field name="date_end" optional="hide" /> | ||
<field name="type" optional="hide" /> |
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.
Please, make this field visible by default
today = fields.Date.today() | ||
values = [{"partner_id": member.id, "date": today} for member in voting_members] | ||
self.search([("date", "=", today)]).sudo().unlink() | ||
self.sudo().create(values) |
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.
Can you remove the sudo here and instead use ir.model.access. I think we can give full rights to the user and add delete="false" create="false"
on the tree for ux
date_end = fields.Date( | ||
help="End date of the membership", | ||
) | ||
can_revoke_membership = fields.Boolean(compute="_compute_can_revoke_membership") |
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'm not sure what this field is used for atm. Left over for development?
@api.model | ||
def action_create_can_vote_snapshot(self): | ||
voting_members = self.env["res.partner"].search( | ||
[("member_can_vote", "=", True)] |
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.
When I have voting members in the future or in the past it doesn't work. Is it maybe easier to have a domain which uses date_from and date_end / date_to on membership.group.member? And then in membership.vote.history.open_at_date set the selected date as context variable.
Or maybe make member_can_vote dependent on context (api.depends_context)
No description provided.