From a392951cc4827b4b45cfee38d553ef7e52308d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Vall=C3=A9s=20Fuster?= Date: Mon, 6 May 2024 16:51:37 +0200 Subject: [PATCH] [MIG] rma: Migration to v17 --- rma/README.rst | 2 +- rma/__manifest__.py | 2 +- rma/models/rma_order_line.py | 42 +----- rma/models/stock_move.py | 4 +- rma/models/stock_warehouse.py | 2 +- rma/report/report_deliveryslip.xml | 4 +- rma/static/description/index.html | 2 +- rma/tests/test_rma.py | 129 +++++++++--------- rma/views/res_config_settings_views.xml | 4 +- rma/views/rma_operation_view.xml | 6 +- rma/views/rma_order_line_view.xml | 89 ++++++++---- rma/views/rma_order_view.xml | 73 ++++------ rma/wizards/rma_add_serial_views.xml | 4 +- rma/wizards/rma_add_stock_move.py | 6 +- rma/wizards/rma_add_stock_move_view.xml | 21 ++- rma/wizards/rma_make_picking.py | 8 +- rma/wizards/rma_make_picking_view.xml | 8 +- .../rma_order_line_make_supplier_rma.py | 2 +- .../rma_order_line_make_supplier_rma_view.xml | 2 +- 19 files changed, 193 insertions(+), 217 deletions(-) diff --git a/rma/README.rst b/rma/README.rst index ee577ae36..95c36299d 100644 --- a/rma/README.rst +++ b/rma/README.rst @@ -7,7 +7,7 @@ RMA (Return Merchandise Authorization) !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:51ec7a60674dede1504836e5881ee8a0f776b770dcc8238dce37e8376e5c4301 + !! source digest: sha256:310ce4e3f5919e5be643c54f11481d09bb8fc79cab65f08ac969ef3bf9d799fe !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/rma/__manifest__.py b/rma/__manifest__.py index 93eb3ea05..79635d2b7 100644 --- a/rma/__manifest__.py +++ b/rma/__manifest__.py @@ -3,7 +3,7 @@ { "name": "RMA (Return Merchandise Authorization)", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "license": "LGPL-3", "category": "RMA", "summary": "Introduces the return merchandise authorization (RMA) process in odoo", diff --git a/rma/models/rma_order_line.py b/rma/models/rma_order_line.py index 6ad55456f..be9c35c83 100644 --- a/rma/models/rma_order_line.py +++ b/rma/models/rma_order_line.py @@ -235,8 +235,6 @@ def _default_date_rma(self): delivery_address_id = fields.Many2one( comodel_name="res.partner", string="Partner delivery address", - readonly=True, - states={"draft": [("readonly", False)]}, help="This address will be used to deliver repaired or replacement " "products.", ) @@ -250,8 +248,6 @@ def _default_date_rma(self): string="Reference", required=True, default="/", - readonly=True, - states={"draft": [("readonly", False)]}, help="Add here the supplier RMA #. Otherwise an internal code is" " assigned.", copy=False, ) @@ -259,8 +255,6 @@ def _default_date_rma(self): conditions = fields.Html(string="Terms and conditions") origin = fields.Char( string="Source Document", - readonly=True, - states={"draft": [("readonly", False)]}, help="Reference of the document that produced this rma.", ) date_rma = fields.Datetime( @@ -298,8 +292,6 @@ def _default_date_rma(self): required=True, store=True, tracking=True, - readonly=True, - states={"draft": [("readonly", False)]}, ) sequence = fields.Integer( default=10, help="Gives the sequence of this line when displaying the rma." @@ -308,38 +300,28 @@ def _default_date_rma(self): comodel_name="product.product", ondelete="restrict", required=True, - readonly=True, - states={"draft": [("readonly", False)]}, ) product_tracking = fields.Selection(related="product_id.tracking") lot_id = fields.Many2one( comodel_name="stock.lot", string="Lot/Serial Number", - readonly=True, - states={"draft": [("readonly", False)]}, ) product_qty = fields.Float( string="Return Qty", copy=False, default=1.0, digits="Product Unit of Measure", - readonly=True, - states={"draft": [("readonly", False)]}, ) uom_id = fields.Many2one( comodel_name="uom.uom", string="Unit of Measure", required=True, - readonly=True, compute="_compute_uom_id", precompute=True, store=True, - states={"draft": [("readonly", False)]}, ) price_unit = fields.Monetary( string="Unit cost", - readonly=True, - states={"draft": [("readonly", False)]}, help="Unit cost of the items under RMA", ) in_shipment_count = fields.Integer( @@ -355,8 +337,6 @@ def _default_date_rma(self): comodel_name="stock.move", string="Originating Stock Move", copy=False, - readonly=True, - states={"draft": [("readonly", False)]}, ) currency_id = fields.Many2one( "res.currency", @@ -375,13 +355,9 @@ def _default_date_rma(self): ) customer_to_supplier = fields.Boolean( "The customer will send to the supplier", - readonly=True, - states={"draft": [("readonly", False)]}, ) supplier_to_customer = fields.Boolean( "The supplier will send to the customer", - readonly=True, - states={"draft": [("readonly", False)]}, ) receipt_policy = fields.Selection( [ @@ -409,45 +385,35 @@ def _default_date_rma(self): string="Inbound Route", required=True, domain=[("rma_selectable", "=", True)], - readonly=True, compute="_compute_in_route_id", precompute=True, store=True, - states={"draft": [("readonly", False)]}, ) out_route_id = fields.Many2one( "stock.route", string="Outbound Route", required=True, domain=[("rma_selectable", "=", True)], - readonly=True, compute="_compute_out_route_id", precompute=True, store=True, - states={"draft": [("readonly", False)]}, ) in_warehouse_id = fields.Many2one( comodel_name="stock.warehouse", string="Inbound Warehouse", required=True, - readonly=True, - states={"draft": [("readonly", False)]}, default=lambda self: self._default_warehouse_id(), ) out_warehouse_id = fields.Many2one( comodel_name="stock.warehouse", string="Outbound Warehouse", required=True, - readonly=True, - states={"draft": [("readonly", False)]}, default=lambda self: self._default_warehouse_id(), ) location_id = fields.Many2one( comodel_name="stock.location", string="Send To This Company Location", required=True, - readonly=True, - states={"draft": [("readonly", False)]}, default=lambda self: self._default_location_id(), ) customer_rma_id = fields.Many2one( @@ -459,15 +425,11 @@ def _default_date_rma(self): ) supplier_address_id = fields.Many2one( comodel_name="res.partner", - readonly=True, - states={"draft": [("readonly", False)]}, string="Supplier Address", help="Address of the supplier in case of Customer RMA operation " "dropship.", ) customer_address_id = fields.Many2one( comodel_name="res.partner", - readonly=True, - states={"draft": [("readonly", False)]}, string="Customer Address", help="Address of the customer in case of Supplier RMA operation " "dropship.", ) @@ -526,9 +488,7 @@ def _default_date_rma(self): compute="_compute_qty_supplier_rma", store=True, ) - under_warranty = fields.Boolean( - string="Under Warranty?", readonly=True, states={"draft": [("readonly", False)]} - ) + under_warranty = fields.Boolean(string="Under Warranty?") def _prepare_rma_line_from_stock_move(self, sm, lot=False): if not self.type: diff --git a/rma/models/stock_move.py b/rma/models/stock_move.py index 9a839f180..f3077f0b6 100644 --- a/rma/models/stock_move.py +++ b/rma/models/stock_move.py @@ -77,8 +77,8 @@ def _get_available_quantity( def _update_reserved_quantity( self, need, - available_quantity, location_id, + quant_ids=None, lot_id=None, package_id=None, owner_id=None, @@ -93,8 +93,8 @@ def _update_reserved_quantity( lot_id = self.rma_line_id.lot_id return super()._update_reserved_quantity( need, - available_quantity, location_id, + quant_ids=quant_ids, lot_id=lot_id, package_id=package_id, owner_id=owner_id, diff --git a/rma/models/stock_warehouse.py b/rma/models/stock_warehouse.py index af1674613..9feebe723 100644 --- a/rma/models/stock_warehouse.py +++ b/rma/models/stock_warehouse.py @@ -91,7 +91,7 @@ def write(self, vals): self.mapped("rma_customer_out_pull_id").unlink() self.mapped("rma_supplier_in_pull_id").unlink() self.mapped("rma_supplier_out_pull_id").unlink() - return super(StockWarehouse, self).write(vals) + return super().write(vals) def _create_rma_picking_types(self): picking_type_obj = self.env["stock.picking.type"] diff --git a/rma/report/report_deliveryslip.xml b/rma/report/report_deliveryslip.xml index 961032ba6..d799380df 100644 --- a/rma/report/report_deliveryslip.xml +++ b/rma/report/report_deliveryslip.xml @@ -34,7 +34,7 @@ id="stock_report_delivery_has_serial_move_line" inherit_id="stock.stock_report_delivery_has_serial_move_line" > - + @@ -45,7 +45,7 @@ id="stock_report_delivery_aggregated_move_lines" inherit_id="stock.stock_report_delivery_aggregated_move_lines" > - +

Beta License: LGPL-3 ForgeFlow/stock-rma

A Return Merchandise Authorization (RMA), is a part of the process of diff --git a/rma/tests/test_rma.py b/rma/tests/test_rma.py index 251fcb2f3..2d7f3ba28 100644 --- a/rma/tests/test_rma.py +++ b/rma/tests/test_rma.py @@ -10,7 +10,7 @@ class TestRma(common.TransactionCase): @classmethod def setUpClass(cls): - super(TestRma, cls).setUpClass() + super().setUpClass() # models cls.rma_make_picking = cls.env["rma_make_picking.wizard"] cls.make_supplier_rma = cls.env["rma.order.line.make.supplier.rma"] @@ -109,7 +109,8 @@ def _receive_rma(cls, rma_line_ids): picking = cls.env["stock.picking"].browse(res["res_id"]) picking.action_assign() for mv in picking.move_ids: - mv.quantity_done = mv.product_uom_qty + mv.quantity = mv.product_uom_qty + mv.picked = True picking._action_done() return picking @@ -128,7 +129,8 @@ def _deliver_rma(cls, rma_line_ids): picking = cls.env["stock.picking"].browse(res["res_id"]) picking.action_assign() for mv in picking.move_ids: - mv.quantity_done = mv.product_uom_qty + mv.quantity = mv.product_uom_qty + mv.picked = True picking._action_done() return picking @@ -168,9 +170,8 @@ def _do_picking(cls, picking): picking.action_confirm() picking.action_assign() for ml in picking.move_ids: - ml.filtered( - lambda m: m.state != "waiting" - ).quantity_done = ml.product_uom_qty + ml.filtered(lambda m: m.state != "waiting").quantity = ml.product_uom_qty + ml.filtered(lambda m: m.state != "waiting").picked = True picking.button_validate() @classmethod @@ -443,38 +444,39 @@ def test_02_customer_rma(self): ) # product specific self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_to_receive, + lines.filtered(lambda x: x.product_id == self.product_1).qty_to_receive, 3, "Wrong qty to receive", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_incoming, + lines.filtered(lambda x: x.product_id == self.product_1).qty_incoming, 3, "Wrong qty incoming", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_to_receive, + lines.filtered(lambda x: x.product_id == self.product_2).qty_to_receive, 5, "Wrong qty to receive", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_incoming, + lines.filtered(lambda x: x.product_id == self.product_2).qty_incoming, 5, "Wrong qty incoming", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_to_receive, + lines.filtered(lambda x: x.product_id == self.product_3).qty_to_receive, 2, "Wrong qty to receive", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_incoming, + lines.filtered(lambda x: x.product_id == self.product_3).qty_incoming, 2, "Wrong qty incoming", ) picking.action_assign() for mv in picking.move_ids: - mv.quantity_done = mv.product_uom_qty + mv.quantity = mv.product_uom_qty + mv.picked = True picking._action_done() lines = self.rma_customer_id.rma_line_ids self.assertEqual( @@ -491,32 +493,32 @@ def test_02_customer_rma(self): ) # product specific self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_received, + lines.filtered(lambda x: x.product_id == self.product_1).qty_received, 3, "Wrong qty received", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_1).qty_to_deliver, 3, "Wrong qty to_deliver", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_received, + lines.filtered(lambda x: x.product_id == self.product_2).qty_received, 5, "Wrong qty received", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_2).qty_to_deliver, 5, "Wrong qty to_deliver", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_received, + lines.filtered(lambda x: x.product_id == self.product_3).qty_received, 2, "Wrong qty received", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_3).qty_to_deliver, 2, "Wrong qty to_deliver", ) @@ -562,38 +564,39 @@ def test_02_customer_rma(self): ) # product specific self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_1).qty_to_deliver, 3, "Wrong qty to_deliver", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_outgoing, + lines.filtered(lambda x: x.product_id == self.product_1).qty_outgoing, 3, "Wrong qty outgoing", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_2).qty_to_deliver, 5, "Wrong qty to_deliver", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_outgoing, + lines.filtered(lambda x: x.product_id == self.product_2).qty_outgoing, 5, "Wrong qty outgoing", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_3).qty_to_deliver, 2, "Wrong qty to_deliver", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_outgoing, + lines.filtered(lambda x: x.product_id == self.product_3).qty_outgoing, 2, "Wrong qty outgoing", ) picking.action_assign() for mv in picking.move_ids: - mv.quantity_done = mv.product_uom_qty + mv.quantity = mv.product_uom_qty + mv.picked = True picking._action_done() lines = self.rma_customer_id.rma_line_ids self.assertEqual( @@ -607,32 +610,32 @@ def test_02_customer_rma(self): ) # product specific self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_received, + lines.filtered(lambda x: x.product_id == self.product_1).qty_received, 3, "Wrong qty_received", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_delivered, + lines.filtered(lambda x: x.product_id == self.product_1).qty_delivered, 3, "Wrong qty_delivered", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_received, + lines.filtered(lambda x: x.product_id == self.product_2).qty_received, 5, "Wrong qty_received", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_delivered, + lines.filtered(lambda x: x.product_id == self.product_2).qty_delivered, 5, "Wrong qty_delivered", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_received, + lines.filtered(lambda x: x.product_id == self.product_3).qty_received, 2, "Wrong qty_received", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_delivered, + lines.filtered(lambda x: x.product_id == self.product_3).qty_delivered, 2, "Wrong qty_delivered", ) @@ -702,17 +705,17 @@ def test_03_dropship(self): self.assertEqual(list(set(lines.mapped("qty_delivered"))), [0], "qty_delivered") # product specific self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_1).qty_to_deliver, 3, "Wrong qty_to_deliver", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_2).qty_to_deliver, 5, "Wrong qty_to_deliver", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_3).qty_to_deliver, 2, "Wrong qty_to_deliver", ) @@ -720,21 +723,21 @@ def test_03_dropship(self): lines.env.invalidate_all() self._check_equal_quantity( lines.filtered( - lambda l: l.product_id == self.product_1 + lambda x: x.product_id == self.product_1 ).qty_in_supplier_rma, 3, "Wrong qty_in_supplier_rma", ) self._check_equal_quantity( lines.filtered( - lambda l: l.product_id == self.product_2 + lambda x: x.product_id == self.product_2 ).qty_in_supplier_rma, 5, "Wrong qty_in_supplier_rma", ) self._check_equal_quantity( lines.filtered( - lambda l: l.product_id == self.product_3 + lambda x: x.product_id == self.product_3 ).qty_in_supplier_rma, 2, "Wrong qty_in_supplier_rma", @@ -791,32 +794,32 @@ def test_04_supplier_rma(self): ) # product specific self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_to_receive, + lines.filtered(lambda x: x.product_id == self.product_1).qty_to_receive, 3, "Wrong qty_to_receive", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_1).qty_to_deliver, 3, "Wrong qty_to_deliver", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_to_receive, + lines.filtered(lambda x: x.product_id == self.product_2).qty_to_receive, 5, "Wrong qty_to_receive", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_2).qty_to_deliver, 5, "Wrong qty_to_deliver", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_to_receive, + lines.filtered(lambda x: x.product_id == self.product_3).qty_to_receive, 2, "Wrong qty_to_receive", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_to_deliver, + lines.filtered(lambda x: x.product_id == self.product_3).qty_to_deliver, 2, "Wrong qty_to_deliver", ) @@ -825,7 +828,8 @@ def test_04_supplier_rma(self): ) picking.action_assign() for mv in picking.move_ids: - mv.quantity_done = mv.product_uom_qty + mv.quantity = mv.product_uom_qty + mv.picked = True picking._action_done() self.assertEqual( list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty_incoming" @@ -839,37 +843,37 @@ def test_04_supplier_rma(self): self.assertEqual(list(set(lines.mapped("qty_outgoing"))), [0], "qty_outgoing") # product specific self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_delivered, + lines.filtered(lambda x: x.product_id == self.product_1).qty_delivered, 3, "Wrong qty_delivered", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_to_receive, + lines.filtered(lambda x: x.product_id == self.product_1).qty_to_receive, 3, "Wrong qty_to_receive", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_received, + lines.filtered(lambda x: x.product_id == self.product_1).qty_received, 0, "Wrong qty_received", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_delivered, + lines.filtered(lambda x: x.product_id == self.product_2).qty_delivered, 5, "Wrong qty_delivered", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_received, + lines.filtered(lambda x: x.product_id == self.product_2).qty_received, 0, "Wrong qty_received", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_delivered, + lines.filtered(lambda x: x.product_id == self.product_3).qty_delivered, 2, "Wrong qty_delivered", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_received, + lines.filtered(lambda x: x.product_id == self.product_3).qty_received, 0, "Wrong qty_received", ) @@ -911,24 +915,25 @@ def test_04_supplier_rma(self): ) # product specific self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_to_receive, + lines.filtered(lambda x: x.product_id == self.product_1).qty_to_receive, 3, "Wrong qty_to_receive", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_to_receive, + lines.filtered(lambda x: x.product_id == self.product_2).qty_to_receive, 5, "Wrong qty_to_receive", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_to_receive, + lines.filtered(lambda x: x.product_id == self.product_3).qty_to_receive, 2, "Wrong qty_to_receive", ) picking_in.action_confirm() picking_in.action_assign() for mv in picking_in.move_line_ids: - mv.qty_done = mv.reserved_uom_qty + mv.quantity = mv.quantity_product_uom + mv.picked = True picking_in._action_done() self.assertEqual( list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty_outgoing" @@ -942,32 +947,32 @@ def test_04_supplier_rma(self): # product specific self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_delivered, + lines.filtered(lambda x: x.product_id == self.product_1).qty_delivered, 3, "Wrong qty_delivered", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_1).qty_received, + lines.filtered(lambda x: x.product_id == self.product_1).qty_received, 3, "Wrong qty_received", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_delivered, + lines.filtered(lambda x: x.product_id == self.product_2).qty_delivered, 5, "Wrong qty_delivered", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_2).qty_received, + lines.filtered(lambda x: x.product_id == self.product_2).qty_received, 5, "Wrong qty_received", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_delivered, + lines.filtered(lambda x: x.product_id == self.product_3).qty_delivered, 2, "Wrong qty_delivered", ) self._check_equal_quantity( - lines.filtered(lambda l: l.product_id == self.product_3).qty_received, + lines.filtered(lambda x: x.product_id == self.product_3).qty_received, 2, "Wrong qty_received", ) diff --git a/rma/views/res_config_settings_views.xml b/rma/views/res_config_settings_views.xml index b462df4f2..82982e2f5 100644 --- a/rma/views/res_config_settings_views.xml +++ b/rma/views/res_config_settings_views.xml @@ -7,7 +7,7 @@ - +

diff --git a/rma/views/rma_operation_view.xml b/rma/views/rma_operation_view.xml index c2bb1b59e..3629a3bbd 100644 --- a/rma/views/rma_operation_view.xml +++ b/rma/views/rma_operation_view.xml @@ -24,7 +24,7 @@ name="web_ribbon" title="Archived" bg_color="bg-danger" - attrs="{'invisible': [('active', '=', True)]}" + invisible="active == True" />
@@ -51,7 +51,7 @@ /> @@ -59,7 +59,7 @@ diff --git a/rma/views/rma_order_line_view.xml b/rma/views/rma_order_line_view.xml index ff71a40e0..887f541d6 100644 --- a/rma/views/rma_order_line_view.xml +++ b/rma/views/rma_order_line_view.xml @@ -61,7 +61,7 @@ name="action_rma_to_approve" type="object" string="Request Approval" - attrs="{'invisible':[('state', '!=', 'draft')]}" + invisible="state != 'draft'" class="oe_highlight" groups="rma.group_rma_customer_user" /> @@ -69,14 +69,14 @@ name="action_rma_draft" type="object" string="Back to Draft" - attrs="{'invisible':[('state', '=', 'draft')]}" + invisible="state == 'draft'" groups="rma.group_rma_customer_user,rma.group_rma_supplier_user" />