[IMP] procurement: improved search views.
[odoo/odoo.git] / addons / procurement / procurement_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <!--
5         Procurement
6         -->
7
8
9         <record id="procurement_tree_view" model="ir.ui.view">
10             <field name="name">procurement.order.tree</field>
11             <field name="model">procurement.order</field>
12             <field name="type">tree</field>
13             <field name="arch" type="xml">
14                 <tree string="Procurement Lines" colors="red:date_planned&lt;current_date and state == 'exception';black:state=='running';darkgreen:state=='confirmed';gray:state in ['done','cancel'];blue:state == 'ready'">
15                     <field name="date_planned" widget="date"/>
16                     <field name="origin"/>
17                     <field name="product_id"/>
18                     <field name="product_qty"/>
19                     <field name="product_uom" string="Unit of Measure"/>
20                     <field name="procure_method"/>
21                     <field name="state"/>
22                     <field name="message"/>
23                     <field name="name" invisible="1"/>
24                 </tree>
25             </field>
26         </record>
27          <record id="procurement_tree_view_board" model="ir.ui.view">
28             <field name="name">procurement.order.tree.board</field>
29             <field name="model">procurement.order</field>
30             <field name="type">tree</field>
31             <field eval="20" name="priority"/>
32             <field name="arch" type="xml">
33                 <tree string="Procurement Lines" colors="red:date_planned&lt;current_date and state == 'exception';black:state=='running';darkgreen:state=='confirmed';gray:state in ['done','cancel'];blue:state == 'ready'">
34                     <field name="date_planned" widget="date"/>
35                     <field name="origin"/>
36                     <field name="product_id"/>
37                     <field name="product_qty"/>
38                     <field name="product_uom" string="Unit of Measure"/>
39                     <field name="state" invisible = "1"/>
40                     <field name="message"/>
41                 </tree>
42             </field>
43         </record>
44         <record id="procurement_form_view" model="ir.ui.view">
45             <field name="name">procurement.order.form</field>
46             <field name="model">procurement.order</field>
47             <field name="type">form</field>
48             <field name="arch" type="xml">
49                 <form string="Procurement" version="7.0">
50                     <header>
51                         <button name="button_confirm" states="draft" string="Confirm" class="oe_highlight"/>
52                         <button name="button_check" states="confirmed" string="Run Procurement" class="oe_highlight"/>
53                         <button name="button_restart" states="exception" string="Retry" class="oe_highlight"/>
54                         <button name="button_cancel" states="draft,exception,waiting" string="Cancel"/>
55                         <field name="state" readonly="1" widget="statusbar" statusbar_visible="draft,confirmed" />
56                     </header>
57                     <sheet>
58                     <label for="name" class="oe_edit_only"/>
59                     <h1>
60                         <field name="name" class="oe_inline"/>
61                         <label string="-" attrs="{'invisible':[('origin','=',False)]}"/>
62                         <field name="origin" class="oe_inline"/>
63                     </h1>
64                     <group>
65                         <group>
66                             <field name="date_planned"/>
67                             <field name="procure_method"/>
68                             <field name="priority"/>
69                         </group>
70                         <group>
71                             <field name="message"/>
72                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
73                         </group>
74                     </group>
75                     <notebook>
76                     <page string="Procurement Details">
77                         <group>
78                             <group>
79                                 <field name="product_id" on_change="onchange_product_id(product_id)"/>
80                                 <label for="product_qty"/>
81                                 <div>
82                                     <field name="product_qty" class="oe_inline"/>
83                                     <field name="product_uom" class="oe_inline"/>
84                                 </div>
85                                 <label for="product_uos_qty" groups="product.group_uos"/>
86                                 <div groups="product.group_uos">
87                                     <field name="product_uos_qty" class="oe_inline"/>
88                                     <field name="product_uos" class="oe_inline"/>
89                                 </div>
90                             </group>
91                             <group>
92                                <field name="location_id" domain="[('usage','=','internal')]"/>
93                             </group>
94                         </group>
95                     </page>
96                     <page string="Extra Information">
97                         <group>
98                             <field name="move_id"/>
99                             <field name="date_close"/>
100                             <field name="close_move"/>
101                         </group>
102                     </page>
103                     <page string="Notes">
104                         <field name="note"/>
105                     </page>
106                     </notebook>
107                     </sheet>
108                     <div class="oe_chatter">
109                         <field name="message_ids" widget="mail_thread"/>
110                     </div>
111                 </form>
112             </field>
113         </record>
114         <record id="view_procurement_filter" model="ir.ui.view">
115             <field name="name">procurement.order.select</field>
116             <field name="model">procurement.order</field>
117             <field name="type">search</field>
118             <field name="arch" type="xml">
119                 <search string="Search Procurement">
120                     <field name="origin" string="Procurement"/>
121                     <field name="date_planned"/>
122                     <field name="product_id" />
123                     <field name="state" />
124                     <filter icon="terp-emblem-important" string="Exceptions" name="exceptions" domain="[('state','=','exception')]" help="Procurement Exceptions"/>
125                     <filter icon="terp-emblem-important" string="To Fix" name="perm_exceptions" domain="[('state','=','exception'),('message', '!=', '')]" help="Permanent Procurement Exceptions"/>
126                     <filter icon="terp-emblem-important" string="Temporary" name="temp_exceptions" domain="[('state','=','exception'),('message', '=', '')]" help="Temporary Procurement Exceptions"/>
127                     <separator/>
128                     <filter icon="terp-gnome-cpu-frequency-applet+" string="Late" domain="['&amp;', ('date_planned','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]" help="Procurement started late" />
129                     <group expand="0" string="Group By">
130                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
131                         <filter string="Reason" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'name'}"/>
132                         <filter string="Scheduled Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
133                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
134                     </group>
135                 </search>
136             </field>
137         </record>
138
139         <record id="procurement_action" model="ir.actions.act_window">
140             <field name="name">Procurement Orders</field>
141             <field name="type">ir.actions.act_window</field>
142             <field name="res_model">procurement.order</field>
143             <field name="view_type">form</field>
144             <field name="view_id" eval="False"/>
145             <field name="search_view_id" ref="view_procurement_filter"/>
146             <field name="context">{'search_default_current':1}</field>
147             <field name="help">A procurement order is used to record a need for a specific product at a specific location. A procurement order is usually created automatically from sales orders, a Pull Logistics rule or Minimum Stock Rules. When the procurement order is confirmed, it automatically creates the necessary operations to fullfil the need: purchase order proposition, manufacturing order, etc.</field>
148         </record>
149
150         <record id="procurement_exceptions" model="ir.actions.act_window">
151             <field name="name">Procurement Exceptions</field>
152             <field name="type">ir.actions.act_window</field>
153             <field name="res_model">procurement.order</field>
154             <field name="view_type">form</field>
155             <field name="view_mode">tree,form</field>
156             <field name="context">{'search_default_perm_exceptions':1}</field>
157             <field name="search_view_id" ref="view_procurement_filter"/>
158             <field name="help">Procurement Orders represent the need for a certain quantity of products, at a given time, in a given location. Sales Orders are one typical source of Procurement Orders (but these are distinct documents). Depending on the procurement parameters and the product configuration, the procurement engine will attempt to satisfy the need by reserving products from stock, ordering products from a supplier, or passing a manufacturing order, etc. A Procurement Exception occurs when the system cannot find a way to fulfill a procurement. Some exceptions will resolve themselves automatically, but others require manual intervention (those are identified by a specific error message).</field>
159         </record>
160
161         <record id="procurement_action5" model="ir.actions.act_window">
162             <field name="name">Procurement Exceptions</field>
163             <field name="type">ir.actions.act_window</field>
164             <field name="res_model">procurement.order</field>
165             <field name="view_type">form</field>
166             <field name="view_mode">tree,form</field>
167             <field name="domain">[('state','=','exception')]</field>
168         </record>
169
170         <!-- Order Point -->
171         <record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
172             <field name="name">stock.warehouse.orderpoint.tree</field>
173             <field name="model">stock.warehouse.orderpoint</field>
174             <field name="type">tree</field>
175             <field name="arch" type="xml">
176                 <tree string="Reordering Rules">
177                     <field name="name"/>
178                     <field name="warehouse_id"/>
179                     <field name="location_id" groups="stock.group_locations"/>
180                     <field name="product_id"/>
181                     <field name="product_uom"/>
182                     <field name="product_min_qty"/>
183                     <field name="product_max_qty"/>
184                 </tree>
185             </field>
186         </record>
187
188         <record model="ir.ui.view" id="warehouse_orderpoint_search">
189             <field name="name">stock.warehouse.orderpoint.search</field>
190             <field name="model">stock.warehouse.orderpoint</field>
191             <field name="type">search</field>
192             <field name="arch" type="xml">
193                 <search string="Reordering Rules Search">
194                     <field name="name" string="Reordering Rules"/>
195                     <field name="warehouse_id"/>
196                     <field name="location_id" groups="stock.group_locations"/>
197                     <field name="company_id" groups="base.group_multi_company"/>
198                     <field name="product_id"/>
199                     <group expand="0" string="Group By...">
200                         <filter string="Warehouse" icon="terp-go-home" domain="[]"  context="{'group_by':'warehouse_id'}"/>
201                         <filter string="Location" icon="terp-go-home" domain="[]" context="{'group_by':'location_id'}"/>
202                     </group>
203                 </search>
204             </field>
205         </record>
206
207         <record id="view_warehouse_orderpoint_form" model="ir.ui.view">
208             <field name="name">stock.warehouse.orderpoint.form</field>
209             <field name="model">stock.warehouse.orderpoint</field>
210             <field name="type">form</field>
211             <field name="arch" type="xml">
212                 <form string="Reordering Rules" version="7.0">
213                     <sheet>
214                         <group>
215                             <group>
216                                 <field name="name" />
217                                 <field name="product_id" on_change="onchange_product_id(product_id)"/>
218                             </group>
219                             <group>
220                                 <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
221                                 <field name="product_uom"/>
222                                 <field name="location_id" groups="stock.group_locations"/>
223                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
224                             </group>
225                         </group>
226                         <group>
227                             <group string="Rules">
228                                 <field name="product_min_qty" />
229                                 <field name="product_max_qty" />
230                                 <field name="qty_multiple" string="Quantity Multiple"/>
231                             </group>
232                             <group string="Misc">
233                                 <field name="procurement_id" readonly="1"/>
234                                 <field name="active" />
235                             </group>
236                         </group>
237                         <group string="Procurement Orders to Process">
238                             <field name="procurement_draft_ids" nolabel="1"/>
239                         </group>
240                     </sheet>
241                 </form>
242             </field>
243         </record>
244
245         <record id="action_orderpoint_form" model="ir.actions.act_window">
246             <field name="name">Reordering Rules</field>
247             <field name="res_model">stock.warehouse.orderpoint</field>
248             <field name="type">ir.actions.act_window</field>
249             <field name="view_type">form</field>
250             <field name="view_id" ref="view_warehouse_orderpoint_tree"/>
251             <field name="search_view_id" ref="warehouse_orderpoint_search" />
252             <field name="help">You can define your minimum stock rules, so that OpenERP will automatically create draft manufacturing orders or purchase quotations according to the stock level. Once the virtual stock of a product (= stock on hand minus all confirmed orders and reservations) is below the minimum quantity, OpenERP will generate a procurement request to increase the stock up to the maximum quantity.</field>
253         </record>
254
255         <act_window
256         context="{'search_default_warehouse_id': active_id, 'default_warehouse_id': active_id}"
257         id="act_stock_warehouse_2_stock_warehouse_orderpoint"
258         name="Reordering Rules"
259         res_model="stock.warehouse.orderpoint"
260         src_model="stock.warehouse"
261         groups="stock.group_stock_user"/>
262
263         <act_window
264             context="{'product_uom': locals().has_key('uom_id') and uom_id, 'default_procurement_id': active_id}"
265             id="act_procurement_2_stock_warehouse_orderpoint"
266             name="Reordering Rules"
267             res_model="stock.warehouse.orderpoint"
268             src_model="procurement.order"
269             groups="stock.group_stock_user"/>
270
271         <!-- Procurements are located in Warehouse menu hierarchy, MRP users should come to Stock application to use it.  -->
272         <menuitem id="menu_stock_sched" name="Schedulers" parent="stock.menu_stock_root" sequence="4"/>
273             <menuitem action="action_compute_schedulers" id="menu_stock_proc_schedulers" parent="menu_stock_sched" sequence="20" groups="stock.group_stock_manager"/>
274             <menuitem action="procurement_exceptions" id="menu_stock_procurement_action" parent="menu_stock_sched" sequence="50" groups="stock.group_stock_manager"/>
275         <menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_configuration" sequence="5"/>
276             <menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="stock.menu_stock_configuration" sequence="10"/>
277
278         <record id="product_normal_form_view" model="ir.ui.view">
279             <field name="name">product.normal.form.orderpoint.inherit</field>
280             <field name="model">product.product</field>
281             <field name="type">form</field>
282             <field name="inherit_id" ref="product.product_normal_form_view"/>
283             <field name="arch" type="xml">
284                 <page string="Procurement &amp; Locations" position="inside">
285                     <separator string="Minimum Stock Rules"/>
286                         <field name="orderpoint_ids" widget="one2many_list" mode="tree" context="{'default_product_id': active_id}">
287                             <tree string="Reordering Rules">
288                                 <field name="name"/>
289                                 <field name="warehouse_id"/>
290                                 <field name="product_min_qty"/>
291                                 <field name="product_max_qty"/>
292                             </tree>
293                         </field>
294                 </page>
295             </field>
296         </record>
297
298     </data>
299 </openerp>