~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to purchase_override/purchase_view.xml

  • Committer: Olivier DOSSMANN
  • Date: 2013-05-31 14:22:09 UTC
  • mto: This revision was merged to the branch mainline in revision 1687.
  • Revision ID: od@tempo-consulting.fr-20130531142209-sbcwvzuema11guzz
UF-1991 [FIX] Problem with wizard on "msg" field. Change it to "name".

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
 
 
6
        <record id="purchase_order_line_form_view_over" model="ir.ui.view">
 
7
            <field name="name">purchase.order.line.form.view.over</field>
 
8
            <field name="model">purchase.order.line</field>
 
9
            <field name="type">form</field>
 
10
            <field name="inherit_id" ref="purchase.purchase_order_line_form" />
 
11
            <field name="arch" type="xml">
 
12
                <data>
 
13
                    <xpath expr="/form/notebook//page[@string='History']" position="replace">
 
14
                    </xpath>
 
15
                    <xpath expr="/form/notebook//page[@string='Invoicing']" position="replace">
 
16
                    </xpath>
 
17
                </data>
 
18
            </field>
 
19
        </record>
 
20
    
 
21
        <record id="purchase_order_type_form_view" model="ir.ui.view">
 
22
            <field name="name">purchase.order.type.form.view</field>
 
23
            <field name="model">purchase.order</field>
 
24
            <field name="type">form</field>
 
25
            <field name="inherit_id" ref="purchase.purchase_order_form" />
 
26
            <field name="arch" type="xml">
 
27
                <data>
 
28
                    <xpath expr="/form/group/field[@name='partner_ref']" position="attributes">
 
29
                        <attribute name="attrs">{'readonly': ['|', ('partner_type', 'not in', ['external', 'esc']), ('state', 'not in', ['draft', 'confirmed'])]}</attribute>
 
30
                    </xpath>
 
31
                    <xpath expr="/form/notebook//page[@string='Delivery &amp; Invoicing']/group[2]" position="replace" >
 
32
                    </xpath>
 
33
 
 
34
                    <xpath expr="/form/notebook//page[@string='Delivery &amp; Invoicing']//separator[@string='Purchase Control']" position="replace" >
 
35
                    </xpath>
 
36
                    <xpath expr="/form/notebook//page[@string='Delivery &amp; Invoicing']//field[@name='validator']" position="attributes" >
 
37
                        <attribute name="invisible">1</attribute>
 
38
                    </xpath>
 
39
                    <xpath expr="/form/notebook//page[@string='Delivery &amp; Invoicing']//field[@name='date_approve']" position="attributes" >
 
40
                        <attribute name="invisible">1</attribute>
 
41
                    </xpath>
 
42
 
 
43
                    <xpath expr="/form/notebook//page[@string='Delivery &amp; Invoicing']//separator[@string='Invoices']" position="replace" >
 
44
                    </xpath>
 
45
                    <xpath expr="/form/notebook//page[@string='Delivery &amp; Invoicing']//field[@name='invoice_ids']" position="replace" >
 
46
                    </xpath>
 
47
 
 
48
 
 
49
                   <xpath expr="/form/notebook/page[@string='Notes']" position="before" >
 
50
                        <page string="Invoices" > 
 
51
                            <group colspan="2" col="2">
 
52
                                <separator string="Invoice Control" colspan="2"/>
 
53
                                <field name="invoice_method"/>
 
54
                                <field name="fiscal_position" widget="selection"/>
 
55
                            </group>
 
56
                            <separator string="Invoices" colspan="4"/>
 
57
                            <newline/>
 
58
                            <field name="invoice_ids" nolabel="1" colspan="4" context="{'type':'in_invoice', 'journal_type': 'purchase'}"/>
 
59
                        </page>
 
60
                   </xpath>
 
61
 
 
62
                    <xpath expr="/form//field[@name='warehouse_id']" position="replace">
 
63
                        <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id,order_type,dest_address_id)" widget="selection"/>
 
64
                    </xpath>
 
65
 
 
66
                    <xpath expr="/form/notebook/page[@string='Purchase Order']/field[@name='partner_id']" position="replace">
 
67
                        <field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1}" domain="[('id', '!=', company_id)]" />
 
68
                        <field name="allocation_setup" invisible="1" />
 
69
                    </xpath>
 
70
 
 
71
                    <xpath expr="/form/group/field[@name='company_id']" position="before">
 
72
                        <field name="order_type" on_change="onchange_internal_type(order_type, partner_id, categ, dest_partner_id, warehouse_id, delivery_requested_date)" />
 
