Skip to content

Conversation

@KKamaa
Copy link

@KKamaa KKamaa commented Jan 26, 2026

Refactor automated action Update Tag and Mailing list -> Update Mailing List

if chan_id:
desired_channel_ids.add(chan_id)

for chan in channels:

Choose a reason for hiding this comment

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

Better to use complete name:
channel

Copy link
Author

Choose a reason for hiding this comment

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

I had made this feature but checking on Tom's requirement he mentioned he will come up with a better way.

elif (not should_be_member) and is_member:
self._safe_channel_write(chan, {field: [(3, partner.id)]})

def action_membership_sync(self):

Choose a reason for hiding this comment

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

Is this called anywhere apart from the tests?
or it can be added as a server action by hand?

Copy link
Author

@KKamaa KKamaa Jan 28, 2026

Choose a reason for hiding this comment

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

I was using it with the base automation but made a server action for partner Sync Member Tag from Membership which you can use. I also added a cron job which can be called on intervals.

image

_logger = logging.getLogger(__name__)

PARAM_PREFIX = "oca_membership_channel_sync."
MEMBER_STATES = {"paid", "invoiced", "free"}

Choose a reason for hiding this comment

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

I think it should only be paid & Free.
but let's confirm from Tom.

Copy link
Author

Choose a reason for hiding this comment

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

I removed free and invoiced and just settled for paid based on the scope Tom mentioned.

return res

if "membership_state" in vals:
self._sync_member_tag_from_membership_state()

Choose a reason for hiding this comment

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

Even after paying for a membership, I couldn't get the tag configured to be added.

Copy link
Author

Choose a reason for hiding this comment

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

@Kiplangatdan can you try again and make sure the member is none if you're creating a new test member
image

@KKamaa KKamaa force-pushed the 18.0-12975-auto-code-RFR branch from d5a8d74 to 666b6ed Compare January 28, 2026 08:49
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.

3 participants