shift_ticket_view.xml 3.73 KB
Newer Older
François C. committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
<?xml version="1.0" encoding="utf-8"?>
<!-- ********************************************************************** -->
<!-- See __openerp__.py file for Copyright and Licence Informations.         -->
<!-- ********************************************************************** -->
<odoo>
    <!-- SHIFT.TICKET VIEWS -->
    <record model="ir.ui.view" id="view_shift_ticket_form">
        <field name="name">shift.ticket.form</field>
        <field name="model">shift.ticket</field>
        <field name="arch" type="xml">
            <form string="Shift Ticket">
                <group name="ticket">
                    <field name="name"/>
                    <field name="product_id"/>
                    <field name="shift_id"/>
                    <field name="seats_max"/>
                    <field name="seats_availability"/>
                    <field name="seats_used"/>
                    <field name="seats_available"/>
                    <field name="seats_reserved"/>
                    <field name="seats_unconfirmed"/>
                </group>
            </form>
        </field>
    </record>

    <record model="ir.ui.view" id="view_shift_ticket_tree">
        <field name="name">shift.ticket.tree</field>
        <field name="model">shift.ticket</field>
        <field name="arch" type="xml">
            <tree string="Shift Ticket" editable="top">
                <field name="name"/>
                <field name="product_id" options="{'no_create_edit': True, 'no_create': True}"/>
                <field name="shift_id" options="{'no_create_edit': True, 'no_create': True}"/>
                <field name="seats_max"/>
                <field name="seats_availability"/>
                <field name="seats_used"/>
                <field name="seats_available"/>
                <field name="seats_reserved"/>
                <field name="seats_unconfirmed"/>
            </tree>
        </field>
    </record>

        <record model="ir.ui.view" id="view_shift_ticket_search">
            <field name="name">shift.ticket.search</field>
            <field name="model">shift.ticket</field>
            <field name="arch" type="xml">
                <search string="Ticket">
                    <field name="name" filter_domain="['|', ('name','ilike',self), ('begin_date_string','ilike',self')]" string="Ticket"/>
                    <separator/>
                    <filter string="My Tickets" help="My Tickets" domain="[('user_ids','in',uid)]"/>
                    <separator/>
                    <filter string="Upcoming" name="upcoming"
                        domain="['&amp;', ('state', '!=', 'cancel'), ('date_begin','&gt;=', datetime.datetime.combine(context_today(), datetime.time(0,0,0)))]" help="Upcoming shifts from today" />
                    <field name="user_ids"/>
                    <field name="product_id"/>
                    <field name="begin_date_string" string="Date"/>
                    <separator/>
                    <filter string="Archived" name="inactive" domain="[('ticket_active','=',False)]"/>
                    <group expand="0" string="Group By">
                        <filter string="Type" context="{'group_by': 'product_id'}"/>
                        <filter string="Start Month" domain="[]" context="{'group_by':'date_begin'}"/>
                    </group>
                </search>
            </field>
        </record>


    <record model="ir.actions.act_window" id="action_shift_ticket">
        <field name="name">Shifts Tickets</field>
        <field name="res_model">shift.ticket</field>
        <field name="view_type">form</field>
    </record>

    <menuitem
        name="Shift Tickets"
        id="menu_shift_ticket"
        action="action_shift_ticket"
        parent="shift_menu"
        groups="coop_shift.group_shift_config"/>
</odoo>