forked from OCA/purchase-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
purchase_request_view.xml
416 lines (415 loc) · 18.4 KB
/
purchase_request_view.xml
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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
<?xml version="1.0" ?>
<!-- Copyright 2018-2019 ForgeFlow, S.L.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
<record id="view_purchase_request_form" model="ir.ui.view">
<field name="name">purchase.request.form</field>
<field name="model">purchase.request</field>
<field name="arch" type="xml">
<form string="Purchase Request">
<header>
<button
name="button_draft"
states="to_approve,approved,rejected,done"
string="Reset"
type="object"
groups="purchase_request.group_purchase_request_manager"
/>
<button
name="button_to_approve"
states="draft"
string="Request approval"
type="object"
class="oe_highlight"
/>
<button
name="button_approved"
states="to_approve"
string="Approve"
type="object"
class="oe_highlight"
groups="purchase_request.group_purchase_request_manager"
/>
<button
name="%(action_purchase_request_line_make_purchase_order)d"
states="approved"
string="Create RFQ"
type="action"
/>
<button
name="button_done"
states="approved"
string="Done"
type="object"
class="oe_highlight"
groups="purchase_request.group_purchase_request_manager"
/>
<button
name="button_rejected"
states="to_approve,approved"
string="Reject"
type="object"
groups="purchase_request.group_purchase_request_manager"
/>
<field
name="state"
widget="statusbar"
statusbar_visible="draft,to_approve,approved,done,rejected"
statusbar_colors='{"approved":"blue"}'
/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button
type="object"
name="action_view_purchase_request_line"
class="oe_stat_button"
attrs="{'invisible':[('line_count', '=', 0)]}"
icon="fa-list"
>
<field name="line_count" widget="statinfo" string="Lines" />
</button>
<button
type="object"
name="action_view_purchase_order"
class="oe_stat_button"
attrs="{'invisible':[('purchase_count', '=', 0)]}"
icon="fa-shopping-cart"
string="Purchase Order"
>
<field
name="purchase_count"
widget="statinfo"
string="Purchase Orders"
/>
</button>
<button
type="object"
name="action_view_stock_picking"
class="oe_stat_button"
attrs="{'invisible':[('move_count', '=', 0)]}"
groups="stock.group_stock_manager"
icon="fa-truck"
string="Picking"
>
<field
name="move_count"
widget="statinfo"
string="Pickings"
/>
</button>
</div>
<div class="oe_edit_only">
<label for="name" class="oe_inline" />
</div>
<h1>
<field name="is_editable" invisible="1" />
<field name="is_name_editable" invisible="1" />
<field
name="name"
class="oe_inline"
attrs="{'readonly': [('is_name_editable','=', False)]}"
/>
</h1>
<group>
<group>
<field
name="requested_by"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="assigned_to"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
</group>
<group>
<field
name="origin"
class="oe_inline"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="description"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="group_id"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
</group>
<group>
<field
name="date_start"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="picking_type_id"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="company_id"
groups="base.group_multi_company"
widget="selection"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
</group>
</group>
<notebook>
<page string="Products">
<field name="line_ids">
<tree
decoration-muted="cancelled == True"
editable="bottom"
>
<field name="product_id" />
<field name="name" />
<field name="product_qty" />
<field
name="product_uom_category_id"
invisible="1"
/>
<field
name="product_uom_id"
invisible="1"
groups="!uom.group_uom"
/>
<field
name="product_uom_id"
groups="uom.group_uom"
/>
<field
name="analytic_distribution"
widget="analytic_distribution"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'purchase_order'}"
/>
<field name="date_required" />
<field name="estimated_cost" widget="monetary" />
<field name="currency_id" invisible="1" />
<field
name="company_id"
groups="base.group_multi_company"
widget="selection"
/>
<field name="cancelled" invisible="1" />
<field name="is_editable" invisible="1" />
<field name="rfq_qty" />
<field name="purchased_qty" />
<field
name="purchase_state"
widget="badge"
decoration-success="purchase_state == ('done')"
decoration-muted="purchase_state == ('draft')"
decoration-info="purchase_state in ('sent', 'purchase')"
decoration-warning="purchase_state == ('to_approve')"
decoration-danger="purchase_state == 'cancelled'"
/>
<button
name="action_show_details"
type="object"
icon="fa-list"
title="Show Details"
width="0.1"
options='{"warn": true}'
/>
</tree>
</field>
<group class="oe_subtotal_footer oe_right">
<field name="currency_id" invisible="1" />
<div class="oe_subtotal_footer_separator oe_inline">
<label for="estimated_cost" />
</div>
<field
name="estimated_cost"
nolabel="1"
class="oe_subtotal_footer_separator"
widget="monetary"
options="{'currency_field': 'currency_id'}"
/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<record id="view_purchase_request_tree" model="ir.ui.view">
<field name="name">purchase.request.tree</field>
<field name="model">purchase.request</field>
<field name="arch" type="xml">
<tree
decoration-bf="message_needaction==True"
decoration-info="state in ('draft','to_approve')"
decoration-muted="state in ('rejected')"
name="Purchase Request"
>
<field name="message_needaction" invisible="1" />
<field name="name" />
<field name="date_start" />
<field name="requested_by" widget="many2one_avatar_user" />
<field
name="company_id"
groups="base.group_multi_company"
widget="selection"
/>
<field name="activity_ids" widget="list_activity" optional="show" />
<field name="origin" />
<field name="currency_id" invisible="1" />
<field name="estimated_cost" optional="hide" />
<field
name="state"
widget="badge"
decoration-success="state in ('done', 'approved')"
decoration-muted="state == 'draft'"
decoration-warning="state == 'to_approve'"
decoration-danger="state == 'rejected'"
/>
</tree>
</field>
</record>
<record id="view_purchase_request_search" model="ir.ui.view">
<field name="name">purchase.request.list.select</field>
<field name="model">purchase.request</field>
<field name="arch" type="xml">
<search string="Search Purchase Request">
<field name="name" string="Purchase Request" />
<separator />
<field name="product_id" />
<field name="state" />
<filter
name="unassigned"
string="Unassigned"
domain="[('assigned_to','=', False)]"
help="Unassigned Request"
/>
<separator />
<filter
name="state_draft"
string="Draft"
domain="[('state','=','draft')]"
help="Request is to be approved"
/>
<filter
name="state_to_approve"
string="To Approve"
domain="[('state','=','to_approve')]"
help="Request is to be approved"
/>
<filter
name="state_approved"
string="Approved"
domain="[('state','=','approved')]"
help="Request is approved"
/>
<filter
name="state_rejected"
string="Rejected"
domain="[('state','=','rejected')]"
help="Request is rejected"
/>
<filter
name="state_done"
string="Done"
domain="[('state','=','done')]"
help="Request is done"
/>
<separator />
<filter
string="Unread Messages"
name="message_needaction"
domain="[('message_needaction','=',True)]"
/>
<filter
name="assigned_to_me"
domain="[('assigned_to','=', uid)]"
help="Assigned to me"
/>
<filter
name="my_requests"
domain="[('requested_by','=', uid)]"
help="My requests"
/>
<field name="requested_by" />
<field name="assigned_to" />
<field name="picking_type_id" />
<group expand="0" string="Group By...">
<filter
name="requested_by"
string="Requested by"
icon="fa-user"
domain="[]"
context="{'group_by':'requested_by'}"
/>
<filter
name="assigned_to"
string="Assigned to"
icon="fa-user"
domain="[]"
context="{'group_by':'assigned_to'}"
/>
<filter
name="source"
string="Source"
icon="fa-caret-square-o-left"
domain="[]"
context="{'group_by':'origin'}"
/>
<filter
name="start_date"
string="Start Date"
icon="fa-calendar"
domain="[]"
context="{'group_by':'date_start'}"
/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="purchase_request_form_action">
<field name="name">Purchase Requests</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.request</field>
<field name="view_mode">tree,form</field>
<field name="context">{"search_default_requested_by":uid}</field>
<field name="search_view_id" ref="view_purchase_request_search" />
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to start a new purchase request process.
</p>
<p>
A purchase request is an instruction to Purchasing to procure
a certain quantity of materials services, so that they are
available at a certain point in time.
</p>
</field>
</record>
<menuitem
id="menu_purchase_request_pro_mgt"
parent="purchase.menu_procurement_management"
action="purchase_request_form_action"
/>
<menuitem
id="parent_menu_purchase_request"
name="Purchase Requests"
sequence="22"
web_icon="purchase_request,static/description/icon.png"
groups="group_purchase_request_user,group_purchase_request_manager"
/>
<menuitem
id="menu_purchase_request"
name="Purchase Requests"
parent="parent_menu_purchase_request"
groups="group_purchase_request_user,group_purchase_request_manager"
/>
<menuitem
id="menu_purchase_request_act"
sequence="10"
parent="menu_purchase_request"
action="purchase_request_form_action"
/>
</odoo>