73
                        <field name="priority" />
 
74
                        <newline />
 
75
                        <field name="categ" />
 
76
                        <field name="details" />
 
77
                        <newline />
 
78
                        <field name="loan_duration" attrs="{'invisible': [('order_type', '!=', 'loan')], 'required': [('order_type', '=', 'loan')]}" />
 
79
                    </xpath>
 
80
                    <xpath expr="/form/notebook/page//field[@name='invoice_method']" position="replace">
 
81
                        <field name="invoice_method" attrs="{'invisible': [('order_type', 'in', ['donation_exp', 'donation_st', 'in_kind', 'loan'])]}" />
 
82
                        <field name="unallocation_ok" attrs="{'readonly': ['|', ('cross_docking_ok', '=', True), ('allocation_setup', '!=', 'mixed')]}" />
 
83
                    </xpath>
 
84
                    <xpath expr="/form/notebook//field[@name='dest_address_id']" position="replace">
 
85
                        <field name="dest_partner_id" attrs="{'invisible': [('order_type', '!=', 'direct')], 'required': [('order_type', '=', 'direct')], 'readonly': [('state', 'not in', ['draft', 'confirmed'])]}"
 
86
                            on_change="on_change_dest_partner_id(dest_partner_id)" />
 
87
                        <field name="dest_address_id" domain="[('partner_id', '=', dest_partner_id)]" attrs="{'required': [('order_type', '=', 'direct')], 'readonly': [('state', 'not in', ['draft', 'confirmed'])]}" />
 
88
                    </xpath>
 
89
                    <xpath expr="/form/notebook//field[@name='fiscal_position']" position="after">
 
90
                        <field name="invoice_address_id"
 
91
                            domain="[('partner_id', 'in', [dest_partner_id, company_id])]"
 
92
                            context="contact_display='partner_address'"
 
93
                            attrs="{'required': [('order_type', '=', 'direct')], 'readonly': [('state', 'not in', ['draft', 'confirmed'])]}"
 
94
                            />
 
95
                    </xpath>
 
96
 
 
97
                    <xpath expr="/form/notebook//tree//field[@name='price_subtotal']" position="after">
 
98
                        <field name="rfq_ok" invisible="1" />
 
99
                        <field name="fake_state" invisible="1" />
 
100
                        <field name="order_state_purchase_order_line" invisible="True" />
 
101
                        <button string="Split line" icon="terp-stock_effects-object-colorize" name="open_split_wizard" type="object" 
 
102
                            attrs="{'invisible': ['|', ('rfq_ok', '=', True), ('order_state_purchase_order_line', 'not in', ('draft', 'wait', 'confirmed'))]}" />
 
103
                    </xpath>
 
104
 
 
105
                    <xpath expr="/form//field[@name='state']" position="after">
 
106
                        <button name="dpo_received"
 
107
                            string="Validate the reception"
 
108
                            icon="terp-camera_test"
 
109
                            attrs="{'invisible': ['|', ('state', '!=', 'approved'), ('order_type', '!=', 'direct')]}" 
 
110
                            />
 
111
                    </xpath>
 
112
                </data>
 
113
            </field>
 
114
        </record>
 
115
        
 
116
        <record id="purchase.purchase_order_tree" model="ir.ui.view">
 
117
            <field name="name">purchase.order.type.tree.view</field>
 
118
            <field name="model">purchase.order</field>
 
119
            <field name="type">tree</field>
 
120
            <field name="arch" type="xml">
 
121
                <tree string="Purchase Orders"
 
122
                      colors="grey:state=='cancel';blue:state in ('wait','confirmed');red:state in ('except_invoice','except_picking')">
 
123
                      <field name="name" string="Reference" />
 
124
                      <field name="order_type" />
 
125
                      <field name="priority" />
 
126
                      <field name="categ" />
 
127
                      <field name="date_order" />
 
128
                      <field name="partner_ref" />
 
129
                      <field name="partner_id" string="Supplier" />
 
130
                      <field name="delivery_requested_date" />
 
131
                      <field name="origin" />
 
132
                      <field name="shipped_rate" widget="progressbar" />
 
133
                      <field name="invoiced_rate" widget="progressbar" />
 
134
                      <field name="amount_total" sum="Total amount" />
 
135
                      <field name="pricelist_id" string="Currency" />
 
136
                      <field name="state" />
 
137
                </tree>
 
138
            </field>
 
139
        </record>
 
140
        
 
141
        <record id="purchase.view_purchase_order_filter" model="ir.ui.view">
 
