[ENH] website_event_ticket_published: re-filter "tickets" instead of changing t-value?
First, thank you very much for everyone's work on this module — I learned a lot going through it and used that knowledge to create a new add-on that I'm happy to donate to the community once it's done (it creates ticket_tags, just like event_tags, which helps when you have a lot of different types of tickets).
Problem: the current method to alter the "tickets" variable makes website_event_ticket_published incompatible with others (e.g. my ticket_tag add-on and event_drag_and_drop on the apps store). I think it might be better to re-filter the existing variable instead?
Current code in /templates/event_ticket.xml:
<xpath expr="//t[@t-set='tickets']" position="attributes">
<attribute
name="t-value"
>event.event_ticket_ids.filtered(lambda t: not t.is_expired and t.show_in_website)</attribute>
</xpath>
Suggestion: re-filter tickets instead:
<xpath expr="//t[@t-set='tickets']" position="after">
<t t-set="tickets" t-value="tickets.filtered(lambda t: t.show_in_website)"/>
</xpath>
The above takes the existing tickets recordset and then further filters it by only showing the ones with show_in_website = True.
I'm happy to work on this change but would love the opinion of those of you with more experience than me.
There hasn't been any activity on this issue in the past 6 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 issue to never become stale, please ask a PSC member to apply the "no stale" label.
Does anyone with more experience have any thoughts on this enhancement?
I think your proposal would be a right fix :smile: :+1: Let's see that PR!
There hasn't been any activity on this issue in the past 6 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 issue to never become stale, please ask a PSC member to apply the "no stale" label.