~asteam/asdaily/dhinesh

« back to all changes in this revision

Viewing changes to openerp/addons/purchase/purchase_view.xml

  • Committer: dhinesh
  • Date: 2014-09-09 07:49:53 UTC
  • Revision ID: p.dhinesh1990escet@gmail.com-20140909074953-mjkzeki2uxryewng
by dhinesh

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<openerp>
 
3
    <data>
 
4
 
 
5
        <!-- Top menu item -->
 
6
        <menuitem name="Purchases"
 
7
            id="base.menu_purchase_root"
 
8
            groups="group_purchase_manager,group_purchase_user"
 
9
            sequence="60"/>
 
10
 
 
11
        <menuitem id="menu_procurement_management" name="Purchase"
 
12
            parent="base.menu_purchase_root" sequence="1" />
 
13
 
 
14
        <menuitem id="menu_purchase_config_purchase" name="Configuration"
 
15
            groups="group_purchase_manager"
 
16
            parent="base.menu_purchase_root" sequence="100"/>
 
17
 
 
18
        <record id="purchase_pricelist_version_action" model="ir.actions.act_window">
 
19
            <field name="name">Pricelist Versions</field>
 
20
            <field name="type">ir.actions.act_window</field>
 
21
            <field name="res_model">product.pricelist.version</field>
 
22
            <field name="view_type">form</field>
 
23
            <field name="view_id" ref="product.product_pricelist_version_tree_view"/>
 
24
            <field name="domain">[('pricelist_id.type','=','purchase')]</field>
 
25
            <field name="help" type="html">
 
26
              <p class="oe_view_nocontent_create">
 
27
                Click to add a pricelist version.
 
28
              </p><p>
 
29
                There can be more than one version of a pricelist, each of
 
30
                these must be valid during a certain period of time. Some
 
31
                examples of versions: Main Prices, 2010, 2011, Summer Sales,
 
32
                etc.
 
33
              </p>
 
34
            </field>
 
35
        </record>
 
36
        <menuitem
 
37
            id="menu_purchase_config_pricelist" name="Pricelists"
 
38
            parent="menu_purchase_config_purchase" sequence="50" groups="product.group_purchase_pricelist"/>
 
39
        <menuitem
 
40
            action="product.product_pricelist_action_for_purchase" id="menu_product_pricelist_action2_purchase"
 
41
            parent="menu_purchase_config_pricelist" sequence="1" groups="product.group_purchase_pricelist" />
 
42
 
 
43
        <menuitem
 
44
            action="product.product_pricelist_action_for_purchase" id="menu_product_pricelist_action2_purchase"
 
45
            parent="menu_purchase_config_pricelist" sequence="1" groups="product.group_purchase_pricelist" />
 
46
 
 
47
        <menuitem
 
48
            action="purchase_pricelist_version_action" id="menu_purchase_pricelist_version_action"
 
49
            parent="menu_purchase_config_pricelist" sequence="2" groups="product.group_purchase_pricelist"/>
 
50
        
 
51
        <menuitem
 
52
            action="product.product_price_type_action" id="menu_product_pricelist_action2_purchase_type"
 
53
            parent="menu_purchase_config_pricelist" sequence="60" />
 
54
        <menuitem
 
55
            id="menu_product_in_config_purchase" name="Products"
 
56
            parent="menu_purchase_config_purchase" sequence="30" groups="base.group_no_one"/>
 
57
 
 
58
        <menuitem
 
59
            action="product.product_category_action_form" id="menu_product_category_config_purchase"
 
60
            parent="purchase.menu_product_in_config_purchase" sequence="1" />
 
61
 
 
62
        <menuitem
 
63
            id="menu_purchase_unit_measure_purchase" name="Units of Measure"
 
64
            parent="purchase.menu_product_in_config_purchase"  sequence="20" groups="product.group_uom"/>
 
65
 
 
66
        <menuitem
 
67
             action="product.product_uom_categ_form_action" id="menu_purchase_uom_categ_form_action"
 
68
             parent="purchase.menu_product_in_config_purchase" sequence="5" />
 
69
 
 
70
        <menuitem
 
71
              action="product.product_uom_form_action" id="menu_purchase_uom_form_action"
 
72
              parent="purchase.menu_product_in_config_purchase" sequence="10"/>
 
73
 
 
74
        <menuitem
 
75
            id="menu_purchase_partner_cat" name="Address Book"
 
76
            parent="menu_purchase_config_purchase"/>
 
77
 
 
78
        <menuitem
 
79
            action="base.action_partner_category_form" id="menu_partner_categories_in_form" name="Partner Tags"
 
80
            parent="purchase.menu_purchase_partner_cat" groups="base.group_no_one"/>
 
