diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-09-11 13:18:02 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-09-11 13:18:02 +0700 |
| commit | 1694e042acb29b476815d29f54f2ec95d37883be (patch) | |
| tree | d502c76d333cc4c0602e01a98eeb7fb7f0461c01 /indoteknik_custom/views/sale_order.xml | |
| parent | 02c2304b242245250177fec6ab3c911d9acba781 (diff) | |
| parent | 9a630354c1d00e218595db9b2e8cd0b7df9ed97c (diff) | |
Merge branch 'feature/voucher-group' into production
Diffstat (limited to 'indoteknik_custom/views/sale_order.xml')
| -rwxr-xr-x | indoteknik_custom/views/sale_order.xml | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 91ce1463..f2cab699 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -26,7 +26,17 @@ <field name="delivery_amt"/> <field name="fee_third_party"/> <field name="total_percent_margin"/> - <field name="voucher_id" readonly="1" /> + <label for="voucher_id"/> + <div class="o_row"> + <field name="voucher_id" id="voucher_id" attrs="{'readonly': ['|', ('state', 'not in', ['draft', 'sent']), ('applied_voucher_id', '!=', False)]}"/> + <field name="applied_voucher_id" invisible="1" /> + <button name="action_apply_voucher" type="object" string="Apply" confirm="Anda yakin untuk menggunakan voucher?" help="Apply the selected voucher" class="btn-link mb-1 px-0" icon="fa-plus" + attrs="{'invisible': ['|', '|', ('voucher_id', '=', False), ('state', 'not in', ['draft', 'sent']), ('applied_voucher_id', '!=', False)]}" + /> + <button name="cancel_voucher" type="object" string="Cancel" confirm="Anda yakin untuk membatalkan penggunaan voucher?" help="Cancel applied voucher" class="btn-link mb-1 px-0" icon="fa-times" + attrs="{'invisible': ['|', ('applied_voucher_id', '=', False), ('state', 'not in', ['draft','sent'])]}" + /> + </div> </field> <field name="source_id" position="attributes"> <attribute name="invisible">1</attribute> @@ -49,6 +59,11 @@ <field name="date_doc_kirim" readonly="1"/> <field name="notification" readonly="1"/> </field> + <xpath expr="//form/sheet/notebook/page/field[@name='order_line']" position="attributes"> + <attribute name="attrs"> + {'readonly': ['|', ('applied_voucher_id', '!=', False), ('state', 'in', ('done','cancel'))]} + </attribute> + </xpath> <xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_unit']" position="attributes"> <attribute name="attrs"> { @@ -75,7 +90,7 @@ <field name="item_percent_margin"/> <field name="note_procurement" optional="hide"/> <field name="vendor_subtotal" optional="hide"/> - <field name="amount_voucher_disc" string="Voucher" optional="hide"/> + <field name="amount_voucher_disc" string="Voucher" readonly="1" optional="hide"/> <field name="program_line_id" optional="1" /> </xpath> <xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='product_id']" position="before"> @@ -85,7 +100,7 @@ <field name="grand_total"/> <label for="amount_voucher_disc" string="Voucher" /> <div> - <field class="mb-0" name="amount_voucher_disc" string="Voucher"/> + <field class="mb-0" name="amount_voucher_disc" string="Voucher" readonly="1"/> <div class="text-right mb-2"><small>*Hanya informasi</small></div> </div> <field name="total_margin"/> |
