[IMP]Improvement in purchase_double_validation Module Taskid-1774
[odoo/odoo.git] / addons / purchase / purchase_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4        <menuitem icon="terp-purchase" id="base.menu_purchase_root" name="Purchases" sequence="3"
5            groups="group_purchase_manager,group_purchase_user"
6            web_icon="images/purchases.png"
7            web_icon_hover="images/purchases-hover.png"/>
8        <menuitem id="menu_procurement_management" name="Purchase Management"
9             parent="base.menu_purchase_root" sequence="1" />
10
11         <menuitem id="menu_purhase_config_purchase" name="Configuration"
12             parent="base.menu_purchase_root" sequence="100"/>
13
14         <menuitem
15             action="product.product_pricelist_action" id="menu_product_pricelist_action_purhase"
16             parent="menu_purhase_config_purchase" sequence="2"/>
17
18         <menuitem
19             action="product.product_pricelist_action2" id="menu_product_pricelist_action2_purchase"
20             parent="menu_purhase_config_purchase" sequence="1"/>
21
22
23         <!--supplier addresses action-->
24         <record id="action_supplier_address_form" model="ir.actions.act_window">
25             <field name="name">Addresses</field>
26             <field name="type">ir.actions.act_window</field>
27             <field name="res_model">res.partner.address</field>
28             <field name="view_type">form</field>
29             <field name="context">{"search_default_supplier":1}</field>
30             <field name="search_view_id" ref="base.view_res_partner_address_filter"/>
31             <field name="help">Access your supplier records and maintain your relationship with them. You can track all your interactions with them through the history tab: emails, orders, meeting, etc.</field>
32         </record>
33         <record id="action_supplier_address_form_view1" model="ir.actions.act_window.view">
34             <field eval="10" name="sequence"/>
35             <field name="view_mode">tree</field>
36             <field name="view_id" ref="base.view_partner_address_tree"/>
37             <field name="act_window_id" ref="action_supplier_address_form"/>
38         </record>
39         <record id="action_supplier_address_form_view2" model="ir.actions.act_window.view">
40             <field eval="20" name="sequence"/>
41             <field name="view_mode">form</field>
42             <field name="view_id" ref="base.view_partner_address_form1"/>
43             <field name="act_window_id" ref="action_supplier_address_form"/>
44         </record>
45
46      <!--supplier menu-->
47       <menuitem id="base.menu_procurement_management_supplier" name="Address Book"
48             parent="base.menu_purchase_root" sequence="3"/>
49       <menuitem id="base.menu_procurement_management_supplier_name" name="Suppliers"
50             parent="base.menu_procurement_management_supplier"
51             action="base.action_partner_supplier_form" sequence="1"/>
52
53           <!--Inventory control-->
54       <menuitem id="menu_procurement_management_inventory" name="Receive Products"
55             parent="base.menu_purchase_root" sequence="4"/>
56       <menuitem action="stock.action_picking_tree4" id="menu_action_picking_tree4" parent="menu_procurement_management_inventory"
57             name="Incoming Shipments" sequence="9"
58             groups="base.group_extended"/>
59       <menuitem action="stock.action_reception_picking_move" id="menu_action_picking_tree_in_move"
60             parent="menu_procurement_management_inventory" sequence="11"/>
61
62      <!--Invoice control-->
63      <menuitem id="menu_procurement_management_invoice" name="Invoice Control"
64           parent="base.menu_purchase_root" sequence="6"/>
65
66     <record id="action_invoice_pending" model="ir.actions.act_window">
67         <field name="res_model">account.invoice</field>
68         <field name="view_type">form</field>
69         <field name="view_mode">tree,form,calendar,graph</field>
70         <field eval="False" name="view_id"/>
71         <field name="domain">[('type','=','in_invoice')]</field>
72         <field name="context">{'type':'in_invoice', 'journal_type': 'purchase', 'search_default_draft': 1}</field>
73         <field name="search_view_id" ref="account.view_account_invoice_filter"/>
74             <field name="help">Use this menu to control the invoices to be received by your supplier. OpenERP pre-generates draft of invoices based on your purchase orders or your receptions. Once you receive a supplier invoice, you can control it according to the draft of invoice and validate it.</field>
75     </record>
76
77      <menuitem name="Supplier Invoices to Receive"
78           id="menu_procurement_management_pending_invoice"
79           action="action_invoice_pending"
80           parent="menu_procurement_management_invoice"
81           sequence="13"/>
82
83       <!--product menu-->
84       <menuitem id="menu_procurement_management_product" name="Products"
85           parent="base.menu_purchase_root" sequence="8"/>
86       <menuitem name="Products" id="menu_procurement_partner_contact_form" action="product.product_normal_action_puchased"
87           parent="menu_procurement_management_product"/>
88
89        <record model="ir.ui.view" id="purchase_order_calendar">
90             <field name="name">purchase.order.calendar</field>
91             <field name="model">purchase.order</field>
92             <field name="type">calendar</field>
93             <field name="priority" eval="2"/>
94             <field name="arch" type="xml">
95                 <calendar string="Calendar View" date_start="minimum_planned_date" color="partner_id">
96                     <field name="name"/>
97                     <field name="amount_total"/>
98                     <field name="partner_id"/>
99                 </calendar>
100             </field>
101         </record>
102         <record model="ir.ui.view" id="view_purchase_order_graph">
103             <field name="name">purchase.order.graph</field>
104             <field name="model">purchase.order</field>
105             <field name="type">graph</field>
106             <field name="arch" type="xml">
107                 <graph string="Purchase Order" type="bar">
108                     <field name="partner_id"/>
109                     <field name="amount_total" operator="+"/>
110                 </graph>
111             </field>
112         </record>
113
114         <record id="purchase_order_form" model="ir.ui.view">
115             <field name="name">purchase.order.form</field>
116             <field name="model">purchase.order</field>
117             <field name="type">form</field>
118             <field name="arch" type="xml">
119                 <form string="Purchase Order">
120                     <group col="6" colspan="4">
121                         <field name="name"/>
122                         <field name="date_order"/>
123                         <field name="invoiced"/>
124                         <newline/>
125                         <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)" widget="selection"/>
126                         <field name="partner_ref"/>
127                         <field name="shipped"/>
128                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
129                     </group>
130                     <notebook colspan="4">
131                         <page string="Purchase Order">
132                             <field name="partner_id" on_change="onchange_partner_id(partner_id)" domain="[('supplier','=',True)]" context="{'search_default_supplier':1}" />
133                             <field name="partner_address_id"/>
134                             <field domain="[('type','=','purchase')]" name="pricelist_id" groups="base.group_extended"/>
135                             <field name="origin" groups="base.group_extended"/>
136                             <newline/>
137                             <field colspan="4" name="order_line" nolabel="1" mode="tree,form">
138                                 <tree string="Purchase Order Lines">
139                                     <field name="date_planned"/>
140                                     <field name="name"/>
141                                     <field name="product_qty"/>
142                                     <field name="product_uom"/>
143                                     <field name="price_unit"/>
144                                     <field name="price_subtotal"/>
145                                 </tree>
146                                 <!-- default form view -->
147                             </field>
148                             <group col="7" colspan="4">
149                                 <field name="amount_untaxed" sum="Untaxed amount"/>
150                                 <field name="amount_tax"/>
151                                 <field name="amount_total" sum="Total amount"/>
152                                 <button name="button_dummy" states="draft" string="Compute" type="object" icon="gtk-execute"/>
153                             </group>
154                             <group col="11" colspan="4">
155                                 <field name="state" readonly="1"/>
156                                 <button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel" icon="gtk-cancel"/>
157                                 <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
158                                 <button name="action_cancel" states="approved,except_picking,except_invoice,wait" string="Cancel Purchase Order" type="object" icon="gtk-cancel"/>
159                                 <button name="picking_ok" states="except_picking" string="Manually Corrected" icon="gtk-convert"/>
160                                 <button name="invoice_ok" states="except_invoice" string="Manually Corrected" icon="gtk-convert"/>
161                                 <button name="purchase_confirm" states="draft" string="Convert to Purchase Order" icon="gtk-go-forward"/>
162                                 <button name="purchase_appbuyer" states="wait_auth" string="Approve Purchase" icon="gtk-ok"/>
163                                 <button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-go-forward"/>
164                                 <button name="%(report_purchase_order)d" string="Print" states="approved" type="action" icon="gtk-print"/>
165                             </group>
166                         </page>
167                         <page string="Delivery &amp; Invoicing" groups="base.group_extended">
168                             <group colspan="2" col="2">
169                                 <separator string="Delivery" colspan="2"/>
170                                 <field name="dest_address_id" on_change="onchange_dest_address_id(dest_address_id)"/>
171                                 <field name="minimum_planned_date"/>
172                                 <field name="location_id"/>
173                             </group>
174                             <group colspan="2" col="2">
175                                 <separator string="Invoice Control" colspan="2"/>
176                                 <field name="invoice_method"/>
177                                 <field name="invoice_id" readonly="1" groups="base.group_extended" />
178                                 <field name="fiscal_position" widget="selection"/>
179                             </group>
180                             <newline/>
181                             <separator string="Purchase Control" colspan="4"/>
182                             <field name="validator"/>
183                             <field name="date_approve"/>
184                         </page>
185                         <page string="Notes">
186                             <field colspan="4" name="notes" nolabel="1"/>
187                         </page>
188                     </notebook>
189                 </form>
190             </field>
191         </record>
192
193        <record id="view_purchase_order_filter" model="ir.ui.view">
194             <field name="name">purchase.order.list.select</field>
195             <field name="model">purchase.order</field>
196             <field name="type">search</field>
197             <field name="arch" type="xml">
198                 <search string="Search Purchase Order">
199                  <group col='10' colspan='4'>
200                     <filter icon="terp-document-new" name="draft" string="Quotations" domain="[('state','=','draft')]" separator="1" help="Purchase order which are in draft state"/>
201                     <filter icon="terp-camera_test" name="confirmed" string="To Approve" domain="[('state','in',('wait','confirmed'))]" separator="1" help="Purchase order to be approved"/>
202                     <filter icon="terp-check" name="approved" string="Approved" domain="[('state','in',('approved','done'))]" separator="1" help="Approved purchase order"/>
203                     <separator orientation="vertical"/>
204                     <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]" separator="1" help="Purchase order which are in the exception state"/>
205                     <separator orientation="vertical"/>
206                     <filter icon="terp-gtk-go-back-rtl" string="To be Invoiced" domain="[('invoiced','=',1)]" separator="1" help="Purchase order to be invoiced"/>
207                     <separator orientation="vertical"/>
208                     <field name="name" select="1" string="Reference"/>
209                     <field name="partner_id" select="1"/>
210                     <field name="product_id" select="1"/>
211                     <field name="create_uid" select="1"/>
212                 </group>
213                 <newline/>
214                   <group expand="0" string="Group By..." colspan="4" col="10" groups="base.group_extended">
215                     <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
216                      <separator orientation="vertical"/>
217                     <filter string="Origin" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
218                     <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
219                      <separator orientation="vertical"/>
220                     <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
221                     <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
222
223                 </group>
224               </search>
225             </field>
226         </record>
227         <record id="purchase_order_tree" model="ir.ui.view">
228             <field name="name">purchase.order.tree</field>
229             <field name="model">purchase.order</field>
230             <field name="type">tree</field>
231             <field name="arch" type="xml">
232                 <tree colors="grey:state=='cancel';blue:state in ('wait','confirmed');red:state in ('except_invoice','except_picking')" string="Purchase Order">
233                     <field name="name" string="Reference"/>
234                     <field name="date_order" string="Order Date"/>
235                     <field name="partner_id"/>
236                     <field name="company_id" groups="base.group_multi_company" widget="selection"/>
237                     <field name="location_id"/>
238                     <field name="minimum_planned_date"/>
239                     <field name="origin"/>
240                     <field name="invoiced_rate" widget="progressbar"/>
241                     <field name="shipped_rate" widget="progressbar"/>
242                     <field name="amount_untaxed" sum="Total Untaxed amount"/>
243                     <field name="amount_total" sum="Total amount"/>
244                     <field name="state"/>
245                 </tree>
246             </field>
247         </record>
248
249         <record id="purchase_rfq" model="ir.actions.act_window">
250             <field name="name">Requests for Quotation</field>
251             <field name="type">ir.actions.act_window</field>
252             <field name="res_model">purchase.order</field>
253             <field name="view_type">form</field>
254             <field name="context">{'search_default_draft': 1}</field>
255             <field name="view_mode">tree,form,graph,calendar</field>
256             <field name="search_view_id" ref="view_purchase_order_filter"/>
257             <field name="help">With the Requests for quotation menu you can create new request for quotations, review existing one and confirm them to order once the supplier offer is approved. When you confirm a RfQ, OpenERP will convert it to a Purchase Order and generate the next steps: draft reception of the products, invoice to control.</field>
258         </record>
259         <menuitem action="purchase_rfq" id="menu_purchase_rfq" parent="menu_procurement_management"
260                 sequence="6" groups="group_purchase_manager,group_purchase_user"/>
261
262         <record id="purchase_form_action" model="ir.actions.act_window">
263             <field name="name">Purchase Orders</field>
264             <field name="type">ir.actions.act_window</field>
265             <field name="res_model">purchase.order</field>
266             <field name="view_mode">tree,form,graph,calendar</field>
267             <field name="context">{'search_default_approved': 1,'search_default_create_uid':uid}</field>
268             <field name="search_view_id" ref="view_purchase_order_filter"/>
269             <field name="help">From the Purchase Orders menu, you can track the status of your orders: products received, invoice received and controlled.
270 </field>
271         </record>
272         <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" />
273
274
275         <record id="purchase_order_line_form" model="ir.ui.view">
276             <field name="name">purchase.order.line.form</field>
277             <field name="model">purchase.order.line</field>
278             <field name="type">form</field>
279             <field name="arch" type="xml">
280                 <form string="Purchase Order Line">
281                     <notebook colspan="4">
282                         <page string="Order Line">
283                             <field colspan="4" context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_id" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,notes)"/>
284                             <field context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" name="product_qty" on_change="product_id_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id,parent.date_order,parent.fiscal_position,date_planned,name,price_unit,notes)"/>
285                             <field name="product_uom" on_change="product_uom_change(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position)"/>
286                             <field colspan="4" name="name"/>
287                             <field name="date_planned" widget="date"/>
288                             <field name="price_unit"/>
289                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
290                             <field name="account_analytic_id" colspan="4" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]" />
291                             <group colspan="4" col="4" groups="base.group_extended">
292                                 <separator colspan="4" string="Taxes"/>
293                                 <field colspan="4" nolabel="1" name="taxes_id"
294                                     domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
295                             </group>
296                         </page>
297                         <page string="Invoicing" groups="base.group_extended">
298                             <separator colspan="4" string="Manual Invoices"/>
299                             <field name="invoiced"/>
300                             <newline/>
301                             <field colspan="4" name="invoice_lines" nolabel="1" widget="many2many"/>
302                         </page>
303                            <page string="Notes">
304                             <field colspan="4" name="notes" nolabel="1"/>
305                         </page>
306                         <page string="History" groups="base.group_extended">
307                                <separator colspan="4" string="Stock Moves"/>
308                                <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
309                         </page>
310                     </notebook>
311                 </form>
312             </field>
313         </record>
314
315         <record id="purchase_order_line_tree" model="ir.ui.view">
316             <field name="name">purchase.order.line.tree</field>
317             <field name="model">purchase.order.line</field>
318             <field name="type">tree</field>
319             <field name="arch" type="xml">
320                 <tree string="Purchase Order Lines">
321                     <field name="order_id"/>
322                     <field name="name"/>
323                     <field name="partner_id" string="Supplier" />
324                     <field name="product_id"/>
325                     <field name="price_unit"/>
326                     <field name="product_qty"/>
327                     <field name="product_uom"/>
328                     <field name="price_subtotal"/>
329                     <field name="date_planned"  widget="date" width="135"/>
330
331
332
333                     <field name="state" invisible="1"/>
334                     <field name="invoiced" invisible="1"/>
335                 </tree>
336             </field>
337         </record>
338         <record id="purchase_order_line_form2" model="ir.ui.view">
339             <field name="name">purchase.order.line.form2</field>
340             <field name="model">purchase.order.line</field>
341             <field name="type">form</field>
342             <field name="priority" eval="20"/>
343             <field name="arch" type="xml">
344                 <form string="Purchase Order Line">
345                     <notebook colspan="4">
346                         <page string="Order Line">
347                                <separator colspan="4" string="General Information"/>
348                              <field name="order_id"/>
349                             <field name="product_id" readonly="1" />
350                             <field name="product_qty" readonly="1" />
351                             <field name="product_uom" readonly="1"/>
352                             <field colspan="4" name="name"/>
353                             <field name="date_planned" widget="date"  readonly="1"/>
354                             <field name="price_unit"/>
355                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
356                             <field name="account_analytic_id" colspan="4" groups="analytic.group_analytic_accounting" domain="[('parent_id','!=',False)]"/>
357                             <group colspan="4" col="4" groups="base.group_extended">
358                                 <separator colspan="4" string="Taxes"/>
359                                 <field colspan="4" nolabel="1" name="taxes_id"
360                                     domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
361                             </group>
362                         </page>
363                         <page string="Invoicing" groups="base.group_extended">
364                             <separator colspan="4" string="Manual Invoices"/>
365                             <field name="invoiced"/>
366                             <newline/>
367                             <field colspan="4" name="invoice_lines" nolabel="1" widget="many2many"/>
368                         </page>
369                          <page string="Notes">
370                             <field colspan="4" name="notes" nolabel="1"/>
371                         </page>
372                         <page string="History" groups="base.group_extended">
373                                <separator colspan="4" string="Stock Moves"/>
374                                <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
375                         </page>
376                     </notebook>
377                 </form>
378             </field>
379         </record>
380           <record id="purchase_order_line_search" model="ir.ui.view">
381             <field name="name">purchase.order.line.search</field>
382             <field name="model">purchase.order.line</field>
383             <field name="type">search</field>
384             <field name="arch" type="xml">
385                 <search string="Search Purchase Order">
386                         <group>
387                         <field name="order_id"/>
388                         <field name="product_id"/>
389                         <field name="partner_id"  string="Supplier"/>
390                         </group>
391                         <newline/>
392                         <group expand="0" string="Group By...">
393                         <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" />
394                         <separator orientation="vertical"/>
395                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" />
396                         <filter icon="terp-gtk-jump-to-rtl" string="Order Reference" domain="[]" context="{'group_by' :'order_id'}"/>
397                         <separator orientation="vertical"/>
398                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by' : 'state'}" />
399                         </group>
400                </search>
401             </field>
402         </record>
403
404         <act_window
405             context="{'search_default_partner_id': [active_id]}"
406             id="act_res_partner_2_purchase_order"
407             name="Purchase Orders"
408             res_model="purchase.order"
409             src_model="res.partner"/>
410
411         <act_window
412             context="{'search_default_product_id': [active_id]}"
413             id="action_purchase_line_product_tree"
414             name="Purchases"
415             res_model="purchase.order.line"
416             src_model="product.product"
417             groups="base.group_extended"/>
418
419
420         <record id="purchase_line_form_action2" model="ir.actions.act_window">
421             <field name="name">Purchase Lines Not Invoiced</field>
422             <field name="type">ir.actions.act_window</field>
423             <field name="res_model">purchase.order.line</field>
424             <field name="domain">[('state','in',('confirmed','done')), ('invoiced', '=', False)]</field>
425             <field name="view_type">form</field>
426             <field name="view_mode">tree,form</field>
427             <field name="search_view_id" ref="purchase_order_line_search"/>
428             <field name="help">If you set the invoicing control on a purchase order as "Manual", you can track here all the purchase order lines for which you did not received the supplier invoice yet. Once you are ready to receive a supplier invoice, you can generate a draft supplier invoice based on the lines from this menu.</field>
429         </record>
430         <record id="purchase_line_form_action_tree2" model="ir.actions.act_window.view">
431             <field eval="1" name="sequence"/>
432             <field name="view_mode">tree</field>
433             <field name="view_id" ref="purchase_order_line_tree"/>
434             <field name="act_window_id" ref="purchase_line_form_action2"/>
435         </record>
436         <record id="purchase_line_form_action_form2" model="ir.actions.act_window.view">
437             <field eval="2" name="sequence"/>
438             <field name="view_mode">form</field>
439             <field name="view_id" ref="purchase_order_line_form2"/>
440             <field name="act_window_id" ref="purchase_line_form_action2"/>
441         </record>
442         <menuitem
443             action="purchase_line_form_action2"
444             id="menu_purchase_line_order_draft"
445             groups="base.group_extended"
446             parent="menu_procurement_management_invoice"
447             sequence="72"/>
448
449         <!--
450             Procurements
451         -->
452
453         <record id="view_procurement_form_inherit" model="ir.ui.view">
454             <field name="name">procurement.order.form.inherit</field>
455             <field name="model">procurement.order</field>
456             <field name="inherit_id" ref="procurement.procurement_form_view"/>
457             <field name="type">form</field>
458             <field name="arch" type="xml">
459                 <xpath expr="/form/notebook/page/field[@name='close_move']" position="before">
460                     <field name="purchase_id"/>
461                 </xpath>
462             </field>
463         </record>
464
465     </data>
466 </openerp>