81
 
 
82
    <!--Supplier menu-->
 
83
    <menuitem id="base.menu_procurement_management_supplier_name" name="Suppliers"
 
84
        parent="menu_procurement_management"
 
85
        action="base.action_partner_supplier_form" sequence="15"/>
 
86
 
 
87
      <!--Inventory control-->
 
88
      <menuitem id="menu_procurement_management_inventory" name="Incoming Products"
 
89
            parent="base.menu_purchase_root" sequence="4"/>
 
90
      <menuitem action="stock.action_receipt_picking_move" id="menu_action_picking_tree_in_move"
 
91
            parent="menu_procurement_management_inventory" sequence="11"/>
 
92
 
 
93
    <!--Invoice control-->
 
94
    <menuitem id="menu_procurement_management_invoice" name="Invoice Control"
 
95
        parent="base.menu_purchase_root" sequence="6"/>
 
96
 
 
97
    <record id="action_invoice_pending" model="ir.actions.act_window">
 
98
        <field name="name">On Draft Invoices</field>
 
99
        <field name="res_model">account.invoice</field>
 
100
        <field name="view_type">form</field>
 
101
        <field name="view_mode">tree,form,calendar,graph</field>
 
102
        <field eval="False" name="view_id"/>
 
103
        <field name="domain">[('type','=','in_invoice')]</field>
 
104
        <field name="context">{'default_type':'in_invoice', 'type':'in_invoice', 'journal_type': 'purchase', 'search_default_draft': 1}</field>
 
105
        <field name="search_view_id" ref="account.view_account_invoice_filter"/>
 
106
        <field name="help" type="html">
 
107
          <p class="oe_view_nocontent_create">
 
108
            Click to create a draft invoice.
 
109
          </p><p>
 
110
            Use this menu to control the invoices to be received from your
 
111
            supplier. Odoo generates draft invoices from your purchase
 
112
            orders or receipts, according to your settings.
 
113
          </p><p>
 
114
            Once you receive a supplier invoice, you can match it with the
 
115
            draft invoice and validate it.
 
116
          </p>
 
117
        </field>
 
118
    </record>
 
119
 
 
120
 
 
121
    <record id="product_normal_action_puchased" model="ir.actions.act_window">
 
122
        <field name="name">Products</field>
 
123
        <field name="type">ir.actions.act_window</field>
 
124
        <field name="res_model">product.template</field>
 
125
        <field name="view_type">form</field>
 
126
        <field name="view_mode">kanban,tree,form</field>
 
127
        <field name="context">{"search_default_filter_to_purchase":1}</field>
 
128
        <field name="help" type="html">
 
129
          <p class="oe_view_nocontent_create">
 
130
            Click to define a new product.
 
131
          </p><p>
 
132
            You must define a product for everything you purchase, whether
 
133
            it's a physical product, a consumable or services you buy to
 
134
            subcontractants.
 
135
          </p><p>
 
136
            The product form contains detailed information to improve the
 
137
            purchase process: prices, procurement logistics, accounting data,
 
138
            available suppliers, etc.
 
139
          </p>
 
140
        </field>
 
141
    </record>
 
142
 
 
143
 
 
144
     <menuitem
 
145
          id="menu_procurement_management_pending_invoice"
 
146
          action="action_invoice_pending"
 
147
          parent="menu_procurement_management_invoice"
 
148
          sequence="13"/>
 
149
 
 
150
      <!-- Product menu-->
 
151
      <menuitem id="menu_procurement_management_product" name="Products"
 
152
          parent="base.menu_purchase_root" sequence="8"/>
 
153
 
 
154
      <menuitem name="Products by Category" id="menu_product_by_category_purchase_form" action="product.product_category_action"
 
155
           parent="menu_procurement_management_product" sequence="10"/>
 
156
 
 
157
      <menuitem name="Products" id="menu_procurement_partner_contact_form" action="product_normal_action_puchased"
 
158
          parent="menu_procurement_management_product"/>
 
159
 
 
160
        <record model="ir.ui.view" id="purchase_order_calendar">
 
161
            <field name="name">purchase.order.calendar</field>
 
162
            <field name="model">purchase.order</field>
 
163
            <field name="priority" eval="2"/>
 
164
            <field name="arch" type="xml">
 
165
                <calendar string="Calendar View" date_start="minimum_planned_date" color="partner_id">
 
166
                    <field name="name"/>
 
167
                    <field name="amount_total"/>
 
168
                    <field name="partner_id"/>
 
169
                </calendar>
 
170
            </field>
 
171
        </record>
 
172
        <record model="ir.ui.view" id="purchase_order_graph">
 
