[IMP] mrp product purchase purchase_requisition sale sale_crm sale_journal stock...
[odoo/odoo.git] / addons / stock_planning / stock_planning_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3 <data>
4         <menuitem id="menu_stock_period_main" 
5                   name="Stock and Sales Periods" 
6                   parent="base.menu_base_config"/>
7
8 <!-- Creating periods section -->
9
10     <record id="view_stock_period_createlines_form" model="ir.ui.view">
11             <field name="name">stock.period.createlines.form</field>
12             <field name="model">stock.period.createlines</field>
13             <field name="type">form</field>
14             <field name="arch" type="xml">
15                 <form string="Stock and Sales Periods">
16                     <separator colspan="4" string="Create periods for Stock and Sales Planning"/>
17                     <field name="date_start"/>
18                     <field name="date_stop"/>                             
19                     <separator colspan="4" string=""/>        
20                     <group col="3" colspan="4">
21                         <button name="create_period" string="Create Daily Periods" type="object"/>
22                         <button name="create_period_weekly" string="Create Weekly Periods" type="object"/>
23                         <button name="create_period_monthly" string="Create Monthly Periods" type="object"/>
24                     </group> 
25                 </form>
26             </field>
27         </record>      
28
29         <record id="action_stock_period_createlines_form" model="ir.actions.act_window">
30             <field name="name">Stock and Sales Planning Periods</field>
31             <field name="res_model">stock.period.createlines</field>
32             <field name="view_type">form</field>
33             <field name="view_mode">form</field>
34             <field name="view_id" ref="view_stock_period_createlines_form"/>
35             <field name="target">new</field>
36         </record>
37
38         <menuitem id="menu_stock_period_creatlines" 
39                   name="Create Stock and Sales Periods" 
40                   parent="menu_stock_period_main" 
41                   action="action_stock_period_createlines_form"
42                   sequence = "5"/>
43
44 <!-- Periods tree and form section -->
45
46         <record id="view_stock_period_form" model="ir.ui.view">
47             <field name="name">stock.period.form</field>
48             <field name="model">stock.period</field>
49             <field name="type">form</field>
50             <field name="arch" type="xml">
51                 <form string="Stock and Sales Periods">
52                     <field name="name"/>
53                     <field name="date_start"/>
54                     <field name="state" select="1"/>
55                     <field name="date_stop"/>
56                 </form>
57             </field>
58         </record>
59         
60         <record id="view_stock_period_tree" model="ir.ui.view">
61             <field name="name">stock.period.tree</field>
62             <field name="model">stock.period</field>
63             <field name="type">tree</field>
64             <field name="arch" type="xml">
65                 <tree string="Stock and Sales Period" editable="bottom">
66                     <field name="name"/>
67                     <field name="date_start"/>
68                     <field name="date_stop"/>
69                     <field name="state" select="1"/>
70                 </tree>
71             </field>
72         </record>
73
74         <record id="action_stock_period_form" model="ir.actions.act_window">
75             <field name="name">Stock and Sales Periods</field>
76             <field name="res_model">stock.period</field>
77             <field name="view_type">form</field>
78             <field name="view_mode">tree,form</field>
79         </record>
80
81         
82         <menuitem
83             id="menu_stock_period"
84             parent="menu_stock_period_main"
85             action="action_stock_period_form"
86             sequence = "10"/>
87
88 <!--   Create Forecast section   -->
89
90         <record id="view_stock_sale_forecast_createlines_form" model="ir.ui.view">
91             <field name="name">stock.sale.forecast.createlines</field>
92             <field name="model">stock.sale.forecast.createlines</field>
93             <field name="type">form</field>
94             <field name="arch" type="xml">
95                 <form string="Stock and Sales Forecasts">
96                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
97                     <newline/>
98                     <field name="period_id1" widget="selection"/>
99                     <newline/>
100                     <field name="warehouse_id1" domain = "[('company_id','=',company_id)] "/>
101                     <newline/>
102                     <field name="product_categ_id1" widget="selection"/>
103                     <newline/>
104                     <field name="copy_forecast"/>
105                     <separator colspan ="4" string="Forecast lines creation"/>
106                     <label  colspan ="4" string="Creates forecast lines for selected warehouse and period. Doesn't duplicate existing lines created by you."/>
107                     <group colspan="4">
108                         <button icon="gtk-cancel" special="cancel" string="Cancel"/>
109                         <button icon="gtk-execute" name="create_forecast" string="Create Forecasts" type="object" />
110                     </group>         
111                 </form>
112             </field>
113         </record>      
114
115         <record id="action_stock_sale_forecast_createlines_form" model="ir.actions.act_window">
116             <field name="name">Create Stock and Sales Forecasts</field>
117             <field name="res_model">stock.sale.forecast.createlines</field>
118             <field name="view_type">form</field>
119             <field name="view_mode">form</field>
120             <field name="view_id" ref="view_stock_sale_forecast_createlines_form"/>
121             <field name="target">new</field>
122         </record>
123         
124         <menuitem id="menu_stock_sale_forecast" name="Stock and Sales Forecasts" parent="base.menu_base_partner"/>
125         
126         <menuitem id="menu_stock_sale_forecast_createlines" name="Create Stock and Sales Forecasts" parent="menu_stock_sale_forecast" action="action_stock_sale_forecast_createlines_form" sequence = "5"/>
127
128         <record id="view_stock_sale_forecast_form" model="ir.ui.view">
129             <field name="name">stock.sale.forecast.form</field>
130             <field name="model">stock.sale.forecast</field>
131             <field name="type">form</field>
132             <field name="arch" type="xml">
133                 <form string="Stock and Sales Forecast">
134                     <group colspan = "4" col = "4">
135                         <group colspan = "2" col="2" >
136                             <field name="company_id"  
137                                         groups="base.group_multi_company" 
138                                         widget="selection" 
139                                         on_change="onchange_company(company_id)"/>
140                             <field name="warehouse_id" domain = "[('company_id','=',company_id)] "/>
141                             <field name="period_id" />
142                             <field name="product_id" on_change="product_id_change(product_id)" />
143                             <field name="product_uom_categ"  invisible = "True"/>
144                             <field name="product_uos_categ"  invisible = "True"/>
145                             <field name="product_uom"  
146                                          domain = "[('category_id','in',[product_uom_categ,product_uos_categ])]"
147                                          on_change = "onchange_uom(product_uom, product_qty, active_uom)"/>
148                             <field name="active_uom" invisible = "True" />  
149                          </group>
150                          <group colspan = "2" col="2" >
151                             <field name="user_id"/>
152                             <field name="product_amt" on_change="product_amt_change( product_amt, product_uom)" />
153                             <field name="product_qty"  />
154                             <field name="state"/>
155                             <button name="action_validate" string="Validate" states="draft" type="object" colspan = "2"/>
156                         </group>
157                     </group>
158                     <separator colspan ="4" string="Sales history"/>
159                     <group colspan = "4" col = "5"> 
160                         <label string = " "/>
161                         <label string = "Per User :"/>
162                         <label string = "Per Department :"/>
163                         <label string = "Per Warehouse :"/>
164                         <label string = "Per Company :"/>
165                         <label string = "Periods :"/>
166                         <field name="analyzed_user_id" nolabel = "1" domain = "[('company_id','=',company_id)] "/>
167                         <field name="analyzed_dept_id" nolabel = "1" domain = "[('company_id','=',company_id)] " />
168                         <field name="analyzed_warehouse_id" nolabel = "1" domain = "[('company_id','=',company_id)] " />
169                         <group colspan = "1" col = "2"> 
170                             <field name = "analyze_company"/>
171                         </group>
172                         <field name = "analyzed_period1_id" nolabel = "1"  />
173                         <field name = "analyzed_period1_per_user" nolabel = "1" />
174                         <field name = "analyzed_period1_per_dept" nolabel = "1" />
175                         <field name = "analyzed_period1_per_warehouse" nolabel = "1" />
176                         <field name = "analyzed_period1_per_company" nolabel = "1"/>
177                         <field name = "analyzed_period2_id" nolabel = "1" />
178                         <field name = "analyzed_period2_per_user" nolabel = "1" />
179                         <field name = "analyzed_period2_per_dept" nolabel = "1" />
180                         <field name = "analyzed_period2_per_warehouse" nolabel = "1" />
181                         <field name = "analyzed_period2_per_company" nolabel = "1" />
182                         <field name = "analyzed_period3_id" nolabel = "1"/>
183                         <field name = "analyzed_period3_per_user" nolabel = "1" />
184                         <field name = "analyzed_period3_per_dept" nolabel = "1" />
185                         <field name = "analyzed_period3_per_warehouse" nolabel = "1" />
186                         <field name = "analyzed_period3_per_company" nolabel = "1" />
187                         <field name = "analyzed_period4_id" nolabel = "1" />
188                         <field name = "analyzed_period4_per_user" nolabel = "1" />
189                         <field name = "analyzed_period4_per_dept" nolabel = "1" />
190                         <field name = "analyzed_period4_per_warehouse" nolabel = "1" />
191                         <field name = "analyzed_period4_per_company" nolabel = "1" />
192                         <field name = "analyzed_period5_id" nolabel = "1" />
193                         <field name = "analyzed_period5_per_user" nolabel = "1" />
194                         <field name = "analyzed_period5_per_dept" nolabel = "1" />
195                         <field name = "analyzed_period5_per_warehouse" nolabel = "1" />
196                         <field name = "analyzed_period5_per_company" nolabel = "1" />
197                         <button name="calculate_sales_history" icon="gtk-execute" 
198                                 string="Calculate Sales History" type="object" colspan = "1" states="draft" />
199                     </group>
200
201                 </form>
202             </field>
203         </record>
204         
205         <record id="view_stock_sale_forecast_tree" model="ir.ui.view">
206              <field name="name">stock.sale.forecast.tree</field>
207             <field name="model">stock.sale.forecast</field>
208             <field name="type">tree</field>
209             <field name="arch" type="xml">
210                 <tree string="Stock and Sales Forecasts" editable="bottom">
211                     <field name="warehouse_id"/>
212                     <field name="user_id"/>
213                     <field name="period_id"/>
214                     <field name="product_id" on_change="product_id_change(product_id)" />
215                     <field name="product_qty"/>
216                     <field name="product_uom" />
217                 </tree>
218             </field>
219         </record>
220         
221        <record id="view_stock_sale_forecast_graph" model="ir.ui.view">
222              <field name="name">stock.sale.forecast.graph</field>
223             <field name="model">stock.sale.forecast</field>
224             <field name="type">graph</field>
225             <field name="arch" type="xml">
226                 <graph string="Stock and Sales Forecast" type = "bar">
227                     <field name="period_id"/>
228                     <field name="product_qty"/>
229                     <field name="product_id"/>
230                 </graph>
231             </field>
232         </record>
233
234
235        <record id="view_stock_sale_forecast_filter" model="ir.ui.view">
236             <field name="name">stock.sale.forecast.list.select</field>
237             <field name="model">stock.sale.forecast</field>
238             <field name="type">search</field>
239             <field name="arch" type="xml">
240                 <search string="Search Stock and Sales Forecast">
241                  <group col='10' colspan='4'>
242                     <filter icon="terp-purchase" string="Validated" domain="[('state','=','validated')]" separator="1"/>
243                     <field name="company_id" widget="selection"/>
244                     <field name="warehouse_id" widget="selection"/>
245                     <field name="period_id" widget="selection"/>
246                     <field name="product_id" widget="selection"/>
247                     <field name="create_uid" widget="selection">
248                         <filter icon="terp-purchase" domain="[('create_uid','=',uid)]" help="My Forecasts"/>
249                     </field>
250                 </group>
251               </search>
252             </field>
253         </record>
254
255         
256         <record id="action_view_stock_sale_forecast_form" model="ir.actions.act_window">
257             <field name="name">Stock and Sales Forecast</field>
258             <field name="res_model">stock.sale.forecast</field>
259             <field name="view_type">form</field>
260             <field name="view_mode">tree,form,graph</field>
261             <field name="search_view_id" ref="view_stock_sale_forecast_filter"/>
262         </record>
263         
264         <menuitem id="menu_stock_sale_forecast_all" 
265                   name="Stock and Sales Forecasts" 
266                   parent="menu_stock_sale_forecast" 
267                   action="action_view_stock_sale_forecast_form"/>
268         
269 <!-- Create Planning section -->
270
271         <menuitem id="menu_stock_planning_main" name="Stock Planning" parent="stock.menu_stock_root"/>
272
273        <record id="view_stock_planning_createlines_form" model="ir.ui.view">
274             <field name="name">stock.planning.createlines.form</field>
275             <field name="model">stock.planning.createlines</field>
276             <field name="type">form</field>
277             <field name="arch" type="xml">
278                 <form string="Stock Planning">                            
279                     <field name="company_id" widget= "selection" on_change="onchange_company(company_id)" groups="base.group_multi_company"/>
280                     <newline/>
281                     <field name="period_id2" widget="selection"/>
282                     <newline/>
283                     <field name="warehouse_id2" domain = "[('company_id','=',company_id)] "/>
284                     <newline/>
285                     <field name="forecasted_products"/>
286                     <newline/>
287                     <field name="product_categ_id2" attrs="{'required':[('forecasted_products','=',0)]}" widget="selection"/>
288                     <separator colspan ="4" string="Stock planning lines creation"/>
289                     <label  colspan ="4" string="Creates planning lines for selected period and warehouse. Doesn't duplicate existing lines created by you."/>
290                     <group colspan="4">
291                         <button icon="gtk-cancel" special="cancel" string="Cancel"/>
292                         <button icon="gtk-ok" name="create_planning" string="Create Stock Planning" type="object"/>
293                     </group>         
294                 </form>
295             </field>
296         </record>      
297
298         <record id="action_stock_planning_createlines_form" model="ir.actions.act_window">
299             <field name="name">Create Stock Planning Lines</field>
300             <field name="res_model">stock.planning.createlines</field>
301             <field name="view_type">form</field>
302             <field name="view_mode">form</field>
303             <field name="view_id" ref="view_stock_planning_createlines_form"/>
304             <field name="target">new</field>
305         </record>
306
307         <menuitem
308             id="menu_stock_planning_createlines" 
309             parent="menu_stock_planning_main"
310             action="action_stock_planning_createlines_form" sequence = "5"/>
311
312 <!-- Planning section -->
313
314         <record id="view_stock_planning_form" model="ir.ui.view">
315             <field name="name">stock.planning.form</field>
316             <field name="model">stock.planning</field>
317             <field name="type">form</field>
318             <field name="priority">50</field>
319             <field name="arch" type="xml">
320                 <form string="Stock Planning">
321                     <group colspan="4" col="7">
322                         <group colspan ="3" col="2">
323                             <separator colspan ="2" string = "General Info"/>
324
325                             <field name="company_id" widget= "selection" 
326                                          on_change="onchange_company(company_id)" groups="base.group_multi_company"/>
327                             <field name="warehouse_id" domain = "[('company_id','=',company_id)] " />
328                             <field name="period_id" />
329                             <field name="product_id" on_change="product_id_change(product_id)"  />
330                             <field name="product_uom_categ"  invisible = "True"/>
331                             <field name="product_uos_categ"  invisible = "True"/>
332                             <field name="product_uom"  
333                                          domain = "[('category_id','in',[product_uom_categ,product_uos_categ])]"
334                                          on_change = "onchange_uom(product_uom)"/>
335 <!--                            <field name="state"/>    -->
336                             <separator colspan ="2" string = "Forecasts"/>
337                             <field name="warehouse_forecast"/>
338                             <field name="company_forecast"/>
339                             <field name="confirmed_forecasts_only"/>
340
341
342                         </group>
343                         <group colspan ="2" col="2">
344                             <separator colspan ="2" string = "Current Period Situation"/>
345                             <field name="stock_start"/>
346                             <field name="already_out"/>
347                             <field name="already_in"/>
348                             <separator colspan ="2" string = "Planning and Situation for Calculated Period"/>
349                             <field name="planned_outgoing"/>
350                             <field name="outgoing"/>
351                             <field name="outgoing_left"/>
352                             <field name="to_procure"/>
353                             <field name="incoming"/>
354                             <field name="incoming_left"/>
355                             <button name="calculate_planning" string="Calculate Planning" type="object" colspan="2"/>
356                             <field name="stock_only"/> 
357                         </group>
358                         <group colspan ="2" col="2">
359                             <separator colspan ="2" string = "Minimum Stock Rule Indicators"/>
360                             <field name="minimum_op"/>
361                             <field name="maximum_op"/>
362                             <separator colspan ="2" string = "Calculated Period Simulation"/>
363                             <field name="outgoing_before"/>
364                             <field name="incoming_before"/>
365                             <field name="stock_simulation"/> 
366                             <button name="procure_incomming_left" string="Procure Incoming Left" type="object" colspan="2"/>
367                             <field name="procure_to_stock"/> 
368                             <separator colspan ="2" string = "Internal Supply"/>
369                             <button name="internal_supply" string="Supply from Another Warehouse" type="object" colspan="2"/>
370                             <field name="supply_warehouse_id" domain = "[('company_id','=',company_id)] "/> 
371                             <field name="stock_supply_location"/> 
372                         </group>
373                     </group>
374                     <separator colspan ="4" string = "Requisition history"/>
375                     <field name = "history" colspan = "2" nolabel = "1"/>
376                 </form>
377             </field>
378         </record>
379
380        <record id="view_stock_planning_filter" model="ir.ui.view">
381             <field name="name">stock.planning.list.select</field>
382             <field name="model">stock.planning</field>
383             <field name="type">search</field>
384             <field name="arch" type="xml">
385                 <search string="Search Stock Planning">
386                  <group col='10' colspan='4'>
387 <!--  Doesn't work !       <filter icon="terp-purchase" string="Current" domain="[('line_time','=','Future')]" separator="1"/>  -->
388                     <filter icon="terp-purchase" string="No Requisition" domain="[('history','=',False)]" separator="1"/>
389                     <field name="company_id" widget="selection"/>
390                     <field name="warehouse_id" widget="selection"/>
391                     <field name="period_id" widget="selection"/>
392                     <field name="product_id" widget="selection"/>
393                  </group>
394               </search>
395             </field>
396         </record>
397
398
399         <record id="view_stock_planning_tree" model="ir.ui.view">
400              <field name="name">stock.planning.tree</field>
401             <field name="model">stock.planning</field>
402             <field name="type">tree</field>
403             <field name="arch" type="xml">
404                 <tree string="Master Procurement Schedule" colors ="blue:line_time=='Past';black:line_time=='Future'">
405                     <field name="warehouse_id" domain = "[('company_id','=',company_id)] " />
406                     <field name="period_id"/>
407                     <field name="product_id" on_change="product_id_change(product_id)" />
408                     <field name="product_uom"/>
409                     <field name="warehouse_forecast" string="Forecast"/>
410                     <field name="planned_outgoing"/>
411                     <field name="to_procure"/>
412                     <field name="stock_simulation" string="Stock"/>   <!-- previously stock_start -->
413                 </tree>
414             </field>
415         </record>
416
417         <record id="action_view_stock_planning_form" model="ir.actions.act_window">
418             <field name="name">Master Procurement Schedule</field>
419             <field name="res_model">stock.planning</field>
420             <field name="type">ir.actions.act_window</field>
421             <field name="view_type">form</field>
422             <field name="view_mode">tree,form</field>
423             <field name="search_view_id" ref="view_stock_planning_filter"/>
424         </record>
425
426         <menuitem
427             id="menu_stock_planning" 
428             parent="menu_stock_planning_main"
429             action="action_view_stock_planning_form"/>
430         
431 </data>
432 </openerp>