flectra/addons/rma/views/rma_request_view.xml

216 lines
10 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<record id="view_rma_request_tree" model="ir.ui.view">
<field name="name">rma.request.tree</field>
<field name="model">rma.request</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="sale_order_id"/>
<field name="partner_id"/>
<field name="type"/>
<field name="team_id"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_rma_request_form" model="ir.ui.view">
<field name="name">rma.request.form</field>
<field name="model">rma.request</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Requests for RMA">
<header>
<button name="action_notify_warranty"
string="Send By Email"
type="object" class="oe_highlight"
groups="stock.group_stock_manager"
attrs="{'invisible': [('state', '=', 'draft')]}"/>
<button name="%(stock.act_stock_return_picking)d"
string="Create RMA"
type="action" class="btn-primary"
attrs="{'invisible': ['|', ('state', 'in', ['draft', 'rma_created', 'replacement_created']), ('is_website', '=', True)]}"
context="{'rma': True}"
groups="stock.group_stock_manager"/>
<button name="action_confirm_request"
string="Confirm"
type="object" class="oe_highlight"
attrs="{'invisible': [('state', 'in', ['confirmed', 'rma_created', 'replacement_created'])]}"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button type="object"
name="action_create_delivery"
class="oe_stat_button"
icon="fa-truck"
attrs="{'invisible': [('state', 'in', ['draft', 'confirmed'])]}">
<field name="picking_count"
widget="statinfo"
string="Delivery"
/>
</button>
</div>
<div class="oe_title">
<h1>
<field name="name" readonly="1"
attrs="{'invisible': [('state', '=', 'draft')]}"
nolabel="1"/>
</h1>
</div>
<group>
<group>
<field name="sale_order_id" required="1"
attrs="{'readonly': [('state', '!=', 'draft')]}"
options="{'no_create': True}"
/>
<field name="partner_id" required="1"
options="{'no_create': True}"
attrs="{'readonly': [('state', '!=', 'draft')]}"
/>
<field name="is_website" invisible="1"/>
<field name="picking_id"
options="{'no_create': True}"
domain="[('sale_id', '=', sale_order_id),
('state', '=', 'done'), ('picking_type_code', '=', 'outgoing')]"
attrs="{'readonly': [('state', '!=', 'draft')], 'required': [('is_website', '=', False)],
'invisible': [('is_website', '=', True)]}"/>
<field name="is_replacement" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="user_id" invisible="1"/>
</group>
<group>
<field name="date" required="1"
attrs="{'readonly': [('state', '!=', 'draft')]}"/>
<field name="team_id" required="1"
attrs="{'readonly': [('state', '!=', 'draft')]}"
options="{'no_create': True}"/>
<field name="type" required="1"
attrs="{'readonly': ['|', ('state', '!=', 'draft'), ('is_website', '=', True)]}"/>
</group>
</group>
<notebook>
<page string="RMA Lines">
<field name="rma_line"
attrs="{'readonly': [('state', '!=', 'draft')]}">
<tree editable="bottom" create="false">
<field name="product_id" readonly="1"
force_save="1"/>
<field name="uom_id" readonly="1"
force_save="1"/>
<field name="qty_delivered" readonly="1"
force_save="1"/>
<field name="qty_return" required="1"/>
<field name="reason_id" required="1"
options="{'no_create': True}"/>
<field name="remark"/>
<field name="rma_id" invisible="1"/>
<field name="move_line_id" invisible="1"/>
</tree>
</field>
</page>
<page string="Warranty Expire Lines">
<field name="warranty_expire_line"
attrs="{'readonly': [('state', '!=', 'draft')]}"/>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="view_rma_request_filter" model="ir.ui.view">
<field name="name">rma.request.search.view</field>
<field name="model">rma.request</field>
<field name="arch" type="xml">
<search string="Search RMA Request">
<field name="name" string="RMA Request"
filter_domain="[('name','ilike',self)]"/>
<field name="partner_id" operator="child_of"/>
<field name="user_id"/>
<field name="state"/>
<field name="team_id" string="Sales Channel"/>
<filter string="My Requests"
domain="[('user_id','=',uid)]"
name="my_rma_request_filter"/>
<filter string="RMA Created"
domain="[('state','=','rma_created')]"
name="rma_request_state_filter"/>
<filter string="Replacements"
domain="[('is_replacement', '=', True)]"
name="replacement_filter"/>
<filter string="Returns"
domain="[('is_replacement', '=', False)]"
name="return_filter"/>
<separator/>
<group expand="1" string="Group By">
<filter string="Partner" name="Partner"
context="{'group_by':'partner_id'}"/>
<filter string="Sale Order"
context="{'group_by':'sale_order_id'}"/>
<filter string="State"
context="{'group_by':'state'}"/>
<filter string="RMA Request type"
context="{'group_by':'type'}"/>
<separator/>
<filter string="Request Month"
context="{'group_by':'date:month'}"/>
<filter string="Return/Replacement"
context="{'group_by':'is_replacement'}"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="act_open_rma_request_view">
<field name="name">RMA Request</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">rma.request</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="context">{}</field>
</record>
<record model="ir.actions.act_window"
id="action_open_rma_request_rmateam">
<field name="name">RMA Request</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">rma.request</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="context">{
'search_default_team_id': [active_id],
'search_default_return_filter': 1,
'default_team_id': active_id,
}
</field>
<field name="search_view_id" ref="view_rma_request_filter"/>
</record>
<record model="ir.actions.act_window"
id="action_open_replacement_request_rmateam">
<field name="name">Replacement Request</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">rma.request</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[]</field>
<field name="context">{
'search_default_team_id': [active_id],
'search_default_replacement_filter': 1,
'default_team_id': active_id,
}
</field>
<field name="search_view_id" ref="view_rma_request_filter"/>
</record>
</flectra>