173
            <field name="name">purchase.order.graph</field>
 
174
            <field name="model">purchase.order</field>
 
175
            <field name="arch" type="xml">
 
176
                <graph string="Purchase Order" type="bar">
 
177
                    <field name="partner_id"/>
 
178
                    <field name="amount_total" operator="+"/>
 
179
                </graph>
 
180
            </field>
 
181
        </record>
 
182
 
 
183
        <record id="purchase_order_form" model="ir.ui.view">
 
184
            <field name="name">purchase.order.form</field>
 
185
            <field name="model">purchase.order</field>
 
186
            <field name="arch" type="xml">
 
187
                <form string="Purchase Order">
 
188
                <header>
 
189
                    <button name="bid_received" states="sent" string="Bid Received" class="oe_highlight"/>
 
190
                    <button name="wkf_send_rfq" states="draft" string="Send RFQ by Email" type="object" context="{'send_rfq':True}" class="oe_highlight"/>
 
191
                    <button name="wkf_send_rfq" states="sent" string="Re-Send RFQ by Email" type="object" context="{'send_rfq':True}"/>
 
192
                    <button name="print_quotation" string="Print RFQ" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
 
193
                    <button name="print_quotation" string="Re-Print RFQ" type="object" states="sent" groups="base.group_user"/>
 
194
                    <button name="purchase_confirm" states="draft" string="Confirm Order" id="draft_confirm"/>
 
195
                    <button name="purchase_confirm" states="bid" string="Confirm Order" class="oe_highlight" id="bid_confirm"/>
 
196
                    <button name="picking_ok" states="except_picking" string="Manually Corrected"/>
 
197
                    <button name="invoice_ok" states="except_invoice" string="Manually Corrected"/>
 
198
                    <button name="purchase_approve" states="confirmed" string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager"/>
 
199
                    <button name="wkf_send_rfq" states="approved" string="Send PO by Email" type="object" context="{'send_rfq':False}"/>
 
200
                    <button name="view_picking" string="Receive Products" type="object" attrs="{'invisible': ['|', ('shipped','=',True), ('state','!=', 'approved')]}" class="oe_highlight"/>
 
201
                    <button name="view_invoice" string="Receive Invoice" type="object" attrs="{'invisible': ['|', ('invoice_method','in', ['picking', 'manual']), '|', ('state','!=', 'approved'), ('invoiced','=',True) ]}" class="oe_highlight"/>
 
202
                    <button name="action_cancel_draft" states="cancel,sent,confirmed" string="Set to Draft" type="object" />
 
203
                    <button name="purchase_cancel" states="draft,confirmed,sent,bid" string="Cancel"/>
 
204
                    <button name="action_cancel" states="approved,except_picking,except_invoice" string="Cancel" type="object" />
 
205
                    <field name="state" widget="statusbar" statusbar_visible="draft,sent,bid,approved,done" statusbar_colors='{"except_picking":"red","except_invoice":"red","confirmed":"blue"}' readonly="1"/>
 
206
                </header>
 
207
                <sheet>
 
208
                    <div class="oe_title">
 
209
                        <h1>
 
210
                            <label string="Request for Quotation " attrs="{'invisible': [('state','not in',('draft','sent','bid'))]}"/>
 
211
                            <label string="Purchase Order " attrs="{'invisible': [('state','in',('draft','sent','bid'))]}"/>
 
212
                            <field name="name" class="oe_inline" readonly="1"/>
 
213
                        </h1>
 
214
                    </div>
 
215
                    <group>
 
216
                        <group>
 
217
                            <field name="partner_id" on_change="onchange_partner_id(partner_id, context)" context="{'search_default_supplier':1, 'default_supplier':1, 'default_customer':0}" domain="[('supplier','=',True)]"/>
 
218
                            <field name="partner_ref"/>
 
219
                            <field domain="[('type','=','purchase')]" name="pricelist_id" groups="product.group_purchase_pricelist" on_change="onchange_pricelist(pricelist_id, context)"/>
 
220
                            <field name="currency_id" groups="base.group_multi_currency"/>
 
221
                            <field name="journal_id" invisible='1'/>
 
222
                        </group>
 
223
                        <group>
 
224
                            <field name="date_order"/>
 
225
                            <field name="origin" attrs="{'invisible': [('origin','=',False)]}"/>
 
226
                            <field name="company_id" groups="base.group_multi_company" widget="selection"/>
 
227
                            <field name="picking_type_id" on_change="onchange_picking_type_id(picking_type_id, context)" domain="[('code','=','incoming')]" widget="selection" context="{'special_shortened_wh_name': True}" groups="stock.group_locations"/>
 
228
                            <field name="related_location_id" invisible="1"/>
 
