[FIX]remove last console log
[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="arch" type="xml">
13                 <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'">
14                     <field name="date_planned" widget="date"/>
15                     <field name="origin"/>
16                     <field name="product_id"/>
17                     <field name="product_qty"/>
18                     <field name="product_uom" string="Unit of Measure"/>
19                     <field name="state"/>
20                 </tree>
21             </field>
22         </record>
23
24         <record id="procurement_form_view" model="ir.ui.view">
25             <field name="name">procurement.order.form</field>
26             <field name="model">procurement.order</field>
27             <field name="arch" type="xml">
28                 <form string="Procurement" version="7.0">
29                     <header>
30                         <button name="run" states="confirmed,exception" string="Run Procurement" class="oe_highlight" type="object"/>
31                         <button name="check" states="running" string="Check Procurement" class="oe_highlight" type="object"/>
32                         <button name="cancel" states="exception,confirmed,running" string="Cancel Procurement" type="object"/>
33                         <button name="reset_to_confirmed" states="cancel" string="Reconfirm Procurement" type="object"/>
34                         <field name="state" readonly="1" widget="statusbar" statusbar_visible="draft,confirmed,running,done" />
35                     </header>
36                     <sheet>
37                     <div class="oe_right oe_button_box" name="button_box">
38                         <button name="do_view_procurements" string="Group's Procurements" type="object"/>
39                     </div>
40                     <group>
41                         <group>
42                             <field name="product_id" on_change="onchange_product_id(product_id)"/>
43                             <label for="product_qty"/>
44                             <div>
45                                 <div>
46                                     <field name="product_qty" class="oe_inline"/>
47                                     <field name="product_uom" class="oe_inline" groups="product.group_uom"/>
48                                 </div>
49                             </div>
50                             <label for="product_uos_qty" groups="product.group_uos"/>
51                             <div groups="product.group_uos">
52                                 <field name="product_uos_qty" class="oe_inline"/>
53                                 <field name="product_uos" class="oe_inline"/>
54                             </div>
55                         </group>
56                         <group name="scheduling" string="Scheduling">
57                             <field name="date_planned"/>
58                             <field name="priority"/>
59                         </group>
60                     </group>
61                     <notebook>
62                         <page string="Notes">
63                             <label for="name" class="oe_edit_only"/>
64                             <field name="name" placeholder="External note..."/>
65                         </page>
66                         <page string="Extra Information">
67                             <group>
68                                 <group>
69                                     <field name="origin" placeholder="e.g. SO005"/>
70                                     <field name="group_id" groups="base.group_no_one"/>
71                                 </group>
72                                 <group>
73                                     <field name="rule_id"/>
74                                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
75                                 </group>
76                             </group>
77                         </page>
78                     </notebook>
79                     </sheet>
80                     <div class="oe_chatter">
81                         <field name="message_follower_ids" widget="mail_followers"/>
82                         <field name="message_ids" widget="mail_thread"/>
83                     </div>
84                 </form>
85             </field>
86         </record>
87
88         <record id="do_view_procurements" model="ir.actions.act_window">
89             <field name="name">Group's Procurements</field>
90             <field name="res_model">procurement.order</field>
91             <field name="view_type">form</field>
92             <field name="view_mode">tree,form</field>
93             <field name="domain">[('group_id','=',active_id)]</field>            
94         </record>
95         
96         <record id="procurement_group_form_view" model="ir.ui.view">
97             <field name="name">procurement.group.form</field>
98             <field name="model">procurement.group</field>
99             <field name="arch" type="xml">
100                 <form string="Procurement group" version="7.0">
101                     <sheet>
102                         <div class="oe_right oe_button_box" name="button_box">
103                             <button name="%(do_view_procurements)d" string="Procurements" type="action"/>
104                         </div>
105                         <group>
106                             <field name="name"/>
107                             <field name="move_type"/>
108                             <field name="partner_id"/>                                                        
109                         </group>                        
110                     </sheet>
111                 </form>
112             </field>
113         </record>
114         
115         <record id="view_procurement_filter" model="ir.ui.view">
116             <field name="name">procurement.order.select</field>
117             <field name="model">procurement.order</field>
118             <field name="arch" type="xml">
119                 <search string="Search Procurement">
120                     <field name="origin" string="Procurement"/>
121                     <field name="date_planned"/>
122                     <filter icon="terp-emblem-important" string="Exceptions" name="exceptions" domain="[('state','=','exception')]" help="Procurement Exceptions"/>
123                     <separator/>
124                     <filter icon="terp-gnome-cpu-frequency-applet+" string="Late" domain="['&amp;', ('date_planned','&lt;', current_date), ('state', '=', 'confirmed')]" help="Procurement started late" />
125                     <field name="product_id" />
126                     <field name="state" />
127                     <group expand="0" string="Group By">
128                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
129                         <filter string="Scheduled Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_planned'}"/>
130                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
131                     </group>
132                 </search>
133             </field>
134         </record>
135         
136         <record id="procurement_action" model="ir.actions.act_window">
137             <field name="name">Procurement Orders</field>
138             <field name="type">ir.actions.act_window</field>
139             <field name="res_model">procurement.order</field>
140             <field name="view_type">form</field>
141             <field name="view_id" eval="False"/>
142             <field name="search_view_id" ref="view_procurement_filter"/>
143             <field name="context">{'search_default_current':1}</field>
144             <field name="help" type="html">
145               <p class="oe_view_nocontent_create">
146                  Click to create a procurement order.  
147               </p>
148               <p>
149                 A <b>procurement order</b> is used to record a need for a specific
150                 product at a specific location. Procurement orders are usually
151                 created automatically from <i>sales orders, pull logistic rules or
152                 minimum stock rules.</i>
153               </p>
154               <p>
155                 When the procurement order is confirmed, it automatically
156                 creates the necessary operations to fullfil the need: purchase
157                 order proposition, manufacturing order, etc.
158               </p>
159             </field>
160         </record>
161         
162         <record id="procurement_exceptions" model="ir.actions.act_window">
163             <field name="name">Procurements</field>
164             <field name="type">ir.actions.act_window</field>
165             <field name="res_model">procurement.order</field>
166             <field name="view_type">form</field>
167             <field name="view_mode">tree,form</field>
168             <field name="context">{}</field>
169             <field name="search_view_id" ref="view_procurement_filter"/>
170             <field name="help" type="html">
171               <p class="oe_view_nocontent_create">
172                  Click to create a Procurement.
173               </p>
174               <p>
175                 <b>Procurement Orders</b> represent the need for a certain quantity of products, at a given time, in a given location.
176               </p>
177               <p>
178                 <b>Sales Orders</b> are one typical source of Procurement Orders (but these are distinct documents). 
179                 <br/>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...
180               </p>
181               <p>
182                 A <b>Procurement Exception</b> 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 in the chatter).
183               </p>
184             </field>
185         </record>
186
187         <record id="procurement_action5" model="ir.actions.act_window">
188             <field name="name">Procurement Exceptions</field>
189             <field name="type">ir.actions.act_window</field>
190             <field name="res_model">procurement.order</field>
191             <field name="view_type">form</field>
192             <field name="view_mode">tree,form</field>
193             <field name="domain">[('state','=','exception')]</field>
194         </record>
195
196         <!-- Procurement Rules -->
197         <record model="ir.ui.view" id="view_procurement_rule_tree">
198             <field name="name">procurement.rule.tree</field>
199             <field name="model">procurement.rule</field>
200             <field eval="10" name="priority"/>
201             <field name="arch" type="xml">
202                 <tree string="Pull Rules">
203                     <field name="name"/>
204                     <field name="action"/>
205                     <field name='company_id' groups="base.group_multi_company"/>
206                 </tree>
207             </field>
208         </record>
209
210         <record model="ir.ui.view" id="view_procurement_rule_form">
211             <field name="name">procurement.rule.form</field>
212             <field name="model">procurement.rule</field>
213             <field eval="10" name="priority"/>
214             <field name="arch" type="xml">
215                 <form string="Pull Rule" version="7.0">
216                     <sheet>
217                         <div class="oe_title">
218                             <label for="name" class="oe_edit_only"/>
219                             <h1><field name="name"/></h1>
220                         </div>
221                         <group>
222                             <group string="General Information">
223                                 <field name="action"/>
224                                 <field name="sequence"/>
225                             </group>
226                             <group name="propagation_group" string="Propagation Options" groups="base.group_no_one">
227                                 <field name="group_propagation_option"/>
228                                 <field name="group_id" attrs="{'invisible': [('group_propagation_option', '!=', 'fixed')], 'required': [('group_propagation_option', '=', 'fixed')]}"/>
229                             </group>
230                         </group>
231                     </sheet>
232                 </form>
233             </field>
234         </record>
235     </data>
236 </openerp>