diff --git a/rma_purchase/__manifest__.py b/rma_purchase/__manifest__.py index addcbc58..6a98ca66 100644 --- a/rma_purchase/__manifest__.py +++ b/rma_purchase/__manifest__.py @@ -2,7 +2,7 @@ # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) { "name": "RMA Purchase", - "version": "15.0.1.0.1", + "version": "16.0.1.0.0", "category": "RMA", "summary": "RMA from PO", "license": "LGPL-3", diff --git a/rma_purchase/models/rma_order_line.py b/rma_purchase/models/rma_order_line.py index 42360794..a2e1aea4 100644 --- a/rma_purchase/models/rma_order_line.py +++ b/rma_purchase/models/rma_order_line.py @@ -24,6 +24,7 @@ class RmaOrderLine(models.Model): purchase_list.append(line.id) rec.purchase_order_line_ids = [(6, 0, purchase_list)] + @api.depends("operation_id", "purchase_policy") def _compute_qty_purchase(self): for rec in self: rec.qty_purchased = rec._get_rma_purchased_qty() diff --git a/rma_purchase/tests/test_rma_stock_account_purchase.py b/rma_purchase/tests/test_rma_stock_account_purchase.py index 199edb56..c74842f2 100644 --- a/rma_purchase/tests/test_rma_stock_account_purchase.py +++ b/rma_purchase/tests/test_rma_stock_account_purchase.py @@ -57,13 +57,15 @@ class TestRmaStockAccountPurchase(TestRmaStockAccount): picking = self._deliver_rma(rma_line) # The price is not the standard price, is the value of the incoming layer # of the PO - rma_move_value = picking.move_lines.stock_valuation_layer_ids.value - po_move_value = po.picking_ids.mapped("move_lines.stock_valuation_layer_ids")[ - -1 - ].value + rma_move_value = picking.move_line_ids.move_id.stock_valuation_layer_ids.value + po_move_value = po.picking_ids.mapped( + "move_line_ids.move_id.stock_valuation_layer_ids" + )[-1].value self.assertEqual(-rma_move_value, po_move_value) # Test the accounts used - account_move = picking.move_lines.stock_valuation_layer_ids.account_move_id + account_move = ( + picking.move_line_ids.move_id.stock_valuation_layer_ids.account_move_id + ) self.check_accounts_used(account_move, "grni", "inventory") # Now forcing a refund to check the stock journals rma_line.refund_policy = "ordered" diff --git a/rma_purchase/views/rma_order_line_view.xml b/rma_purchase/views/rma_order_line_view.xml index 9ac0496b..6563cabd 100644 --- a/rma_purchase/views/rma_order_line_view.xml +++ b/rma_purchase/views/rma_order_line_view.xml @@ -37,6 +37,7 @@ class="oe_stat_button" icon="fa-shopping-cart" groups="purchase.group_purchase_user" + attrs="{'invisible':[('purchase_count','=',0)]}" > - +