summaryrefslogtreecommitdiff
path: root/indoteknik_custom/views
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-06-16 14:38:40 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-06-16 14:38:40 +0700
commita0e90200638e26ad06d1caaf2d91d0aeea3ba19d (patch)
tree34adea34676cc913273ae3a4c87845ef5df204db /indoteknik_custom/views
parent0b6109930666039ed8e12569b6a9de7cbb4ea216 (diff)
<miqdad> add tukar guling PO and move from inventory
Diffstat (limited to 'indoteknik_custom/views')
-rw-r--r--indoteknik_custom/views/tukar_guling.xml196
-rw-r--r--indoteknik_custom/views/tukar_guling_po.xml117
2 files changed, 209 insertions, 104 deletions
diff --git a/indoteknik_custom/views/tukar_guling.xml b/indoteknik_custom/views/tukar_guling.xml
index 1556adcb..e008d2a1 100644
--- a/indoteknik_custom/views/tukar_guling.xml
+++ b/indoteknik_custom/views/tukar_guling.xml
@@ -1,127 +1,115 @@
<?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 Tukar Guling</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
+ <data>
+ <!-- Action -->
+ <record id="action_pengajuan_tukar_guling" model="ir.actions.act_window">
+ <field name="name">Pengajuan Tukar Guling 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 Tukar Guling"
- parent="stock.menu_warehouse_report"
+ name="Pengajuan Tukar Guling SO"
+ parent="sale.sale_order_menu"
sequence="3"
action="action_pengajuan_tukar_guling"
/>
-
- <!-- Sequence -->
- <record id="seq_tukar_guling" model="ir.sequence">
- <field name="name">Pengajuan Tukar Guling</field>
- <field name="code">tukar.guling</field>
- <field name="prefix">PTG/</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_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="1" delete="1" default_order="create_date desc">
- <field name="name"/>
- <field name="date"/>
- <field name="out_num" string="BU/Out"/>
- <field name="in_num" string="BU/In"/>
- <field name="ba_num" string="Nomor BA"/>
- <field name="return_type" string="Return Type"/>
- <field name="state" widget="badge"
- decoration-info="state in ('draft', 'waiting')"
+ <!-- Sequence -->
+ <record id="seq_tukar_guling" model="ir.sequence">
+ <field name="name">Pengajuan Tukar Guling SO</field>
+ <field name="code">tukar.guling</field>
+ <field name="prefix">PTG/</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_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="1" delete="1" default_order="create_date desc">
+ <field name="name"/>
+ <field name="date"/>
+ <field name="out_num" 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_sales', 'approval_logistic','approval_finance')"
decoration-success="state == 'done'"
decoration-muted="state == 'cancel'"
/>
- </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"
+ </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', '!=', 'waiting')]}"/>
- <button name="action_cancel" string="Cancel" type="object"
+ <button name="action_approve" string="Approve" type="object"
+ class="btn-primary"
+ attrs="{'invisible': [('state', 'not in', ['approval_sales', 'approval_logistic', 'approval_finance'])]}"/>
+ <button name="action_cancel" string="Cancel" type="object"
class="btn-secondary"
- attrs="{'invisible': [('state', 'in', ('done', 'cancel'))]}"
+ attrs="{'invisible': [('state', '=', 'draft')]}"
confirm="Are you sure you want to cancel this record?"/>
- <button name="action_draft" string="Set to Draft" type="object"
+ <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"/>
- </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="in_num" string="BU/In"
- attrs="{
- 'invisible': [('return_type', 'not in', ['debit_memo', 'revisi_po', 'tukar_guling'])],
- 'required': [('return_type', 'in', ['debit_memo', 'revisi_po'])]
- }"/>
-
- <field name="out_num" string="BU/Out"
+ <field name="state" widget="statusbar" readonly="1"
+ statusbar_visible="draft,approval_sales,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="out_num" string="BU/Out"
attrs="{
'invisible': [('return_type', 'not in', ['revisi_so', 'credit_memo', 'tukar_guling'])],
'required': [('return_type', 'in', ['revisi_so', 'credit_memo'])]
}"/>
- </group>
- <group>
- <field name="ba_num" string="Nomor BA"/>
- <field name="notes"/>
-<!-- <field name="state" readonly="1"/>-->
- </group>
- </group>
-
- <!-- Product Lines -->
- <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"
+ </group>
+ <group>
+ <field name="ba_num" string="Nomor BA"/>
+ <field name="notes"/>
+ </group>
+ </group>
+ <!-- Product Lines -->
+ <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"
+ <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>
+ </tree>
+ </field>
+ </page>
+ </notebook>
+ </sheet>
+ </form>
+ </field>
+ </record>
+ </data>
</odoo> \ No newline at end of file
diff --git a/indoteknik_custom/views/tukar_guling_po.xml b/indoteknik_custom/views/tukar_guling_po.xml
new file mode 100644
index 00000000..840b625b
--- /dev/null
+++ b/indoteknik_custom/views/tukar_guling_po.xml
@@ -0,0 +1,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="out_num" 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_sales', '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_sales', '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_sales,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="out_num" 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>