[IMP]:Task-1847 Add many2many function field
[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_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 name="arch" type="xml">
32                 <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')">
33                     <field name="date_planned" widget="date"/>
34                     <field name="origin"/>
35                     <field name="product_id"/>
36                     <field name="product_qty"/>
37                     <field name="product_uom" string="UOM"/>
38                     <field name="message"/>
39                 </tree>
40             </field>
41         </record>
42         <record id="procurement_form_view" model="ir.ui.view">
43             <field name="name">procurement.order.form</field>
44             <field name="model">procurement.order</field>
45             <field name="type">form</field>
46             <field name="arch" type="xml">
47                 <form string="Procurement">
48                     <group col="2" colspan="2">
49                         <separator colspan="2" string="References"/>
50                         <field name="name" string="Procurement Reason"/>
51                         <field name="origin"/>
52                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
53                     </group>
54                     <group col="2" colspan="2">
55                         <separator colspan="2" string="Planification"/>
56                         <field name="date_planned"/>
57                         <field name="procure_method"/>
58                         <field name="priority" groups="base.group_extended"/>
59                     </group>
60                     <notebook colspan="4">
61                     <page string="Procurement Details">
62                         <separator colspan="4" string="Product &amp; Location"/>
63                         <field name="product_id" on_change="onchange_product_id(product_id)"/>
64                         <field name="location_id" domain="[('usage','=','internal')]"/>
65                         <field name="product_qty"/>
66                         <field name="product_uom" widget="selection"/>
67
68                         <field name="product_uos_qty" groups="product.group_uos,base.group_extended"/>
69                         <field name="product_uos" widget="selection" groups="product.group_uos,base.group_extended"/>
70
71                         <separator colspan="4" string="Status"/>
72                         <field colspan="4" name="message" readonly="1"/>
73                         <field name="state" readonly="1"/>
74                         <group col="7" colspan="2">
75                             <button name="button_cancel" states="draft,exception,waiting" string="Cancel" icon="gtk-cancel"/>
76                             <button name="button_confirm" states="draft" string="Confirm" icon="gtk-apply"/>
77                             <button name="button_restart" states="exception" string="Retry" icon="gtk-convert"/>
78                             <button name="button_check" states="confirmed" string="Run Procurement" icon="gtk-media-play"/>
79                         </group>
80                     </page>
81                     <page string="Extra Information">
82                         <separator colspan="4" string="Details"/>
83                         <field name="move_id" groups="base.group_extended"/>
84                         <field name="date_close"/>
85                         <field name="close_move" groups="base.group_extended"/>
86                     </page>
87                     <page string="Notes">
88                         <separator colspan="4" string="Note" />
89                         <field name="note" colspan="4" nolabel="1"/>
90                     </page>
91                     </notebook>
92                 </form>
93             </field>
94         </record>
95         <record id="view_procurement_filter" model="ir.ui.view">
96             <field name="name">procurement.order.select</field>
97             <field name="model">procurement.order</field>
98             <field name="type">search</field>
99             <field name="arch" type="xml">
100                 <search string="Search Procurement">
101                     <group col='10' colspan='4'>
102                        <filter icon="terp-check" string="Current" domain="[('state','in',('draft','confirmed'))]" name="current" help="Procurement Orders in draft or open state."/>
103                        <filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
104                            domain="['&amp;', ('date_planned::date','&lt;', current_date), ('state', 'in', ('draft', 'confirmed'))]"
105                            help="Procurement started late" />
106                        <separator orientation="vertical"/>
107                        <filter icon="terp-emblem-important" string="Exceptions" name="exceptions" domain="[('state','=','exception')]" help="Procurement Exceptions"/>
108                        <filter icon="terp-emblem-important" string="To Fix" name="perm_exceptions" domain="[('state','=','exception'),('message', '!=', '')]" help="Permanent Procurement Exceptions"/>
109                        <filter icon="terp-emblem-important" string="Temporary" name="temp_exceptions" domain="[('state','=','exception'),('message', '=', '')]" help="Temporary Procurement Exceptions"/>
110                        <separator orientation="vertical"/>
111                        <field name="origin"/>
112                        <field name="product_id" />
113                        <field name="date_planned" widget="date"/>
114                        <field name="state" />
115                     </group>
116                     <newline/>
117                     <group expand="0" string="Group By" colspan="4" col="8" groups="base.group_extended">
118                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
119                         <filter string="Reason" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'name'}"/>
120                         <filter string="Scheduled Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
121                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
122                     </group>
123                 </search>
124             </field>
125         </record>
126
127         <record id="procurement_action" model="ir.actions.act_window">
128             <field name="name">Procurement Orders</field>
129             <field name="type">ir.actions.act_window</field>
130             <field name="res_model">procurement.order</field>
131             <field name="view_type">form</field>
132             <field name="view_id" eval="False"/>
133             <field name="search_view_id" ref="view_procurement_filter"/>
134             <field name="context">{'search_default_current':1}</field>
135             <field name="help">A procurement order is used to record a need in a specific product at a specific location. They are usually created automatically by the sales orders, the Pull Logistics rules or the minimum stock rules. When the procurement order is confirmed, it creates automatically the necessary operations to fullfil the need: purchase order proposition, manufacturing order, etc.</field>
136         </record>
137
138         <record id="procurement_exceptions" model="ir.actions.act_window">
139             <field name="name">Procurement Exceptions</field>
140             <field name="type">ir.actions.act_window</field>
141             <field name="res_model">procurement.order</field>
142             <field name="view_type">form</field>
143             <field name="view_mode">tree,form</field>
144             <field name="context">{'search_default_perm_exceptions':1}</field>
145             <field name="search_view_id" ref="view_procurement_filter"/>
146             <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>
147         </record>
148
149         <record id="procurement_action5" model="ir.actions.act_window">
150             <field name="name">Procurement Exceptions</field>
151             <field name="type">ir.actions.act_window</field>
152             <field name="res_model">procurement.order</field>
153             <field name="view_type">form</field>
154             <field name="view_mode">tree,form</field>
155             <field name="domain">[('state','=','exception')]</field>
156         </record>
157
158         <!-- Order Point -->
159         <record id="view_warehouse_orderpoint_tree" model="ir.ui.view">
160             <field name="name">stock.warehouse.orderpoint.tree</field>
161             <field name="model">stock.warehouse.orderpoint</field>
162             <field name="type">tree</field>
163             <field name="arch" type="xml">
164                 <tree string="Minimum Stock Rules">
165                     <field name="name"/>
166                     <field name="warehouse_id"/>
167                     <field name="location_id"/>
168                     <field name="product_id"/>
169                     <field name="product_uom"/>
170                     <field name="product_min_qty"/>
171                     <field name="product_max_qty"/>
172                 </tree>
173             </field>
174         </record>
175
176         <record model="ir.ui.view" id="warehouse_orderpoint_search">
177             <field name="name">stock.warehouse.orderpoint.search</field>
178             <field name="model">stock.warehouse.orderpoint</field>
179             <field name="type">search</field>
180             <field name="arch" type="xml">
181                 <search string="Minimum Stock Rules Search">
182                     <group col="10" colspan="4">
183                         <field name="name"/>
184                         <field name="warehouse_id" widget="selection"/>
185                         <field name="location_id"/>
186                         <field name="company_id" widget="selection" groups="base.group_multi_company"/>
187                         <field name="product_id"/>
188                     </group>
189                     <newline/>
190                     <group expand="0" string="Group By..." colspan="4" col="10">
191                         <filter string="Warehouse" icon="terp-go-home" domain="[]"  context="{'group_by':'warehouse_id'}"/>
192                         <filter string="Location" icon="terp-go-home" domain="[]" context="{'group_by':'location_id'}"/>
193                     </group>
194                 </search>
195             </field>
196         </record>
197
198         <record id="view_warehouse_orderpoint_form" model="ir.ui.view">
199             <field name="name">stock.warehouse.orderpoint.form</field>
200             <field name="model">stock.warehouse.orderpoint</field>
201             <field name="type">form</field>
202             <field name="arch" type="xml">
203                 <form string="Minimum Stock Rules">
204                     <group col="2" colspan="2">
205                         <separator string="General Information" colspan="2" />
206                         <field name="name" />
207                         <field name="product_id" on_change="onchange_product_id(product_id)"/>
208                         <field name="product_uom"/>
209                     </group>
210                     <group col="2" colspan="2">
211                         <separator string="Locations" colspan="2" />
212                         <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
213                         <field name="location_id"/>
214                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
215                     </group>
216                     <group col="2" colspan="2">
217                         <separator string="Quantity Rules" colspan="2" />
218                         <field name="product_min_qty"/>
219                         <field name="product_max_qty"/>
220                         <field name="qty_multiple"/>
221                     </group>
222                     <group col="2" colspan="2" groups="base.group_extended">
223                         <separator string="Misc" colspan="2" />
224                         <field name="procurement_id" readonly="1"/>
225                         <field name="active" />
226                     </group>
227                     <group col="4" colspan="4" groups="base.group_extended">
228                         <separator string="Related Procurement Orders" colspan="4" />
229                         <field name="procurement_data_id" colspan="4" nolabel="1"/>
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             <field name="help">You can define your minimum stock rules, so that OpenERP will trigger automatically the propositions of manufacturing or purchase orders according to the stock level. Once the virtual stock of a product (=stock on hand minus all confirmed orders and reservations) is bellow the minimum quantity, OpenERP will generate a procurement request in order to fullfil the stock up to the maximum quantity.</field>
243         </record>
244
245         <act_window
246         context="{'search_default_warehouse_id': active_id}"
247         id="act_stock_warehouse_2_stock_warehouse_orderpoint"
248         name="Minimum Stock Rules"
249         res_model="stock.warehouse.orderpoint"
250         src_model="stock.warehouse"/>
251
252         <!-- add product_uom to context to be the default value when adding new orderpoints -->
253         <act_window
254             context="{'product_uom': locals().has_key('uom_id') and uom_id,'search_default_product_id': [active_id]}"
255             id="act_product_product_2_stock_warehouse_orderpoint"
256             name="Minimum Stock Rules"
257             res_model="stock.warehouse.orderpoint"
258             src_model="product.product"/>
259
260         <act_window
261             context="{'product_uom': locals().has_key('uom_id') and uom_id}"
262             domain="[('procurement_id', '=', active_id)]"
263             id="act_procurement_2_stock_warehouse_orderpoint"
264             name="Minimum Stock Rules"
265             res_model="stock.warehouse.orderpoint"
266             src_model="procurement.order"/>
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_root" sequence="5" groups="base.group_extended"/>
273             <menuitem action="action_orderpoint_form" id="menu_stock_order_points" parent="menu_stock_procurement" sequence="10"/>
274
275     </data>
276 </openerp>