229
                            <field name="dest_address_id" string="Customer Address" on_change="onchange_dest_address_id(dest_address_id, context)"
 
230
                                attrs="{'invisible':['|', ('picking_type_id','=',False), ('related_location_id','!=', False)], 
 
231
                                'required': [('picking_type_id','!=',False), ('related_location_id','=', False)]}" 
 
232
                                groups="stock.group_locations"/>
 
233
                        </group>
 
234
                    </group>
 
235
                    <notebook>
 
236
                        <page string="Products">
 
237
                            <field name="order_line">
 
238
                                <tree string="Purchase Order Lines" editable="bottom">
 
239
                                    <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,parent.state,context)"/>
 
240
                                    <field name="name"/>
 
241
                                    <field name="date_planned"/>
 
242
                                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
 
243
                                    <field name="account_analytic_id" groups="purchase.group_analytic_accounting" domain="[('type','not in',('view','template'))]"/>
 
244
                                    <field name="product_qty" on_change="onchange_product_id(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id,parent.date_order,parent.fiscal_position,date_planned,name,price_unit,parent.state,context)"/>
 
245
                                    <field name="product_uom" groups="product.group_uom" on_change="onchange_product_uom(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,parent.state,context)"/>
 
246
                                    <field name="price_unit"/>
 
247
                                    <field name="taxes_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
 
248
                                    <field name="price_subtotal"/>
 
249
                                    <field name="state" invisible="1"/>
 
250
                                </tree>
 
251
                            </field>
 
252
                            <group class="oe_subtotal_footer oe_right">
 
253
                                <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}"/>
 
254
                                <field name="amount_tax" widget="monetary" options="{'currency_field': 'currency_id'}"/>
 
255
                                <div class="oe_subtotal_footer_separator oe_inline">
 
256
                                    <label for="amount_total"/>
 
257
                                    <button name="button_dummy"
 
258
                                        states="draft" string="(update)" type="object" class="oe_edit_only oe_link"/>
 
259
                                </div>
 
260
                                <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget="monetary" options="{'currency_field': 'currency_id'}"/>
 
261
                            </group>
 
262
                            <div class="oe_clear"/>
 
263
                            <field name="notes" class="oe_inline" placeholder="Terms and conditions..."/>
 
264
                        </page>
 
265
                        <page string="RFQ &amp; Bid">
 
266
                            <group>
 
267
                                <field name="payment_term_id" widget="selection"/>
 
268
                                <field name="incoterm_id"/>
 
269
                                <field name="bid_date"/>
 
270
                                <field name="bid_validity"/>
 
271
                            </group>
 
272
                        </page>
 
273
                        <page string="Deliveries &amp; Invoices">
 
274
                            <group>
 
275
                                <group>
 
276
                                    <field name="minimum_planned_date"/>
 
277
                                    <field name="location_id" groups="stock.group_locations"/>
 
278
                                    <field name="shipped" groups="base.group_no_one"/>
 
279
                                </group>
 
280
                                <group>
 
281
                                    <field name="invoice_method"/>
 
282
                                    <field name="invoiced"/>
 
283
                                    <field name="payment_term_id" widget="selection"/>
 
284
                                    <field name="fiscal_position" attrs="{'readonly': [('invoiced','=', True)]}" />
 
285
                                    <!-- We do not need these fields anymore, the information is in open chatter -->
 
286
                                    <field name="validator" groups="base.group_no_one"/>
 
287
                                    <field name="date_approve" groups="base.group_no_one"/>
 
288
                                </group>
 
289
                            </group>
 
290
                        </page>
 
291
                    </notebook>
 
292
                </sheet>
 
293
                <div class="oe_chatter">
 
294
                    <field name="message_follower_ids" widget="mail_followers"/>
 
295
                    <field name="message_ids" widget="mail_thread"/>
 
296
                </div>
 
297
                </form>
 
298
            </field>
 
299
        </record>
 
300
 
 
301
       <record id="view_request_for_quotation_filter" model="ir.ui.view">
 
302
            <field name="name">request.quotation.select</field>
 
303
            <field name="model">purchase.order</field>
 
304
            <field name="arch" type="xml">
 
305
                <search string="Search Purchase Order">
 
306
                    <field name="name" string="Reference"/>
 
307
                    <field name="partner_id" operator="child_of"/>
 
308
                    <field name="product_id"/>
 
309
                    <field name="create_uid"/>
 
310
                    <filter name="draft" string="Quotations" domain="[('state','=','draft')]"/>
 
311
                    <filter name="approved" string="Approved" domain="[('state','in',('approved','done'))]"/>
 
312
                    <filter name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]"/>
 
