summaryrefslogtreecommitdiff
path: root/indoteknik_custom/views/tukar_guling_po.xml
blob: 76d8590465eb078d99471692ee5409c6424ff5e5 (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
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
	<data>
		<!-- Action -->
		<record id="action_pengajuan_tukar_guling_po" model="ir.actions.act_window">
			<field name="name">Pengajuan Tukar Guling PO</field>
			<field name="type">ir.actions.act_window</field>
			<field name="res_model">tukar.guling.po</field>
			<field name="view_mode">tree,form</field>
		</record>

		<menuitem
				id="menu_pengajuan_tukar_guling_po"
				name="Pengajuan Tukar Guling PO"
				parent="purchase.menu_procurement_management"
				sequence="4"
				action="action_pengajuan_tukar_guling_po"
		/>

		<!-- Sequence -->
		<record id="seq_tukar_guling_po" model="ir.sequence">
			<field name="name">Pengajuan Tukar Guling PO</field>
			<field name="code">tukar.guling.po</field>
			<field name="prefix">PTGPO/</field>
			<field name="padding">5</field>
			<field name="number_next">1</field>
			<field name="number_increment">1</field>
			<field name="company_id" eval="False"/>
		</record>

		<!-- Tree View -->
		<record id="pengajuan_tukar_guling_po_tree" model="ir.ui.view">
			<field name="name">pengajuan.tukar.guling.po.tree</field>
			<field name="model">tukar.guling.po</field>
			<field name="arch" type="xml">
				<tree create="1" delete="1" default_order="create_date desc">
					<field name="name"/>
					<field name="date"/>
					<field name="operations" string="BU/Out"/>
					<field name="ba_num" string="Nomor BA"/>
					<field name="return_type" string="Return Type"/>
					<field name="state" widget="badge"
						decoration-info="state in ('draft', 'approval_purchase', 'approval_logistic','approval_finance')"
						decoration-success="state == 'done'"
						decoration-muted="state == 'cancel'"
					/>
				</tree>
			</field>
		</record>

		<!-- Form View -->
		<record id="pengajuan_tukar_guling_po_form" model="ir.ui.view">
			<field name="name">pengajuan.tukar.guling.po.form</field>
			<field name="model">tukar.guling.po</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_purchase', 'approval_logistic', 'approval_finance'])]}"/>
						<button name="action_cancel" string="Cancel" type="object"
							class="btn-secondary"
							attrs="{'invisible': [('state', '=', 'draft')]}"
							confirm="Are you sure you want to cancel this record?"/>
						<button name="action_draft" string="Set to Draft" type="object"
							class="btn-secondary"
							attrs="{'invisible': [('state', '!=', 'cancel')]}"
							confirm="Are you sure you want to reset this record to draft?"/>
						<field name="state" widget="statusbar" readonly="1"
							statusbar_visible="draft,approval_purchase,approval_logistic,approval_finance,done"/>
					</header>
					<sheet>
						<div class="oe_title">
							<h1>
								<field name="name" readonly="1" class="oe_inline"/>
							</h1>
							<hr/>
						</div>
						<group>
							<group>
								<field name="date" string="Date" readonly="1"/>
								<field name="return_type"/>
								<field name="operations" string="BU/Out"
									attrs="{
										'invisible': [('return_type', 'not in', ['revisi_po', 'debit_memo', 'tukar_guling'])],
										'required': [('return_type', 'in', ['revisi_po', 'debit_memo'])]
									}"/>
							</group>
							<group>
								<field name="ba_num" string="Nomor BA"/>
								<field name="notes"/>
							</group>
						</group>
						<notebook>
							<page string="Product Lines" name="product_lines">
								<field name="line_ids">
									<tree string="Product Lines" editable="bottom">
										<field name="sequence" widget="handle"/>
										<field name="product_id" required="1"
											options="{'no_create': True, 'no_create_edit': True}"/>
										<field name="name" force_save="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>
						</notebook>
					</sheet>
				</form>
			</field>
		</record>
	</data>
</odoo>