[IMP] procurement: Add the menu
[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-emblem-important" string="Exceptions" domain="[('state','=','exception')]" help="Procurement Orders with exceptions"/>
89                        <filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
90                            domain="['&amp;', ('date_planned::date','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]"
91                            help="Procurement started late" />
92                        <filter icon="terp-gtk-go-back-rtl" string="To Fix" domain="[('state', '=', 'exception'),('message','=','')]" help="Procurement Orders with exceptions and without message"/>
93                        <separator orientation="vertical"/>
94                        <field name="name"/>
95                        <field name="origin"/>
96                        <field name="product_id" />
97                        <field name="date_planned" widget="date"/>
98                        <field name="state" />
99                     </group>
100                     <newline/>
101                     <group expand="0" string="Group By" colspan="4" col="8" groups="base.group_extended">
102                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
103                         <filter string="Reason" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'name'}"/>
104                         <filter string="Scheduled Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
105                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
106                     </group>
107                 </search>
108             </field>
109         </record>
110         <record id="procurement_action" model="ir.actions.act_window">
111             <field name="name">Procurement Orders</field>
112             <field name="type">ir.actions.act_window</field>
113             <field name="res_model">procurement.order</field>
114             <field name="view_type">form</field>
115             <field name="view_id" eval="False"/>
116             <field name="context">{'search_default_current':1}</field>
117             <field name="search_view_id" ref="view_procurement_filter"/>
118             <field name="context">{'search_default_Current':1}</field>
119             <field name="help">The procurement order will schedule a proposal for automatic procurement for the product concerned. This procurement will start a task, a purchase order form for the supplier or a production depending on the product configuration.</field>
120         </record>
121
122         <record id="procurement_action3" model="ir.actions.act_window">
123             <field name="name">Procurements</field>
124             <field name="type">ir.actions.act_window</field>
125             <field name="res_model">procurement.order</field>
126             <field name="view_type">form</field>
127             <field name="view_mode">tree,form</field>
128             <field name="search_view_id" ref="view_procurement_filter"/>
129             <field name="domain">[]</field>
130             <field name="context">{}</field>
131         </record>
132
133         <record id="procurement_action5" model="ir.actions.act_window">
134             <field name="name">Procurement Exceptions</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_mode">tree,form</field>
139             <field name="domain">[('state','=','exception')]</field>
140             <field name="help"> For each customer order line or raw materials in a manufacturing order, there is a procurement form . In normal system use, procurement orders are automatically generated by OpenERP. But if there are configuration problems, the system can remain blocked by a procurement without generating a corresponding document. It is a procurement exception. Some problems are link to timing and will be correct automatically by the system. If there is no procurement rule, the exception must be corrected manually.</field>
141         </record>
142
143         <record id="procurement_action4" model="ir.actions.act_window">
144             <field name="name">Procurement Exceptions to Fix</field>
145             <field name="type">ir.actions.act_window</field>
146             <field name="res_model">procurement.order</field>
147             <field name="view_type">form</field>
148             <field name="view_mode">tree,form</field>
149             <field name="domain">[('state','=','exception'), ('message', '&lt;&gt;', '')]</field>
150             <field name="filter" eval="True"/>
151         </record>
152
153         <record id="procurement_action11" model="ir.actions.act_window">
154             <field name="name">Temporary 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="domain">[('state','=','exception'), ('message', '=', '')]</field>
160         </record>
161
162         <!-- Order Point -->
163         <record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
164             <field name="name">stock.warehouse.orderpoint.tree</field>
165             <field name="model">stock.warehouse.orderpoint</field>
166             <field name="type">tree</field>
167             <field name="arch" type="xml">
168                 <tree string="Minimum Stock Rules">
169                     <field name="name"/>
170                     <field name="warehouse_id"/>
171                     <field name="location_id"/>
172                     <field name="product_id"/>
173                     <field name="product_uom"/>
174                     <field name="product_min_qty"/>
175                     <field name="product_max_qty"/>
176                 </tree>
177             </field>
178         </record>
179
180         <record model="ir.ui.view" id="warehouse_orderpoint_search">
181             <field name="name">stock.warehouse.orderpoint.search</field>
182             <field name="model">stock.warehouse.orderpoint</field>
183             <field name="type">search</field>
184             <field name="arch" type="xml">
185                 <search string="Minimum Stock Rules Search">
186                     <group col="10" colspan="4">
187                         <field name="name"/>
188                         <field name="warehouse_id" widget="selection"/>
189                         <field name="location_id"/>
190                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
191                         <field name="product_id"/>
192                     </group>
193                     <newline/>
194                     <group expand="0" string="Group By..." colspan="4" col="10">
195                         <filter string="Warehouse" icon="terp-go-home" domain="[]"  context="{'group_by':'warehouse_id'}"/>
196                         <filter string="Location" icon="terp-go-home" domain="[]" context="{'group_by':'location_id'}"/>
197                     </group>
198                 </search>
199             </field>
200         </record>
201
202         <record id="view_warehouse_orderpoint_form" model="ir.ui.view">
203             <field name="name">stock.warehouse.orderpoint.form</field>
204             <field name="model">stock.warehouse.orderpoint</field>
205             <field name="type">form</field>
206             <field name="arch" type="xml">
207                 <form string="Minimum Stock Rules">
208                     <group col="2" colspan="2">
209                         <separator string="General Information" colspan="2" />
210                         <field name="name" />
211                         <field name="product_id" on_change="onchange_product_id(product_id)"/>
212                         <field name="product_uom"/>
213                     </group>
214                     <group col="2" colspan="2">
215                         <separator string="Locations" colspan="2" />
216                         <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
217                         <field name="location_id"/>
218                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
219                     </group>
220                     <group col="2" colspan="2">
221                         <separator string="Quantity Rules" colspan="2" />
222                         <field name="product_min_qty"/>
223                         <field name="product_max_qty"/>
224                         <field name="qty_multiple"/>
225                     </group>
226                     <group col="2" colspan="2" groups="base.group_extended">
227                         <separator string="Misc" colspan="2" />
228                         <field name="procurement_id" readonly="1"/>
229                         <field name="active" />
230                     </group>
231                 </form>
232             </field>
233         </record>
234
235         <record id="action_orderpoint_form" model="ir.actions.act_window">
236             <field name="name">Minimum Stock Rules</field>
237             <field name="res_model">stock.warehouse.orderpoint</field>
238             <field name="type">ir.actions.act_window</field>
239             <field name="view_type">form</field>
240             <field name="view_id" ref="view_warehouse_orderpoint_tree"/>
241             <field name="search_view_id" ref="warehouse_orderpoint_search" />
242         </record>
243
244         <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"/>
245
246         <!-- add product_uom to context to be the default value when adding new orderpoints -->
247         <act_window
248             context="{'product_uom': locals().has_key('uom_id') and uom_id}"
249             domain="[('product_id', '=', active_id)]"
250             id="act_product_product_2_stock_warehouse_orderpoint"
251             name="Minimum Stock Rules"
252             res_model="stock.warehouse.orderpoint"
253             src_model="product.product"/>
254
255         <act_window
256             context="{'product_uom': locals().has_key('uom_id') and uom_id}"
257             domain="[('procurement_id', '=', active_id)]"
258             id="act_procurement_2_stock_warehouse_orderpoint"
259             name="Minimum Stock Rules"
260             res_model="stock.warehouse.orderpoint"
261             src_model="procurement.order"/>
262
263                 <menuitem id="base.menu_mrp_scheduler" name="Schedulers" parent="stock.menu_stock_root" groups="base.group_system" sequence="10"/>
264                 <menuitem action="action_compute_schedulers" id="base.mrp_Sched_all" parent="base.menu_mrp_scheduler" sequence="50" groups="base.group_system"/>
265                 <menuitem action="procurement.procurement_action" id="base.menu_mrp_procurement_action" parent="stock.menu_stock_warehouse_mgmt" sequence="9" groups="base.group_system"/>              
266                 
267
268     </data>
269 </openerp>