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

« back to all changes in this revision

Viewing changes to purchase_override/purchase_view.xml

  • Committer: matthieu.choplin at msf
  • Date: 2012-08-30 07:48:00 UTC
  • mto: This revision was merged to the branch mainline in revision 1118.
  • Revision ID: matthieu.choplin@geneva.msf.org-20120830074800-l442bu42mt0yzutn
[uf-1374]- change the write and create by an _sql_constraint on the financing contract check dates

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
                    </xpath>
15
15
                    <xpath expr="/form/notebook//page[@string='Invoicing']" position="replace">
16
16
                    </xpath>
17
 
                    <xpath expr="//field[@name='product_uom']" position="attributes">
18
 
                        <attribute name="domain">[('uom_by_product', '=', product_id)]</attribute>
19
 
                    </xpath>
20
 
                    <xpath expr="/form//field[@name='notes']" position="before">
21
 
                        <separator colspan="4" string="Information" />
22
 
                        <field name="external_ref" readonly="1" />
23
 
                        <field name="project_ref" readonly="1" />
24
 
                        <field name="fnct_project_ref" readonly="1" />
25
 
                        <separator colspan="4" string="Notes" />
26
 
                    </xpath>
27
 
 
28
 
                    <xpath expr="/form//group" position="before">
29
 
                        <field name="vat_ok" invisible="1" />
30
 
                    </xpath>
31
 
 
32
 
                    <xpath expr="/form//group" position="attributes">
33
 
                        <attribute name="attrs">{'invisible': [('vat_ok', '=', False)]}</attribute>
34
 
                    </xpath>
35
 
 
36
17
                </data>
37
18
            </field>
38
19
        </record>
44
25
            <field name="inherit_id" ref="purchase.purchase_order_form" />
45
26
            <field name="arch" type="xml">
46
27
                <data>
47
 
 
48
 
                    <xpath expr="/form//field[@name='name']" position="before">
49
 
                        <field name="requested_date_in_past" invisible="1" />
50
 
                        <group colspan="6">
51
 
                            <html>
52
 
                                <p id="view_order_requested_in_past"
53
 
                                    style="display:none; text-align:center; color:#f27d0c; font-weight:bold; font-size:1.2em">
54
 
                                    WARNING: The requested date of this purchase order is in the past.
55
 
                                </p>
56
 
                                <script language="javascript">
57
 
                                    var is_in_past = $('#requested_date_in_past').val();
58
 
                                    if (is_in_past == "1") {
59
 
                                        msg_dom = $('#view_order_requested_in_past');
60
 
                                        msg_dom.show();
61
 
                                    } 
62
 
                                </script>
63
 
                            </html>
64
 
                        </group>
65
 
                    </xpath>
66
 
 
67
28
                    <xpath expr="/form/group/field[@name='partner_ref']" position="attributes">
68
29
                        <attribute name="attrs">{'readonly': ['|', ('partner_type', 'not in', ['external', 'esc']), ('state', 'not in', ['draft', 'confirmed'])]}</attribute>
69
30
                    </xpath>
94
55
                            </group>
95
56
                            <separator string="Invoices" colspan="4"/>
96
57
                            <newline/>
97
 
                            <field name="invoice_ids" nolabel="1" colspan="4" context="{'type':'in_invoice', 'journal_type': 'purchase'}"/>
 
58
                            <field name="invoice_ids" groups="base.group_extended" nolabel="1" colspan="4" context="{'type':'in_invoice', 'journal_type': 'purchase'}"/>
98
59
                        </page>
99
 
                    </xpath>
100
 
 
101
 
                    <xpath expr="/form/notebook/page[@string='Notes']/field[@name='notes']" position="after">
102
 
                        <separator colspan="4" string="Message ESC" />
103
 
                        <field name="message_esc" colspan="4" nolabel="1" readonly="1" attrs="{'invisible': [('partner_type', '!=', 'esc')]}" />
104
 
                        <separator colspan="4" string="Project info" />
105
 
                        <field name="project_ref" readonly="1" />
106
 
                    </xpath>
 
60
                   </xpath>
107
61
 
108
62
                    <xpath expr="/form//field[@name='warehouse_id']" position="replace">
109
63
                        <field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id,order_type,dest_address_id)" widget="selection"/>
115
69
                    </xpath>
116
70
 
117
71
                    <xpath expr="/form/group/field[@name='company_id']" position="before">
