[IMP] search view: review of the 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                     <separator/>
126                     <filter icon="terp-emblem-important" string="To Fix" name="perm_exceptions" domain="[('state','=','exception'),('message', '!=', '')]" help="Permanent Procurement Exceptions"/>
127                     <filter icon="terp-emblem-important" string="Temporary" name="temp_exceptions" domain="[('state','=','exception'),('message', '=', '')]" help="Temporary Procurement Exceptions"/>
128                     <separator/>
129                     <filter icon="terp-gnome-cpu-frequency-applet+" string="Late" domain="['&amp;', ('date_planned','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]" help="Procurement started late" />
130                     <group expand="0" string="Group By">
131                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
132                         <filter string="Reason" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'name'}"/>
133                         <filter string="Scheduled Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
134                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
135                     </group>
136                 </search>
137             </field>
138         </record>
139
140         <record id="procurement_action" model="ir.actions.act_window">
141             <field name="name">Procurement Orders</field>
142             <field name="type">ir.actions.act_window</field>
143             <field name="res_model">procurement.order</field>
144             <field name="view_type">form</field>
145             <field name="view_id" eval="False"/>
146             <field name="search_view_id" ref="view_procurement_filter"/>
147             <field name="context">{'search_default_current':1}</field>
148             <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>
149         </record>
150
151         <record id="procurement_exceptions" model="ir.actions.act_window">
152             <field name="name">Procurement Exceptions</field>
153             <field name="type">ir.actions.act_window</field>
154             <field name="res_model">procurement.order</field>
155             <field name="view_type">form</field>
156             <field name="view_mode">tree,form</field>
157             <field name="context">{'search_default_perm_exceptions':1}</field>
158             <field name="search_view_id" ref="view_procurement_filter"/>
159             <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>
160         </record>
161
162         <record id="procurement_action5" model="ir.actions.act_window">
163             <field name="name">Procurement Exceptions</field>
164             <field name="type">ir.actions.act_window</field>
165             <field name="res_model">procurement.order</field>
166             <field name="view_type">form</field>
167             <field name="view_mode">tree,form</field>
168             <field name="domain">[('state','=','exception')]</field>
169         </record>
170
171         <!-- Order Point -->
172         <record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
173             <field name="name">stock.warehouse.orderpoint.tree</field>
174             <field name="model">stock.warehouse.orderpoint</field>
175             <field name="type">tree</field>
176             <field name="arch" type="xml">
177                 <tree string="Reordering Rules">
178                     <field name="name"/>
179                     <field name="warehouse_id"/>
180                     <field name="location_id" groups="stock.group_locations"/>
181                     <field name="product_id"/>
182                     <field name="product_uom"/>
183                     <field name="product_min_qty"/>
184                     <field name="product_max_qty"/>
185                 </tree>
186             </field>
187         </record>
188
189         <record model="ir.ui.view" id="warehouse_orderpoint_search">
190             <field name="name">stock.warehouse.orderpoint.search</field>
191             <field name="model">stock.warehouse.orderpoint</field>
192             <field name="type">search</field>
193             <field name="arch" type="xml">
194                 <search string="Reordering Rules Search">
195                     <field name="name" string="Reordering Rules"/>
196                     <field name="warehouse_id"/>
197                     <field name="location_id" groups="stock.group_locations"/>
198                     <field name="company_id" groups="base.group_multi_company"/>
199                     <field name="product_id"/>
200                     <group expand="0" string="Group By...">
201                         <filter string="Warehouse" icon="terp-go-home" domain="[]"  context="{'group_by':'warehouse_id'}"/>
202                         <filter string="Location" icon="terp-go-home" domain="[]" context="{'group_by':'location_id'}"/>
203                     </group>
204                 </search>
205             </field>
206         </record>
207
208         <record id="view_warehouse_orderpoint_form" model="ir.ui.view">
209             <field name="name">stock.warehouse.orderpoint.form</field>
210             <field name="model">stock.warehouse.orderpoint</field>
211             <field name="type">form</field>
212             <field name="arch" type="xml">
213                 <form string="Reordering Rules" version="7.0">
214                     <sheet>
215                         <group>
216                             <group>
217                                 <field name="name" />
218                                 <field name="product_id" on_change="onchange_product_id(product_id)"/>
219                             </group>
220                             <group>
221                                 <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
222                                 <field name="product_uom"/>
223                                 <field name="location_id" groups="stock.group_locations"/>
224                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
225                             </group>
226                         </group>
227                         <group>
228                             <group string="Rules">
229                                 <field name="product_min_qty" />
230                                 <field name="product_max_qty" />
231                                 <field name="qty_multiple" string="Quantity Multiple"/>
232                             </group>
233                             <group string="Misc">
234                                 <field name="procurement_id" readonly="1"/>
235                                 <field name="active" />
236                             </group>
237                         </group>
238                         <group string="Procurement Orders to Process">
239                             <field name="procurement_draft_ids" nolabel="1"/>
240                         </group>
241                     </sheet>
242                 </form>
243             </field>
244         </record>
245
246         <record id="action_orderpoint_form" model="ir.actions.act_window">
247             <field name="name">Reordering Rules</field>
248             <field name="res_model">stock.warehouse.orderpoint</field>
249             <field name="type">ir.actions.act_window</field>
250             <field name="view_type">form</field>
251             <field name="view_id" ref="view_warehouse_orderpoint_tree"/>
252             <field name="search_view_id" ref="warehouse_orderpoint_search" />
253             <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>
254         </record>
255
256         <act_window
257         context="{'search_default_warehouse_id': active_id, 'default_warehouse_id': active_id}"
258         id="act_stock_warehouse_2_stock_warehouse_orderpoint"
259         name="Reordering Rules"
260         res_model="stock.warehouse.orderpoint"
261         src_model="stock.warehouse"
262         groups="stock.group_stock_user"/>
263
264         <act_window
265             context="{'product_uom': locals().has_key('uom_id') and uom_id, 'default_procurement_id': active_id}"
266             id="act_procurement_2_stock_warehouse_orderpoint"
267             name="Reordering Rules"
268             res_model="stock.warehouse.orderpoint"
269             src_model="procurement.order"
270             groups="stock.group_stock_user"/>
271
272         <!-- Procurements are located in Warehouse menu hierarchy, MRP users should come to Stock application to use it.  -->
273         <menuitem id="menu_stock_sched" name="Schedulers" parent="stock.menu_stock_root" sequence="4"/>
274             <menuitem action="action_compute_schedulers" id="menu_stock_proc_schedulers" parent="menu_stock_sched" sequence="20" groups="stock.group_stock_manager"/>
275             <menuitem action="procurement_exceptions" id="menu_stock_procurement_action" parent="menu_stock_sched" sequence="50" groups="stock.group_stock_manager"/>
276         <menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_configuration" sequence="5"/>
277             <menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="stock.menu_stock_configuration" sequence="10"/>
278
279         <record id="product_normal_form_view" model="ir.ui.view">
280             <field name="name">product.normal.form.orderpoint.inherit</field>
281             <field name="model">product.product</field>
282             <field name="type">form</field>
283             <field name="inherit_id" ref="product.product_normal_form_view"/>
284             <field name="arch" type="xml">
285                 <page string="Procurement &amp; Locations" position="inside">
286                     <separator string="Minimum Stock Rules"/>
287                         <field name="orderpoint_ids" widget="one2many_list" mode="tree" context="{'default_product_id': active_id}">
288                             <tree string="Reordering Rules">
289                                 <field name="name"/>
290                                 <field name="warehouse_id"/>
291                                 <field name="product_min_qty"/>
292                                 <field name="product_max_qty"/>
293                             </tree>
294                         </field>
295                 </page>
296             </field>
297         </record>
298
299     </data>
300 </openerp>