313
                    <separator/>
 
314
                    <filter name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]" help="Purchase orders that include lines not invoiced."/>
 
315
                    <group expand="0" string="Group By">
 
316
                        <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
 
317
                        <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
 
318
                        <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
 
319
                    </group>
 
320
                </search>
 
321
            </field>
 
322
        </record>
 
323
 
 
324
        <record id="view_purchase_order_filter" model="ir.ui.view">
 
325
            <field name="name">purchase.order.list.select</field>
 
326
            <field name="model">purchase.order</field>
 
327
            <field name="arch" type="xml">
 
328
                <search string="Search Purchase Order">
 
329
                    <field name="name" string="Reference"/>
 
330
                    <field name="partner_id" operator="child_of"/>
 
331
                    <field name="product_id"/>
 
332
                    <field name="create_uid"/>
 
333
                    <filter name="draft" string="Quotations" domain="[('state','in',('draft','sent'))]"/>
 
334
                    <filter name="approved" string="Purchase Orders" domain="[('state','not in',('draft','cancel'))]"/>
 
335
                    <filter name="exception" string="Exception" domain="[('state','in',('except_invoice','except_picking'))]"/>
 
336
                    <separator/>
 
337
                    <filter name="not_invoiced" string="Not Invoiced" domain="[('invoice_ids','=', False)]"/>
 
338
                    <separator/>
 
339
                    <filter string="New Mail" name="message_unread" domain="[('message_unread','=',True)]"/>
 
340
                    <group expand="0" string="Group By">
 
341
                        <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
 
342
                        <filter string="Order Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
 
343
                        <filter string="Expected Month" icon="terp-go-month" domain="[]" context="{'group_by':'minimum_planned_date'}"/>
 
344
                    </group>
 
345
                </search>
 
346
            </field>
 
347
        </record>
 
348
 
 
349
        <record id="purchase_order_tree" model="ir.ui.view">
 
350
            <field name="name">purchase.order.tree</field>
 
351
            <field name="model">purchase.order</field>
 
352
            <field name="arch" type="xml">
 
353
                <tree fonts="bold:message_unread==True" colors="grey:state=='cancel';blue:state in ('wait','confirmed');red:state in ('except_invoice','except_picking')" string="Purchase Order">
 
354
                    <field name="message_unread" invisible="1"/>
 
355
                    <field name="name" string="Reference"/>
 
356
                    <field name="date_order" />
 
357
                    <field name="partner_id"/>
 
358
                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
 
359
                    <field name="minimum_planned_date" invisible="context.get('quotation_only', False)"/>
 
360
                    <field name="origin"/>
 
361
                    <field name="amount_untaxed" sum="Total Untaxed amount" string="Untaxed"/>
 
362
                    <field name="amount_total" sum="Total amount"/>
 
363
                    <field name="state"/>
 
364
                </tree>
 
365
            </field>
 
366
        </record>
 
367
 
 
368
        <record id="purchase_rfq" model="ir.actions.act_window">
 
369
            <field name="name">Requests for Quotation</field>
 
370
            <field name="type">ir.actions.act_window</field>
 
371
            <field name="res_model">purchase.order</field>
 
372
            <field name="context">{}</field>
 
373
            <field name="domain">[('state','in',('draft','sent','bid','cancel', 'confirmed'))]</field>
 
374
            <field name="view_mode">tree,form,graph,calendar</field>
 
375
            <field name="search_view_id" ref="view_purchase_order_filter"/>
 
376
            <field name="help" type="html">
 
377
              <p class="oe_view_nocontent_create">
 
378
                Click to create a request for quotation.
 
379
              </p><p>
 
380
                The quotation contains the history of the discussion/negociation
 
381
                you had with your supplier. Once confirmed, a request for
 
382
                quotation is converted into a purchase order.
 
383
              </p><p>
 
384
                Most propositions of purchase orders are created automatically
 
385
                by Odoo based on inventory needs.
 
386
              </p>
 
387
            </field>
 
388
        </record>
 
389
        <menuitem action="purchase_rfq" id="menu_purchase_rfq"
 
390
            parent="menu_procurement_management"
 
391
            sequence="0"/>
 
392
 
 
393
        <record id="purchase_form_action" model="ir.actions.act_window">
 
394
            <field name="name">Purchase Orders</field>
 
395
            <field name="type">ir.actions.act_window</field>
 
396
            <field name="res_model">purchase.order</field>
 
397
            <field name="view_mode">tree,form,graph,calendar</field>
 
398
            <field name="context">{}</field>
 
399
            <field name="domain">[('state','not in',('draft','sent','bid', 'confirmed'))]</field>
 
400
            <field name="search_view_id" ref="view_purchase_order_filter"/>
 
