add new module

This commit is contained in:
sonal arora
2020-07-21 10:09:46 +00:00
parent 800e7fdceb
commit c0d10e3fbe
1063 changed files with 243750 additions and 5 deletions

View File

@@ -0,0 +1,243 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="seq_hr_custody_seq" model="ir.sequence">
<field name="name">Custody Code</field>
<field name="code">hr.custody</field>
<field name="prefix">CR</field>
<field eval="4" name="padding"/>
<field eval="False" name="company_id"/>
</record>
<record model='ir.ui.view' id='wizard_return_date_form'>
<field name="name">wizard.return.date.form</field>
<field name="model">wizard.return.date</field>
<field name="arch" type="xml">
<form string="Renewal Request">
<group>
<group>
<field name="returned_date"/>
</group>
</group>
<footer>
<button name="proceed" string="Proceed" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
<record model='ir.ui.view' id='custody_custody_form_view'>
<field name="name">custody.property.form</field>
<field name="model">custody.property</field>
<field name="arch" type="xml">
<form string="Equipments">
<sheet>
<field name="image" widget='image' class="oe_avatar"/>
<div class="oe_title">
<h1>
<field name="name" placeholder="Name"/>
</h1>
</div>
<group>
<group>
<field name="property_selection" widget="radio"/>
<field name="asset_true" invisible="1"/>
<field name="asset_id" attrs="{'invisible': [('asset_true', '=', False)]}"/>
<field name="product_id"
attrs="{'invisible': [('property_selection', '!=', 'product')]}"/>
<field name="company_id" options="{'no_create': True}"
groups="base.group_multi_company"/>
</group>
</group>
<notebook>
<page name="desc" string="Description">
<field name="desc"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record model='ir.actions.act_window' id='wizard_return_date_act'>
<field name="name">Custody Request</field>
<field name="res_model">wizard.return.date</field>
<field name="view_mode">form</field>
<field name="view_id" ref="wizard_return_date_form"/>
<field name="target">new</field>
</record>
<record id="hr_custody_form_view" model="ir.ui.view">
<field name="name">hr.custody.form</field>
<field name="model">hr.custody</field>
<field name="arch" type="xml">
<form string="Custody">
<header>
<button string="Send For Approval" type="object" name="sent"
class="oe_highlight"
attrs="{'invisible': [('state','not in',('draft'))]}"/>
<button string="Approve" groups="hr.group_hr_manager" type="object" name="approve"
class="oe_highlight"
attrs="{'invisible': ['|',('state','not in',('to_approve')),
('renew_return_date','=',True)]}"/>
<button string="Renewal Approval" groups="hr.group_hr_manager" type="object"
name="renew_approve"
class="oe_highlight"
attrs="{'invisible': ['|',('state','not in',('to_approve')),
('renew_return_date','=',False)]}"/>
<button string="Refuse" groups="hr.group_hr_manager" type="action"
name="%(hr_custody.wizard_reason_act)d"
attrs="{'invisible': ['|',('state','not in',('to_approve')),
('renew_return_date','=',True)]}" class="btn-primary"
context="{'reject_id':id,'model_id':'hr.custody'}"/>
<button class="btn-primary" name="%(hr_custody.wizard_reason_act)d" string="Refuse"
groups="hr.group_hr_manager" type="action"
attrs="{'invisible': ['|',('state','not in',('to_approve')),
('renew_return_date','=',False)]}"
context="{'reject_id':id,'model_id':'hr.custody','renew': 'renew'}"/>
<button string="Set to Draft" type="object" name="set_to_draft"
attrs="{'invisible': [('state','not in',('rejected'))]}"/>
<button string="Return" type="object" name="set_to_return" groups="hr.group_hr_manager"
attrs="{'invisible': [('state','not in',('approved'))]}"/>
<button string="Send Mail" type="object" name="send_mail" groups="hr.group_hr_manager"
attrs="{'invisible': ['|',('mail_send', '=', False),('state','not in',('approved'))]}"/>
<button string="Send Mail" type="object" class="oe_highlight" name="send_mail"
groups="hr.group_hr_manager"
attrs="{'invisible': ['|',('mail_send', '=', True),('state','not in',('approved'))]}"/>
<button string="Renew" type="action" name="%(wizard_return_date_act)d"
context="{'custody_id':id}" class="oe_highlight"
attrs="{'invisible': ['|',('state','not in',('approved')),
('renew_return_date','=',True)]}"/>
<field name="state" widget="statusbar" statusbar_visible="draft,to_approve,approved,returned"/>
</header>
<sheet>
<h1>
<field name="name" readonly="1" nolabel="1"/>
</h1>
<group>
<group>
<field name="read_only" invisible="1"/>
<field name="employee" attrs="{'readonly': [('read_only','=',False)]}"/>
<field name="custody_name" options="{'no_open':True,'no_create':True}"
domain="[('company_id','child_of',[company_id])]"/>
<field name="renew_return_date" invisible="1"/>
<field name="renew_reject" invisible="1"/>
<field name="mail_send" invisible="1"/>
<field name="purpose"/>
</group>
<group>
<field name="date_request"/>
<field name="return_date" attrs="{'invisible': [('renew_return_date','=',True),
('renew_date','not in',[None,False]),('renew_reject','=',False)]}"/>
<field name="renew_date" attrs="{'invisible': ['|',('renew_return_date','=',False),
('state','!=','to_approve')]}"/>
<field name="rejected_reason" attrs="{'invisible': [('state','not in',('rejected'))]}"/>
<field name="renew_rejected_reason"
attrs="{'invisible': ['|',('renew_reject','=',False),('state','not in',('approved'))]}"/>
<field name="company_id" options="{'no_create': True}"
groups="base.group_multi_company"/>
</group>
</group>
<notebook>
<page string="Notes">
<field name="notes"/>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="hr_custody_tree_view" model="ir.ui.view">
<field name="name">hr.custody.tree</field>
<field name="model">hr.custody</field>
<field name="arch" type="xml">
<!-- <tree decoration-info="state == 'draft'" colors="red:current_date > return_date;grey:state == 'rejected';green:state == 'approved';-->
<!-- black:state == 'to_approve';grey:state == 'returned';">-->
<tree>
<field name="name"/>
<field name="employee"/>
<field name="custody_name"/>
<field name="purpose"/>
<field name="date_request"/>
<field name="return_date"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="hr_property_tree_view" model="ir.ui.view">
<field name="name">hr_property_tree_view.tree</field>
<field name="model">custody.property</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
</tree>
</field>
</record>
<record id="hr_custody_search_view" model="ir.ui.view">
<field name="name">hr.custody.search</field>
<field name="model">hr.custody</field>
<field name="arch" type="xml">
<search string="Custody">
<field name="name"/>
<field name="employee"/>
<field name="custody_name"/>
<field name="purpose"/>
<field name="date_request"/>
<field name="return_date"/>
<field name="state"/>
<separator/>
<group expand="0" string="Group By">
<filter string="Status" name="status" domain="[]" context="{'group_by':'state'}"/>
<filter string="Employee" name="employee" domain="[]" context="{'group_by':'employee'}"/>
<filter string="Custody Name" name="custody" domain="[]" context="{'group_by':'custody_name'}"/>
</group>
</search>
</field>
</record>
<record id="action_hr_custody" model="ir.actions.act_window">
<field name="name">Custody</field>
<field name="res_model">hr.custody</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="hr_custody_search_view"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to Create a New Record.
</p>
</field>
</record>
<record id="action_hr_property" model="ir.actions.act_window">
<field name="name">Property</field>
<field name="res_model">custody.property</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to Create a New Record.
</p>
</field>
</record>
<menuitem id="hr_custody_main_menu"
web_icon="hr_custody,static/description/custody_icon.png"
name="Custody" sequence="20"/>
<menuitem id="hr_custody_menu" parent="hr_custody_main_menu"
name="Custody Management" sequence="20"/>
<menuitem action="action_hr_custody" id="hr_custody_menu" parent="hr_custody.hr_custody_main_menu"
name="Custody Request" sequence="1"/>
<menuitem action="action_hr_property" id="hr_property_menu" parent="hr_custody.hr_custody_main_menu"
name="Property" sequence="5" groups="hr.group_hr_manager"/>
</data>
</odoo>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record model="ir.cron" id="hr_custody_data_reminders">
<field name="name">HR Custody Return Notification</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
<field name="model_id" ref="model_hr_custody"/>
<field name="state">code</field>
<field name="code">model.mail_reminder()</field>
</record>
</data>
</odoo>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="custody_hr_employee_inherit_form_view">
<field name="name">hr.employee.form.inherit.view</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<div class="oe_button_box" position="inside">
<button class="oe_stat_button" name="custody_view" type="object" icon="fa-list-ol">
<field string="Custody" name="custody_count" widget="statinfo"/>
</button>
<button class="oe_stat_button" name="equipment_view" type="object" icon="fa-tablet">
<field string="Equipments" name="equipment_count" widget="statinfo"/>
</button>
</div>
</field>
</record>
</data>
</odoo>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="custody_email_notification_template" model="mail.template">
<field name="name">Custody e-mail template</field>
<field name="email_from">${object.company_id and object.company_id.email or ''}</field>
<field name="subject">Notification to return company asset-${object.custody_name.name}</field>
<field name="email_to">${object.email|safe}</field>
<field name="lang">${object.lang}</field>
<field name="model_id" ref="hr_custody.model_hr_custody"/>
<field name="auto_delete" eval="True"/>
<field name="body_html">
<![CDATA[
<p>Dear ${(object.employee.name)},<br/><br/>
You are in possession of the company asset
<strong>"${(object.custody_name.name)}"</strong>
since <strong>${(object.return_date)}.</strong><br/><br/>
Please kindly return the property as soon as possible.<br/><br/></p>
Regards,<br/><br/>
${(object.company_id.name)}]]>
</field>
</record>
</data>
</odoo>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model='ir.ui.view' id='wizard_reason_form'>
<field name="name">wizard.reason.form</field>
<field name="model">wizard.reason</field>
<field name="arch" type="xml">
<form string="Update Reason">
<group>
<field name="reason" required="True"/>
</group>
<footer>
<button name="send_reason" string="Proceed" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record model='ir.actions.act_window' id='wizard_reason_act'>
<field name="name">Update Reason</field>
<field name="res_model">wizard.reason</field>
<field name="view_mode">form</field>
<field name="view_id" ref="wizard_reason_form"/>
<field name="target">new</field>
</record>
</data>
</odoo>