PURPOSE The event foldable badge is currently not very user-friendly in terms of usage and style. This commit aims to re-work it visually as well as getting rid of multiple technical flows (unnecessary fields / no studio anchors / ...). SPECS Preliminary cleaning : Unify both foldable badge templates into one. The "event badges" report can be printed from 2 different sources, from the event.event itself as a preview and from the event.registration as an actual badge for a specific attendee. The implementation was done using two different templates, leading to a lot of duplicated code and potential issues when editing one template that would not modify the other accordingly. This commit unifies both templates into one. When the report is printed from the event as a "preview", we simply check that the attendee variable is missing and print placeholders instead. Main changes : Rework the whole foldable badge template 1. Get rid of unnecessary fields The foldable badge template used several fields on the event.event model itself that would allow customizing the report per event. However, there were actually no way for the user to access and edit those fields, as they are not part of any views. We therefore removed them (badge_front, badge_back, badge_innerleft, badge_innerright, event_logo). And instead offer a single new field (ticket_extra_instructions), available on the form view of the event, that allows to easily customize the foldable badge and adding instructions specific to this event (how to come / what to bring / ...). 2. Visual changes The report was re-worked to make it look a bit more recent, as the previous look was very basic and was not very attractive. This was done using a specific scss file that allows defining rules without bloating the template with long style attributes. In addition, we added some pictures that help the attendee understanding how to correctly fold the printed A4 sheet into a badge and slide it into the holder. All the information that were previously on the report should still be there. 3. Relocate action from website_event to event As a bonus, we moved the reporting action from website_event to event, in order to have everything that is related to this foldable badge in the same module. Side note: scss disclaimer As the reporting engine does not allow complex class/rules building, we had to implement this nice layout using very well placed background-image and "pixel perfect" sized elements. You will see a lot of hardcoded numbers, mainly on heights, but it can't be helped. LINKS ENT PR odoo/enterprise#19349 UPG PR odoo/upgrade#2599 Task-26779
46 lines
2.3 KiB
XML
46 lines
2.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<record id="event_event_view_form" model="ir.ui.view">
|
|
<field name="name">event.event.view.form.inherit.website</field>
|
|
<field name="model">event.event</field>
|
|
<field name="priority" eval="5"/>
|
|
<field name="inherit_id" ref="event.view_event_form"/>
|
|
<field name="arch" type="xml">
|
|
<field name="company_id" position="after">
|
|
<field name="website_id" options="{'no_create': True}" domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]" groups="website.group_multi_website"/>
|
|
</field>
|
|
<div name="button_box" position="inside">
|
|
<field name="website_url" invisible="1"/>
|
|
<field name="is_published" widget="website_redirect_button"/>
|
|
</div>
|
|
<xpath expr="//div[hasclass('oe_title')]" position="after">
|
|
<div name="event_menu_configuration" groups="base.group_no_one">
|
|
<label for="website_menu" string="Website Submenu"/>
|
|
<field name="website_menu"/>
|
|
<!-- hidden sub-menus, they are triggered all at once based on "website_menu" -->
|
|
<field name="introduction_menu" invisible="1"/>
|
|
<field name="location_menu" invisible="1"/>
|
|
<field name="register_menu" invisible="1"/>
|
|
<label for="menu_register_cta" string="Extra Register Button"/>
|
|
<field name="menu_register_cta"/>
|
|
<label for="community_menu" string="Community" invisible="1"/>
|
|
<field name="community_menu" invisible="1"/>
|
|
</div>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="event_event_view_list" model="ir.ui.view">
|
|
<field name="name">event.event.view.list.inherit.website</field>
|
|
<field name="model">event.event</field>
|
|
<field name="inherit_id" ref="event.view_event_tree"/>
|
|
<field name="arch" type="xml">
|
|
<field name="company_id" position="after">
|
|
<field name="website_id" groups="website.group_multi_website" domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]" optional="show"/>
|
|
</field>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|