142
            <field name="name">purchase.view.purchase.order.filter</field>
 
143
            <field name="model">purchase.order</field>
 
144
            <field name="type">search</field>
 
145
            <field name="arch" type="xml">
 
146
                <search string="Search Purchase Orders">
 
147
                    <group col="8" colspan="4">
 
148
                      <filter icon="terp-document-new" name="draft" string="Draft" domain="[('state', 'in', ['draft'])]" separator="1" help="Purchase orders which are in draft state" />
 
149
                      <filter icon="terp-camera_test" name="confirmed" string="Validated" domain="[('state','in',['confirmed','wait'])]" separator="1" help="Purchase orders which are in validated state." />
 
150
                      <filter icon="gtk-paste-v" name="sourced" string="Sourced" domain="[('state','=','sourced')]" separator="1" />
 
151
                      <filter icon="terp-check" name="confirmed_wait" string="Confirmed (waiting)" domain="[('state', 'in', ['confirmed_wait'])]" separator="1" help="Purchase orders which are in approved state." />
 
152
                      <filter icon="terp-check" name="approved" string="Confirmed" domain="[('state', 'in', ['approved'])]" separator="1" help="Purchase orders which are in approved state." />
 
153
                      <filter icon="gtk-close" name="done" string="Closed" domain="[('state', 'in', ['done'])]" separator="1" help="Purchase orders which are in done state." />
 
154
                      <separator orientation="vertical" />
 
155
                      <filter icon="gtk-missing-image" name="inactive" string="Show Split" domain="[('state','=','split')]" context="{'active_test': False}" separator="1" />
 
156
                      <separator orientation="vertical" />
 
157
                      <filter icon="gtk-cancel" name="cancelled" string="Cancelled" domain="[('state', 'in', ['cancel'])]" separator="1" help="Purchase orders which are in cancelled state." />
 
158
                      <separator orientation="vertical" />
 
159
                      <filter icon="terp-emblem-important" name="exception" string="Exception" domain="[('state', 'in', ['except_invoice', 'except_picking'])]" separator="1" help="Purchase orders which are in the exception state." />
 
160
                      <separator orientation="vertical" />
 
161
                      <field name="name" select="1" string="Reference" />
 
162
                      <field name="partner_id" select="1" string="Supplier" />
 
163
                      <field name="partner_ref" select="1" string="Supplier Ref." />
 
164
                    </group>
 
165
                    <newline />
 
166
                    <group>
 
167
                      <field name="product_id" />
 
168
                      <field name="origin" />
 
169
                      <field name="create_uid" />
 
170
                      <field name="date_order" />
 
171
                    </group>
 
172
                    <newline />
 
173
                    <group string="Type" expand="0">
 
174
                          <filter icon="terp-check" string="Regular" domain="[('order_type','=','regular')]" />
 
175
                          <filter icon="terp-stage" string="Donation before expiry" domain="[('order_type','=','donation_exp')]" />
 
176
                          <filter icon="terp-gtk-jump-to-ltr" string="Standard Donation" domain="[('order_type','=','donation_st')]" />
 
177
                          <filter icon="terp-partner" string="Loan" domain="[('order_type','=','loan')]" />
 
178
                          <filter icon="terp-gtk-jump-to-rtl" string="In-Kind donation" domain="[('order_type','=','in_kind')]" />
 
179
                          <filter icon="terp-purchase" string="Purchase List" domain="[('order_type','=','purchase_list')]" />
 
180
                          <filter icon="terp-crm" string="Direct PO" domain="[('order_type','=','direct')]" />
 
181
                        </group>
 
182
                        <newline />
 
183
                        <group string="Priority" expand="0">
 
184
                      <filter icon="gtk-dialog-warning" string="Emergency" domain="[('priority','=','emergency')]"/>
 
185
                      <filter icon="gtk-yes" string="Normal" domain="[('priority','=','normal')]"/>
 
186
                      <filter icon="gtk-info" string="Priority" domain="[('priority','=','priority')]"/>
 
187
                        </group>
 
188
                        <newline />
 
189
                        <group string="Category" expand="0">
 
190
                      <filter icon="gtk-color-picker" string="Medical" domain="[('categ','=','medical')]"/>
 
191
                      <filter icon="terp-stock" string="Logistic" domain="[('categ','=','log')]"/>
 
192
                      <filter icon="terp-purchase" string="Service" domain="[('categ','=','service')]"/>
 
193
                      <filter icon="gtk-quit" string="Transport" domain="[('categ','=','transport')]"/>
 
