|
2 | 2 | <!-- Copyright 2019-2020 ForgeFlow S.L.
|
3 | 3 | License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
4 | 4 | <odoo>
|
5 |
| - <record id="view_purchase_request_form_inherit_tier" model="ir.ui.view"> |
6 |
| - <field name="name">purchase.request.tier.validation.form</field> |
7 |
| - <field name="model">purchase.request</field> |
8 |
| - <field name="inherit_id" ref="purchase_request.view_purchase_request_form" /> |
9 |
| - <field name="arch" type="xml"> |
10 |
| - <button name="button_approved" position="attributes"> |
11 |
| - <attribute |
12 |
| - name="attrs" |
13 |
| - >{'invisible': ['|','&',('validated', '!=', True),('need_validation', '=', True),'|',('need_validation', '=', True),('state', 'not in', ['draft'])]}</attribute> |
14 |
| - <attribute name="string">Confirm</attribute> |
15 |
| - <attribute |
16 |
| - name="groups" |
17 |
| - >purchase_request.group_purchase_request_manager</attribute> |
18 |
| - </button> |
19 |
| - <button name="button_to_approve" position="attributes"> |
20 |
| - <attribute name="invisible">1</attribute> |
21 |
| - </button> |
22 |
| - <button name="button_approved" position="before"> |
23 |
| - <button |
24 |
| - name="request_validation" |
25 |
| - string="Request Validation" |
26 |
| - attrs="{'invisible': ['|','|',('need_validation', '!=', True),('rejected','=',True),('state','not in',['draft','sent'])]}" |
27 |
| - type="object" |
28 |
| - /> |
29 |
| - <button |
30 |
| - name="restart_validation" |
31 |
| - string="Restart Validation" |
32 |
| - attrs="{'invisible': ['|',('review_ids', '=', []),('state','not in',['to_approve','draft'])]}" |
33 |
| - type="object" |
34 |
| - /> |
35 |
| - </button> |
36 |
| - <field name="state" position="attributes"> |
37 |
| - <attribute |
38 |
| - name="statusbar_visible" |
39 |
| - >draft,approved,done,rejected</attribute> |
40 |
| - </field> |
41 |
| - <header position="after"> |
42 |
| - <field name="need_validation" invisible="1" /> |
43 |
| - <field name="validated" invisible="1" /> |
44 |
| - <field name="rejected" invisible="1" /> |
45 |
| - <div |
46 |
| - class="alert alert-warning" |
47 |
| - role="alert" |
48 |
| - attrs="{'invisible': ['|', '|', '|', |
49 |
| - ('validated', '=', True), ('state', 'not in', ['draft','sent']), |
50 |
| - ('rejected', '=', True), ('review_ids', '=', [])]}" |
51 |
| - style="margin-bottom:0px;" |
52 |
| - > |
53 |
| - <p style="line-height:30px"><i |
54 |
| - class="fa fa-info-circle" |
55 |
| - />This Purchase Request needs to be |
56 |
| - validated. |
57 |
| - <field name="can_review" invisible="1" /> |
58 |
| - <button |
59 |
| - name="validate_tier" |
60 |
| - string="Validate" |
61 |
| - attrs="{'invisible': [('can_review', '=', False)]}" |
62 |
| - type="object" |
63 |
| - class="oe_inline oe_button btn-success" |
64 |
| - icon="fa-thumbs-up" |
65 |
| - /> |
66 |
| - <button |
67 |
| - name="reject_tier" |
68 |
| - string="Reject" |
69 |
| - attrs="{'invisible': [('can_review', '=', False)]}" |
70 |
| - type="object" |
71 |
| - class="btn-icon btn-danger" |
72 |
| - icon="fa-thumbs-down" |
73 |
| - /> |
74 |
| - </p> |
75 |
| - </div> |
76 |
| - <div |
77 |
| - class="alert alert-success" |
78 |
| - role="alert" |
79 |
| - attrs="{'invisible': ['|', '|', ('validated', '!=', True), ('state', 'not in', ['draft','sent']), ('review_ids', '=', [])]}" |
80 |
| - style="margin-bottom:0px;" |
81 |
| - > |
82 |
| - <p><i class="fa fa-thumbs-up" /> Operation has been <b |
83 |
| - >validated</b>!</p> |
84 |
| - </div> |
85 |
| - <div |
86 |
| - class="alert alert-danger" |
87 |
| - role="alert" |
88 |
| - attrs="{'invisible': ['|', '|', ('rejected', '!=', True), ('state', 'not in', ['draft','sent']), ('review_ids', '=', [])]}" |
89 |
| - style="margin-bottom:0px;" |
90 |
| - > |
91 |
| - <p><i class="fa fa-thumbs-down" /> Operation has been <b |
92 |
| - >rejected</b>.</p> |
93 |
| - </div> |
94 |
| - </header> |
95 |
| - <xpath expr="//form/div[hasclass('oe_chatter')]" position="before"> |
96 |
| - <field |
97 |
| - name="review_ids" |
98 |
| - widget="tier_validation" |
99 |
| - attrs="{'invisible':[('review_ids', '=', [])]}" |
100 |
| - /> |
101 |
| - </xpath> |
102 |
| - </field> |
103 |
| - </record> |
104 | 5 | <record id="view_purchase_request_filter" model="ir.ui.view">
|
105 | 6 | <field
|
106 | 7 | name="name"
|
|
0 commit comments