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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<record id="purchase_order_line_form_view_over" model="ir.ui.view">
<field name="name">purchase.order.line.form.view.over</field>
<field name="model">purchase.order.line</field>
<field name="type">form</field>
<field name="inherit_id" ref="purchase.purchase_order_line_form" />
<field name="arch" type="xml">
<data>
<xpath expr="/form/notebook//page[@string='History']" position="replace">
</xpath>
<xpath expr="/form/notebook//page[@string='Invoicing']" position="replace">
</xpath>
</data>
</field>
</record>
<record id="purchase_order_type_form_view" model="ir.ui.view">
<field name="name">purchase.order.type.form.view</field>
<field name="model">purchase.order</field>
<field name="type">form</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
<data>
<xpath expr="/form/group/field[@name='partner_ref']" position="attributes">
<attribute name="attrs">{'readonly': ['|', ('partner_type', 'not in', ['external', 'esc']), ('state', 'not in', ['draft', 'confirmed'])]}</attribute>
</xpath>
<xpath expr="/form/notebook//page[@string='Delivery & Invoicing']/group[2]" position="replace" >
</xpath>
<xpath expr="/form/notebook//page[@string='Delivery & Invoicing']//separator[@string='Purchase Control']" position="replace" >
</xpath>
<xpath expr="/form/notebook//page[@string='Delivery & Invoicing']//field[@name='validator']" position="attributes" >
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="/form/notebook//page[@string='Delivery & Invoicing']//field[@name='date_approve']" position="attributes" >
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="/form/notebook//page[@string='Delivery & Invoicing']//separator[@string='Invoices']" position="replace" >
</xpath>
<xpath expr="/form/notebook//page[@string='Delivery & Invoicing']//field[@name='invoice_ids']" position="replace" >
</xpath>
<xpath expr="/form/notebook/page[@string='Notes']" position="before" >
<page string="Invoices" >
<group colspan="2" col="2">
<separator string="Invoice Control" colspan="2"/>
<field name="invoice_method"/>
<field name="fiscal_position" widget="selection"/>
</group>
<separator string="Invoices" colspan="4"/>
<newline/>
<field name="invoice_ids" nolabel="1" colspan="4" context="{'type':'in_invoice', 'journal_type': 'purchase'}"/>
</page>
</xpath>
<xpath expr="/form//field[@name='warehouse_id']" position="replace">
<field name="warehouse_id" on_change="onchange_warehouse_id(warehouse_id,order_type,dest_address_id)" widget="selection"/>
</xpath>
<xpath expr="/form/notebook/page[@string='Purchase Order']/field[@name='partner_id']" position="replace">
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1}" domain="[('id', '!=', company_id)]" />
<field name="allocation_setup" invisible="1" />
</xpath>
<xpath expr="/form/group/field[@name='company_id']" position="before">
<field name="order_type" on_change="onchange_internal_type(order_type, partner_id, categ, dest_partner_id, warehouse_id, delivery_requested_date)" />
<field name="priority" />
<newline />
<field name="categ" />
<field name="details" />
<newline />
<field name="loan_duration" attrs="{'invisible': [('order_type', '!=', 'loan')], 'required': [('order_type', '=', 'loan')]}" />
</xpath>
<xpath expr="/form/notebook/page//field[@name='invoice_method']" position="replace">
<field name="invoice_method" attrs="{'invisible': [('order_type', 'in', ['donation_exp', 'donation_st', 'in_kind', 'loan'])]}" />
<field name="unallocation_ok" attrs="{'readonly': ['|', ('cross_docking_ok', '=', True), ('allocation_setup', '!=', 'mixed')]}" />
</xpath>
<xpath expr="/form/notebook//field[@name='dest_address_id']" position="replace">
<field name="dest_partner_id" attrs="{'invisible': [('order_type', '!=', 'direct')], 'required': [('order_type', '=', 'direct')], 'readonly': [('state', 'not in', ['draft', 'confirmed'])]}"
on_change="on_change_dest_partner_id(dest_partner_id)" />
<field name="dest_address_id" domain="[('partner_id', '=', dest_partner_id)]" attrs="{'required': [('order_type', '=', 'direct')], 'readonly': [('state', 'not in', ['draft', 'confirmed'])]}" />
</xpath>
<xpath expr="/form/notebook//field[@name='fiscal_position']" position="after">
<field name="invoice_address_id"
domain="[('partner_id', 'in', [dest_partner_id, company_id])]"
context="contact_display='partner_address'"
attrs="{'required': [('order_type', '=', 'direct')], 'readonly': [('state', 'not in', ['draft', 'confirmed'])]}"
/>
</xpath>
<xpath expr="/form/notebook//tree//field[@name='price_subtotal']" position="after">
<field name="rfq_ok" invisible="1" />
<field name="fake_state" invisible="1" />
<field name="order_state_purchase_order_line" invisible="True" />
<button string="Split line" icon="terp-stock_effects-object-colorize" name="open_split_wizard" type="object"
attrs="{'invisible': ['|', ('rfq_ok', '=', True), ('order_state_purchase_order_line', 'not in', ('draft', 'wait', 'confirmed'))]}" />
</xpath>
<xpath expr="/form//field[@name='state']" position="after">
<button name="dpo_received"
string="Validate the reception"
icon="terp-camera_test"
attrs="{'invisible': ['|', ('state', '!=', 'approved'), ('order_type', '!=', 'direct')]}"
/>
</xpath>
</data>
</field>
</record>
<record id="purchase.purchase_order_tree" model="ir.ui.view">
<field name="name">purchase.order.type.tree.view</field>
<field name="model">purchase.order</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Purchase Orders"
colors="grey:state=='cancel';blue:state in ('wait','confirmed');red:state in ('except_invoice','except_picking')">
<field name="name" string="Reference" />
<field name="order_type" />
<field name="priority" />
<field name="categ" />
<field name="date_order" />
<field name="partner_ref" />
<field name="partner_id" string="Supplier" />
<field name="delivery_requested_date" />
<field name="origin" />
<field name="shipped_rate" widget="progressbar" />
<field name="invoiced_rate" widget="progressbar" />
<field name="amount_total" sum="Total amount" />
<field name="pricelist_id" string="Currency" />
<field name="state" />
</tree>
</field>
</record>
<record id="purchase.view_purchase_order_filter" model="ir.ui.view">
<field name="name">purchase.view.purchase.order.filter</field>
<field name="model">purchase.order</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Search Purchase Orders">
<group col="8" colspan="4">
<filter icon="terp-document-new" name="draft" string="Draft" domain="[('state', 'in', ['draft'])]" separator="1" help="Purchase orders which are in draft state" />
<filter icon="terp-camera_test" name="confirmed" string="Validated" domain="[('state','in',['confirmed','wait'])]" separator="1" help="Purchase orders which are in validated state." />
<filter icon="gtk-paste-v" name="sourced" string="Sourced" domain="[('state','=','sourced')]" separator="1" />
<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." />
<filter icon="terp-check" name="approved" string="Confirmed" domain="[('state', 'in', ['approved'])]" separator="1" help="Purchase orders which are in approved state." />
<filter icon="gtk-close" name="done" string="Closed" domain="[('state', 'in', ['done'])]" separator="1" help="Purchase orders which are in done state." />
<separator orientation="vertical" />
<filter icon="gtk-missing-image" name="inactive" string="Show Split" domain="[('state','=','split')]" context="{'active_test': False}" separator="1" />
<separator orientation="vertical" />
<filter icon="gtk-cancel" name="cancelled" string="Cancelled" domain="[('state', 'in', ['cancel'])]" separator="1" help="Purchase orders which are in cancelled state." />
<separator orientation="vertical" />
<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." />
<separator orientation="vertical" />
<field name="name" select="1" string="Reference" />
<field name="partner_id" select="1" string="Supplier" />
<field name="partner_ref" select="1" string="Supplier Ref." />
</group>
<newline />
<group>
<field name="product_id" />
<field name="origin" />
<field name="create_uid" />
<field name="date_order" />
</group>
<newline />
<group string="Type" expand="0">
<filter icon="terp-check" string="Regular" domain="[('order_type','=','regular')]" />
<filter icon="terp-stage" string="Donation before expiry" domain="[('order_type','=','donation_exp')]" />
<filter icon="terp-gtk-jump-to-ltr" string="Standard Donation" domain="[('order_type','=','donation_st')]" />
<filter icon="terp-partner" string="Loan" domain="[('order_type','=','loan')]" />
<filter icon="terp-gtk-jump-to-rtl" string="In-Kind donation" domain="[('order_type','=','in_kind')]" />
<filter icon="terp-purchase" string="Purchase List" domain="[('order_type','=','purchase_list')]" />
<filter icon="terp-crm" string="Direct PO" domain="[('order_type','=','direct')]" />
</group>
<newline />
<group string="Priority" expand="0">
<filter icon="gtk-dialog-warning" string="Emergency" domain="[('priority','=','emergency')]"/>
<filter icon="gtk-yes" string="Normal" domain="[('priority','=','normal')]"/>
<filter icon="gtk-info" string="Priority" domain="[('priority','=','priority')]"/>
</group>
<newline />
<group string="Category" expand="0">
<filter icon="gtk-color-picker" string="Medical" domain="[('categ','=','medical')]"/>
<filter icon="terp-stock" string="Logistic" domain="[('categ','=','log')]"/>
<filter icon="terp-purchase" string="Service" domain="[('categ','=','service')]"/>
<filter icon="gtk-quit" string="Transport" domain="[('categ','=','transport')]"/>
<filter icon="gtk-harddisk" string="Other" domain="[('categ','=','other')]"/>
</group>
<newline />
<group expand="0" string="Group By..." colspan="4" col="10">
<filter string="Order Type" icon="terp-rating-rated" domain="[]" context="{'group_by':'order_type'}"/>
<separator orientation="vertical" />
<filter string="Priority" icon="terp-project" domain="[]" context="{'group_by': 'priority'}" />
<separator orientation="vertical" />
<filter string="Category" icon="terp-translate" domain="[]" context="{'group_by':'categ'}"/>
<separator orientation="vertical" />
<filter string="Supplier" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical" />
<filter string="Origin" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'origin'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical" />
<filter string="Order Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_order'}"/>
<filter string="Expected Date" icon="terp-go-month" domain="[]" context="{'group_by':'delivery_requested_date'}" />
</group>
</search>
</field>
</record>
<record id="purchase.purchase_form_action" model="ir.actions.act_window">
<field name="name">Purchase Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">tree,form,graph,calendar</field>
<field name="context">{'search_default_approved': 1,'search_default_create_uid':uid, 'purchase_order': True}</field>
<field name="domain">[('tender_id', '=', False)]</field>
<field name="search_view_id" ref="purchase.view_purchase_order_filter"/>
<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>
</record>
<!-- REWORK THE PURCHASE MENU − SEE UF-657 - ERGONOMIC REQUIREMENTS -->
<!-- Purchase Management -->
<menuitem id="purchase.menu_purchase_form_action"
action="purchase.purchase_form_action"
sequence="1"
parent="purchase.menu_procurement_management" />
<menuitem id="purchase.menu_purchase_rfq"
action="purchase.purchase_rfq"
sequence="2"
parent="purchase.menu_procurement_management" />
<menuitem id="base.menu_procurement_management_supplier_name"
action="base.action_partner_supplier_form"
sequence="4"
parent="purchase.menu_procurement_management" />
<menuitem id="base.menu_purchase_root" sequence="2" />
<!-- Address Book -->
<menuitem id="base.menu_procurement_management_supplier"
name="Address Book"
parent="purchase.menu_purchase_config_purchase" />
<record id="action_supplier_address_form" model="ir.actions.act_window">
<field name="name">Addresses</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.partner.address</field>
<field name="view_type">form</field>
<field name="context">{"search_default_supplier":1}</field>
<field name="search_view_id" ref="base.view_res_partner_address_filter" />
<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>
</record>
<record id="purchase_order_line_form_view_inherit" model="ir.ui.view">
<field name="name">purchase.order.line.form.view</field>
<field name="model">purchase.order.line</field>
<field name="type">form</field>
<field name="inherit_id" ref="purchase.purchase_order_line_form" />
<field name="arch" type="xml">
<data>
<xpath expr="/form//field[@name='product_id']" position="replace">
<field name="product_id" colspan="4"
context="partner_id=parent.partner_id,quantity=product_qty,pricelist=parent.pricelist_id,uom=product_uom,warehouse=parent.warehouse_id"
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)"
domain="[('purchase_type', '=', parent.categ)]" />
</xpath>
<xpath expr="/form//field[@name='price_unit']" position="replace">
<field name="rfq_ok" invisible="1" />
<field name="state" invisible="1" />
<field name="fake_id" invisible="1" />
<field name="change_price_ok" invisible="1" />
<field name="old_price_unit" invisible="1" />
<field name="price_unit"
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)" />
</xpath>
</data>
</field>
</record>
<!-- Modify the view of the merge PO wizard -->
<record id="inherit_view_purchase_order_group" model="ir.ui.view">
<field name="name">Merger Purchase Orders</field>
<field name="model">purchase.order.group</field>
<field name="inherit_id" ref="purchase.view_purchase_order_group" />
<field name="arch" type="xml">
<xpath expr="/form//label" position="replace">
<group colspan="4">
<html>
<p>Please note that: </p>
<p style="margin-left:10px">Orders will only be merged if: </p>
<p style="margin-left:20px">* Purchase Orders are in draft</p>
<p style="margin-left:20px">* Purchase Orders belong to the same supplier and the same currency</p>
</html>
</group>
<separator colspan="4" />
<group colspan="4">
<field name="po_value_id" readonly="1" colspan="2" />
<newline />
<html colspan="4">
<p>All information of the PO template will be written in the new PO,</p>
<p>except the Delivery Requested date which will be the earliest date of all POs.</p>
</html>
</group>
</xpath>
</field>
</record>
<record id="purchase_order_confirm_wizard" model="ir.ui.view">
<field name="name">purchase.order.confirm.wizard</field>
<field name="model">purchase.order.confirm.wizard</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Warning on confirmation">
<separator colspan="4" string="Purchase Order" />
<field name="order_id" colspan="4" />
<separator colspan="4" string="Warning" />
<field name="errors" colspan="4" nolabel="1" />
<separator colspan="4" string="Actions" />
<button special="cancel" icon="gtk-cancel" string="Close window" colspan="1" />
<button type="object" name="validate_order" icon="terp-check" string="Confirm" colspan="3" />
</form>
</field>
</record>
<!-- Invoice control -->
<menuitem id="purchase.menu_action_stock_move_report_po" parent="stock.next_id_61" />
<!-- Invoice control -->
<!-- MOVED THIS BLOCK TO hidden_menu.xml === DO NOT HARD DELETE MenuItem -->
<!--
<delete model="ir.ui.menu" id="purchase.menu_purchase_config_pricelist" />
<delete model="ir.ui.menu" id="purchase.menu_product_in_config_purchase" />
used in useability_dashboard_and_menu/menu/supply_config_menu.xml
-->
<!-- <delete model="ir.ui.menu" id="purchase.action_supplier_address_form" /> -->
<!-- Here was an act_window to display all PO from products views.
This action is defined on product_attributes module -->
</data>
</openerp>
|