194
                      <filter icon="gtk-harddisk" string="Other" domain="[('categ','=','other')]"/>                            
 
195
                        </group>
 
196
                    <newline />
 
197
                    <group expand="0" string="Group By..." colspan="4" col="10">
 
198
                      <filter string="Order Type" icon="terp-rating-rated" domain="[]" context="{'group_by':'order_type'}"/>
 
199
                      <separator orientation="vertical" />
 
200
                      <filter string="Priority" icon="terp-project" domain="[]" context="{'group_by': 'priority'}" />
 
201
                      <separator orientation="vertical" />
 
202
                      <filter string="Category" icon="terp-translate" domain="[]" context="{'group_by':'categ'}"/>
 
203
                      <separator orientation="vertical" />
 
204
                      <filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
 
205
                      <separator orientation="vertical" />
 
206
                      <filter string="Origin" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
 
207
                      <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
 
208
                      <separator orientation="vertical" />
 
209
                      <filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
 
210
                      <filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'delivery_requested_date'}" />
 
211
                    </group>
 
212
                </search>
 
213
            </field>
 
214
        </record>
 
215
        
 
216
        <record id="purchase.purchase_form_action" model="ir.actions.act_window">
 
217
            <field name="name">Purchase Orders</field>
 
218
            <field name="type">ir.actions.act_window</field>
 
219
            <field name="res_model">purchase.order</field>
 
220
            <field name="view_mode">tree,form,graph,calendar</field>
 
221
            <field name="context">{'search_default_approved': 1,'search_default_create_uid':uid, 'purchase_order': True}</field>
 
222
            <field name="domain">[('tender_id', '=', False)]</field>
 
223
            <field name="search_view_id" ref="purchase.view_purchase_order_filter"/>
 
224
            <field name="help">Use this menu to search within your purchase orders by references, supplier, products, etc. For each purchase order, you can track the products received, and control the supplier invoices.</field>
 
225
        </record>
 
226
 
 
227
        <!-- REWORK THE PURCHASE MENU − SEE UF-657 - ERGONOMIC REQUIREMENTS -->
 
228
        <!-- Purchase Management -->
 
229
        <menuitem id="purchase.menu_purchase_form_action" 
 
230
                  action="purchase.purchase_form_action"
 
231
                  sequence="1" 
 
232
                  parent="purchase.menu_procurement_management" />
 
233
 
 
234
        <menuitem id="purchase.menu_purchase_rfq" 
 
235
                  action="purchase.purchase_rfq"
 
236
                  sequence="2" 
 
237
                  parent="purchase.menu_procurement_management" />
 
238
 
 
239
        <menuitem id="base.menu_procurement_management_supplier_name"
 
240
                  action="base.action_partner_supplier_form"
 
241
                  sequence="4"
 
242
                  parent="purchase.menu_procurement_management" />
 
243
 
 
244
        <menuitem id="base.menu_purchase_root" sequence="2" />
 
245
 
 
246
        <!-- Address Book -->
 
247
        <menuitem id="base.menu_procurement_management_supplier"
 
248
                  name="Address Book"
 
249
                  parent="purchase.menu_purchase_config_purchase" />
 
250
 
 
251
        <record id="action_supplier_address_form" model="ir.actions.act_window">
 
252
            <field name="name">Addresses</field>
 
253
            <field name="type">ir.actions.act_window</field>
 
254
            <field name="res_model">res.partner.address</field>
 
255
            <field name="view_type">form</field>
 
256
            <field name="context">{"search_default_supplier":1}</field>
 
257
            <field name="search_view_id" ref="base.view_res_partner_address_filter" />
 
258
            <field name="help">Suppliers (also called Partners in other areas of the system) helps you manage your address book of companies whether they are prospects, customers and/or suppliers. The partner form allows you to track and record all the necessary information to interact with your partners from the company address to their contacts as well as pricelists, and much more. If you installed the CRM, with the history tab, you can track all the interactions with a partner such as opportunities, emails, or sales orders issued.</field>
 
259
        </record>
 
260
 
 
261
        <record id="purchase_order_line_form_view_inherit" model="ir.ui.view">
 
262
            <field name="name">purchase.order.line.form.view</field>
 
263
            <field name="model">purchase.order.line</field>
 
264
            <field name="type">form</field>
 
265
            <field name="inherit_id" ref="purchase.purchase_order_line_form" />
 
266
            <field name="arch" type="xml">
 
267
                <data>
 
