diff --git a/rma/views/rma_order_line_view.xml b/rma/views/rma_order_line_view.xml index 86aac3cc..74e2305e 100644 --- a/rma/views/rma_order_line_view.xml +++ b/rma/views/rma_order_line_view.xml @@ -330,6 +330,7 @@ name="action_view_in_shipments" class="oe_stat_button" icon="fa-truck" + attrs="{'invisible': [('in_shipment_count', '=', 0)]}" groups="stock.group_stock_user" > @@ -76,7 +77,8 @@ name="action_view_refunds" class="oe_stat_button" icon="fa-pencil-square-o" - groups="account.group_account_user" + attrs="{'invisible': [('refund_count', '=', 0)]}" + groups="account.group_account_invoice" > diff --git a/rma_sale/models/rma_order_line.py b/rma_sale/models/rma_order_line.py index caf332d7..654d1176 100644 --- a/rma_sale/models/rma_order_line.py +++ b/rma_sale/models/rma_order_line.py @@ -204,6 +204,13 @@ class RmaOrderLine(models.Model): result["domain"] = [("id", "in", order_ids)] return result + def action_view_origin_sale_order(self): + action = self.env.ref("sale.action_orders_salesteams") + result = action.sudo().read()[0] + order_ids = self.sale_id.ids + result["domain"] = [("id", "in", order_ids)] + return result + def _get_rma_sold_qty(self): self.ensure_one() qty = 0.0 diff --git a/rma_sale/views/rma_order_line_view.xml b/rma_sale/views/rma_order_line_view.xml index 013011a1..1c48b924 100644 --- a/rma_sale/views/rma_order_line_view.xml +++ b/rma_sale/views/rma_order_line_view.xml @@ -7,11 +7,21 @@
+
+ - - -