summaryrefslogtreecommitdiff
path: root/indoteknik_custom/views/tukar_guling.xml
blob: 609dea1593c06a3648ac953e950c5bb8fc05a745 (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
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
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
	<data>
		<!-- Action -->
		<record id="action_pengajuan_tukar_guling" model="ir.actions.act_window">
			<field name="name">Pengajuan Return SO</field>
			<field name="type">ir.actions.act_window</field>
			<field name="res_model">tukar.guling</field>
			<field name="view_mode">tree,form</field>
		</record>
		<!-- Menu -->
		<menuitem
				id="menu_pengajuan_tukar_guling"
				name="Pengajuan Return SO"
				parent="sale.sale_order_menu"
				sequence="7"
				action="action_pengajuan_tukar_guling"
		/>
		<!-- Tree View -->
		<record id="pengajuan_tukar_guling_tree" model="ir.ui.view">
			<field name="name">pengajuan.tukar.guling.tree</field>
			<field name="model">tukar.guling</field>
			<field name="arch" type="xml">
				<tree create="0" delete="1" default_order="create_date desc">
					<field name="name"/>
                    <field name="partner_id" string="Customer"/>
                    <field name="origin" string="SO Number"/>
					<field name="operations" string="Operations"/>
					<field name="return_type" string="Return Type"/>
					<field name="state" widget="badge"
						   decoration-info="state in ('draft', 'approval_sales', 'approval_finance','approval_logistic')"
                           decoration-warning="state == 'approved'"
						   decoration-success="state == 'done'"
						   decoration-muted="state == 'cancel'"
					/>
                    <field name="ba_num" string="Nomor BA"/>
                    <field name="date"/>
                    <field name="date_logistic" string="Approved Date"/>
				</tree>
			</field>
		</record>
		<!-- Form View -->
        <record id="pengajuan_tukar_guling_form" model="ir.ui.view">
            <field name="name">pengajuan.tukar.guling.form</field>
            <field name="model">tukar.guling</field>
            <field name="arch" type="xml">
                <form>
                    <header>
                        <button name="action_submit" string="Submit" type="object"
                                class="btn-primary"
                                attrs="{'invisible': [('state', '!=', 'draft')]}"/>
                        <button name="action_approve" string="Approve" type="object"
                                class="btn-primary"
                                attrs="{'invisible': [('state', 'not in', ['approval_sales', 'approval_finance', 'approval_logistic'])]}"/>
                        <button name="action_cancel" string="Cancel" type="object"
                                class="btn-secondary"
                                attrs="{'invisible': [('state', '=', 'cancel')]}"/>
                        <button name="action_draft" string="Set to Draft" type="object"
                                class="btn-secondary"
                                attrs="{'invisible': [('state', '!=', 'cancel')]}"/>
                        <field name="state" widget="statusbar" readonly="1"
                               statusbar_visible="draft,approval_sales,approval_logistic,approval_finance,approved,done"/>
                    </header>
                    <sheet>
                        <div class="oe_button_box">
                            <button name="action_view_picking"
                                    type="object"
                                    class="oe_stat_button"
                                    icon="fa-truck"
                                    attrs="{'invisible': [('picking_ids', '=', False), ('state', 'in', ['draft', 'approval_sales', 'approval_logistic', 'approval_finance', 'approved', 'done', 'cancel'])]}">
                                <field name="picking_ids" widget="statinfo" string="Delivery"/>
                            </button>
                        </div>
                        <div class="oe_title">
                            <h1>
                                <field name="name" readonly="1" class="oe_inline"/>
                            </h1>
                        </div>
                        <group>
                            <group>
                                <field name="date" string="Date" readonly="1"/>
                                <field name="partner_id" readonly="1"/>
                                <field name="return_type" attrs="{'readonly': [('state', 'not in', 'draft')]}"/>
                                <field name="operations"
                                       attrs="{'readonly': [('state', 'not in', 'draft')]}"/>
<!--                                <field name="origin" readonly="1"/>-->
                                <field name="origin_so" readonly="1"/>
                                <field name="rev_tukar_guling" attrs="{'invisible': [('return_type', '!=', 'tukar_guling')]}"/>
                                <field name="is_has_invoice" readonly="1"/>
                            </group>
                            <group>
                                <field name="val_inv_opt" attrs="{'invisible': [('is_has_invoice', '=', False)]}"/>
                                <field name="ba_num" string="Nomor BA"/>
                                <field name="notes"/>
                                <field name="date_sales" readonly="1"/>
                                <field name="date_finance" readonly="1"/>
                                <field name="date_logistic" readonly="1"/>
                            </group>
                            <group>
                                <field name="invoice_id" readonly="1" attrs="{'invisible': [('is_has_invoice', '=', False)]}"/>
                            </group>
                        </group>
                        <notebook>
                            <page string="Product Lines" name="product_lines">
                                <field name="line_ids">
                                    <tree string="Product Lines" editable="top" create="0" delete="1">
                                        <field name="sequence" widget="handle"/>
                                        <field name="product_id" required="0"
                                               options="{'no_create': True, 'no_create_edit': True}" readonly="0"/>
                                        <field name="name" force_save="0" readonly="1"/>
                                        <field name="product_uom_qty" string="Quantity"/>
                                        <field name="product_uom" string="UoM"
                                               options="{'no_create': True, 'no_create_edit': True}"/>
                                    </tree>
                                </field>
                            </page>
                            <page string="Mapping Koli" name="mapping_koli">
                                <field name="mapping_koli_ids">
                                    <tree editable="top" create="0" delete="1">
                                        <field name="pick_id" readonly="1" force_save="1"/>
                                        <field name="product_id" readonly="1" force_save="1"/>
                                        <field name="qty_done" force_save="1" readonly="1"/>
                                        <field name="qty_return"/>
                                    </tree>
                                </field>
                            </page>
                        </notebook>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids" widget="mail_followers"/>
                        <field name="message_ids" widget="mail_thread"/>
                    </div>
                </form>
            </field>
        </record>
        <record id="view_tukar_guling_filter" model="ir.ui.view">
            <field name="name">tukar.guling.filter</field>
            <field name="model">tukar.guling</field>
            <field name="arch" type="xml">
                <search string="Tukar Guling">
                    <field name="name" string="No. Dokumen"/>
                    <field name="partner_id" string="Customer"/>
                    <field name="origin" string="SO Number"/>
                    <field name="operations" string="Operations"/>
                    <!-- <filter string="Pengajuan Saya" name="my_tukar_guling" domain="[('create_uid', '=', uid)]"/> -->
                    <separator/>
                    <filter string="Tukar Guling" name="tukar_guling" domain="[('return_type', '=', 'tukar_guling')]"/>
                    <filter string="Return SO" name="return_so" domain="[('return_type', '=', 'retur_so')]"/>
                    <separator/>
                    <filter string="Approval Sales" name="approval_sales" domain="[('state', '=', 'approval_sales')]"/>
                    <filter string="Approval Logistic" name="approval_logistic" domain="[('state', '=', 'approval_logistic')]"/>
                    <filter string="Approval Finance" name="approval_finance" domain="[('state', '=', 'approval_finance')]"/>
                    <filter string="Approved" name="approved" domain="[('state', '=', 'approved')]"/>
                    <separator/>
                    <filter string="Done" name="done" domain="[('state', '=', 'done')]"/>
                    <filter string="Cancelled" name="cancel" domain="[('state', '=', 'cancel')]"/>
                </search>
            </field>
        </record>
    </data>
</odoo>