[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-06-24 10:56:42 +02:00
committed by DavidJForgeFlow
parent 2760f14ed0
commit aa7253dc30
5 changed files with 52 additions and 5 deletions

View File

@@ -444,6 +444,30 @@
</group> </group>
</group> </group>
<notebook> <notebook>
<page name="quantities" string="Quantities">
<group name="quantities" col="4" string="Quantities">
<group
name="receive"
attrs="{'invisible': [('receipt_policy', '=', 'no')]}"
>
<field name="qty_to_receive" />
<field name="qty_incoming" />
<field name="qty_received" />
</group>
<group
name="deliver"
attrs="{'invisible': [('delivery_policy', '=', 'no')]}"
>
<field name="qty_to_deliver" />
<field name="qty_outgoing" />
<field name="qty_delivered" />
</group>
<group name="supplier_rma">
<field name="qty_to_supplier_rma" />
<field name="qty_in_supplier_rma" />
</group>
</group>
</page>
<page name="route" string="Routes"> <page name="route" string="Routes">
<group name="inbound" string="Inbound"> <group name="inbound" string="Inbound">
<field name="in_warehouse_id" /> <field name="in_warehouse_id" />
@@ -472,7 +496,11 @@
/> />
</group> </group>
</page> </page>
<page name="stock" string="Stock Moves"> <page
name="stock"
string="Stock Moves"
attrs="{'invisible': [('move_ids', '=', [])]}"
>
<field name="move_ids" nolabel="1" readonly="1" /> <field name="move_ids" nolabel="1" readonly="1" />
</page> </page>
<page name="quantities" string="Quantities"> <page name="quantities" string="Quantities">

View File

@@ -103,6 +103,7 @@
states="approved" states="approved"
string="Create Incoming Shipment" string="Create Incoming Shipment"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible':['|', '|', ('qty_to_receive', '=', 0), ('state', '!=', 'approved'), ('receipt_policy', '=', 'no')]}"
type="action" type="action"
/> />
<button <button
@@ -110,6 +111,7 @@
states="approved" states="approved"
string="Create Delivery" string="Create Delivery"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible':['|', '|', ('qty_to_deliver', '=', 0), ('state', '!=', 'approved'), ('delivery_policy', '=', 'no')]}"
type="action" type="action"
/> />
</header> </header>
@@ -127,6 +129,7 @@
states="approved" states="approved"
string="Create Incoming Shipment" string="Create Incoming Shipment"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible':['|', '|', ('qty_to_receive', '=', 0), ('state', '!=', 'approved'), ('receipt_policy', '=', 'no')]}"
type="action" type="action"
/> />
<button <button
@@ -134,6 +137,7 @@
states="approved" states="approved"
string="Create Delivery" string="Create Delivery"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible':['|', '|', ('qty_to_deliver', '=', 0), ('state', '!=', 'approved'), ('delivery_policy', '=', 'no')]}"
type="action" type="action"
/> />
</header> </header>

View File

@@ -95,7 +95,11 @@
<field name="refund_policy" /> <field name="refund_policy" />
</field> </field>
<page name="stock" position="after"> <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" /> <field name="refund_line_ids" nolabel="1" />
</page> </page>
</page> </page>
@@ -106,7 +110,10 @@
/> />
</field> </field>
<group name="supplier_rma" position="after"> <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_to_refund" />
<field name="qty_refunded" /> <field name="qty_refunded" />
</group> </group>

View File

@@ -59,6 +59,7 @@
states="approved" states="approved"
string="Create Refund" string="Create Refund"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible':['|', '|', ('qty_to_refund', '=', 0), ('state', '!=', 'approved'), ('refund_policy', '=', 'no')]}"
type="action" type="action"
/> />
</xpath> </xpath>
@@ -76,6 +77,7 @@
states="approved" states="approved"
string="Create Refund" string="Create Refund"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible':['|', '|', ('qty_to_refund', '!=', 0), ('state', '!=', 'approved'), ('refund_policy', '=', 'no')]}"
type="action" type="action"
/> />
</xpath> </xpath>

View File

@@ -29,7 +29,7 @@
/> />
</group> </group>
<group name="quantities" position="inside"> <group name="quantities" position="inside">
<group> <group attrs="{'invisible': [('sale_policy', '=', 'no')]}">
<field name="qty_to_sell" /> <field name="qty_to_sell" />
<field name="qty_sold" /> <field name="qty_sold" />
</group> </group>
@@ -44,7 +44,11 @@
/> />
</field> </field>
<notebook position="inside"> <notebook position="inside">
<page name="sale" string="Sale Lines"> <page
name="sale"
string="Sale Lines"
attrs="{'invisible': [('sale_line_ids', '=', [])]}"
>
<field name="sale_line_ids" nolabel="1" /> <field name="sale_line_ids" nolabel="1" />
</page> </page>
</notebook> </notebook>
@@ -99,6 +103,7 @@
states="approved" states="approved"
string="Create Sales Quotation" string="Create Sales Quotation"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible':['|', '|', ('qty_to_sell', '=', 0), ('state', '!=', 'approved'), ('sale_policy', '=', 'no')]}"
type="action" type="action"
/> />
</header> </header>
@@ -115,6 +120,7 @@
states="approved" states="approved"
string="Create Sales Quotation" string="Create Sales Quotation"
class="oe_highlight" class="oe_highlight"
attrs="{'invisible':['|', '|', ('qty_to_sell', '!=', 0), ('state', '!=', 'approved'), ('sale_policy', '=', 'no')]}"
type="action" type="action"
/> />
</header> </header>