c9a6d55c9d4ad3fed16bac49b0fba8cd328b1a0c
[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"/>
52                         <button name="button_check" states="confirmed" string="Run Procurement"/>
53                         <button name="button_restart" states="exception" string="Retry"/>
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                     <group>
59                         <group string="References">
60                             <field name="name"/>
61                             <field name="origin"/>
62                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
63                         </group>
64                         <group string="Planification">
65                             <field name="date_planned"/>
66                             <field name="procure_method"/>
67                             <field name="priority"/>
68                         </group>
69                     </group>
70                     <notebook>
71                     <page string="Procurement Details">
72                         <group string="Product &amp; Location" col="4">
73                             <field name="product_id" on_change="onchange_product_id(product_id)"/>
74                             <field name="location_id" domain="[('usage','=','internal')]"/>
75                             <field name="product_qty"/>
76                             <field name="product_uom"/>
77
78                             <field name="product_uos_qty" groups="product.group_uos"/>
79                             <field name="product_uos"  groups="product.group_uos"/>
80                         </group>
81                         <separator string="Status"/>
82                         <field name="message"/>
83                     </page>
84                     <page string="Extra Information">
85                         <group string="Details" col="4">
86                             <field name="move_id"/>
87                             <field name="date_close"/>
88                             <field name="close_move"/>
89                         </group>
90                     </page>
91                     <page string="Notes">
92                         <field name="note"/>
93                     </page>
94                     </notebook>
95                     </sheet>
96                     <footer>
97                         <field name="message_ids" widget="ThreadView"/>
98                     </footer>
99                 </form>
100             </field>
101         </record>
102         <record id="view_procurement_filter" model="ir.ui.view">
103             <field name="name">procurement.order.select</field>
104             <field name="model">procurement.order</field>
105             <field name="type">search</field>
106             <field name="arch" type="xml">
107                 <search string="Search Procurement">
108                     <group>
109                        <filter icon="terp-emblem-important" string="Exceptions" name="exceptions" domain="[('state','=','exception')]" help="Procurement Exceptions"/>
110                        <filter icon="terp-emblem-important" string="To Fix" name="perm_exceptions" domain="[('state','=','exception'),('message', '!=', '')]" help="Permanent Procurement Exceptions"/>
111                        <filter icon="terp-emblem-important" string="Temporary" name="temp_exceptions" domain="[('state','=','exception'),('message', '=', '')]" help="Temporary Procurement Exceptions"/>
112                        <separator orientation="vertical"/>
113                        <filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
114                            domain="['&amp;', ('date_planned','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]"
115                            help="Procurement started late" />
116                        <separator orientation="vertical"/>
117                        <field name="origin"/>
118                        <field name="product_id" />
119                        <field name="date_planned"/>
120                        <field name="state" />
121                     </group>
122                     <newline/>
123                     <group expand="0" string="Group By">
124                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
125                         <filter string="Reason" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'name'}"/>
126                         <filter string="Scheduled Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
127                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
128                     </group>
129                 </search>
130             </field>
131         </record>
132
133         <record id="procurement_action" model="ir.actions.act_window">
134             <field name="name">Procurement Orders</field>
135             <field name="type">ir.actions.act_window</field>
136             <field name="res_model">procurement.order</field>
137             <field name="view_type">form</field>
138             <field name="view_id" eval="False"/>
139             <field name="search_view_id" ref="view_procurement_filter"/>
140             <field name="context">{'search_default_current':1}</field>
141             <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>
142         </record>
143
144         <record id="procurement_exceptions" model="ir.actions.act_window">
145             <field name="name">Procurement Exceptions</field>
146             <field name="type">ir.actions.act_window</field>
147             <field name="res_model">procurement.order</field>
148             <field name="view_type">form</field>
149             <field name="view_mode">tree,form</field>
150             <field name="context">{'search_default_perm_exceptions':1}</field>
151             <field name="search_view_id" ref="view_procurement_filter"/>
152             <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>
153         </record>
154
155         <record id="procurement_action5" model="ir.actions.act_window">
156             <field name="name">Procurement Exceptions</field>
157             <field name="type">ir.actions.act_window</field>
158             <field name="res_model">procurement.order</field>
159             <field name="view_type">form</field>
160             <field name="view_mode">tree,form</field>
161             <field name="domain">[('state','=','exception')]</field>
162         </record>
163
164         <!-- Order Point -->
165         <record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
166             <field name="name">stock.warehouse.orderpoint.tree</field>
167             <field name="model">stock.warehouse.orderpoint</field>
168             <field name="type">tree</field>
169             <field name="arch" type="xml">
170                 <tree string="Reordering Rules">
171                     <field name="name"/>
172                     <field name="warehouse_id"/>
173                     <field name="location_id" groups="stock.group_locations"/>
174                     <field name="product_id"/>
175                     <field name="product_uom"/>
176                     <field name="product_min_qty"/>
177                     <field name="product_max_qty"/>
178                 </tree>
179             </field>
180         </record>
181
182         <record model="ir.ui.view" id="warehouse_orderpoint_search">
183             <field name="name">stock.warehouse.orderpoint.search</field>
184             <field name="model">stock.warehouse.orderpoint</field>
185             <field name="type">search</field>
186             <field name="arch" type="xml">
187                 <search string="Reordering Rules Search">
188                     <group>
189                         <field name="name"/>
190                         <field name="warehouse_id" widget="selection"/>
191                         <field name="location_id" groups="stock.group_locations"/>
192                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
193                         <field name="product_id"/>
194                     </group>
195                     <newline/>
196                     <group expand="0" string="Group By...">
197                         <filter string="Warehouse" icon="terp-go-home" domain="[]"  context="{'group_by':'warehouse_id'}"/>
198                         <filter string="Location" icon="terp-go-home" domain="[]" context="{'group_by':'location_id'}"/>
199                     </group>
200                 </search>
201             </field>
202         </record>
203
204         <record id="view_warehouse_orderpoint_form" model="ir.ui.view">
205             <field name="name">stock.warehouse.orderpoint.form</field>
206             <field name="model">stock.warehouse.orderpoint</field>
207             <field name="type">form</field>
208             <field name="arch" type="xml">
209                 <form string="Reordering Rules" version="7.0">
210                     <sheet>
211                         <group>
212                             <group>
213                                 <field name="name" />
214                                 <field name="product_id" on_change="onchange_product_id(product_id)"/>
215                             </group>
216                             <group>
217                                 <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
218                                 <field name="product_uom"/>
219                                 <field name="location_id" groups="stock.group_locations"/>
220                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
221                             </group>
222                         </group>
223                         <group>
224                             <group string="Rules">
225                                 <field name="product_min_qty" />
226                                 <field name="product_max_qty" />
227                                 <field name="qty_multiple" string="Quantity Multiple"/>
228                             </group>
229                             <group string="Misc">
230                                 <field name="procurement_id" readonly="1"/>
231                                 <field name="active" />
232                             </group>
233                         </group>
234                         <group string="Procurement Orders to Process">
235                             <field name="procurement_draft_ids" nolabel="1"/>
236                         </group>
237                     </sheet>
238                 </form>
239             </field>
240         </record>
241
242         <record id="action_orderpoint_form" model="ir.actions.act_window">
243             <field name="name">Reordering Rules</field>
244             <field name="res_model">stock.warehouse.orderpoint</field>
245             <field name="type">ir.actions.act_window</field>
246             <field name="view_type">form</field>
247             <field name="view_id" ref="view_warehouse_orderpoint_tree"/>
248             <field name="search_view_id" ref="warehouse_orderpoint_search" />
249             <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>
250         </record>
251
252         <act_window
253         context="{'search_default_warehouse_id': active_id, 'default_warehouse_id': active_id}"
254         id="act_stock_warehouse_2_stock_warehouse_orderpoint"
255         name="Reordering Rules"
256         res_model="stock.warehouse.orderpoint"
257         src_model="stock.warehouse"
258         groups="stock.group_stock_user"/>
259
260         <act_window
261             context="{'product_uom': locals().has_key('uom_id') and uom_id, 'default_procurement_id': active_id}"
262             id="act_procurement_2_stock_warehouse_orderpoint"
263             name="Reordering Rules"
264             res_model="stock.warehouse.orderpoint"
265             src_model="procurement.order"
266             groups="stock.group_stock_user"/>
267
268         <!-- Procurements are located in Warehouse menu hierarchy, MRP users should come to Stock application to use it.  -->
269         <menuitem id="menu_stock_sched" name="Schedulers" parent="stock.menu_stock_root" sequence="4"/>
270             <menuitem action="action_compute_schedulers" id="menu_stock_proc_schedulers" parent="menu_stock_sched" sequence="20" groups="stock.group_stock_manager"/>
271             <menuitem action="procurement_exceptions" id="menu_stock_procurement_action" parent="menu_stock_sched" sequence="50" groups="stock.group_stock_manager"/>
272         <menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_configuration" sequence="5"/>
273             <menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="stock.menu_stock_configuration" sequence="10"/>
274
275         <record id="product_normal_form_view" model="ir.ui.view">
276             <field name="name">product.normal.form.orderpoint.inherit</field>
277             <field name="model">product.product</field>
278             <field name="type">form</field>
279             <field name="inherit_id" ref="product.product_normal_form_view"/>
280             <field name="arch" type="xml">
281                 <group name="misc" position="after">
282                     <group colspan="4" attrs="{'invisible':[('type','=','service')]}" groups="stock.group_stock_manager">
283                         <separator string="Minimum Stock Rules" colspan="4"/>
284                         <field name="orderpoint_ids" nolabel="1" colspan="4" context="{'default_product_id': active_id}"/>
285                     </group>
286                 </group>
287             </field>
288         </record>
289
290     </data>
291 </openerp>