|
|
<odoo> <record model="ir.ui.view" id="task_view_tree"> <field name="name">Shift List</field> <field name="model">beesdoo.shift.shift</field> <field name="arch" type="xml"> <tree> <field name="start_time" /> <field name="planning_id" /> <field name="task_type_id" /> <field name="name" /> <field name="super_coop_id" /> <field name="worker_id" /> <field name="replaced_id" /> <field name="end_time" /> <field name="state" /> </tree> </field> </record>
<record model="ir.ui.view" id="task_view_search"> <field name="name">Shift Search</field> <field name="model">beesdoo.shift.shift</field> <field name="arch" type="xml"> <search> <field name="planning_id" /> <field name="task_type_id" /> <field name="name" /> <field name="super_coop_id" /> <field name="worker_id" /> <filter string="My Team Shift" domain="[('super_coop_id', '=', uid)]" /> <filter string="My Shift" domain="[('worker_id.user_ids', 'in', uid)]" /> <separator /> <filter string="Assigned" name="assigned" domain="[('worker_id', '!=', False)]" /> <filter string="Unassigned" name="unassigned" domain="[('worker_id', '=', False)]" /> <separator /> <filter string="4 next days" name="nextweek" domain="[('end_time','>', context_today().strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','<', (context_today() + datetime.timedelta(days=4)).strftime('%%Y-%%m-%%d 23:59:59'))]" /> <filter string="J-5" name="jminus5" domain="[('end_time','>', (context_today() - datetime.timedelta(days=5)).strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','<', (context_today() - datetime.timedelta(days=5)).strftime('%%Y-%%m-%%d 23:59:59'))]" /> <filter string="J-4" name="jminus4" domain="[('end_time','>', (context_today() - datetime.timedelta(days=4)).strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','<', (context_today() - datetime.timedelta(days=4)).strftime('%%Y-%%m-%%d 23:59:59'))]" /> <filter string="J-3" name="jminus3" domain="[('end_time','>', (context_today() - datetime.timedelta(days=3)).strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','<', (context_today() - datetime.timedelta(days=3)).strftime('%%Y-%%m-%%d 23:59:59'))]" /> <filter string="J-2" name="jminus2" domain="[('end_time','>', (context_today() - datetime.timedelta(days=2)).strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','<', (context_today() - datetime.timedelta(days=2)).strftime('%%Y-%%m-%%d 23:59:59'))]" /> <filter string="J-1" name="jminus1" domain="[('end_time','>', (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','<', (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d 23:59:59'))]" /> <filter string="Today" name="today" domain="[('end_time','>', context_today().strftime('%%Y-%%m-%%d 00:00:00')), ('start_time','<', context_today().strftime('%%Y-%%m-%%d 23:59:59'))]" /> <group expand="1" string="Group By"> <filter string="Shift Template" context="{'group_by' : 'task_template_id'}" /> <filter string="Type" name="gb_type" context="{'group_by' : 'task_type_id'}" /> <filter string="Status" name="gb_status" context="{'group_by' : 'state'}" /> <filter string="Day" name="gb_day" context="{'group_by' : 'start_time:day'}" /> </group> </search> </field> </record>
<record model="ir.ui.view" id="task_view_calendar"> <field name="name">Task Template List</field> <field name="model">beesdoo.shift.shift</field> <field name="arch" type="xml"> <calendar string="Calendar View" date_start="start_time" date_stop="end_time" color="task_type_id"> <field name="name" /> <field name="super_coop_id" /> <field name="worker_id" /> </calendar> </field> </record>
<record model="ir.ui.view" id="task_view_form"> <field name="name">Task Template Form</field> <field name="model">beesdoo.shift.shift</field> <field name="arch" type="xml"> <form> <header> <field name="state" widget="statusbar" clickable="1" /> </header> <sheet> <div class="oe_title"> <h1> <field name="name" /> </h1> </div> <group> <group> <field name="task_template_id" /> <field name="task_type_id" /> <field name="super_coop_id" domain="[('cooperative_status_ids.status', 'not in', ('unsubscribed', 'resigning'))]"/> <field name="worker_id" options="{'no_create': True, 'no_open': True}" domain="[('cooperative_status_ids.status', 'not in', ('unsubscribed', 'resigning'))]"/> <field name="replaced_id" options="{'no_create': True, 'no_open': True}" domain="[('working_mode', '=', 'regular')]" attrs="{'invisible': [('working_mode', '!=', 'regular')]}" /> <group> <field name="is_regular" attrs="{'invisible': [('working_mode', '!=', 'regular')]}"/> <field name="is_compensation" attrs="{'invisible': [('working_mode', '!=', 'regular')]}"/> <field name="working_mode" invisible="1"/> </group> </group> <group> <field name="start_time" /> <field name="end_time" /> <field name="revert_info" invisible="0" /> </group> </group> </sheet> <!-- Solution Ex1 --> <div class="oe_chatter"> <field name="message_follower_ids" widget="mail_followers" /> <field name="message_ids" widget="mail_thread" /> </div> </form> </field> </record>
<record model="ir.ui.view" id="task_shift_view_kanban"> <field name="name">Shift Kanban</field> <field name="model">beesdoo.shift.shift</field> <field name="arch" type="xml"> <kanban> <field name="color" /> <field name="task_type_id" /> <field name="name" /> <field name="state" /> <field name="worker_id" /> <field name="super_coop_id" /> <field name="is_regular" /> <templates> <t t-name="kanban-box"> <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click"> <div class="o_dropdown_kanban dropdown" groups="base.group_user"> <a class="dropdown-toggle btn" data-toggle="dropdown" href="#"> <span class="fa fa-bars fa-lg" /> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> <t t-if="widget.editable"> <li> <a type="edit">Edit Shift</a> </li> </t> </ul> </div> <div class="oe_kanban_content"> <strong> <field name="name" /> </strong> <div> <field name="start_time" widget="datetime" /> - <field name="end_time" widget="datetime" /> </div> <div> Status: <field name="state" /> </div> <div t-if="record.task_type_id.raw_value"> Type: <field name="task_type_id" /> </div> <div> Worker: <field name="worker_id" /> </div> <div t-if="record.super_coop_id.raw_value"> Super Coop: <field name="super_coop_id" /> </div> <div t-if="record.is_regular.raw_value"> Regular Shift </div>
</div> </div> </t> </templates> </kanban> </field> </record>
<!-- Actions --> <record model="ir.actions.act_window" id="action_task"> <field name="name">Task Action</field> <field name="res_model">beesdoo.shift.shift</field> <field name="view_mode">kanban,calendar,tree,form,pivot</field> <field name="context">{'search_default_today': 1, 'search_default_gb_type':1}</field> </record>
<record model="ir.actions.act_window" id="action_task_attendance"> <field name="name">Shift Attendance</field> <field name="res_model">beesdoo.shift.shift</field> <field name="view_mode">kanban,tree,form</field> <field name="context">{ 'search_default_assigned': 1, 'search_default_today': 1, 'search_default_gb_status':1}</field> </record>
<!-- Top menu item --> <menuitem name="Planning" id="menu_task_top" parent="menu_root" sequence="1" groups="beesdoo_shift.group_shift_attendance" /> <!-- actions --> <menuitem name="Shift" id="menu_task" parent="menu_task_top" action="action_task" groups="beesdoo_shift.group_shift_management" /> <menuitem name="Shift Attendance" id="menu_task_attendance" parent="menu_task_top" action="action_task_attendance" /> </odoo>
|