118
 
                        <field name="order_type" on_change="onchange_internal_type(order_type, partner_id, categ, dest_partner_id, warehouse_id, delivery_requested_date)" />
 
72
                        <field name="order_type" on_change="onchange_internal_type(order_type, partner_id, dest_partner_id, warehouse_id)" />
119
73
                        <field name="priority" />
120
74
                        <newline />
121
75
                        <field name="categ" />
 
76
                        <field name="loan_duration" attrs="{'invisible': [('order_type', '!=', 'loan')], 'required': [('order_type', '=', 'loan')]}" />
122
77
                        <field name="details" />
123
 
                        <field name="parent_order_name" readonly="True" attrs="{'invisible': [('parent_order_name', '=', False)]}" />
124
 
                        <newline />
125
 
                        <field name="loan_duration" attrs="{'invisible': [('order_type', '!=', 'loan')], 'required': [('order_type', '=', 'loan')]}" />
126
78
                    </xpath>
127
79
                    <xpath expr="/form/notebook/page//field[@name='invoice_method']" position="replace">
128
80
                        <field name="invoice_method" attrs="{'invisible': [('order_type', 'in', ['donation_exp', 'donation_st', 'in_kind', 'loan'])]}" />
131
83
                    <xpath expr="/form/notebook//field[@name='dest_address_id']" position="replace">
132
84
                        <field name="dest_partner_id" attrs="{'invisible': [('order_type', '!=', 'direct')], 'required': [('order_type', '=', 'direct')], 'readonly': [('state', 'not in', ['draft', 'confirmed'])]}"
133
85
                            on_change="on_change_dest_partner_id(dest_partner_id)" />
134
 
                        <field name="dest_address_id" domain="[('dest_address', '=', dest_partner_id)]" attrs="{'required': [('order_type', '=', 'direct')], 'readonly': [('state', 'not in', ['draft', 'confirmed'])]}" />
 
86
                        <field name="dest_address_id" domain="[('partner_id', '=', dest_partner_id)]" attrs="{'required': [('order_type', '=', 'direct')], 'readonly': [('state', 'not in', ['draft', 'confirmed'])]}" />
135
87
                    </xpath>
136
88
                    <xpath expr="/form/notebook//field[@name='fiscal_position']" position="after">
137
89
                        <field name="invoice_address_id"
138
 
                            domain="[('inv_address', 'in', [company_id])]"
139
 
                            context="contact_display='partner_address'"
 
90
                            domain="[('partner_id', 'in', (dest_partner_id, company_id))]"
140
91
                            attrs="{'required': [('order_type', '=', 'direct')], 'readonly': [('state', 'not in', ['draft', 'confirmed'])]}"
141
92
                            />
142
93
                    </xpath>
143
94
 
144
 
                    <xpath expr="/form/notebook//tree" position="attributes">
145
 
                        <attribute name="hide_delete_button">True</attribute>
146
 
                    </xpath>
147
 
 
148
95
                    <xpath expr="/form/notebook//tree//field[@name='price_subtotal']" position="after">
149
96
                        <field name="rfq_ok" invisible="1" />
150
 
                        <field name="tender_line_id" invisible="1" />
151
97
                        <field name="fake_state" invisible="1" />
152
98
                        <field name="order_state_purchase_order_line" invisible="True" />
153
99
                        <button string="Split line" icon="terp-stock_effects-object-colorize" name="open_split_wizard" type="object" 
154
100
                            attrs="{'invisible': ['|', ('rfq_ok', '=', True), ('order_state_purchase_order_line', 'not in', ('draft', 'wait', 'confirmed'))]}" />
155
 
                        <button string="Delete" icon="gtk-del" type="object" name="ask_unlink" confirm="You requested to cancel a line in the PO. Do you want to proceed?" 
156
 
                            attrs="{'invisible': ['|', ('tender_line_id', '!=', False), ('order_state_purchase_order_line', 'not in', ('rfq_sent', 'draft', 'wait', 'confirmed'))]}" />
157
101
                    </xpath>
158
102
 
159
103
                    <xpath expr="/form//field[@name='state']" position="after">
179
123
                      <field name="priority" />
180
124
                      <field name="categ" />
181
125
                      <field name="date_order" />
182
 
                      <field name="partner_ref" />
183
126
                      <field name="partner_id" string="Supplier" />
184
127
                      <field name="delivery_requested_date" />
185
128
                      <field name="origin" />
186
 
                      <field name="dest_partner_names" />
187
129
                      <field name="shipped_rate" widget="progressbar" />
