[IMP] Make rma order view cleaner for user

Hide button and fields depending on the policy chosen on the rma line
This commit is contained in:
Florian da Costa
2022-07-01 13:53:14 +02:00
committed by AaronHForgeFlow
parent f4a7817dbe
commit eca8bea60a
2 changed files with 11 additions and 4 deletions

View File

@@ -60,7 +60,11 @@
<field name="refund_policy" />
</field>
<page name="stock" position="after">
<page name="refunds" string="Refunds">
<page
name="refunds"
string="Refunds"
attrs="{'invisible': [('refund_line_ids', '=', [])]}"
>
<field name="refund_line_ids" nolabel="1" />
</page>
</page>
@@ -71,7 +75,10 @@
/>
</field>
<group name="supplier_rma" position="after">
<group name="refund">
<group
name="refund"
attrs="{'invisible': [('refund_policy', '=', 'no')]}"
>
<field name="qty_to_refund" />
<field name="qty_refunded" />
</group>

View File

@@ -59,13 +59,13 @@
name="%(action_rma_refund)d"
string="Create Refund"
class="oe_highlight"
attrs="{'invisible':['|', ('qty_to_refund', '=', 0), ('state', '!=', 'approved')]}"
attrs="{'invisible':['|', '|', ('qty_to_refund', '=', 0), ('state', '!=', 'approved'), ('refund_policy', '=', 'no')]}"
type="action"
/>
<button
name="%(action_rma_refund)d"
string="Create Refund"
attrs="{'invisible':['|', ('qty_to_refund', '!=', 0), ('state', '!=', 'approved')]}"
attrs="{'invisible':['|', '|', ('qty_to_refund', '!=', 0), ('state', '!=', 'approved'), ('refund_policy', '=', 'no')]}"
type="action"
/>
</xpath>