[MEREG] Merge with lp:openobject-addons
[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 in ('exception');black:state=='running';darkgreen:state=='confirmed';gray:state in ['done','cancel'];blue:state in ('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="UOM"/>
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_form_view" model="ir.ui.view">
28             <field name="name">procurement.order.form</field>
29             <field name="model">procurement.order</field>
30             <field name="type">form</field>
31             <field name="arch" type="xml">
32                 <form string="Procurement">
33                     <group col="2" colspan="2">
34                         <separator colspan="2" string="References"/>
35                         <field name="name" string="Procurement Reason"/>
36                         <field name="origin"/>
37                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
38                     </group>
39                     <group col="2" colspan="2">
40                         <separator colspan="2" string="Planification"/>
41                         <field name="date_planned"/>
42                         <field name="procure_method"/>
43                         <field name="priority" groups="base.group_extended"/>
44                     </group>
45                     <notebook colspan="4">
46                     <page string="Procurement Details">
47                         <separator colspan="4" string="Product &amp; Location"/>
48                         <field name="product_id" on_change="onchange_product_id(product_id)"/>
49                         <field name="location_id" domain="[('usage','=','internal')]"/>
50                         <field name="product_qty"/>
51                         <field name="product_uom" widget="selection"/>
52
53                         <field name="product_uos_qty" groups="product.group_uos,base.group_extended"/>
54                         <field name="product_uos" widget="selection" groups="product.group_uos,base.group_extended"/>
55
56                         <separator colspan="4" string="Status"/>
57                         <field colspan="4" name="message" readonly="1"/>
58                         <field name="state" readonly="1"/>
59                         <group col="7" colspan="2">
60                             <button name="button_confirm" states="draft" string="Confirm" icon="gtk-apply"/>
61                             <button name="button_restart" states="exception" string="Retry" icon="gtk-convert"/>
62                             <button name="button_cancel" states="draft,exception,waiting" string="Cancel" icon="gtk-cancel"/>
63                             <button name="button_check" states="confirmed" string="Run Procurement" icon="gtk-media-play"/>
64                         </group>
65                     </page>
66                     <page string="Extra Information">
67                         <separator colspan="4" string="Details"/>
68                         <field name="move_id" groups="base.group_extended"/>
69                         <field name="date_close"/>
70                         <field name="close_move" groups="base.group_extended"/>
71                     </page>
72                     <page string="Notes">
73                         <separator colspan="4" string="Note" />
74                         <field name="note" colspan="4" nolabel="1"/>
75                     </page>
76                     </notebook>
77                 </form>
78             </field>
79         </record>
80         <record id="view_procurement_filter" model="ir.ui.view">
81             <field name="name">procurement.order.select</field>
82             <field name="model">procurement.order</field>
83             <field name="type">search</field>
84             <field name="arch" type="xml">
85                 <search string="Search Procurement">
86                     <group col='10' colspan='4'>
87                        <filter icon="terp-check" string="Current" domain="[('state','in',('draft','confirmed'))]" name="current" help="Procurement Orders in draft or open state."/>
88                        <filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
89                            domain="['&amp;', ('date_planned::date','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]"
90                            help="Procurement started late" />
91                        <separator orientation="vertical"/>
92                        <filter icon="terp-emblem-important" string="Exceptions" name="exceptions" domain="[('state','=','exception')]" help="Procurement Exceptions"/>
93                        <filter icon="terp-emblem-important" string="To Fix" name="perm_exceptions" domain="[('state','=','exception'),('message', '!=', '')]" help="Permanent Procurement Exceptions"/>
94                        <filter icon="terp-emblem-important" string="Temporary" name="temp_exceptions" domain="[('state','=','exception'),('message', '=', '')]" help="Temporary Procurement Exceptions"/>
95                        <separator orientation="vertical"/>
96                        <field name="origin"/>
97                        <field name="product_id" />
98                        <field name="date_planned" widget="date"/>
99                        <field name="state" />
100                     </group>
101                     <newline/>
102                     <group expand="0" string="Group By" colspan="4" col="8" groups="base.group_extended">
103                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
104                         <filter string="Reason" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'name'}"/>
105                         <filter string="Scheduled Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
106                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
107                     </group>
108                 </search>
109             </field>
110         </record>
111
112         <record id="procurement_action" model="ir.actions.act_window">
113             <field name="name">Procurement Orders</field>
114             <field name="type">ir.actions.act_window</field>
115             <field name="res_model">procurement.order</field>
116             <field name="view_type">form</field>
117             <field name="view_id" eval="False"/>
118             <field name="search_view_id" ref="view_procurement_filter"/>
119             <field name="context">{'search_default_current':1}</field>
120             <field name="help">Procurement Orders represent the need for a certain quantity of products, at a given time, in a given location. Sale Orders are one typical source of Procurement Orders (but these are distinct documents). Depending on the procurement parameters and the products configuration, the procurement engine will attempt to satisfy the need by reserving products from stock, or ordering products from a supplier, or passing a manufacturing order, etc.</field>
121         </record>
122
123         <record id="procurement_exceptions" model="ir.actions.act_window">
124             <field name="name">Procurement Exceptions</field>
125             <field name="type">ir.actions.act_window</field>
126             <field name="res_model">procurement.order</field>
127             <field name="view_type">form</field>
128             <field name="view_mode">tree,form</field>
129             <field name="context">{'search_default_perm_exceptions':1}</field>
130             <field name="search_view_id" ref="view_procurement_filter"/>
131             <field name="help">Procurement Orders represent the need for a certain quantity of products, at a given time, in a given location. Sale Orders are one typical source of Procurement Orders (but these are distinct documents). Depending on the procurement parameters and the products configuration, the procurement engine will attempt to satisfy the need by reserving products from stock, or 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>
132         </record>
133         
134         <record id="procurement_action5" model="ir.actions.act_window">
135             <field name="name">Procurement Exceptions</field>
136             <field name="type">ir.actions.act_window</field>
137             <field name="res_model">procurement.order</field>
138             <field name="view_type">form</field>
139             <field name="view_mode">tree,form</field>
140             <field name="domain">[('state','=','exception')]</field>
141         </record>
142
143         <!-- Order Point -->
144         <record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
145             <field name="name">stock.warehouse.orderpoint.tree</field>
146             <field name="model">stock.warehouse.orderpoint</field>
147             <field name="type">tree</field>
148             <field name="arch" type="xml">
149                 <tree string="Minimum Stock Rules">
150                     <field name="name"/>
151                     <field name="warehouse_id"/>
152                     <field name="location_id"/>
153                     <field name="product_id"/>
154                     <field name="product_uom"/>
155                     <field name="product_min_qty"/>
156                     <field name="product_max_qty"/>
157                 </tree>
158             </field>
159         </record>
160
161         <record model="ir.ui.view" id="warehouse_orderpoint_search">
162             <field name="name">stock.warehouse.orderpoint.search</field>
163             <field name="model">stock.warehouse.orderpoint</field>
164             <field name="type">search</field>
165             <field name="arch" type="xml">
166                 <search string="Minimum Stock Rules Search">
167                     <group col="10" colspan="4">
168                         <field name="name"/>
169                         <field name="warehouse_id" widget="selection"/>
170                         <field name="location_id"/>
171                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
172                         <field name="product_id"/>
173                     </group>
174                     <newline/>
175                     <group expand="0" string="Group By..." colspan="4" col="10">
176                         <filter string="Warehouse" icon="terp-go-home" domain="[]"  context="{'group_by':'warehouse_id'}"/>
177                         <filter string="Location" icon="terp-go-home" domain="[]" context="{'group_by':'location_id'}"/>
178                     </group>
179                 </search>
180             </field>
181         </record>
182
183         <record id="view_warehouse_orderpoint_form" model="ir.ui.view">
184             <field name="name">stock.warehouse.orderpoint.form</field>
185             <field name="model">stock.warehouse.orderpoint</field>
186             <field name="type">form</field>
187             <field name="arch" type="xml">
188                 <form string="Minimum Stock Rules">
189                     <group col="2" colspan="2">
190                         <separator string="General Information" colspan="2" />
191                         <field name="name" />
192                         <field name="product_id" on_change="onchange_product_id(product_id)"/>
193                         <field name="product_uom"/>
194                     </group>
195                     <group col="2" colspan="2">
196                         <separator string="Locations" colspan="2" />
197                         <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
198                         <field name="location_id"/>
199                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
200                     </group>
201                     <group col="2" colspan="2">
202                         <separator string="Quantity Rules" colspan="2" />
203                         <field name="product_min_qty"/>
204                         <field name="product_max_qty"/>
205                         <field name="qty_multiple"/>
206                     </group>
207                     <group col="2" colspan="2" groups="base.group_extended">
208                         <separator string="Misc" colspan="2" />
209                         <field name="procurement_id" readonly="1"/>
210                         <field name="active" />
211                     </group>
212                 </form>
213             </field>
214         </record>
215
216         <record id="action_orderpoint_form" model="ir.actions.act_window">
217             <field name="name">Minimum Stock Rules</field>
218             <field name="res_model">stock.warehouse.orderpoint</field>
219             <field name="type">ir.actions.act_window</field>
220             <field name="view_type">form</field>
221             <field name="view_id" ref="view_warehouse_orderpoint_tree"/>
222             <field name="search_view_id" ref="warehouse_orderpoint_search" />
223         </record>
224
225         <act_window domain="[('warehouse_id', '=', active_id)]" id="act_stock_warehouse_2_stock_warehouse_orderpoint" name="Minimum Stock Rules" res_model="stock.warehouse.orderpoint" src_model="stock.warehouse"/>
226
227         <!-- add product_uom to context to be the default value when adding new orderpoints -->
228         <act_window
229             context="{'product_uom': locals().has_key('uom_id') and uom_id}"
230             domain="[('product_id', '=', active_id)]"
231             id="act_product_product_2_stock_warehouse_orderpoint"
232             name="Minimum Stock Rules"
233             res_model="stock.warehouse.orderpoint"
234             src_model="product.product"/>
235
236         <act_window
237             context="{'product_uom': locals().has_key('uom_id') and uom_id}"
238             domain="[('procurement_id', '=', active_id)]"
239             id="act_procurement_2_stock_warehouse_orderpoint"
240             name="Minimum Stock Rules"
241             res_model="stock.warehouse.orderpoint"
242             src_model="procurement.order"/>
243
244         <!-- Procurements are located in Warehouse menu hierarchy, MRP users should come to Stock application to use it.  -->
245         <menuitem id="menu_stock_sched" name="Schedulers" parent="stock.menu_stock_root" sequence="4" groups="base.group_extended"/>
246             <menuitem action="action_compute_schedulers" id="menu_stock_proc_schedulers" parent="menu_stock_sched" sequence="20" groups="stock.group_stock_manager"/>
247             <menuitem action="procurement_exceptions" id="menu_stock_procurement_action" parent="menu_stock_sched" sequence="50" groups="stock.group_stock_manager"/>
248         <menuitem id="menu_stock_procurement" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="5" groups="base.group_extended"/>
249             <menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="menu_stock_procurement" sequence="10"/>
250
251     </data>
252 </openerp>