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.
 
 
 
 
 

83 lines
4.0 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- Window Action to show all incoming requests from request.document module-->
<record id="request_document_action" model="ir.actions.act_window">
<field name="name">Incoming Requests</field>
<field name="res_model">request.document</field>
<field name="domain">[('user_id','=', uid)]</field>
<field name="view_mode">tree,form</field>
<field name="context">{'create':False }</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a Request for document from user
</p>
</field>
</record>
<!-- Document Request form view -->
<record id="incoming_request_document_view_form" model="ir.ui.view">
<field name="name">request.document.incoming.view.form</field>
<field name="model">request.document</field>
<field name="arch" type="xml">
<form string="Request document">
<header>
<group attrs="{'invisible':[('state', '=', 'accepted')]}">
<button name="action_accept_request" string="Accept"
type="object" class="btn-primary"
attrs="{'invisible': ['|',('hide_accept_button', '=', False), ('hide_accept_for_user_button', '=', False)]}"/>
</group>
</header>
<sheet>
<group>
<group>
<field name="user_id" string="Request To"/>
</group>
<group>
<field name="workspace_id" string="Workspace"/>
<field name="company_id"/>
<field name="hide_accept_for_user_button" invisible="1"/>
<field name="boolean_user_default" invisible="1"/>
<field name="hide_accept_button" invisible="1"/>
<field name="state" invisible="1"/>
</group>
</group>
<group colspan="4">
<field colspan="2" name="needed_doc" string="Note"
placeholder="Document Needed....."/>
</group>
<notebook>
<page name="public" string="Reject reason"
attrs="{'invisible':[('state', '!=', 'rejected')]}">
<field name="reject_reason"/>
</page>
</notebook>
</sheet>
<footer>
<button name="action_send_document_request" string="REQUEST"
type="object" class="btn-primary"/>
<button special="cancel" string="DISCARD"/>
</footer>
</form>
</field>
</record>
<!-- Document Request tree view -->
<record id="incoming_request_document_view_tree" model="ir.ui.view">
<field name="name">request.document.incoming.view.tree</field>
<field name="model">request.document</field>
<field name="arch" type="xml">
<tree>
<field name="needed_doc" string="Request"/>
<field name="requested_by" string="Requested by"
widget="many2one_avatar_user"/>
<field name="user_id" string="Requested to"
widget="many2one_avatar_user"/>
<field name="create_date" string="Requested Date"/>
<field name="workspace_id" string="Workspace"/>
<field name="needed_doc" string="Document"/>
<field name="state" string="State" widget="badge"
decoration-warning="state == 'requested'"
decoration-danger="state == 'rejected'"
decoration-success="state == 'accepted'"/>
</tree>
</field>
</record>
</odoo>