flectra/addons/mrp/views/mrp_unbuild_views.xml
2018-01-16 02:34:37 -08:00

180 lines
9.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<!-- Unbuild and scrap menu -->
<record model="ir.actions.act_window" id="action_mrp_unbuild_moves">
<field name="name">Stock Moves</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.move</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">['|', ('unbuild_id', '=', active_id), ('consume_unbuild_id', '=', active_id)]</field>
</record>
<record id="mrp_unbuild_search_view" model="ir.ui.view">
<field name="name">mrp.unbuild.search</field>
<field name="model">mrp.unbuild</field>
<field name="arch" type="xml">
<search string="Search">
<field name="product_id"/>
<field name="state"/>
<field name="mo_id"/>
<group expand="0" string="Filters">
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]"/>
<filter name="done" string="Done" domain="[('state', '=', 'done')]"/>
<separator/>
<filter string="My Activities" name="activities_my"
domain="[('activity_ids.user_id', '=', uid)]"/>
<separator/>
<filter string="Late Activities" name="activities_overdue"
domain="[('activity_ids.date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter string="Today Activities" name="activities_today"
domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="Future Activitie" name="activities_upcoming_all"
domain="[('activity_ids.date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))
]"/>
</group>
<group expand='0' string='Group by...'>
<filter string='Product' name="productgroup" context="{'group_by': 'product_id'}"/>
<filter string="Manufacturing Order" name="mogroup" context="{'group_by': 'mo_id'}"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_mrp_unbuild_moves">
<field name="name">Product Moves</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.move.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">['|', ('move_id.unbuild_id', '=', active_id), ('move_id.consume_unbuild_id', '=', active_id)]</field>
</record>
<record id="mrp_unbuild_kanban_view" model="ir.ui.view">
<field name="name">mrp.unbuild.kanban</field>
<field name="model">mrp.unbuild</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="name"/>
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom_id"/>
<field name="state"/>
<field name="location_id"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings mt4">
<strong class="o_kanban_record_title"><span><field name="name"/></span></strong>
</div>
<strong><t t-esc="record.product_qty.value"/> <small><t t-esc="record.product_uom_id.value"/></small></strong>
</div>
<div class="row">
<div class="col-xs-8 text-muted">
<span><t t-esc="record.product_id.value"/></span>
</div>
<div class="col-xs-4">
<span class="pull-right text-right">
<field name="state" widget="kanban_label_selection" options="{'classes': {'draft': 'default', 'done': 'success'}}"/>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="mrp_unbuild_form_view" model="ir.ui.view">
<field name="name">mrp.unbuild.form</field>
<field name="model">mrp.unbuild</field>
<field name="arch" type="xml">
<form string="Unbuild Orders">
<header>
<button name="action_validate" string="Unbuild" type="object" states="draft" class="oe_highlight"/>
<field name="state" widget="statusbar" statusbar_visible="draft,done"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" name="%(action_mrp_unbuild_moves)d"
string="Product Moves" type="action" icon="fa-arrows-v" states="done"/>
</div>
<div class="oe_title">
<h1><field name="name" placeholder="Unbuild Order" nolabel="1"/></h1>
</div>
<group>
<group>
<field name="product_id" domain="[('bom_ids', '!=', False)]"/>
<field name="bom_id" domain="['|',
('product_id','=',product_id),
'&amp;',
('product_tmpl_id.product_variant_ids','=',product_id),
('product_id','=',False),
('type', '=', 'normal')]"/>
<label for="product_qty"/>
<div class="o_row">
<field name="product_qty"/>
<field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="product.group_uom"/>
</div>
</group>
<group>
<field name="mo_id" required="True"/>
<field name="location_id" groups="stock.group_stock_multi_locations"/>
<field name="location_dest_id" groups="stock.group_stock_multi_locations"/>
<field name="has_tracking" invisible="1"/>
<field name="lot_id" attrs="{'invisible': [('has_tracking', '=', 'none')], 'required': [('has_tracking', '!=', 'none')]}" groups="stock.group_production_lot"/>
</group>
</group>
</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="mrp_unbuild_tree_view" model="ir.ui.view">
<field name="name">mrp.unbuild.tree</field>
<field name="model">mrp.unbuild</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="product_id"/>
<field name="bom_id"/>
<field name="lot_id" groups="stock.group_production_lot"/>
<field name="product_qty"/>
<field name="product_uom_id" groups="product.group_uom"/>
<field name="state"/>
<field name="location_id" groups="stock.group_stock_multi_locations"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="mrp_unbuild">
<field name="name">Unbuild Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.unbuild</field>
<field name="view_type">form</field>
<field name="view_mode">tree,kanban,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click here to create a Unbuild Order.
</p><p>
Unbuild Orders are used to break down a product you manufactured or purchased into its components, based on its Bill of Material.</p>
</field>
</record>
<menuitem id="menu_mrp_unbuild"
name="Unbuild Orders"
parent="menu_mrp_manufacturing"
action="mrp_unbuild"
sequence="20"/>
</flectra>