diff --git a/rma_sale/README.rst b/rma_sale/README.rst index bd64ce7a..912c4c82 100644 --- a/rma_sale/README.rst +++ b/rma_sale/README.rst @@ -7,7 +7,7 @@ Return Merchandise Authorization Management - Link with Sales !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:39fa5c0e9b816d7bf19689674b96c160586e4e716b0c028e6e94b7b2bc1f6a42 + !! source digest: sha256:7e0618b54228b56d98fe59f32f0d347363353c739194e3fbeb60760c7964b120 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png @@ -106,6 +106,7 @@ Contributors * Chafique Delli * Giovanni Serra - Ooops +* Michael Tietz (MT Software) Maintainers ~~~~~~~~~~~ diff --git a/rma_sale/models/rma.py b/rma_sale/models/rma.py index 7b120fe2..d95f6155 100644 --- a/rma_sale/models/rma.py +++ b/rma_sale/models/rma.py @@ -1,4 +1,5 @@ # Copyright 2020 Tecnativa - Ernesto Tejeda +# Copyright 2023 Michael Tietz (MT Software) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import api, fields, models @@ -116,3 +117,6 @@ class Rma(models.Model): if line: line_form.discount = line.discount line_form.sequence = line.sequence + analytic_account = line.order_id.analytic_account_id + if analytic_account: + line_form.analytic_account_id = analytic_account diff --git a/rma_sale/readme/CONTRIBUTORS.rst b/rma_sale/readme/CONTRIBUTORS.rst index 75646b6d..1ebe5ca2 100644 --- a/rma_sale/readme/CONTRIBUTORS.rst +++ b/rma_sale/readme/CONTRIBUTORS.rst @@ -7,3 +7,4 @@ * Chafique Delli * Giovanni Serra - Ooops +* Michael Tietz (MT Software) diff --git a/rma_sale/static/description/index.html b/rma_sale/static/description/index.html index 7c31efb7..80afa399 100644 --- a/rma_sale/static/description/index.html +++ b/rma_sale/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:39fa5c0e9b816d7bf19689674b96c160586e4e716b0c028e6e94b7b2bc1f6a42 +!! source digest: sha256:7e0618b54228b56d98fe59f32f0d347363353c739194e3fbeb60760c7964b120 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Production/Stable License: AGPL-3 OCA/rma Translate me on Weblate Try me on Runboat

This module allows you to link a sales order to an RMA. @@ -455,6 +455,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

  • Chafique Delli <chafique.delli@akretion.com>
  • Giovanni Serra - Ooops <giovanni@ooops404.com>
  • +
  • Michael Tietz (MT Software) <mtietz@mt-software.de>
  • diff --git a/rma_sale/tests/test_rma_sale.py b/rma_sale/tests/test_rma_sale.py index a2794b47..169656c6 100644 --- a/rma_sale/tests/test_rma_sale.py +++ b/rma_sale/tests/test_rma_sale.py @@ -1,5 +1,6 @@ # Copyright 2020 Tecnativa - Ernesto Tejeda # Copyright 2022 Tecnativa - Víctor Martínez +# Copyright 2023 Michael Tietz (MT Software) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo.tests import Form, SavepointCase @@ -91,11 +92,18 @@ class TestRmaSale(SavepointCase): {"login": "test_refund_with_so", "name": "Test"} ) order.user_id = user.id + order.analytic_account_id = self.env["account.analytic.account"].create( + {"name": "Test Account"} + ) rma.action_confirm() rma.reception_move_id.quantity_done = rma.product_uom_qty rma.reception_move_id.picking_id._action_done() rma.action_refund() self.assertEqual(rma.refund_id.user_id, user) + self.assertEqual( + rma.refund_id.invoice_line_ids.analytic_account_id, + order.analytic_account_id, + ) @users("partner@rma") def test_create_rma_from_so_portal_user(self):