You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
142 lines
6.0 KiB
142 lines
6.0 KiB
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- Form view for fo visit-->
|
|
<record id="fo_visit_view_form" model="ir.ui.view">
|
|
<field name="name">fo.visit.view.form</field>
|
|
<field name="model">fo.visit</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Visits">
|
|
<header>
|
|
<button name="action_check_in"
|
|
string="Check In"
|
|
type="object"
|
|
invisible="state != 'draft'"
|
|
class="oe_highlight"/>
|
|
|
|
<button name="action_check_out"
|
|
string="Check Out"
|
|
type="object"
|
|
invisible="state != 'check_in'"
|
|
class="oe_highlight"
|
|
/>
|
|
<button name="action_cancel"
|
|
string="Cancel"
|
|
type="object"
|
|
invisible="state != 'draft' and state in ('prop_in','prop_out', 'cancel')"/>
|
|
<field name="state"
|
|
widget="statusbar"
|
|
statusbar_visible="draft,check_in,check_out,cancel"
|
|
/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_title">
|
|
<h1>
|
|
<field name="name" readonly="1"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<group>
|
|
<field name="visitor_id"/>
|
|
<field name="phone"/>
|
|
<field name="email"/>
|
|
</group>
|
|
<group string="Check In/Out Details">
|
|
<field name="check_in_date"/>
|
|
<field name="check_out_date"/>
|
|
</group>
|
|
</group>
|
|
<group string="Purpose Of Visit">
|
|
<group>
|
|
<field name="employee_id"/>
|
|
<field name="department_id"/>
|
|
<field name="reason_ids" widget="many2many_tags"/>
|
|
</group>
|
|
<group>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Personal Belongings">
|
|
<field name="belonging_ids"
|
|
widget="one2many_list" nolabel="1">
|
|
<tree decoration-success="permission == '0' or permission == '2'"
|
|
decoration-danger="permission == '1'"
|
|
string="Items" editable="bottom">
|
|
<field name="number"/>
|
|
<field name="property_name"/>
|
|
<field name="property_count"/>
|
|
<field name="permission"/>
|
|
</tree>
|
|
</field>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids"
|
|
widget="mail_followers"
|
|
groups="base.group_user"/>
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
</div>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<!--Tree view of fo visit-->
|
|
<record id="fo_visit_view_tree" model="ir.ui.view">
|
|
<field name="name">fo.visit.view.tree</field>
|
|
<field name="model">fo.visit</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="Visits" decoration-success="state == 'check_in'"
|
|
decoration-muted="state == 'check_out'">
|
|
<field name="visitor_id"/>
|
|
<field name="reason_ids"/>
|
|
<field name="employee_id"/>
|
|
<field name="state"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<!-- Action of fo visit-->
|
|
<record id="fo_visit_action" model="ir.actions.act_window">
|
|
<field name="name">Visits</field>
|
|
<field name="res_model">fo.visit</field>
|
|
<field name="view_mode">tree,form</field>
|
|
<field name="help" type="html">
|
|
<p class="oe_view_nocontent_create">Create Visits.</p>
|
|
<p>
|
|
The check in time will be automatically filled when the
|
|
visitor check in to the office.
|
|
</p>
|
|
<p>
|
|
The check out time automatically filled when the visitor
|
|
check out from office.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
<!-- Action for today's visit-->
|
|
<record id="fo_visit_today_action" model="ir.actions.act_window">
|
|
<field name="name">Today's Visits</field>
|
|
<field name="res_model">fo.visit</field>
|
|
<field name="view_mode">tree,form</field>
|
|
<field name="domain">[('check_in_date', '>=',((context_today()-datetime.timedelta(days=0)).strftime('%Y-%m-%d
|
|
00:00:00'))),
|
|
('check_in_date', '<=',((context_today()-datetime.timedelta(days=0)).strftime('%Y-%m-%d
|
|
23:59:59')))]
|
|
</field>
|
|
</record>
|
|
<record model="ir.ui.view" id="fo_belongings_form_view">
|
|
<field name="name">Belongings</field>
|
|
<field name="model">fo.belongings</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Belongings">
|
|
<sheet>
|
|
<group>
|
|
<group>
|
|
<field name="property_name"/>
|
|
</group>
|
|
<group>
|
|
<field name="property_count"/>
|
|
</group>
|
|
</group>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
</odoo>
|
|
|