188
130
                      <field name="invoiced_rate" widget="progressbar" />
189
131
                      <field name="amount_total" sum="Total amount" />
202
144
                    <group col="8" colspan="4">
203
145
                      <filter icon="terp-document-new" name="draft" string="Draft" domain="[('state', 'in', ['draft'])]" separator="1" help="Purchase orders which are in draft state" />
204
146
                      <filter icon="terp-camera_test" name="confirmed" string="Validated" domain="[('state','in',['confirmed','wait'])]" separator="1" help="Purchase orders which are in validated state." />
205
 
                      <filter icon="gtk-paste-v" name="sourced" string="Sourced" domain="[('state','=','sourced')]" separator="1" />
206
147
                      <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." />
207
148
                      <filter icon="terp-check" name="approved" string="Confirmed" domain="[('state', 'in', ['approved'])]" separator="1" help="Purchase orders which are in approved state." />
208
149
                      <filter icon="gtk-close" name="done" string="Closed" domain="[('state', 'in', ['done'])]" separator="1" help="Purchase orders which are in done state." />
209
150
                      <separator orientation="vertical" />
210
 
                      <filter icon="gtk-missing-image" name="inactive" string="Show Split" domain="[('state','=','split')]" context="{'active_test': False}" separator="1" />
211
 
                      <separator orientation="vertical" />
212
151
                      <filter icon="gtk-cancel" name="cancelled" string="Cancelled" domain="[('state', 'in', ['cancel'])]" separator="1" help="Purchase orders which are in cancelled state." />
213
152
                      <separator orientation="vertical" />
214
153
                      <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." />
215
154
                      <separator orientation="vertical" />
216
155
                      <field name="name" select="1" string="Reference" />
217
156
                      <field name="partner_id" select="1" string="Supplier" />
218
 
                      <field name="partner_ref" select="1" string="Supplier Ref." />
219
157
                    </group>
220
158
                    <newline />
221
159
                    <group>
249
187
                      <filter icon="gtk-harddisk" string="Other" domain="[('categ','=','other')]"/>                            
250
188
                        </group>
251
189
                    <newline />
252
 
                    <group expand="0" string="Group By..." colspan="4" col="10">
 
190
                    <group expand="0" string="Group By..." colspan="4" col="10" groups="base.group_extended">
253
191
                      <filter string="Order Type" icon="terp-rating-rated" domain="[]" context="{'group_by':'order_type'}"/>
254
192
                      <separator orientation="vertical" />
255
193
                      <filter string="Priority" icon="terp-project" domain="[]" context="{'group_by': 'priority'}" />
303
241
                  name="Address Book"
304
242
                  parent="purchase.menu_purchase_config_purchase" />
305
243
 
306
 
        <record id="res_partner_address_list_view" model="ir.ui.view">
307
 
            <field name="name">res.partner.address.list.view</field>
308
 
            <field name="model">res.partner.address</field>
309
 
            <field name="type">tree</field>
310
 
            <field name="inherit_id" ref="base.view_partner_address_tree" />
311
 
            <field name="arch" type="xml">
312
 
                <xpath expr="/tree//field[@name='name']" position="after">
313
 
                    <field name="street" />
314
 
                </xpath>
315
 
            </field>
316
 
        </record>
317
 
 
318
244
        <record id="action_supplier_address_form" model="ir.actions.act_window">
319
245
            <field name="name">Addresses</field>
320
246
            <field name="type">ir.actions.act_window</field>
333
259
            <field name="arch" type="xml">
334
260
                <data>
335
261
                    <xpath expr="/form//field[@name='product_id']" position="replace">
336
 
                        <field name="tender_line_id" invisible="1" />
337
262
                        <field name="product_id" colspan="4" 
338
 
                            context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id, available_for_restriction=parent.partner_type,search_default_not_restricted=1,categ=parent.categ" 
339
 
                            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)"
340
 
                            attrs="{'readonly': [('tender_line_id', '!=', False)]}"
341
 
                            />
342
 
                        <!-- domain="[('purchase_type', '=', parent.categ)] />" -->
 
263
                            context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id" 
 
264
                            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)"/>
343
265
                    </xpath>
344
266
 
345
267
                    <xpath expr="/form//field[@name='price_unit']" position="replace">
375
297
                    <group colspan="4">
376
298
                        <field name="po_value_id" readonly="1" colspan="2" />
377
299
                        <newline />
378
 
                        <field name="unmatched_categ" invisible="1" />