401
            <field name="help" type="html">
 
402
              <p class="oe_view_nocontent_create">
 
403
                Click to create a quotation that will be converted into a purchase order. 
 
404
              </p><p>
 
405
                Use this menu to search within your purchase orders by
 
406
                references, supplier, products, etc. For each purchase order,
 
407
                you can track the related discussion with the supplier, control
 
408
                the products received and control the supplier invoices.
 
409
              </p>
 
410
            </field>
 
411
        </record>
 
412
        <menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" sequence="6"/>
 
413
 
 
414
        <record id="purchase_order_line_form" model="ir.ui.view">
 
415
            <field name="name">purchase.order.line.form</field>
 
416
            <field name="model">purchase.order.line</field>
 
417
            <field name="arch" type="xml">
 
418
                <form string="Purchase Order Line">
 
419
                    <sheet>
 
420
                        <group>
 
421
                            <group>
 
422
                                <field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,0,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,'draft',context)"/>
 
423
                                <label for="product_qty"/>
 
424
                                <div>
 
425
                                    <field name="product_qty" on_change="onchange_product_id(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id,parent.date_order,parent.fiscal_position,date_planned,name,price_unit,'draft',context)" class="oe_inline"/>
 
426
                                    <field name="product_uom" groups="product.group_uom" on_change="onchange_product_uom(parent.pricelist_id,product_id,product_qty,product_uom,parent.partner_id, parent.date_order,parent.fiscal_position,date_planned,name,price_unit,'draft',context)" class="oe_inline"/>
 
427
                                </div>
 
428
                                <field name="price_unit"/>
 
429
                            </group>
 
430
                            <group>
 
431
                                <field name="taxes_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
 
432
                                <field name="date_planned" widget="date"/>
 
433
                                <field name="account_analytic_id" colspan="2" groups="purchase.group_analytic_accounting"/>
 
434
                                <field name="company_id" groups="base.group_multi_company" widget="selection"/>
 
435
                            </group>
 
436
                        </group>
 
437
                        <notebook>
 
438
                        <page string="Notes">
 
439
                            <field name="name"/>
 
440
                        </page><page string="Invoices and Incoming Shipments">
 
441
                            <field name="invoice_lines"/>
 
442
                            <field name="move_ids"/>
 
443
                        </page>
 
444
                        </notebook>
 
445
                    </sheet>
 
446
                </form>
 
447
            </field>
 
448
        </record>
 
449
 
 
450
        <record id="purchase_order_line_tree" model="ir.ui.view">
 
451
            <field name="name">purchase.order.line.tree</field>
 
452
            <field name="model">purchase.order.line</field>
 
453
            <field name="arch" type="xml">
 
454
                <tree string="Purchase Order Lines" create="false">
 
455
                    <field name="order_id"/>
 
456
                    <field name="name"/>
 
457
                    <field name="partner_id" string="Supplier" />
 
458
                    <field name="product_id"/>
 
459
                    <field name="price_unit"/>
 
460
                    <field name="product_qty"/>
 
461
                    <field name="product_uom" groups="product.group_uom"/>
 
462
                    <field name="price_subtotal"/>
 
463
                    <field name="date_planned"  widget="date" width="135"/>
 
464
                    <field name="state" invisible="1"/>
 
465
                    <field name="invoiced" invisible="1"/>
 
466
                </tree>
 
467
            </field>
 
468
        </record>
 
469
        
 
470
        <record id="purchase_order_line_form2" model="ir.ui.view">
 
471
            <field name="name">purchase.order.line.form2</field>
 
472
            <field name="model">purchase.order.line</field>
 
473
            <field name="priority" eval="20"/>
 
474
            <field name="arch" type="xml">
 
475
                <form string="Purchase Order Line" create="false">
 
476
                    <sheet>
 
477
                        <label for="order_id" class="oe_edit_only"/>
 
478
                        <h1>
 
479
                            <field name="order_id" class="oe_inline" domain="[('invoice_method','=','manual')]" />
 
480
                            <label string="," attrs="{'invisible':[('date_order','=',False)]}"/>
 
481
                            <field name="date_order" class="oe_inline"/>
 
482
                        </h1>
 
483
                        <label for="partner_id" class="oe_edit_only"/>
 
484
                        <h2><field name="partner_id"/></h2>
 
485
                        <group>
 
486
                            <group>
 
487
                                <field name="product_id" readonly="1"/>
 
488
                                <label for="product_qty"/>
 
489
                                <div>
 
490
                                    <field name="product_qty" readonly="1" class="oe_inline"/>
 
491
                                    <field name="product_uom" readonly="1" groups="product.group_uom" class="oe_inline"/>
 
