From 8a758a67ffeaa4eedf8d862539f3648086b40ec2 Mon Sep 17 00:00:00 2001 From: DavidJForgeFlow Date: Thu, 23 Feb 2023 13:01:02 +0100 Subject: [PATCH] [MIG] rma_sale: Migration to 16.0 --- rma_sale/__manifest__.py | 2 +- rma_sale/models/rma_order_line.py | 2 +- rma_sale/tests/test_rma_stock_account_sale.py | 8 ++++---- rma_sale/views/rma_order_line_view.xml | 4 ++-- rma_sale/wizards/rma_add_sale.py | 4 ++-- rma_sale/wizards/rma_order_line_make_sale_order_view.xml | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rma_sale/__manifest__.py b/rma_sale/__manifest__.py index b3da6d36..da495e85 100644 --- a/rma_sale/__manifest__.py +++ b/rma_sale/__manifest__.py @@ -3,7 +3,7 @@ { "name": "RMA Sale", - "version": "15.0.1.0.1", + "version": "16.0.1.0.0", "license": "LGPL-3", "category": "RMA", "summary": "Links RMA with Sales Orders", diff --git a/rma_sale/models/rma_order_line.py b/rma_sale/models/rma_order_line.py index feff0161..9dac20ae 100644 --- a/rma_sale/models/rma_order_line.py +++ b/rma_sale/models/rma_order_line.py @@ -201,7 +201,7 @@ class RmaOrderLine(models.Model): return result def action_view_origin_sale_order(self): - action = self.env.ref("sale.action_orders_salesteams") + action = self.env.ref("sale.action_orders") result = action.sudo().read()[0] order_ids = self.sale_id.ids result["domain"] = [("id", "in", order_ids)] diff --git a/rma_sale/tests/test_rma_stock_account_sale.py b/rma_sale/tests/test_rma_stock_account_sale.py index 3df53471..8562719f 100644 --- a/rma_sale/tests/test_rma_stock_account_sale.py +++ b/rma_sale/tests/test_rma_stock_account_sale.py @@ -40,7 +40,7 @@ class TestRmaStockAccountSale(TestRmaStockAccount): ) cls.so1.action_confirm() for ml in cls.so1.picking_ids.move_line_ids: - ml.qty_done = ml.product_uom_qty + ml.qty_done = ml.reserved_uom_qty cls.so1.picking_ids.button_validate() def test_01_cost_from_so_move(self): @@ -65,13 +65,13 @@ class TestRmaStockAccountSale(TestRmaStockAccount): picking = self._receive_rma(rma_line) # The price is not the standard price, is the value of the outgoing layer # of the SO - rma_move_value = picking.move_lines.stock_valuation_layer_ids.value + rma_move_value = picking.move_ids.stock_valuation_layer_ids.value so_move_value = self.so1.picking_ids.mapped( - "move_lines.stock_valuation_layer_ids" + "move_ids.stock_valuation_layer_ids" )[-1].value self.assertEqual(rma_move_value, -so_move_value) # Test the accounts used - account_move = picking.move_lines.stock_valuation_layer_ids.account_move_id + account_move = picking.move_ids.stock_valuation_layer_ids.account_move_id self.check_accounts_used( account_move, debit_account="inventory", credit_account="gdni" ) diff --git a/rma_sale/views/rma_order_line_view.xml b/rma_sale/views/rma_order_line_view.xml index 4d0f3322..03c5c239 100644 --- a/rma_sale/views/rma_order_line_view.xml +++ b/rma_sale/views/rma_order_line_view.xml @@ -71,13 +71,13 @@ name="%(action_rma_order_line_make_sale_order)d" string="Create Sales Quotation" class="oe_highlight" - attrs="{'invisible':['|', '|', ('qty_to_sell', '=', 0), ('state', '!=', 'approved'), ('sale_policy', '=', 'no')]}" + attrs="{'invisible':['|', '|', '|', ('qty_to_sell', '=', 0), ('qty_to_sell', '<', 0), ('state', '!=', 'approved'), ('sale_policy', '=', 'no')]}" type="action" />