changes
This commit is contained in:
202
fusion_rental/views/sale_order_views.xml
Normal file
202
fusion_rental/views/sale_order_views.xml
Normal file
@@ -0,0 +1,202 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<record id="sale_order_form_inherit_fusion_rental" model="ir.ui.view">
|
||||
<field name="name">sale.order.form.inherit.fusion.rental</field>
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale_renting.rental_order_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
|
||||
<!-- Header buttons -->
|
||||
<button name="action_open_pickup" position="before">
|
||||
<button name="action_send_rental_agreement"
|
||||
type="object"
|
||||
class="btn-secondary"
|
||||
string="Send Agreement"
|
||||
data-hotkey="a"
|
||||
invisible="not is_rental_order or state != 'sale' or rental_agreement_signed"
|
||||
icon="fa-file-text-o"/>
|
||||
<button name="action_manual_renewal"
|
||||
type="object"
|
||||
class="btn-secondary"
|
||||
string="Renew Rental"
|
||||
data-hotkey="r"
|
||||
invisible="not is_rental_order or state != 'sale' or rental_status not in ('pickup', 'return')"
|
||||
icon="fa-refresh"/>
|
||||
|
||||
<!-- Deposit buttons -->
|
||||
<button name="action_create_deposit_invoice"
|
||||
type="object"
|
||||
class="btn-secondary"
|
||||
string="Create Deposit Invoice"
|
||||
invisible="not is_rental_order or state != 'sale' or rental_deposit_invoice_id"
|
||||
icon="fa-file-text"/>
|
||||
<button name="action_mark_deposit_collected"
|
||||
type="object"
|
||||
class="btn-secondary"
|
||||
string="Mark Deposit Collected"
|
||||
invisible="not is_rental_order or rental_deposit_status != 'pending'"
|
||||
icon="fa-check-circle"/>
|
||||
<button name="action_refund_deposit"
|
||||
type="object"
|
||||
class="btn-secondary"
|
||||
string="Refund Deposit"
|
||||
invisible="not is_rental_order or rental_deposit_status != 'collected'"
|
||||
confirm="This will initiate the deposit refund hold period. Continue?"
|
||||
icon="fa-undo"/>
|
||||
<button name="action_force_refund_deposit"
|
||||
type="object"
|
||||
class="btn-secondary"
|
||||
string="Process Refund Now"
|
||||
invisible="not is_rental_order or rental_deposit_status != 'refund_hold'"
|
||||
confirm="Skip the hold period and process the refund immediately?"
|
||||
icon="fa-bolt"/>
|
||||
<button name="action_deduct_deposit"
|
||||
type="object"
|
||||
class="btn-danger"
|
||||
string="Deduct Deposit"
|
||||
invisible="not is_rental_order or rental_deposit_status != 'collected'"
|
||||
icon="fa-minus-circle"/>
|
||||
|
||||
<button name="action_close_rental"
|
||||
type="object"
|
||||
class="btn-warning"
|
||||
string="Close Rental"
|
||||
data-hotkey="x"
|
||||
invisible="not is_rental_order or state != 'sale' or rental_closed or rental_deposit_status not in ('refunded', 'deducted', False)"
|
||||
confirm="This will delete the stored card and send a thank-you email. Continue?"
|
||||
icon="fa-power-off"/>
|
||||
</button>
|
||||
|
||||
<!-- Rental fields -->
|
||||
<field name="duration_days" position="after">
|
||||
<!-- Renewal settings -->
|
||||
<field name="rental_auto_renew" invisible="not is_rental_order"/>
|
||||
<field name="rental_renewal_count" invisible="not is_rental_order or rental_renewal_count == 0"/>
|
||||
<field name="rental_max_renewals" invisible="not is_rental_order or not rental_auto_renew"/>
|
||||
<field name="rental_payment_token_id" invisible="not is_rental_order"/>
|
||||
<field name="rental_next_renewal_date" invisible="not is_rental_order or not rental_auto_renew"/>
|
||||
<field name="rental_reminder_sent" invisible="1"/>
|
||||
<field name="rental_original_duration" invisible="1"/>
|
||||
<field name="rental_agreement_token" invisible="1"/>
|
||||
|
||||
<!-- Agreement status -->
|
||||
<field name="rental_agreement_signed" invisible="not is_rental_order"
|
||||
widget="boolean_toggle" readonly="1"/>
|
||||
<field name="rental_agreement_signer_name"
|
||||
invisible="not is_rental_order or not rental_agreement_signed" readonly="1"/>
|
||||
<field name="rental_agreement_signed_date"
|
||||
invisible="not is_rental_order or not rental_agreement_signed" readonly="1"/>
|
||||
|
||||
<!-- Rental charges invoice -->
|
||||
<field name="rental_charges_invoice_id"
|
||||
invisible="not is_rental_order or not rental_charges_invoice_id" readonly="1"/>
|
||||
|
||||
<!-- Deposit status -->
|
||||
<field name="rental_deposit_status" invisible="not is_rental_order or not rental_deposit_status"
|
||||
decoration-success="rental_deposit_status == 'refunded'"
|
||||
decoration-warning="rental_deposit_status in ('pending', 'refund_hold', 'collected')"
|
||||
decoration-danger="rental_deposit_status == 'deducted'"
|
||||
widget="badge"/>
|
||||
<field name="rental_deposit_invoice_id"
|
||||
invisible="not is_rental_order or not rental_deposit_invoice_id" readonly="1"/>
|
||||
|
||||
<!-- Inspection status -->
|
||||
<field name="rental_inspection_status"
|
||||
invisible="not is_rental_order or not rental_inspection_status"
|
||||
decoration-success="rental_inspection_status == 'passed'"
|
||||
decoration-danger="rental_inspection_status == 'flagged'"
|
||||
widget="badge"/>
|
||||
|
||||
<!-- Purchase interest -->
|
||||
<field name="rental_purchase_interest"
|
||||
invisible="not is_rental_order or not rental_purchase_interest"
|
||||
widget="boolean_toggle" readonly="1"/>
|
||||
<field name="rental_purchase_coupon_id"
|
||||
invisible="not is_rental_order or not rental_purchase_coupon_id" readonly="1"/>
|
||||
|
||||
<!-- Close status -->
|
||||
<field name="rental_closed"
|
||||
invisible="not is_rental_order or not rental_closed" readonly="1"/>
|
||||
<field name="rental_marketing_email_sent" invisible="1"/>
|
||||
</field>
|
||||
|
||||
<!-- Notebook pages -->
|
||||
<xpath expr="//notebook" position="inside">
|
||||
<page string="Renewal History"
|
||||
name="renewal_history"
|
||||
invisible="not is_rental_order or rental_renewal_count == 0">
|
||||
<field name="rental_renewal_log_ids" readonly="1">
|
||||
<list>
|
||||
<field name="renewal_number"/>
|
||||
<field name="renewal_type"/>
|
||||
<field name="previous_start_date"/>
|
||||
<field name="previous_return_date"/>
|
||||
<field name="new_start_date"/>
|
||||
<field name="new_return_date"/>
|
||||
<field name="invoice_id"/>
|
||||
<field name="payment_status"
|
||||
decoration-success="payment_status == 'paid'"
|
||||
decoration-danger="payment_status == 'failed'"
|
||||
decoration-warning="payment_status == 'pending'"
|
||||
widget="badge"/>
|
||||
<field name="state"
|
||||
decoration-success="state == 'done'"
|
||||
decoration-danger="state == 'failed'"
|
||||
widget="badge"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Cancellation Requests"
|
||||
name="cancellation_requests"
|
||||
invisible="not is_rental_order"
|
||||
badge="rental_cancellation_request_ids">
|
||||
<field name="rental_cancellation_request_ids">
|
||||
<list>
|
||||
<field name="request_date"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="reason"/>
|
||||
<field name="assigned_user_id"/>
|
||||
<field name="state"
|
||||
decoration-info="state == 'new'"
|
||||
decoration-success="state in ('confirmed', 'completed')"
|
||||
decoration-warning="state == 'pickup_scheduled'"
|
||||
decoration-danger="state == 'rejected'"
|
||||
widget="badge"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Inspection"
|
||||
name="inspection"
|
||||
invisible="not is_rental_order or not rental_inspection_status">
|
||||
<group>
|
||||
<group>
|
||||
<field name="rental_inspection_status"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Inspection Notes">
|
||||
<field name="rental_inspection_notes" nolabel="1"/>
|
||||
</group>
|
||||
<group string="Inspection Photos">
|
||||
<field name="rental_inspection_photo_ids" widget="many2many_binary" nolabel="1"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Agreement"
|
||||
name="agreement_tab"
|
||||
invisible="not is_rental_order or not rental_agreement_signed">
|
||||
<group>
|
||||
<group string="Signature Details">
|
||||
<field name="rental_agreement_signer_name" readonly="1"/>
|
||||
<field name="rental_agreement_signed_date" readonly="1"/>
|
||||
</group>
|
||||
<group string="Signature">
|
||||
<field name="rental_agreement_signature" widget="image" readonly="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user