492
                                </div>
 
493
                                <field name="price_unit"/>
 
494
                            </group>
 
495
                            <group>
 
496
                                <field name="taxes_id" widget="many2many_tags"
 
497
                                    domain="[('parent_id','=',False),('type_tax_use','!=','sale')]"/>
 
498
                                <field name="date_planned" widget="date" readonly="1"/>
 
499
                                <field name="company_id" groups="base.group_multi_company" widget="selection"/>
 
500
                                <field name="account_analytic_id" colspan="4" groups="purchase.group_analytic_accounting"/>
 
501
                                <field name="invoiced"/>
 
502
                            </group>
 
503
                        </group>
 
504
                        <field name="name"/>
 
505
                        <separator string="Manual Invoices"/>
 
506
                        <field name="invoice_lines"/>
 
507
                        <separator string="Stock Moves"/>
 
508
                        <field name="move_ids"/>
 
509
                    </sheet>
 
510
                </form>
 
511
            </field>
 
512
        </record>
 
513
          <record id="purchase_order_line_search" model="ir.ui.view">
 
514
            <field name="name">purchase.order.line.search</field>
 
515
            <field name="model">purchase.order.line</field>
 
516
            <field name="arch" type="xml">
 
517
                <search string="Search Purchase Order">
 
518
                    <field name="order_id"/>
 
519
                    <field name="product_id"/>
 
520
                    <field name="partner_id" string="Supplier" filter_domain="[('partner_id', 'child_of', self)]"/>
 
521
                    <filter name="hide_cancelled" string="Hide cancelled lines" domain="[('state', '!=', 'cancel')]"/>
 
522
                    <group expand="0" string="Group By">
 
523
                        <filter name="groupby_supplier" string="Supplier" icon="terp-partner" domain="[]" context="{'group_by' : 'partner_id'}" />
 
524
                        <filter name="groupby_product" string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by' : 'product_id'}" />
 
525
                        <filter icon="terp-gtk-jump-to-rtl" string="Order Reference" domain="[]" context="{'group_by' :'order_id'}"/>
 
526
                        <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by' : 'state'}" />
 
527
                    </group>
 
528
                </search>
 
529
            </field>
 
530
        </record>
 
531
 
 
532
        <record id="purchase_line_form_action2" model="ir.actions.act_window">
 
533
            <field name="name">On Purchase Order Lines</field>
 
534
            <field name="type">ir.actions.act_window</field>
 
535
            <field name="res_model">purchase.order.line</field>
 
536
            <field name="domain">[('order_id.invoice_method','&lt;&gt;','picking'), ('state','in',('confirmed','done')), ('invoiced', '=', False)]</field>
 
537
            <field name="view_type">form</field>
 
538
            <field name="view_mode">tree,form</field>
 
539
            <field name="search_view_id" ref="purchase_order_line_search"/>
 
540
            <field name="help" type="html">
 
541
              <p>
 
542
                Here you can track all the lines of purchase orders where the
 
543
                invoicing is "Based on Purchase Order Lines", and for which you
 
544
                have not received a supplier invoice yet. You can generate a
 
545
                draft supplier invoice based on the lines from this list.
 
546
              </p>
 
547
            </field>
 
548
        </record>
 
549
 
 
550
        <record id="purchase_line_form_action_tree2" model="ir.actions.act_window.view">
 
551
            <field eval="1" name="sequence"/>
 
552
            <field name="view_mode">tree</field>
 
553
            <field name="view_id" ref="purchase_order_line_tree"/>
 
554
            <field name="act_window_id" ref="purchase_line_form_action2"/>
 
555
        </record>
 
556
        <record id="purchase_line_form_action_form2" model="ir.actions.act_window.view">
 
557
            <field eval="2" name="sequence"/>
 
558
            <field name="view_mode">form</field>
 
559
            <field name="view_id" ref="purchase_order_line_form2"/>
 
560
            <field name="act_window_id" ref="purchase_line_form_action2"/>
 
561
        </record>
 
562
        <menuitem
 
563
            action="purchase_line_form_action2"
 
564
            id="menu_purchase_line_order_draft"
 
565
            parent="menu_procurement_management_invoice"
 
566
            sequence="72"/>
 
567
 
 
568
        <!-- Procurements -->
 
569
 
 
570
        <record id="view_procurement_form_inherit" model="ir.ui.view">
 
571
            <field name="name">procurement.order.form.inherit</field>
 
572
            <field name="model">procurement.order</field>
 
573
            <field name="inherit_id" ref="procurement.procurement_form_view"/>
 
574
            <field name="arch" type="xml">
 
575
                <xpath expr="//field[@name='origin']" position="after">
 
