1 <?xml version="1.0" encoding="utf-8"?>
4 <menuitem icon="terp-purchase" id="menu_purchase_root" name="Purchase Management"
5 groups="group_purchase_user"/>
7 <record model="ir.ui.view" id="purchase_order_calendar">
8 <field name="name">purchase.order.calendar</field>
9 <field name="model">purchase.order</field>
10 <field name="type">calendar</field>
11 <field name="priority" eval="2"/>
12 <field name="arch" type="xml">
13 <calendar string="Calendar View" date_start="minimum_planned_date" color="partner_id">
15 <field name="amount_total"/>
16 <field name="partner_id"/>
20 <record model="ir.ui.view" id="view_purchase_order_graph">
21 <field name="name">purchase.order.graph</field>
22 <field name="model">purchase.order</field>
23 <field name="type">graph</field>
24 <field name="arch" type="xml">
25 <graph string="Purchase Order" type="bar">
26 <field name="partner_id"/>
27 <field name="amount_total" operator="+"/>
32 <record id="purchase_order_form" model="ir.ui.view">
33 <field name="name">purchase.order.form</field>
34 <field name="model">purchase.order</field>
35 <field name="type">form</field>
36 <field name="arch" type="xml">
37 <form string="Purchase Order">
38 <group col="6" colspan="4">
39 <field name="name" select="1"/>
40 <field name="date_order" select="2"/>
41 <field name="invoiced" select="2"/>
43 <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id)"/>
44 <field name="origin" select="2"/>
45 <field name="shipped" select="2"/>
47 <notebook colspan="4">
48 <page string="Purchase Order">
49 <field name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" domain="[('supplier','=', 1)]"/>
50 <field name="partner_address_id"/>
51 <field domain="[('type','=','purchase')]" name="pricelist_id"/>
52 <field name="partner_ref" select="2"/>
54 <field colspan="4" name="order_line" nolabel="1" mode="tree,form">
55 <tree colors="red:date_planned<=current_date" string="Purchase Order Lines">
56 <field name="date_planned"/>
58 <field name="product_id"/>
59 <field name="product_qty"/>
60 <field name="product_uom"/>
61 <field name="price_unit"/>
62 <field name="price_subtotal"/>
64 <!-- default form view -->
66 <group col="7" colspan="4">
67 <field name="amount_untaxed" sum="Untaxed amount"/>
68 <field name="amount_tax"/>
69 <field name="amount_total" sum="Total amount"/>
70 <button name="button_dummy" states="draft" string="Compute" type="object"/>
72 <group col="11" colspan="4">
73 <field name="state" readonly="1"/>
74 <button name="purchase_confirm" states="draft" string="Confirm Purchase Order" icon="gtk-execute"/>
75 <button name="purchase_appbuyer" states="wait_auth" string="Approve Purchase" icon="gtk-ok"/>
76 <button name="purchase_approve" states="confirmed" string="Approved by Supplier" icon="gtk-ok"/>
77 <button name="purchase_cancel" states="draft,confirmed,wait_auth" string="Cancel Purchase Order" icon="gtk-cancel"/>
78 <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object" icon="gtk-convert"/>
79 <button name="action_cancel" states="approved,except_picking,except_invoice" string="Cancel Purchase Order" type="object" icon="gtk-cancel"/>
81 <button name="picking_ok" states="except_picking" string="Manually Corrected" icon="gtk-convert"/>
82 <button name="invoice_ok" states="except_invoice" string="Manually Corrected" icon="gtk-convert"/>
85 <page string="Delivery & Invoices" groups="account.group_account_user">
86 <group colspan="2" col="2">
87 <separator string="Delivery" colspan="2"/>
88 <field name="dest_address_id" on_change="onchange_dest_address_id(dest_address_id)"/>
89 <field name="minimum_planned_date"/>
90 <field name="location_id"/>
92 <group colspan="2" col="2">
93 <separator string="Invoice Control" colspan="2"/>
94 <field name="invoice_method"/>
95 <field name="invoice_id" readonly="1"/>
96 <field name="fiscal_position" groups="base.group_extended"/>
99 <separator string="Purchase Control" colspan="4"/>
100 <field name="validator"/>
101 <field name="date_approve"/>
103 <page string="Notes">
104 <field colspan="4" name="notes" nolabel="1"/>
111 <record id="purchase_form_action" model="ir.actions.act_window">
112 <field name="name">Purchase Orders</field>
113 <field name="type">ir.actions.act_window</field>
114 <field name="res_model">purchase.order</field>
115 <field name="view_mode">tree,form,calendar,graph</field>
117 <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="purchase.menu_purchase_root"/>
119 <record id="purchase_form_action2" model="ir.actions.act_window">
120 <field name="name">Request For Quotations</field>
121 <field name="type">ir.actions.act_window</field>
122 <field name="res_model">purchase.order</field>
123 <field name="domain">[('state','=','draft')]</field>
124 <field name="view_type">form</field>
125 <field name="view_mode">tree,form,calendar,graph</field>
127 <menuitem action="purchase_form_action2" id="menu_purchase_order_draft" parent="purchase.menu_purchase_form_action"/>
129 <record id="purchase_form_action3" model="ir.actions.act_window">
130 <field name="name">Purchase Order Waiting Approval</field>
131 <field name="type">ir.actions.act_window</field>
132 <field name="res_model">purchase.order</field>
133 <field name="view_type">form</field>
134 <field name="view_mode">tree,form,calendar,graph</field>
135 <field name="domain">[('state','=','confirmed')]</field>
137 <menuitem action="purchase_form_action3" id="menu_purchase_form_action3" parent="purchase.menu_purchase_form_action"/>
139 <record id="purchase_form_action4" model="ir.actions.act_window">
140 <field name="name">Purchase Orders in Progress</field>
141 <field name="type">ir.actions.act_window</field>
142 <field name="res_model">purchase.order</field>
143 <field name="view_type">form</field>
144 <field name="view_mode">tree,form,calendar,graph</field>
145 <field name="domain">[('state','=','approved')]</field>
147 <menuitem action="purchase_form_action4" id="menu_purchase_form_action4" parent="purchase.menu_purchase_form_action"/>
149 <record id="purchase_form_action_new" model="ir.actions.act_window">
150 <field name="name">New Purchase Order</field>
151 <field name="type">ir.actions.act_window</field>
152 <field name="res_model">purchase.order</field>
153 <field name="view_mode">form,tree</field>
155 <menuitem action="purchase_form_action_new" id="menu_purchase_form_action_new" parent="purchase.menu_purchase_root"/>
158 <record id="purchase_order_tree" model="ir.ui.view">
159 <field name="name">purchase.order.tree</field>
160 <field name="model">purchase.order</field>
161 <field name="type">tree</field>
162 <field name="arch" type="xml">
163 <tree string="Purchase Order">
164 <field name="name" string="Reference"/>
165 <field name="date_order"/>
166 <field name="minimum_planned_date"/>
167 <field name="partner_id"/>
168 <field name="location_id"/>
169 <field name="invoiced_rate" widget="progressbar"/>
170 <field name="shipped_rate" widget="progressbar"/>
171 <field name="amount_untaxed"/>
172 <field name="origin"/>
173 <field name="state"/>
178 <record id="purchase_order_line_form" model="ir.ui.view">
179 <field name="name">purchase.order.line.form</field>
180 <field name="model">purchase.order.line</field>
181 <field name="type">form</field>
182 <field name="arch" type="xml">
183 <form string="Purchase Order Line">
184 <notebook colspan="4">
185 <page string="Order Line">
186 <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)"/>
187 <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)"/>
188 <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)"/>
189 <field colspan="4" name="name"/>
190 <field name="date_planned"/>
191 <field name="price_unit"/>
193 <field name="price_subtotal" readonly="1"/>
195 <page string="Notes">
196 <field colspan="4" name="notes" nolabel="1"/>
198 <page string="History" groups="base.group_extended,stock.group_stock_user">
199 <separator colspan="4" string="Stock Moves"/>
200 <field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
202 <page string="Invoicing" groups="account.group_account_user">
203 <field name="account_analytic_id" colspan="4"/>
204 <separator colspan="4" string="Taxes"/>
205 <field colspan="4" nolabel="1" name="taxes_id" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
212 <record id="purchase_order_line_tree" model="ir.ui.view">
213 <field name="name">purchase.order.line.tree</field>
214 <field name="model">purchase.order.line</field>
215 <field name="type">tree</field>
216 <field name="arch" type="xml">
217 <tree colors="red:date_planned<=current_date" string="Purchase Order Lines">
218 <field name="order_id"/>
220 <field name="date_planned"/>
221 <field name="product_id"/>
222 <field name="product_qty"/>
223 <field name="product_uom"/>
224 <field name="price_unit"/>
225 <field name="price_subtotal"/>
231 context="{'partner_id': active_id}"
232 domain="[('partner_id', '=', active_id)]"
233 id="act_res_partner_2_purchase_order"
234 name="Purchase orders"
235 res_model="purchase.order"
236 src_model="res.partner"/>
239 domain="[('product_id','=',active_id)]"
240 id="action_purchase_line_product_tree"
241 name="Product purchases"
242 res_model="purchase.order.line"
243 src_model="product.product"/>