1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<!-- Add required fields on standard sale order view -->
<record id="sale_order_form_view_required" model="ir.ui.view">
<field name="name">sale.order.form.view.required</field>
<field name="model">sale.order</field>
<field name="type">form</field>
<field name="inherit_id" ref="sale.view_order_form" />
<field name="arch" type="xml">
<data>
<xpath expr="/form/notebook/page[@string='Sales Order']/field[@name='partner_invoice_id']" position="replace">
<field domain="[('partner_id','=',partner_id)]" name="partner_order_id" required="1" />
</xpath>
<xpath expr="/form/notebook/page[@string='Sales Order']/field[@name='partner_order_id']" position="replace">
<field domain="[('partner_id','=',partner_id)]" name="partner_invoice_id" groups="base.group_extended" required="1" />
</xpath>
<xpath expr="/form/notebook/page[@string='Sales Order']/field[@name='partner_shipping_id']" position="replace">
<field domain="[('partner_id','=',partner_id)]" name="partner_shipping_id" groups="base.group_extended" required="1" />
</xpath>
<xpath expr="/form/notebook/page[@string='Sales Order']/field[@name='pricelist_id']" position="replace">
<field domain="[('type','=','sale')]" name="pricelist_id" groups="base.group_extended" required="1" />
</xpath>
</data>
</field>
</record>
<record id="procurement_request_form_view" model="ir.ui.view">
<field name="name">procurement.request.form.view</field>
<field name="model">sale.order</field>
<field name="type">form</field>
<field name="priority" eval="250" />
<field name="arch" type="xml">
<form string="Procurement Request">
<group col="6" colspan="4">
<field name="name"/>
<field name="date_order" attrs="{'readonly': [('state', '!=', 'procurement')]}" />
<field name="warehouse_id" widget="selection" attrs="{'readonly': [('state', '!=', 'procurement')]}" />
<field name="requestor" attrs="{'readonly': [('state', '!=', 'procurement')]}" />
<field name="origin" attrs="{'readonly': [('state', '!=', 'procurement')]}" />
</group>
<notebook colspan="5">
<page string="Products">
<field name="order_line" mode="tree,form" colspan="4" nolabel="1">
<tree editable="top" string="Products">
<field name="product_id" on_change="requested_product_id_change(product_id, type)" required="1" />
<field name="name" invisible="1" />
<field name="product_uom" />
<field name="product_uom_qty" />
<field name="notes" />
<field name="type" on_change="requested_product_id_change(product_id, type)"/>
<field name="latest" />
<field name="supplier" context="{'product_id': product_id, 'choose_supplier': True}" attrs="{'readonly': [('type', '=', 'make_to_stock')]}" domain="[('supplier', '=', True)]"/>
<!-- <button name="split_line" type="object" string="Split Line" icon="terp-stock_effects-object-colorize" />
<button name="merge_line" type="object" string="Merge Line" icon="terp-gtk-jump-to-ltr" context="{'wizard_id': active_id}" /> -->
</tree>
<form>
<field name="product_id" colspan="4" />
<field name="product_uom_qty" />
<field name="product_uom" />
<field name="type" />
<newline />
<field name="notes" colspan="4"/>
<field name="supplier" />
<field name="latest" />
</form>
</field>
<group colspan="4" col="6">
<field name="state" />
<button name="procurement_cancel" icon="gtk-cancel" string="Cancel" states="procurement,proc_progress" />
<button name="procurement_confirm" icon="gtk-execute" string="Confirm Request" states="procurement" />
<button name="order_confirm" icon="gtk-execute" string="Close Request" states="proc_progress" />
</group>
</page>
<page string="Sourcing Documents">
<field name="order_ids" nolabel="1" colspan="4">
<tree string="Sourcing Documents" colors="blue:state=='draft'">
<field name="name" />
<field name="partner_id" />
<field name="state" />
</tree>
</field>
</page>
<page string="Notes">
<field name="notes" nolabel="1" />
</page>
</notebook>
</form>
</field>
</record>
<record id="procurement_request_tree_view" model="ir.ui.view">
<field name="name">procurement.request.tree.view</field>
<field name="model">sale.order</field>
<field name="type">tree</field>
<field name="priority" eval="250" />
<field name="arch" type="xml">
<tree string="Procurement Requests">
<field name="name" />
<field name="date_order" />
<field name="origin" />
<field name="requestor" />
<field name="state" />
</tree>
</field>
</record>
<record id="procurement_request_search_view" model="ir.ui.view">
<field name="name">procurement.request.search.view</field>
<field name="model">sale.order</field>
<field name="type">search</field>
<field name="priority" eval="250" />
<field name="arch" type="xml">
<search string="Procurment Requests">
<group string="Filters" expand="1">
<filter name="state_proc" string="Procurement" icon="terp-document-new" domain="[('state', '=', 'procurement')]" />
<filter name="state_proc_progress" string="In Progress" icon="terp-stage" domain="[('state', '=', 'proc_progress')]" />
<filter name="state_done" string="Done" icon="terp-dialog-close" domain="[('state', '=', 'proc_done')]" />
<separator orientation="vertical" />
<field name="name" />
<field name="origin" />
<field name="requestor" />
</group>
<group string="Group By...">
<filter string="State" icon="terp-gtk-select-all" domain="[]" context="{'group_by': 'state'}" />
</group>
</search>
</field>
</record>
<record id="action_procurement_request" model="ir.actions.act_window">
<field name="name">Procurement Requests</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_search_id" ref="procurement_request_search_view" />
<field name="context">{'procurement_request': True}</field>
<field name="domain">[('procurement_request', '=', True)]</field>
</record>
<record id="action_procurement_request_form_view" model="ir.actions.act_window.view">
<field name="act_window_id" ref="action_procurement_request" />
<field name="sequence">2</field>
<field name="view_mode">form</field>
<field name="view_id" ref="procurement_request_form_view" />
</record>
<record id="action_procurement_request_tree_view" model="ir.actions.act_window.view">
<field name="act_window_id" ref="action_procurement_request" />
<field name="sequence">1</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="procurement_request_tree_view" />
</record>
<menuitem action="action_procurement_request"
id="menu_procurement_request"
parent="base.menu_sales" />
</data>
</openerp>
|