576
                    <field name="purchase_id"/>
 
577
                </xpath>
 
578
            </field>
 
579
        </record>
 
580
        
 
581
        <!-- Product Suppliers-->
 
582
        
 
583
        <record id="view_product_supplier_inherit" model="ir.ui.view">
 
584
            <field name="name">product.template.supplier.form.inherit</field>
 
585
            <field name="model">product.template</field>
 
586
            <field name="inherit_id" ref="product.product_template_form_view"/>
 
587
            <field name="arch" type="xml">
 
588
                <div name="options" position="inside">
 
589
                    <div>
 
590
                        <field name="purchase_ok"/>
 
591
                        <label for="purchase_ok"/>
 
592
                    </div>
 
593
                </div>
 
594
            </field>
 
595
        </record>
 
596
 
 
597
        <record id="product_template_search_view_purchase" model="ir.ui.view">
 
598
            <field name="name">product.template.search.purchase.form</field>
 
599
            <field name="model">product.template</field>
 
600
            <field name="inherit_id" ref="product.product_template_search_view"/>
 
601
            <field name="arch" type="xml">
 
602
                <filter name="filter_to_sell" position="before">
 
603
                    <filter name="filter_to_purchase" string="To Purchase" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
 
604
                </filter>
 
605
                <filter name="filter_to_sell" position="after">
 
606
                   <filter name="filter_to_purchase" string="Can be Purchased" icon="terp-accessories-archiver+" domain="[('purchase_ok', '=', 1)]"/>
 
607
                </filter>
 
608
            </field>
 
609
        </record>
 
610
 
 
611
        <record model="ir.actions.act_window" id="action_purchase_line_product_tree">
 
612
            <field name="context">{'search_default_product_id': active_id, 'default_product_id': active_id}</field>
 
613
            <field name="name">Purchases</field>
 
614
            <field name="res_model">purchase.order.line</field>
 
615
            <field name="view_id" ref="purchase_order_line_tree"/>
 
616
        </record>
 
617
 
 
618
        <record id="view_product_account_purchase_ok_form" model="ir.ui.view">
 
619
            <field name="name">product.template.account.purchase.ok.form.inherit</field>
 
620
            <field name="model">product.template</field>
 
621
            <field name="inherit_id" ref="account.product_template_form_view"/>
 
622
            <field name="arch" type="xml">
 
623
                <field name="property_account_expense" position="replace" >
 
624
                     <field name="property_account_expense" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]" attrs="{'readonly':[('purchase_ok','=',0)]}" groups="account.group_account_user"/>
 
625
                </field>
 
626
                <field name='supplier_taxes_id' position="replace" >
 
627
                     <field name="supplier_taxes_id" colspan="2" widget="many2many_tags" attrs="{'readonly':[('purchase_ok','=',0)]}"/>
 
628
                </field>
 
629
            </field>
 
630
        </record>
 
631
        
 
632
        <record id="view_product_template_purchase_buttons_from" model="ir.ui.view">
 
633
            <field name="name">product.template.purchase.button.inherit</field>
 
634
            <field name="model">product.template</field>
 
635
            <field name="inherit_id" ref="product.product_template_only_form_view"/>
 
636
            <field name="groups_id" eval="[(4, ref('purchase.group_purchase_user'))]"/>
 
637
            <field name="arch" type="xml">
 
638
                <xpath expr="//div[@name='buttons']" position="inside">
 
639
                   <button class="oe_inline oe_stat_button" name="action_view_purchases" type="object" 
 
640
                       icon="fa-shopping-cart">
 
641
                       <field string="Purchases" name="purchase_count" widget="statinfo"/>
 
642
                   </button>
 
643
                </xpath>
 
644
            </field>
 
645
        </record>
 
646
        
 
647
        <record id="view_product_normal_purchase_buttons_from" model="ir.ui.view">
 
648
            <field name="name">product.product.purchase.button.inherit</field>
 
649
            <field name="model">product.product</field>
 
650
            <field name="inherit_id" ref="product.product_normal_form_view"/>
 
651
            <field name="groups_id" eval="[(4, ref('purchase.group_purchase_user'))]"/>
 
652
            <field name="arch" type="xml">
 
653
                <xpath expr="//div[@name='buttons']" position="inside">
 
654
                   <button class="oe_inline oe_stat_button" name="%(action_purchase_line_product_tree)d" type="action" 
 
655
                       icon="fa-shopping-cart">
 
656
                       <field string="Purchases" name="purchase_count" widget="statinfo"/>
 
657
                   </button>
 
658
                </xpath>
 
659
            </field>
 
660
        </record>
 
661
    </data>
 
662
</openerp>