[FIX]: Improve Treeview colors red to black, Improve tooltips in product form.
[odoo/odoo.git] / addons / purchase_requisition / purchase_requisition_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5
6     <record model="ir.ui.view" id="purchase_order_form_inherit">
7         <field name="name">purchase.order.form.inherit</field>
8         <field name="type">form</field>
9         <field name="model">purchase.order</field>
10         <field name="inherit_id" ref="purchase.purchase_order_form"/>
11         <field name="arch" type="xml">
12             <field name="shipped" position="after">
13                 <field name="requisition_id"/>
14             </field>
15         </field>
16     </record>
17
18     <record model="ir.ui.view" id="purchase_order_search_inherit">
19         <field name="name">purchase.order.list.select.inherit</field>
20         <field name="type">form</field>
21         <field name="model">purchase.order</field>
22         <field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
23         <field name="arch" type="xml">
24             <xpath expr="//filter[@name='approved']" position="after">
25                 <filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]"  help="Purchase Orders with requisition"/>
26             </xpath>
27         </field>
28     </record>
29
30     <record model="ir.ui.view" id="view_purchase_requisition_form">
31         <field name="name">purchase.requisition.form</field>
32         <field name="type">form</field>
33         <field name="model">purchase.requisition</field>
34         <field name="arch" type="xml">
35             <form string="Purchase Requisition" version="7.0">
36             <header>
37                 <button name="tender_in_progress" states="draft" string="Send to Suppliers" type="object" />
38                 <button name="tender_reset" states="done,cancel" string="Reset to Draft" type="object" />
39                 <button name="tender_done" states="in_progress" string=" Purchase Done" type="object" />
40                 <button name="tender_cancel" states="draft,in_progress" string="Cancel" type="object" />
41                 <field name="state" widget="statusbar" statusbar_visible="draft,in_progress,done" statusbar_colors='{"in_progress":"blue"}'/>
42             </header>
43             <sheet>
44                 <label for="name" class="oe_edit_only"/>
45                 <h1>
46                     <field name="name" class="oe_inline"/>, 
47                     <field name="origin" class="oe_inline"/>
48                 </h1>
49                 <group>
50                     <group>
51                         <field name="user_id"/>
52                         <field name="exclusive"/>
53                     </group><group>
54                         <field name="date_start"/>
55                         <field name="date_end"/>
56                         <field name="warehouse_id" widget="selection" groups="stock.group_locations"/>
57                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
58                     </group>
59                 </group>
60                 <notebook colspan="4">
61                     <page string="Products">
62                         <field name="line_ids">
63                             <tree string="Products" editable="bottom">
64                                 <field name="product_id" on_change="onchange_product_id(product_id,product_uom_id)"/>
65                                 <field name="product_qty"/>
66                                 <field name="product_uom_id" groups="product.group_uom"/>
67                             </tree>
68                             <form string="Products" version="7.0">
69                                 <group col="4">
70                                     <field name="product_id" />
71                                     <field name="product_qty"/>
72                                     <field name="product_uom_id" />
73                                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
74                                 </group>
75                             </form>
76                         </field>
77                         <button name="%(action_purchase_requisition_partner)d" string="Request a Quotation" type="action" icon="gtk-execute"
78                             attrs="{'invisible': [('line_ids','=',False),('state', 'not in', ('in_progress'))]}" class="oe_mail_button_mouseout"/>
79                         <separator colspan="4" string="Quotations"/>
80                            <field name="purchase_ids" readonly="1">
81                              <tree string="Purchase Order">
82                                 <field name="name" string="Reference"/>
83                                 <field name="date_order" string="Order Date"/>
84                                 <field name="partner_id"/>
85                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
86                                 <field name="location_id" groups="stock.group_locations"/>
87                                 <field name="minimum_planned_date"/>
88                                 <field name="origin"/>
89                                 <field name="state"/>
90                                 <button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel Purchase Order" icon="gtk-cancel"/>                                
91                                 <button name="purchase_confirm" states="draft" string="Confirm Purchase Order" icon="gtk-apply"/>
92                                 <button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-ok"/>
93                             </tree>
94                          </field>
95                          <group colspan="4" col="4">
96                             <group cosplan="4" col="4">
97                                 <label   string="" />
98                             </group>
99                         </group>
100                         <separator string="Terms and Conditions"/>
101                         <field name="description"/>
102                     </page>
103                 </notebook>
104             </sheet>
105             <div class="oe_form_sheet_width">
106                   <field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
107             </div> 
108             </form>
109         </field>
110     </record>
111     <record model="ir.ui.view" id="view_purchase_requisition_tree">
112         <field name="name">purchase.requisition.tree</field>
113         <field name="type">tree</field>
114         <field name="model">purchase.requisition</field>
115         <field name="arch" type="xml">
116             <tree fonts="bold:needaction_pending==True" colors="grey:state == 'cancel';red:date_end and date_end&lt;current_date;black:date_end&gt;current_date;" string="Purchase Requisition">
117                 <field name="needaction_pending" invisible="1"/>
118                 <field name="name"/>
119                 <field name="date_start"/>
120                 <field name="user_id"/>
121                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
122                 <field name="date_end"/>
123                 <field name="origin"/>
124                 <field name="state"/>
125             </tree>
126       </field>
127     </record>
128
129     <record id="view_purchase_requisition_filter" model="ir.ui.view">
130             <field name="name">purchase.requisition.list.select</field>
131             <field name="model">purchase.requisition</field>
132             <field name="type">search</field>
133             <field name="arch" type="xml">
134                 <search string="Search Purchase Requisition">
135                  <group>
136                     <field name="name" string="Purchase Requisition"/>
137                     <separator orientation="vertical"/>
138                     <filter icon="terp-document-new" name="draft" string="New" domain="[('state','=','draft')]" help="New Purchase Requisition"/>
139                     <filter icon="terp-camera_test" string="Sent to Suppliers" domain="[('state','=','in_progress')]" help="Purchase Requisition in negociation"/>
140                     <filter icon="terp-dialog-close" string="Purchase Done" domain="[('state','=','done')]" help="Current Purchase Requisition"/>
141                     <separator orientation="vertical"/>
142                     <filter icon="terp-personal-" string="Unassigned"  domain="[('user_id','=', False)]" help="Unassigned  Requisition"/>
143                     <separator orientation="vertical"/>
144                     <field name="user_id" />
145                     <field name="exclusive" />
146                 </group>
147                 <newline/>
148                   <group expand="0" string="Group By...">
149                     <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
150                     <separator orientation="vertical"/>
151                     <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
152                     <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
153                     <separator orientation="vertical"/>
154                     <filter string="Start Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}"/>
155                     <filter string="End Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_end'}"/>
156                 </group>
157               </search>
158             </field>
159         </record>
160
161
162     <record model="ir.actions.act_window" id="action_purchase_requisition">
163         <field name="name">Purchase Requisitions</field>
164         <field name="type">ir.actions.act_window</field>
165         <field name="res_model">purchase.requisition</field>
166         <field name="view_type">form</field>
167         <field name="view_mode">tree,form</field>
168         <field name="context">{"search_default_create_uid":uid}</field>
169         <field name="search_view_id" ref="view_purchase_requisition_filter"/>
170         <field name="help">A purchase requisition is the step before a request for quotation. In a purchase requisition (or purchase tender), you can record the products you need to buy and trigger the creation of RfQs to suppliers. After the negotiation, once you have reviewed all the supplier's offers, you can validate some and cancel others.</field>
171     </record>
172
173     <menuitem
174         id="menu_purchase_requisition_pro_mgt"
175         sequence="10"
176         parent="purchase.menu_procurement_management"
177         action="action_purchase_requisition"/>
178
179     <record model="ir.ui.view" id="product_normal_form_view_inherit">
180         <field name="name">product.form.inherit</field>
181         <field name="type">form</field>
182         <field name="model">product.product</field>
183         <field name="inherit_id" ref="product.product_normal_form_view"/>
184         <field name="arch" type="xml">
185             <field name="supply_method" position="after">
186                 <group colspan="2" col="2" attrs="{'invisible': [('supply_method','&lt;&gt;','buy')]}">
187                 <field name="purchase_requisition"/>
188                 </group>
189             </field>
190         </field>
191     </record>
192
193     <record model="ir.ui.view" id="procurement_normal_form_view_inherit">
194         <field name="name">procurement.form.inherit</field>
195         <field name="type">form</field>
196         <field name="model">procurement.order</field>
197         <field name="inherit_id" ref="procurement.procurement_form_view"/>
198         <field name="arch" type="xml">
199              <xpath expr="//field[@name='close_move']" position="after">
200                 <field name="requisition_id"/>
201             </xpath>
202         </field>
203     </record>
204     <act_window
205             domain="[('requisition_id', '=', active_id)]"
206             context="{'default_requisition_id': active_id}"
207             id="act_res_partner_2_purchase_order"
208             name="Purchase orders"
209             res_model="purchase.order"
210             src_model="purchase.requisition"/>
211
212     </data>
213 </openerp>