[FIX] stock: packages menuitem hidden by the right group. sale_stock: fixed bug ...
[odoo/odoo.git] / addons / purchase_requisition / purchase_requisition_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5     <record model="ir.ui.view" id="purchase_order_form_inherit">
6         <field name="name">purchase.order.form.inherit</field>
7         <field name="model">purchase.order</field>
8         <field name="inherit_id" ref="purchase.purchase_order_form"/>
9         <field name="arch" type="xml">
10             <field name="payment_term_id" position="before">
11                 <field name="requisition_id"/>
12             </field>
13         </field>
14     </record>
15
16     <record model="ir.ui.view" id="purchase_order_search_inherit">
17         <field name="name">purchase.order.list.select.inherit</field>
18         <field name="model">purchase.order</field>
19         <field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
20         <field name="arch" type="xml">
21             <xpath expr="//filter[@name='approved']" position="after">
22                 <filter icon="terp-gtk-jump-to-rtl" string="Requisition" domain="[('requisition_id','!=',False)]"  help="Purchase Orders with requisition"/>
23             </xpath>
24         </field>
25     </record>
26
27     <record model="ir.ui.view" id="view_purchase_requisition_form">
28         <field name="name">purchase.requisition.form</field>
29         <field name="model">purchase.requisition</field>
30         <field name="arch" type="xml">
31             <form string="Call for Bids" version="7.0">
32             <header>              
33                 <button name="sent_suppliers" states="draft" string="Confirm Call" class="oe_highlight"/>
34                 <button name="open_bid" states="in_progress" string="Close Call for Bids" class="oe_highlight"/>
35                 <button name="tender_reset" states="cancel" string="Reset to Draft" type="object" />
36                 <button name="open_product_line" states="open" string="Choose product lines" type="object" class="oe_highlight" groups="purchase.group_advance_bidding"/>
37                 <button name="generate_po" states="open" string="Done" type="object" class="oe_highlight"/>
38                 <button name="cancel_requisition" states="draft,in_progress" string="Cancel Call"/>
39                 <field name="state" widget="statusbar" statusbar_visible="draft,in_progress,open,done" statusbar_colors='{"in_progress":"blue"}'/>
40             </header>
41             <sheet>
42                 <div class="oe_right oe_button_box" style="margin-top: 10px">
43                     <button name="open_product_line" type="object" string="View Products Lines"
44                         attrs="{'invisible': ['|', ('state', 'not in', ('open','done')), ('exclusive', '=', 'exclusive')]}" groups="purchase.group_advance_bidding"/>
45                     
46                 </div>
47                 <div class="oe_edit_only">
48                     <label for="name" class="oe_inline"/>
49                 </div>
50                 <h1>
51                     <field name="name" class="oe_inline" attrs="{'readonly': [('state','not in',('draft'))]}"/>
52                 </h1>
53                 <group>
54                     <group>
55                         <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'purchase_requisition.group_purchase_requisition_user', 'purchase.group_purchase_user', 'account.group_account_invoice']}" attrs="{'readonly': [('state','not in',('draft'))]}"/>
56                         <field name="exclusive" attrs="{'readonly': [('state','not in',('draft'))]}"/>
57                         <field name="account_analytic_id" colspan="2" groups="purchase.group_analytic_accounting" attrs="{'readonly': [('state','not in',('draft'))]}"/>
58                         <field name="multiple_rfq_per_supplier" attrs="{'readonly': [('state','not in',('draft'))]}"/>
59                     </group>
60                     <group>
61                         <field name="date_end" attrs="{'readonly': [('state','not in',('draft'))]}"/>
62                         <field name="ordering_date" attrs="{'readonly': [('state','not in',('draft'))]}"/>
63                         <field name="schedule_date" attrs="{'readonly': [('state','not in',('draft'))]}"/>
64                         <field name="origin" placeholder="e.g. OP0025" attrs="{'readonly': [('state','not in',('draft'))]}"/>
65                         <field name="picking_type_id" widget="selection" groups="stock.group_locations" attrs="{'readonly': [('state','not in',('draft'))]}"/>
66                         <field name="company_id" groups="base.group_multi_company" widget="selection" attrs="{'readonly': [('state','not in',('draft'))]}"/>
67                     </group>
68                 </group>
69                 <notebook>
70                     <page string="Products">
71                         <field name="line_ids" attrs="{'readonly': [('state','not in',('draft'))]}">
72                             <tree string="Products" editable="bottom">
73                                 <field name="product_id" on_change="onchange_product_id(product_id,product_uom_id,parent.account_analytic_id,account_analytic_id,parent.schedule_date,schedule_date)"/>
74                                 <field name="product_qty"/>
75                                 <field name="product_uom_id" groups="product.group_uom"/>
76                                 <field name="schedule_date"/>
77                                 <field name="account_analytic_id" groups="purchase.group_analytic_accounting"/>
78                                 
79                             </tree>
80                             <form string="Products" version="7.0">
81                                 <group>
82                                     <field name="product_id" />
83                                     <field name="product_qty"/>
84                                     <field name="product_uom_id" />
85                                     <field name="schedule_date"/>
86                                     <field name="account_analytic_id" groups="purchase.group_analytic_accounting"/>
87                                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
88                                 </group>
89                             </form>
90                         </field>
91                         <div class="oe_right oe_button_box" style="margin-top: 10px">
92                             <button name="%(action_purchase_requisition_partner)d" type="action"
93                                 string="Request a Quotation" icon="gtk-execute"
94                                 attrs="{'invisible': ['|', ('line_ids','=',[]),('state', 'in', ('draft' ,'open','done'))]}"/>
95                             <button name="open_rfq" type="object" string="View RFQs/Bids" attrs="{'invisible': [('state', 'in', ('draft'))]}"/>
96                         </div>
97                         <separator string="Requests for Quotation"/>
98                         <field name="purchase_ids">
99                             <tree string="Purchase Order">
100                                 <field name="name" string="Reference"/>
101                                 <field name="date_order" string="Order Date"/>
102                                 <field name="partner_id"/>
103                                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
104                                 <field name="location_id" groups="stock.group_locations"/>
105                                 <field name="minimum_planned_date" invisible="1"/>
106                                 <field name="origin"/>
107                                 <field name="state"/>
108                                 <button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel Purchase Order" icon="gtk-cancel"/>
109                                 <button name="purchase_confirm" states="draft" string="Confirm Purchase Order" icon="gtk-apply"/>
110                                 <button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-ok"/>
111                                 <button name="wkf_send_rfq" states="draft" string="Send RFQ by Email" type="object" context="{'send_rfq':True}" icon="gtk-network"/>
112                             </tree>
113                         </field>
114                         <separator string="Terms and Conditions"/>
115                         <field name="description" attrs="{'readonly': [('state','not in',('draft'))]}"/>
116                     </page>
117                 </notebook>
118             </sheet>
119             <div class="oe_chatter">
120               <field name="message_follower_ids" widget="mail_followers"/>
121               <field name="message_ids" widget="mail_thread"/>
122             </div> 
123             </form>
124         </field>
125     </record>
126     <record model="ir.ui.view" id="view_purchase_requisition_tree">
127         <field name="name">purchase.requisition.tree</field>
128         <field name="model">purchase.requisition</field>
129         <field name="arch" type="xml">
130             <tree fonts="bold:message_unread==True" colors="grey:state == 'cancel';red:date_end and date_end&lt;current_date;black:date_end&gt;current_date;" string="Call for Bids">
131                 <field name="message_unread" invisible="1"/>
132                 <field name="name"/>
133                 <field name="ordering_date"/>
134                 <field name="user_id"/>
135                 <field name="company_id" groups="base.group_multi_company" widget="selection"/>
136                 <field name="date_end"/>
137                 <field name="origin"/>
138                 <field name="state"/>
139             </tree>
140       </field>
141     </record>
142
143     <record id="view_purchase_requisition_filter" model="ir.ui.view">
144             <field name="name">purchase.requisition.list.select</field>
145             <field name="model">purchase.requisition</field>
146             <field name="arch" type="xml">
147                 <search string="Search Call for Bids">
148                     <field name="name" string="Call for Bids"/>
149                     <field name="exclusive" />
150                     <filter icon="terp-document-new" name="draft" string="New" domain="[('state','=','draft')]" help="New Call for Bids"/>
151                     <filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','in_progress')]" help="Call for Bids in negociation"/>
152                     <filter icon="terp-dialog-close" string="Closed Bids" domain="[('state','=','open')]" help="Call for Bids where bids are closed"/>
153                     <separator/>
154                     <filter icon="terp-personal-" string="Unassigned"  domain="[('user_id','=', False)]" help="Unassigned  Requisition"/>
155                     <field name="user_id" />
156                     <group expand="0" string="Group By...">
157                         <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
158                         <filter string="Source" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
159                         <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
160                         <filter string="Start Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}"/>
161                         <filter string="End Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_end'}"/>
162                     </group>
163                 </search>
164             </field>
165         </record>
166
167
168     <record model="ir.actions.act_window" id="action_purchase_requisition">
169         <field name="name">Calls for Bids</field>
170         <field name="type">ir.actions.act_window</field>
171         <field name="res_model">purchase.requisition</field>
172         <field name="view_type">form</field>
173         <field name="view_mode">tree,form</field>
174         <field name="context">{"search_default_user_id":uid}</field>
175         <field name="search_view_id" ref="view_purchase_requisition_filter"/>
176         <field name="help" type="html">
177           <p class="oe_view_nocontent_create">
178             Click to start a new Call for Bids process. 
179           </p><p>
180             A Call for Bids is a procedure for generating competing offers from
181             different bidders. In the call for bids, you can record the
182             products you need to buy and generate the creation of RfQs to
183             suppliers. Once the bids have been registered, you can review and
184             compare them and you can validate some and cancel others.
185           </p>
186         </field>
187     </record>
188
189     <menuitem
190         id="menu_purchase_requisition_pro_mgt"
191         sequence="10"
192         parent="purchase.menu_procurement_management"
193         action="action_purchase_requisition"/>
194
195     <record model="ir.ui.view" id="product_normal_form_view_inherit">
196         <field name="name">product.form.inherit</field>
197         <field name="model">product.product</field>
198         <field name="inherit_id" ref="stock.product_form_view_procurement_button"/>
199         <field name="arch" type="xml">
200             <field name="route_ids" position="after">
201                 <field name="purchase_requisition"/>
202             </field>
203         </field>
204     </record>
205
206     <record model="ir.ui.view" id="procurement_normal_form_view_inherit">
207         <field name="name">procurement.form.inherit</field>
208         <field name="model">procurement.order</field>
209         <field name="inherit_id" ref="procurement.procurement_form_view"/>
210         <field name="arch" type="xml">
211             <xpath expr="//field[@name='origin']" position="after">
212                 <field name="requisition_id"/>
213             </xpath>
214         </field>
215     </record>
216     <act_window
217             domain="[('requisition_id', '=', active_id)]"
218             context="{'default_requisition_id': active_id}"
219             id="act_res_partner_2_purchase_order"
220             name="Purchase orders"
221             res_model="purchase.order"
222             src_model="purchase.requisition"/>
223
224
225     <record id="purchase_order_line_tree_tender" model="ir.ui.view">
226             <field name="name">purchase.order.line.tree.tender</field>
227             <field name="model">purchase.order.line</field>
228             <field eval="1" name="priority"/>
229             <field name="arch" type="xml">
230                 <tree string="Purchase Order Lines" create="false" colors="blue:state == 'confirmed';gray:state == 'cancel'">
231                     <field name="name"/>
232                     <field name="partner_id" string="Supplier" />
233                     <field name="product_id"/>
234                     <field name="price_unit"/>
235                     <field name="product_qty"/>
236                     <field name="quantity_bid"/>
237                     <field name="product_uom" groups="product.group_uom"/>
238                     <field name="price_subtotal"/>
239                     <field name="state" invisible="1"/>
240                     <field name="invoiced" invisible="1"/>
241                     <button name="action_draft" states="confirmed" type="object" string="Cancel Choice" icon="gtk-cancel"/>
242                     <button name="%(action_bid_line_qty)d" type="action" states="draft" string="Change Quantity" icon="gtk-ok"/>
243                     <button name="action_confirm" states="draft" type="object" string="Confirm Order" icon="gtk-apply"/>
244                 </tree>
245             </field>
246     </record>
247
248     <record id="purchase_line_tree" model="ir.actions.act_window">
249             <field name="name">Bid Lines</field>
250             <field name="res_model">purchase.order.line</field>
251             <field name="context">{"search_default_groupby_product" : True,}</field>
252             <field name="view_type">form</field>
253             <field name="view_mode">tree_purchase_order_line_compare</field>
254             <field name="view_id" ref="purchase_order_line_tree_tender"/>
255             <field name="search_view_id" ref="purchase.purchase_order_line_search"/>
256     </record>
257
258     </data>
259 </openerp>