diff --git a/rma/README.rst b/rma/README.rst index 8c5cfc4b..3e50406e 100644 --- a/rma/README.rst +++ b/rma/README.rst @@ -17,13 +17,13 @@ Return Merchandise Authorization Management :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frma-lightgray.png?logo=github - :target: https://github.com/OCA/rma/tree/17.0/rma + :target: https://github.com/OCA/rma/tree/18.0/rma :alt: OCA/rma .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/rma-17-0/rma-17-0-rma + :target: https://translation.odoo-community.org/projects/rma-18-0/rma-18-0-rma :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png - :target: https://runboat.odoo-community.org/builds?repo=OCA/rma&target_branch=17.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/rma&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -150,7 +150,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -179,6 +179,8 @@ Contributors - Antoni Marroig - Michael Tietz (MT Software) mtietz@mt-software.de +- Jacques-Etienne Baudoux - BCIM je@bcim.be +- Souheil Bejaoui - ACSONE SA/NV souheil.bejaoui@acsone.eu Maintainers ----------- @@ -204,6 +206,6 @@ Current `maintainers `__: |maintainer-pedrobaeza| |maintainer-chienandalu| -This module is part of the `OCA/rma `_ project on GitHub. +This module is part of the `OCA/rma `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/rma/models/rma.py b/rma/models/rma.py index 41e2d9ee..9c36e500 100644 --- a/rma/models/rma.py +++ b/rma/models/rma.py @@ -856,6 +856,7 @@ class Rma(models.Model): "partner_invoice_id", "product_id", "location_id", + "operation_id", ] for record in self: desc = "" diff --git a/rma/readme/CONTRIBUTORS.md b/rma/readme/CONTRIBUTORS.md index 801eb97b..6a7b4808 100644 --- a/rma/readme/CONTRIBUTORS.md +++ b/rma/readme/CONTRIBUTORS.md @@ -8,3 +8,5 @@ - [APSL-Nagarro](https://www.apsl.tech): - Antoni Marroig \<\> - Michael Tietz (MT Software) +- Jacques-Etienne Baudoux - BCIM +- Souheil Bejaoui - ACSONE SA/NV diff --git a/rma/static/description/index.html b/rma/static/description/index.html index 56ece24c..455a321b 100644 --- a/rma/static/description/index.html +++ b/rma/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -368,7 +369,7 @@ ul.auto-toc { !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:8f36869aece97a0f6af8aa5d76b446e9cf0bd589d914c1f5e12c628e87317021 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module allows you to manage Return Merchandise Authorization (RMA). RMA documents can be created from scratch, from a delivery order or from @@ -503,7 +504,7 @@ inside the warehouse definition.

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -531,18 +532,22 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
  • Michael Tietz (MT Software) mtietz@mt-software.de
  • +
  • Jacques-Etienne Baudoux - BCIM je@bcim.be
  • +
  • Souheil Bejaoui - ACSONE SA/NV souheil.bejaoui@acsone.eu
  • Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    Current maintainers:

    pedrobaeza chienandalu

    -

    This module is part of the OCA/rma project on GitHub.

    +

    This module is part of the OCA/rma project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/rma/tests/test_rma.py b/rma/tests/test_rma.py index 6eb0987f..1bd39979 100644 --- a/rma/tests/test_rma.py +++ b/rma/tests/test_rma.py @@ -71,8 +71,11 @@ class TestRma(BaseCommon): cls.warehouse = cls.env.ref("stock.warehouse0") # Ensure grouping cls.env.company.rma_return_grouping = True + cls.operation = cls.env.ref("rma.rma_operation_replace") - def _create_rma(self, partner=None, product=None, qty=None, location=None): + def _create_rma( + self, partner=None, product=None, qty=None, location=None, operation=None + ): vals = {} if partner: vals["partner_id"] = partner.id @@ -82,14 +85,17 @@ class TestRma(BaseCommon): vals["product_uom_qty"] = qty if location: vals["location_id"] = location.id - + if operation: + vals["operation_id"] = operation.id + elif operation is None: + vals["operation_id"] = self.operation.id vals["user_id"] = self.env.user.id return self.env["rma"].create(vals) def _create_confirm_receive( - self, partner=None, product=None, qty=None, location=None + self, partner=None, product=None, qty=None, location=None, operation=None ): - rma = self._create_rma(partner, product, qty, location) + rma = self._create_rma(partner, product, qty, location, operation) rma.action_confirm() rma.reception_move_id.quantity = rma.product_uom_qty rma.reception_move_id.picking_id.button_validate() @@ -221,19 +227,26 @@ class TestRmaCase(TestRma): self.assertEqual(rma.product_uom, self.product.uom_id) def test_ensure_required_fields_on_confirm(self): - rma = self._create_rma() + rma = self._create_rma(operation=False) with self.assertRaises(ValidationError) as e: rma.action_confirm() self.assertEqual( e.exception.args[0], - "Required field(s):\nCustomer\nShipping Address\nInvoice Address\nProduct", + "Required field(s):\nCustomer\nShipping Address\nInvoice Address\nProduct" + "\nRequested operation", ) rma.partner_id = self.partner.id with self.assertRaises(ValidationError) as e: rma.action_confirm() - self.assertEqual(e.exception.args[0], "Required field(s):\nProduct") + self.assertEqual( + e.exception.args[0], "Required field(s):\nProduct\nRequested operation" + ) rma.product_id = self.product.id rma.location_id = self.rma_loc.id + with self.assertRaises(ValidationError) as e: + rma.action_confirm() + self.assertEqual(e.exception.args[0], "Required field(s):\nRequested operation") + rma.operation_id = self.operation rma.action_confirm() self.assertEqual(rma.state, "confirmed") @@ -670,6 +683,7 @@ class TestRmaCase(TestRma): ) ) stock_return_picking_form.create_rma = True + stock_return_picking_form.rma_operation_id = self.operation return_wizard = stock_return_picking_form.save() picking_action = return_wizard.create_returns() # Each origin move is linked to a different RMA @@ -698,6 +712,7 @@ class TestRmaCase(TestRma): rma_form.move_id = origin_delivery.move_ids.filtered( lambda r: r.product_id == self.product ) + rma_form.operation_id = self.operation rma = rma_form.save() rma.action_confirm() rma.reception_move_id.quantity = 10 diff --git a/rma/wizard/stock_picking_return.py b/rma/wizard/stock_picking_return.py index 7c7ca364..3bed8265 100644 --- a/rma/wizard/stock_picking_return.py +++ b/rma/wizard/stock_picking_return.py @@ -11,6 +11,20 @@ from odoo.tools import float_compare class ReturnPickingLine(models.TransientModel): _inherit = "stock.return.picking.line" + rma_operation_id = fields.Many2one( + comodel_name="rma.operation", + string="Operation", + compute="_compute_rma_operation_id", + store=True, + readonly=False, + ) + + @api.depends("wizard_id.rma_operation_id") + def _compute_rma_operation_id(self): + for rec in self: + if rec.wizard_id.rma_operation_id: + rec.rma_operation_id = rec.wizard_id.rma_operation_id + def _prepare_rma_vals(self): self.ensure_one() return { @@ -19,6 +33,7 @@ class ReturnPickingLine(models.TransientModel): "product_uom_qty": self.quantity, "product_uom": self.product_id.uom_id.id, "location_id": self.wizard_id.location_id.id or self.move_id.location_id.id, + "operation_id": self.rma_operation_id.id, } @@ -30,6 +45,10 @@ class ReturnPicking(models.TransientModel): rma_location_ids = fields.Many2many( comodel_name="stock.location", compute="_compute_rma_location_id" ) + rma_operation_id = fields.Many2one( + comodel_name="rma.operation", + string="Requested operation", + ) # Expand domain for RMAs location_id = fields.Many2one( domain="create_rma and [('id', 'child_of', rma_location_ids)]" diff --git a/rma/wizard/stock_picking_return_views.xml b/rma/wizard/stock_picking_return_views.xml index 983815eb..167519d9 100644 --- a/rma/wizard/stock_picking_return_views.xml +++ b/rma/wizard/stock_picking_return_views.xml @@ -8,12 +8,20 @@ stock.return.picking - + + + + +