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

[REF] membership changes #80

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

gbrito
Copy link
Contributor

@gbrito gbrito commented Feb 7, 2025

No description provided.

@gbrito gbrito force-pushed the 16.0-membership_group branch from 78f11d5 to 937a838 Compare February 18, 2025 10:13
@gbrito gbrito force-pushed the 16.0-membership_group branch 3 times, most recently from d4a7b44 to 6c40c93 Compare February 28, 2025 15:48
@tarteo tarteo force-pushed the 16.0-membership_group branch from 6c40c93 to e5b047e Compare March 7, 2025 08:58
@gbrito gbrito changed the title [WIP] membership changes DO NOT MERGE [REF] membership changes Mar 7, 2025
<field name="active" eval="True" />
</record>

<record id="ir_cron_revoke_memberships" model="ir.cron">
Copy link
Member

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" />
Copy link
Member

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)
Copy link
Member

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")
Copy link
Member

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)]
Copy link
Member

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)

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.

2 participants