diff options
Diffstat (limited to 'indoteknik_custom/views/refund_sale_order.xml')
| -rw-r--r-- | indoteknik_custom/views/refund_sale_order.xml | 309 |
1 files changed, 309 insertions, 0 deletions
diff --git a/indoteknik_custom/views/refund_sale_order.xml b/indoteknik_custom/views/refund_sale_order.xml new file mode 100644 index 00000000..0c6cd371 --- /dev/null +++ b/indoteknik_custom/views/refund_sale_order.xml @@ -0,0 +1,309 @@ +<?xml version="1.0" encoding="UTF-8"?> +<odoo> + <!-- Tree View --> + <record id="view_refund_sale_order_tree" model="ir.ui.view"> + <field name="name">refund.sale.order.tree</field> + <field name="model">refund.sale.order</field> + <field name="arch" type="xml"> + <tree string="Refund Sales Orders"> + <field name="name" readonly="1"/> + <field name="created_date" readonly="1"/> + <field name="partner_id" readonly="1"/> + <field name="sale_order_ids" widget="many2many_tags" readonly="1"/> + <field name="uang_masuk" readonly="1"/> + <field name="ongkir" readonly="1"/> + <field name="total_invoice" readonly="1"/> + <field name="amount_refund" readonly="1"/> + <field name="remaining_refundable" readonly="1" optional="hide"/> + <field name="status" + decoration-info="status == 'draft'" + decoration-danger="status == 'reject'" + decoration-success="status == 'refund'" + decoration-warning="status == 'pengajuan1' or status == 'pengajuan2' or status == 'pengajuan3'" + widget="badge" + readonly="1"/> + <field name="status_payment" + decoration-info="status_payment == 'pending'" + decoration-danger="status_payment == 'reject'" + decoration-success="status_payment == 'done'" + widget="badge" + readonly="1"/> + <field name="refund_date" readonly="1"/> + <field name="amount_refund_text" readonly="1" optional="hide"/> + <field name="invoice_ids" readonly="1" optional="hide"/> + <field name="refund_type" readonly="1" optional="hide"/> + <field name="user_ids" readonly="1" optional="hide"/> + </tree> + </field> + </record> + + <!-- Form View --> + <record id="view_refund_sale_order_form" model="ir.ui.view"> + <field name="name">refund.sale.order.form</field> + <field name="model">refund.sale.order</field> + <field name="arch" type="xml"> + <form string="Refund Sales Order"> + <header> + <button name="action_ask_approval" + type="object" + string="Ask Approval" + attrs="{'invisible': [('status', '!=', 'draft')]}"/> + + <button name="action_approve_flow" + type="object" + string="Approve" + class="oe_highlight" + attrs="{'invisible': [('status', 'in', ['refund', 'reject', 'draft'])]}"/> + <button name="action_trigger_cancel" + type="object" + string="Cancel" + attrs="{'invisible': ['|', ('status_payment', '!=', 'pending'), ('status', 'in', ['reject', 'refund'])]}" /> + <button name="action_confirm_refund" + type="object" + string="Confirm Payment" + class="btn-primary" + attrs="{'invisible': ['|', ('status', 'not in', ['pengajuan3','refund']), ('status_payment', '!=', 'pending')]}"/> + <button name="action_create_journal_refund" + string="AP Only" + type="object" + class="oe_highlight" + attrs="{'invisible': ['|', ('journal_refund_state', 'in', ['posted', 'draft']), ('status', 'not in', ['pengajuan3','refund'])]}"/> + <button name="action_create_tukar_guling" + string="Create Return" + type="object" + class="oe_highlight" + attrs="{'invisible': [('refund_type', 'not in', ['retur_half', 'retur'])]}"/> + + <field name="status" + widget="statusbar" + statusbar_visible="draft,pengajuan1,pengajuan2,pengajuan3,reject" + attrs="{'invisible': [('status', '!=', 'reject')]}" /> + + <field name="status" + widget="statusbar" + statusbar_visible="draft,pengajuan1,pengajuan2,pengajuan3,refund" + attrs="{'invisible': [('status', '=', 'reject')]}" /> + </header> + <xpath expr="//sheet" position="inside"> + <field name="show_return_alert" invisible="1"/> + <div class="alert alert-danger" role="alert" + attrs="{'invisible': [('show_return_alert', '=', False)]}"> + ⚠️ SO belum melakukan retur barang. Silakan buat pengajuan retur. + </div> + <field name="show_approval_alert" invisible="1"/> + <div class="alert alert-info" role="alert" + attrs="{'invisible': ['|', ('show_approval_alert', '=', False), ('status', 'in', ['reject', 'refund'])]}"> + ⚠️ SO sudah melakukan retur barang. Silakan lanjutkan refund. + </div> + </xpath> + <sheet> + <div class="oe_button_box" name="button_box"> + <button name="action_open_journal_refund" + type="object" + class="oe_stat_button" + icon="fa-book" + width="250px" + attrs="{'invisible': [('journal_refund_move_id', '=', False)]}"> + <field name="journal_refund_move_id" string="Journal Refund" widget="statinfo"/> + </button> + + <button name="action_open_tukar_guling" + type="object" + class="oe_stat_button" + icon="fa-refresh" + attrs="{'invisible': ['|', ('tukar_guling_count','=', 0), ('has_picking','=',True)]}"> + <div class="o_stat_info"> + <field name="tukar_guling_count" widget="statinfo"/> + <span class="o_stat_text">Pengajuan Return SO</span> + </div> + </button> + + <button name="action_view_picking" + type="object" + class="oe_stat_button" + icon="fa-truck" + attrs="{'invisible': [('has_picking','=',False)]}"> + <field name="picking_ids" widget="statinfo" string="Delivery"/> + </button> + </div> + <widget name="web_ribbon" + title="PAID" + bg_color="bg-success" + attrs="{'invisible': [('status_payment', '!=', 'done')]}"/> + + <widget name="web_ribbon" + title="CANCEL" + bg_color="bg-danger" + attrs="{'invisible': [('status_payment', '!=', 'reject')]}"/> + <h1> + <field name="name" readonly="1"/> + </h1> + <group col="2"> + <group> + <field name="is_locked" invisible="1"/> + <field name="status_payment" invisible="1"/> + <field name="journal_refund_state" invisible="1"/> + + <field name="partner_id" attrs="{'readonly': [('is_locked', '=', True)]}"/> + <field name="sale_order_ids" widget="many2many_tags" attrs="{'readonly': [('is_locked', '=', True)], 'invisible': [('refund_type', '=', 'salah_transfer')]}"/> + <field name="invoice_ids" widget="many2many_tags" readonly="1" attrs="{'invisible': [('refund_type', '=', 'salah_transfer')]}"/> + <field name="tukar_guling_count" invisible="1"/> + <field name="invoice_names" widget="html" readonly="1" attrs="{'invisible': [('refund_type', '=', 'salah_transfer')]}"/> + <field name="so_names" widget="html" readonly="1" attrs="{'invisible': [('refund_type', '=', 'salah_transfer')]}"/> + <field name="advance_move_names" widget="html" readonly="1" attrs="{'invisible': [('refund_type', '=', 'salah_transfer')]}"/> + <field name="transfer_move_id" + attrs="{'invisible': [('refund_type', '!=', 'salah_transfer')], + 'required': [('refund_type', '=', 'salah_transfer')]}"/> + <field name="refund_type" attrs="{'readonly': [('is_locked', '=', True)]}"/> + <field name="note_refund" attrs="{'readonly': [('is_locked', '=', True)]}"/> + </group> + <group> + <field name="uang_masuk" attrs="{'readonly': [('refund_type', '!=', 'salah_transfer')]}"/> + <field name="total_invoice" readonly="1" attrs="{'invisible': [('refund_type', '=', 'salah_transfer')]}"/> + <field name="ongkir" attrs="{'readonly': [('is_locked', '=', True)], 'invisible': [('refund_type', '=', 'salah_transfer')]}"/> + <field name="amount_refund" attrs="{'readonly': [('is_locked', '=', True)]}"/> + <field name="amount_refund_text" readonly="1"/> + <field name="sale_order_count" invisible="1"/> + <field name="has_picking" invisible="1"/> + <field name="tukar_guling_ids" invisible="1"/> + <field name="remaining_refundable" readonly="1" attrs="{'invisible': [('sale_order_count', '>', 1)]}"/> + <field name="uang_masuk_type" required="1" attrs="{'readonly': [('is_locked', '=', True)]}"/> + <field name="bukti_uang_masuk_image" widget="image" + attrs="{'invisible': [('uang_masuk_type', '=', 'pdf')], 'readonly': [('is_locked', '=', True)]}"/> + <field name="bukti_uang_masuk_pdf" widget="pdf_viewer" + attrs="{'invisible': [('uang_masuk_type', '=', 'image')], 'readonly': [('is_locked', '=', True)]}"/> + </group> + </group> + + <notebook> + <page string="Produk Line"> + <field name="line_ids" attrs="{'readonly': [('is_locked', '=', True)]}"> + <tree editable="bottom" create="0" delete="1"> + <field name="from_name"/> + <field name="prod_id" invisible="1"/> + <field name="ref_id" invisible="1"/> + <field name="product_id"/> + <field name="quantity"/> + <field name="price_unit"/> + <field name="discount"/> + <field name="subtotal"/> + <field name="tax" widget="many2many_tags"/> + <field name="tax_amt" widget="monetary" options="{'currency_field': 'currency_id'}"/> + <field name="total" widget="monetary" options="{'currency_field': 'currency_id'}" sum="Grand Total"/> + <field name="reason"/> + </tree> + </field> + </page> + + <page string="Other Info"> + <group col="2"> + <group> + <field name="user_ids" widget="many2many_tags" readonly="1"/> + <field name="created_date" readonly="1"/> + <field name="refund_date" attrs="{'readonly': [('status', 'not in', ['pengajuan3','refund'])]}"/> + </group> + <group> + <field name="bank" attrs="{'readonly': [('is_locked', '=', True)]}"/> + <field name="account_name" attrs="{'readonly': [('is_locked', '=', True)]}"/> + <field name="account_no" attrs="{'readonly': [('is_locked', '=', True)]}"/> + <field name="kcp" attrs="{'readonly': [('is_locked', '=', True)]}"/> + </group> + </group> + </page> + + <page string="Finance Note"> + <group col="2"> + <group> + <field name="finance_note"/> + </group> + <group> + <field name="bukti_refund_type" reqiured="1"/> + <field name="bukti_transfer_refund_pdf" widget="pdf_viewer" attrs="{'invisible': [('bukti_refund_type', '=', 'image')]}"/> + <field name="bukti_transfer_refund_image" widget="image" attrs="{'invisible': [('bukti_refund_type', '=', 'pdf')]}"/> + </group> + </group> + </page> + <page string="Sales Order Lines"> + <field name="so_order_line_ids" nolabel="1" readonly="1"> + <tree> + <field name="order_id"/> + <field name="product_id"/> + <field name="purchase_price"/> + <field name="product_uom_qty"/> + <field name="price_unit"/> + <field name="tax_id" widget="many2many_tags"/> + <field name="discount"/> + <field name="price_subtotal"/> + <field name="item_percent_margin"/> + <field name="item_percent_margin_before"/> + </tree> + </field> + <group class="oe_subtotal_footer oe_right" colspan="2" name="refund_total"> + <field name="amount_untaxed" widget="monetary" options="{'currency_field': 'currency_id'}" readonly="1"/> + <field name="amount_tax" widget="monetary" options="{'currency_field': 'currency_id'}" readonly="1"/> + <div class="oe_subtotal_footer_separator oe_inline o_td_label"> + <label for="amount_total"/> + </div> + <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" + widget="monetary" options="{'currency_field': 'currency_id'}" readonly="1"/> + <field name="delivery_amt" widget="monetary" options="{'currency_field': 'currency_id'}" readonly="1"/> + <div class="oe_subtotal_footer_separator oe_inline o_td_label"> + <label for="grand_total"/> + </div> + <field name="grand_total" nolabel="1" class="oe_subtotal_footer_separator" + widget="monetary" options="{'currency_field': 'currency_id'}" readonly="1"/> + <field name="total_margin" widget="monetary" options="{'currency_field': 'currency_id'}" readonly="1"/> + </group> + </page> + + <page string="Cancel Reason" attrs="{'invisible': [('status', '=', 'refund')]}"> + <group> + <field name="reason_reject"/> + </group> + </page> + + <page string="Return Line" attrs="{'invisible': ['|', ('tukar_guling_count','=', 0), ('has_picking', '=', False)]}"> + <group> + <field name="tukar_guling_ids" readonly="1" nolabel="1"> + <tree> + <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"/> + </tree> + </field> + </group> + </page> + </notebook> + </sheet> + <div class="oe_chatter"> + <field name="message_follower_ids" widget="mail_followers"/> + <field name="message_ids" widget="mail_thread"/> + <field name="activity_ids" widget="mail_activity"/> + </div> + </form> + </field> + </record> + <!-- Action --> + <record id="action_refund_sale_order" model="ir.actions.act_window"> + <field name="name">Refund Sales Order</field> + <field name="res_model">refund.sale.order</field> + <field name="view_mode">tree,form</field> + </record> + + <!-- Menu --> + <menuitem id="menu_refund_sale_order" + name="Refund" + parent="sale.sale_order_menu" + sequence="10" + action="action_refund_sale_order"/> +</odoo> |