379
300
                        <html colspan="4">
380
301
                            <p>All information of the PO template will be written in the new PO,</p>
381
302
                            <p>except the Delivery Requested date which will be the earliest date of all POs.</p>
382
303
                        </html>
383
 
                        <newline />
384
 
                        <group colspan="4" col="4" attrs="{'invisible': [('unmatched_categ', '=', False)]}">
385
 
                            <html colspan="4">
386
 
                                <p style="margin-top:10px;padding-left:5px;border-style:solid;border-width:1px;background-color:#F0EBA4;border-radius:5px;">
387
 
                                    <span style="font-weight:bold">WARNING: </span>
388
 
                                    <span>The category of the new PO  is not consistent with the category of the other POs being merged</span>
389
 
                                </p>
390
 
                            </html>
391
 
                        </group>
392
304
                    </group>
393
305
                 </xpath>
394
306
            </field>
415
327
        <menuitem id="purchase.menu_action_stock_move_report_po" parent="stock.next_id_61" />
416
328
 
417
329
        <!-- Invoice control -->
418
 
        <!-- MOVED THIS BLOCK TO hidden_menu.xml === DO NOT HARD DELETE MenuItem -->
419
 
        
 
330
        <delete id="purchase.menu_procurement_management_invoice" model="ir.ui.menu" />
 
331
        <delete id="purchase.menu_procurement_management_pending_invoice" model="ir.ui.menu" />
 
332
        <delete id="purchase.menu_purchase_line_order_draft" model="ir.ui.menu" />
 
333
 
 
334
        <!-- Products -->
 
335
        <delete id="purchase.menu_procurement_partner_contact_form" model="ir.ui.menu" />
 
336
        <delete id="purchase.menu_product_by_category_purchase_form" model="ir.ui.menu" />
 
337
        <delete id="purchase.menu_procurement_management_product" model="ir.ui.menu" />
 
338
 
 
339
        <!-- Picking on Purchase menu -->
 
340
        <delete model="ir.ui.menu" id="purchase.menu_action_picking_tree4" />
 
341
        <delete model="ir.ui.menu" id="purchase.menu_action_picking_tree_in_move" />
 
342
<!--        <delete model="ir.ui.menu" id="purchase.menu_procurement_management_inventory" /> -->
 
343
 
 
344
        <!-- Purchase configuration menu -->
 
345
<!--
 
346
        <delete model="ir.ui.menu" id="base.menu_procurement_management_supplier" />
 
347
-->
 
348
        <delete model="ir.ui.menu" id="purchase.menu_purchase_uom_categ_form_action" />
 
349
        <delete model="ir.ui.menu" id="purchase.menu_purchase_uom_form_action" />
 
350
        <delete model="ir.ui.menu" id="purchase.menu_purchase_unit_measure_purchase" />
 
351
        <delete model="ir.ui.menu" id="purchase.menu_product_pricelist_action_purhase" />
 
352
        <delete model="ir.ui.menu" id="purchase.menu_product_pricelist_action2_purchase" />
 
353
        <delete model="ir.ui.menu" id="purchase.menu_purchase_product_pricelist_type" />
 
354
        <delete model="ir.ui.menu" id="purchase.menu_product_category_config_purchase" />
420
355
<!--
421
356
        <delete model="ir.ui.menu" id="purchase.menu_purchase_config_pricelist" />
422
357
        <delete model="ir.ui.menu" id="purchase.menu_product_in_config_purchase" />
423
358
    used in useability_dashboard_and_menu/menu/supply_config_menu.xml
424
359
-->
425
 
<!--        <delete model="ir.ui.menu" id="purchase.action_supplier_address_form" /> -->
 
360
        <delete model="ir.ui.menu" id="purchase.action_supplier_address_form" />
426
361
 
427
362
        <!-- Here was an act_window to display all PO from products views.
428
363
             This action is defined on product_attributes module -->
429
 
 
430
 
        <record id="purchase_order_line_unlink_wizard_form_view" model="ir.ui.view">
431
 
            <field name="name">purchase.order.line.unlink.wizard.form.view</field>
432
 
            <field name="model">purchase.order.line.unlink.wizard</field>
433
 
            <field name="type">form</field>
434
 
            <field name="arch" type="xml">
435
 
                <form string="Purchase order line cancelation">
436
 
                    <field name="last_line" invisible="1" />
437
 
                    <field name="only_exp" invisible="1" />