268
                    <xpath expr="/form//field[@name='product_id']" position="replace">
 
269
                        <field name="product_id" colspan="4" 
 
270
                            context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" 
 
271
                            on_change="product_id_on_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,parent.state,old_price_unit,nomen_manda_0,comment,context)"
 
272
                            domain="[('purchase_type', '=', parent.categ)]" />
 
273
                    </xpath>
 
274
 
 
275
                    <xpath expr="/form//field[@name='price_unit']" position="replace">
 
276
                        <field name="rfq_ok" invisible="1" />
 
277
                        <field name="state" invisible="1" />
 
278
                        <field name="fake_id" invisible="1" />
 
279
                        <field name="change_price_ok" invisible="1" />
 
280
                        <field name="old_price_unit" invisible="1" />
 
281
                        <field name="price_unit" 
 
282
                            on_change="price_unit_change(fake_id, price_unit, product_id, product_uom, product_qty, parent.pricelist_id, parent.partner_id, parent.date_order, change_price_ok, parent.state, old_price_unit, nomen_manda_0, comment, context)" />
 
283
                    </xpath>
 
284
 
 
285
                </data>
 
286
            </field>
 
287
        </record>
 
288
        
 
289
        <!-- Modify the view of the merge PO wizard -->
 
290
        <record id="inherit_view_purchase_order_group" model="ir.ui.view">
 
291
            <field name="name">Merger Purchase Orders</field>
 
292
            <field name="model">purchase.order.group</field>
 
293
            <field name="inherit_id" ref="purchase.view_purchase_order_group" />
 
294
            <field name="arch" type="xml">
 
295
                <xpath expr="/form//label" position="replace">
 
296
                    <group colspan="4">
 
297
                        <html>
 
298
                            <p>Please note that: </p>
 
299
                            <p style="margin-left:10px">Orders will only be merged if: </p>
 
300
                            <p style="margin-left:20px">* Purchase Orders are in draft</p>
 
301
                            <p style="margin-left:20px">* Purchase Orders belong to the same supplier and the same currency</p>
 
302
                        </html>
 
303
                    </group>
 
304
                    <separator colspan="4" />
 
305
                    <group colspan="4">
 
306
                        <field name="po_value_id" readonly="1" colspan="2" />
 
307
                        <newline />
 
308
                        <html colspan="4">
 
309
                            <p>All information of the PO template will be written in the new PO,</p>
 
310
                            <p>except the Delivery Requested date which will be the earliest date of all POs.</p>
 
311
                        </html>
 
312
                    </group>
 
313
                 </xpath>
 
314
            </field>
 
315
        </record>
 
316
 
 
317
        <record id="purchase_order_confirm_wizard" model="ir.ui.view">
 
318
            <field name="name">purchase.order.confirm.wizard</field>
 
319
            <field name="model">purchase.order.confirm.wizard</field>
 
320
            <field name="type">form</field>
 
321
            <field name="arch" type="xml">
 
322
                <form string="Warning on confirmation">
 
323
                    <separator colspan="4" string="Purchase Order" />
 
324
                    <field name="order_id" colspan="4" />
 
325
                    <separator colspan="4" string="Warning" />
 
326
                    <field name="errors" colspan="4" nolabel="1" />
 
327
                    <separator colspan="4" string="Actions" />
 
328
                    <button special="cancel" icon="gtk-cancel" string="Close window" colspan="1" />
 
329
                    <button type="object" name="validate_order" icon="terp-check" string="Confirm" colspan="3" />
 
330
                </form>
 
331
            </field>
 
332
        </record>
 
333
        
 
334
        <!-- Invoice control -->
 
335
        <menuitem id="purchase.menu_action_stock_move_report_po" parent="stock.next_id_61" />
 
336
 
 
337
        <!-- Invoice control -->
 
338
        <!-- MOVED THIS BLOCK TO hidden_menu.xml === DO NOT HARD DELETE MenuItem -->
 
339
        
 
340
<!--
 
341
        <delete model="ir.ui.menu" id="purchase.menu_purchase_config_pricelist" />
 
342
        <delete model="ir.ui.menu" id="purchase.menu_product_in_config_purchase" />
 
343
    used in useability_dashboard_and_menu/menu/supply_config_menu.xml
 
344
-->
 
345
<!--        <delete model="ir.ui.menu" id="purchase.action_supplier_address_form" /> -->
 
346
 
 
347
        <!-- Here was an act_window to display all PO from products views.
 
348
             This action is defined on product_attributes module -->
 
349
        
 
350
    </data>
 
351
</openerp>