fix
[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="arch" type="xml">
13                 <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'">
14                     <field name="date_planned" widget="date"/>
15                     <field name="origin"/>
16                     <field name="product_id"/>
17                     <field name="product_qty"/>
18                     <field name="product_uom" string="Unit of Measure"/>
19                     <field name="procure_method"/>
20                     <field name="state"/>
21                     <field name="message"/>
22                     <field name="name" invisible="1"/>
23                 </tree>
24             </field>
25         </record>
26          <record id="procurement_tree_view_board" model="ir.ui.view">
27             <field name="name">procurement.order.tree.board</field>
28             <field name="model">procurement.order</field>
29             <field eval="20" name="priority"/>
30             <field name="arch" type="xml">
31                 <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'">
32                     <field name="date_planned" widget="date"/>
33                     <field name="origin"/>
34                     <field name="product_id"/>
35                     <field name="product_qty"/>
36                     <field name="product_uom" string="Unit of Measure"/>
37                     <field name="state" invisible = "1"/>
38                     <field name="message"/>
39                 </tree>
40             </field>
41         </record>
42         <record id="procurement_form_view" model="ir.ui.view">
43             <field name="name">procurement.order.form</field>
44             <field name="model">procurement.order</field>
45             <field name="arch" type="xml">
46                 <form string="Procurement" version="7.0">
47                     <header>
48                         <button name="button_confirm" states="draft" string="Confirm" class="oe_highlight"/>
49                         <button name="button_check" states="confirmed" string="Run Procurement" class="oe_highlight"/>
50                         <button name="button_restart" states="exception" string="Retry" class="oe_highlight"/>
51                         <button name="button_cancel" states="draft,exception,waiting" string="Cancel"/>
52                         <field name="state" readonly="1" widget="statusbar" statusbar_visible="draft,confirmed" />
53                     </header>
54                     <sheet>
55                     <label for="name" class="oe_edit_only"/>
56                     <h1>
57                         <field name="name" class="oe_inline"/>
58                         <label string="-" attrs="{'invisible':[('origin','=',False)]}"/>
59                         <field name="origin" class="oe_inline"/>
60                     </h1>
61                     <group>
62                         <group>
63                             <field name="date_planned"/>
64                             <field name="procure_method"/>
65                             <field name="priority"/>
66                         </group>
67                         <group>
68                             <field name="message"/>
69                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
70                         </group>
71                     </group>
72                     <notebook>
73                     <page string="Procurement Details">
74                         <group>
75                             <group>
76                                 <field name="product_id" on_change="onchange_product_id(product_id)"/>
77                                 <label for="product_qty"/>
78                                 <div>
79                                     <field name="product_qty" class="oe_inline"/>
80                                     <field name="product_uom" class="oe_inline"/>
81                                 </div>
82                                 <label for="product_uos_qty" groups="product.group_uos"/>
83                                 <div groups="product.group_uos">
84                                     <field name="product_uos_qty" class="oe_inline"/>
85                                     <field name="product_uos" class="oe_inline"/>
86                                 </div>
87                             </group>
88                             <group>
89                                <field name="location_id" domain="[('usage','=','internal')]"/>
90                             </group>
91                         </group>
92                     </page>
93                     <page string="Extra Information">
94                         <group>
95                             <field name="move_id"/>
96                             <field name="date_close"/>
97                             <field name="close_move"/>
98                         </group>
99                     </page>
100                     <page string="Notes">
101                         <field name="note"/>
102                     </page>
103                     </notebook>
104                     </sheet>
105                     <div class="oe_chatter">
106                         <field name="message_ids" widget="mail_thread"/>
107                         <field name="message_follower_ids" widget="mail_followers"/>
108                     </div>
109                 </form>
110             </field>
111         </record>
112         <record id="view_procurement_filter" model="ir.ui.view">
113             <field name="name">procurement.order.select</field>
114             <field name="model">procurement.order</field>
115             <field name="arch" type="xml">
116                 <search string="Search Procurement">
117                     <field name="origin" string="Procurement"/>
118                     <field name="date_planned"/>
119                     <filter icon="terp-emblem-important" string="Exceptions" name="exceptions" domain="[('state','=','exception')]" help="Procurement Exceptions"/>
120                     <separator/>
121                     <filter icon="terp-emblem-important" string="To Fix" name="perm_exceptions" domain="[('state','=','exception'),('message', '!=', '')]" help="Permanent Procurement Exceptions"/>
122                     <filter icon="terp-emblem-important" string="Temporary" name="temp_exceptions" domain="[('state','=','exception'),('message', '=', '')]" help="Temporary Procurement Exceptions"/>
123                     <separator/>
124                     <filter icon="terp-gnome-cpu-frequency-applet+" string="Late" domain="['&amp;', ('date_planned','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]" help="Procurement started late" />
125                     <field name="product_id" />
126                     <field name="state" />
127                     <group expand="0" string="Group By">
128                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
129                         <filter string="Reason" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'name'}"/>
130                         <filter string="Scheduled Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
131                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
132                     </group>
133                 </search>
134             </field>
135         </record>
136
137         <record id="procurement_action" model="ir.actions.act_window">
138             <field name="name">Procurement Orders</field>
139             <field name="type">ir.actions.act_window</field>
140             <field name="res_model">procurement.order</field>
141             <field name="view_type">form</field>
142             <field name="view_id" eval="False"/>
143             <field name="search_view_id" ref="view_procurement_filter"/>
144             <field name="context">{'search_default_current':1}</field>
145             <field name="help" type="html">
146               <p class="oe_view_nocontent_create">
147                 Click to create a procurement order. 
148               </p><p>
149                 A procurement order is used to record a need for a specific
150                 product at a specific location.  Procurement orders are usually
151                 created automatically from sales orders, pull logistic rules or
152                 minimum stock rules.
153               </p><p>
154                 When the procurement order is confirmed, it automatically
155                 creates the necessary operations to fullfil the need: purchase
156                 order proposition, manufacturing order, etc.
157               </p>
158             </field>
159         </record>
160
161         <record id="procurement_exceptions" 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="context">{'search_default_perm_exceptions':1}</field>
168             <field name="search_view_id" ref="view_procurement_filter"/>
169             <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>
170         </record>
171
172         <record id="procurement_action5" model="ir.actions.act_window">
173             <field name="name">Procurement Exceptions</field>
174             <field name="type">ir.actions.act_window</field>
175             <field name="res_model">procurement.order</field>
176             <field name="view_type">form</field>
177             <field name="view_mode">tree,form</field>
178             <field name="domain">[('state','=','exception')]</field>
179         </record>
180
181         <!-- Order Point -->
182         <record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
183             <field name="name">stock.warehouse.orderpoint.tree</field>
184             <field name="model">stock.warehouse.orderpoint</field>
185             <field name="arch" type="xml">
186                 <tree string="Reordering Rules">
187                     <field name="name"/>
188                     <field name="warehouse_id" groups="stock.group_locations"/>
189                     <field name="location_id" groups="stock.group_locations"/>
190                     <field name="product_id"/>
191                     <field name="product_uom" groups="product.group_uom"/>
192                     <field name="product_min_qty"/>
193                     <field name="product_max_qty"/>
194                 </tree>
195             </field>
196         </record>
197
198         <record model="ir.ui.view" id="warehouse_orderpoint_search">
199             <field name="name">stock.warehouse.orderpoint.search</field>
200             <field name="model">stock.warehouse.orderpoint</field>
201             <field name="arch" type="xml">
202                 <search string="Reordering Rules Search">
203                     <field name="name" string="Reordering Rules"/>
204                     <field name="warehouse_id"/>
205                     <field name="location_id" groups="stock.group_locations"/>
206                     <field name="company_id" groups="base.group_multi_company"/>
207                     <field name="product_id"/>
208                     <group expand="0" string="Group By...">
209                         <filter string="Warehouse" icon="terp-go-home" domain="[]"  context="{'group_by':'warehouse_id'}"/>
210                         <filter string="Location" icon="terp-go-home" domain="[]" context="{'group_by':'location_id'}"/>
211                     </group>
212                 </search>
213             </field>
214         </record>
215
216         <record id="view_warehouse_orderpoint_form" model="ir.ui.view">
217             <field name="name">stock.warehouse.orderpoint.form</field>
218             <field name="model">stock.warehouse.orderpoint</field>
219             <field name="arch" type="xml">
220                 <form string="Reordering Rules" version="7.0">
221                     <sheet>
222                         <group>
223                             <group>
224                                 <field name="name" />
225                                 <field name="product_id" on_change="onchange_product_id(product_id)"/>
226                             </group>
227                             <group>
228                                 <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection" groups="stock.group_locations"/>
229                                 <field name="product_uom" groups="product.group_uom"/>
230                                 <field name="location_id" groups="stock.group_locations"/>
231                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
232                             </group>
233                         </group>
234                         <group>
235                             <group string="Rules">
236                                 <field name="product_min_qty" />
237                                 <field name="product_max_qty" />
238                                 <field name="qty_multiple" string="Quantity Multiple"/>
239                             </group>
240                             <group string="Misc">
241                                 <field name="procurement_id" readonly="1"/>
242                                 <field name="active" />
243                             </group>
244                         </group>
245                         <group string="Procurement Orders to Process">
246                             <field name="procurement_draft_ids" nolabel="1"/>
247                         </group>
248                     </sheet>
249                 </form>
250             </field>
251         </record>
252
253         <record id="action_orderpoint_form" model="ir.actions.act_window">
254             <field name="name">Reordering Rules</field>
255             <field name="res_model">stock.warehouse.orderpoint</field>
256             <field name="type">ir.actions.act_window</field>
257             <field name="view_type">form</field>
258             <field name="view_id" ref="view_warehouse_orderpoint_tree"/>
259             <field name="search_view_id" ref="warehouse_orderpoint_search" />
260             <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>
261         </record>
262
263         <act_window
264             context="{'search_default_warehouse_id': active_id, 'default_warehouse_id': active_id}"
265             id="act_stock_warehouse_2_stock_warehouse_orderpoint"
266             name="Reordering Rules"
267             res_model="stock.warehouse.orderpoint"
268             src_model="stock.warehouse"
269             groups="stock.group_stock_user"/>
270
271         <act_window
272             context="{'product_uom': locals().has_key('uom_id') and uom_id, 'default_procurement_id': active_id}"
273             id="act_procurement_2_stock_warehouse_orderpoint"
274             name="Reordering Rules"
275             res_model="stock.warehouse.orderpoint"
276             src_model="procurement.order"
277             groups="stock.group_stock_user"/>
278
279         <!-- Procurements are located in Warehouse menu hierarchy, MRP users should come to Stock application to use it.  -->
280         <menuitem id="menu_stock_sched" name="Schedulers" parent="stock.menu_stock_root" sequence="4"/>
281             <menuitem action="action_compute_schedulers" id="menu_stock_proc_schedulers" parent="menu_stock_sched" sequence="20" groups="stock.group_stock_manager"/>
282             <menuitem action="procurement_exceptions" id="menu_stock_procurement_action" parent="menu_stock_sched" sequence="50" groups="stock.group_stock_manager"/>
283         <menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_configuration" sequence="5"/>
284             <menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="stock.menu_stock_configuration" sequence="10"/>
285
286
287         <record model="ir.actions.act_window" id="product_open_orderpoint">
288             <field name="context">{'default_product_id': active_id, 'search_default_product_id': active_id}</field>
289             <field name="name">Orderpoints</field>
290             <field name="res_model">stock.warehouse.orderpoint</field>
291         </record>
292
293         <record model="ir.ui.view" id="product_form_view_procurement_button">
294             <field name="name">product.product.procurement</field>
295             <field name="model">product.product</field>
296             <field name="inherit_id" ref="product.product_normal_form_view"/>
297             <field name="arch" type="xml">
298                 <xpath expr="//div[@name='buttons']" position="inside">
299                     <button string="Request Procurement" name="%(act_make_procurement)d" type="action"/>
300                     <button string="Orderpoints" name="%(product_open_orderpoint)d" type="action"/>
301                 </xpath>
302             </field>
303         </record>
304
305     </data>
306 </openerp>