438
 
                    <group colspan="4" col="1" attrs="{'invisible': [('only_exp', '=', True)]}">
439
 
                        <html>
440
 
                            <h4 style="text-align: center; margin: 10px; font-size: 1.2em">Would you re-source the needs sourced by this purchase order line ?</h4>
441
 
                        </html>
442
 
                    </group>
443
 
                    <group colspan="6">
444
 
                        <html>
445
 
                            <p id="view_last_line_message"
446
 
                                style="display:none; text-align:center; color: red; font-weight: bold; font-size: 1.2em;">
447
 
                                WARNING! You are about to cancel/delete a line. This action once done cannot be changed, and it will mean all other related POs will be confirmed. Therefore if you wish to add another product to this PO you should do this BEFORE deleting this line. To add another product click "Close window" .
448
 
                            </p>
449
 
                            <script language="javascript">
450
 
                                var is_displayed = $('#last_line').val();
451
 
                                if (is_displayed == "1") {
452
 
                                    msg_dom = $('#view_last_line_message')
453
 
                                    msg_dom.show();
454
 
                                }
455
 
                            </script>
456
 
                        </html>
457
 
                    </group>
458
 
                    <newline />
459
 
                    <group colspan="4" col="6" attrs="{'invisible': [('only_exp', '=', True)]}">
460
 
                        <separator string="Actions" colspan="6" />
461
 
                        <button special="cancel" string="Close window" icon="gtk-cancel" colspan="2" />
462
 
                        <button name="just_cancel" string="No" type="object" icon="gtk-execute" colspan="2" />
463
 
                        <button name="cancel_and_resource" string="Yes" type="object" icon="gtk-execute" colspan="2" />
464
 
                    </group>
465
 
                    <group colspan="4" col="4" attrs="{'invisible': [('only_exp', '=', False)]}">
466
 
                        <separator string="Actions" colspan="4" />
467
 
                        <button special="cancel" string="Close window" icon="gtk-cancel" colspan="2" />
468
 
                        <button name="just_cancel" string="Confirm deletion" type="object" icon="gtk-execute" colspan="2" />
469
 
                    </group>
470
 
                </form>
471
 
            </field>
472
 
        </record>
473
 
 
474
 
        <record id="purchase_order_cancel_wizard_form_view" model="ir.ui.view">
475
 
            <field name="name">purchase.order.cancel.wizard.form.view</field>
476
 
            <field name="model">purchase.order.cancel.wizard</field>
477
 
            <field name="type">form</field>
478
 
            <field name="arch" type="xml">
479
 
                <form string="Cancel Purchase Order">
480
 
                    <field name="last_lines" invisible="1" />
481
 
                    <group colspan="4" col="1">
482
 
                        <html>
483
 
                            <h4 style="text-align: center; margin: 10px">If you click on 'Cancel &amp; Resource' button, all Field Order lines or Internal Request lines sourced by this Purchase Order will be re-sourced.</h4>
484
 
                        </html>
485
 
                    </group>
486
 
                    <newline />
487
 
                    <separator string="Actions" />
488
 
                    <button name="cancel_po" string="Cancel only" type="object" icon="gtk-cancel" colspan="2" />
489
 
                    <button name="cancel_and_resource" string="Cancel &amp; Resource" type="object" icon="gtk-cancel" colspan="2" />
490
 
                </form>
491
 
            </field>
492
 
        </record>
493
 
 
494
 
        <record id="ask_po_cancel_wizard_form_view" model="ir.ui.view">
495
 
            <field name="name">ask.po.cancel.wizard.form.view</field>
496
 
            <field name="model">purchase.order.cancel.wizard</field>
497
 
            <field name="type">form</field>
498
 
            <field name="priority" eval="99" />
499
 
            <field name="arch" type="xml">
500
 
                <form string="Cancel Purchase Order">
501
 
                    <group colspan="4" col="1">
502
 
                        <html>
503
 
                            <h4 style="text-align: center; margin: 10px">You removed all lines of this purchase order, would you cancel it ?</h4>
504
 
                        </html>
505
 
                    </group>
506
 
                    <newline />
507
 
                    <separator string="Actions" colspan="4" />
508
 
                    <button colspan="1" type="object" icon="gtk-cancel" name="close_window" string="Close window" />
509
 
                    <button colspan="2" type="object" icon="gtk-execute" name="cancel_po" string="Cancel PO" />
510
 
                </form>
511
 
            </field>
512
 
        </record>
513
364
        
514
365
    </data>
515
366
</openerp>