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