blob: e4f309fda5e471f2d29e4e7457db2419d4afb222 (
plain)
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
|
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="user_merchant_request_tree" model="ir.ui.view">
<field name="name">user.merchant.request.tree</field>
<field name="model">user.merchant.request</field>
<field name="arch" type="xml">
<tree create="1" default_order="create_date desc">
<field name="user_id"/>
<field name="merchant_id"/>
<field name="state_merchant" decoration-success="state_merchant == 'approved'" decoration-danger="state_merchant == 'reject'" widget="badge" optional="show"/>
<field name="create_date"/>
</tree>
</field>
</record>
<record id="user_merchant_request_form" model="ir.ui.view">
<field name="name">user.merchant.request.form</field>
<field name="model">user.merchant.request</field>
<field name="arch" type="xml">
<form create="0">
<header>
<button name="button_approve"
string="Approve Merchant"
attrs="{'invisible': [('state_merchant', 'in', ['approved','reject'])]}"
type="object"
class="oe_highlight"/>
<button name="button_reject"
string="Reject"
attrs="{'invisible': [('state_merchant', 'in', ['approved','reject'])]}"
type="object"
groups="purchase.group_purchase_manager"
class="oe_highlight"/>
<field name="state_merchant" widget="statusbar"
statusbar_visible="draft,approved"
statusbar_colors='{"reject":"red"}'/>
</header>
<sheet>
<group>
<group>
<field name="user_id" readonly="1"/>
<field name="merchant_id"/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<!-- Wizard for Reject Reason -->
<record id="view_reject_reason_wizard_merchant_form" model="ir.ui.view">
<field name="name">reject.reason.wizard.merchant.form</field>
<field name="model">reject.reason.wizard.merchant</field>
<field name="arch" type="xml">
<form string="Reject Reason">
<group>
<field name="reason_reject" widget="text"/>
</group>
<footer>
<button string="Confirm" type="object" name="confirm_reject" class="btn-primary"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="action_reject_reason_wizard_merchant" model="ir.actions.act_window">
<field name="name">Reject Reason</field>
<field name="res_model">reject.reason.wizard.merchant</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record id="view_confirm_approval_wizard_merchant_form" model="ir.ui.view">
<field name="name">confirm.approval.wizard.merchant.form</field>
<field name="model">confirm.approval.wizard.merchant</field>
<field name="arch" type="xml">
<form string="Konfirmasi Approval">
<group>
<p>Apakah Anda yakin ingin mengapprove merchant ini?</p>
</group>
<footer>
<button string="Batal" class="btn-secondary" special="cancel"/>
<button string="Konfirmasi" type="object" name="confirm_approval" class="btn-primary"/>
</footer>
</form>
</field>
</record>
<record id="action_user_merchant_request" model="ir.actions.act_window">
<field name="name">User Merchant Request</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">user.merchant.request</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
id="menu_user_merchant_request"
name="User Merchant Request"
parent="res_partner_menu_user"
sequence="2"
action="action_user_merchant_request"
/>
</odoo>
|