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