diff --git a/rma_delivery/README.rst b/rma_delivery/README.rst index 887063234..3de3b9b27 100644 --- a/rma_delivery/README.rst +++ b/rma_delivery/README.rst @@ -17,13 +17,13 @@ Return Merchandise Authorization Management - Link with deliveries :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/15.0/rma_delivery + :target: https://github.com/OCA/rma/tree/16.0/rma_delivery :alt: OCA/rma .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/rma-15-0/rma-15-0-rma_delivery + :target: https://translation.odoo-community.org/projects/rma-16-0/rma-16-0-rma_delivery :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=15.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/rma&target_branch=16.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| @@ -67,7 +67,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. @@ -86,6 +86,8 @@ Contributors * David Vidal +* Souheil Bejaoui - ACSONE SA/NV + Maintainers ~~~~~~~~~~~ @@ -107,6 +109,6 @@ Current `maintainer `__: |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_delivery/__manifest__.py b/rma_delivery/__manifest__.py index 6750e2648..76472db63 100644 --- a/rma_delivery/__manifest__.py +++ b/rma_delivery/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Return Merchandise Authorization Management - Link with deliveries", "summary": "Allow to choose a default delivery carrier for returns", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "development_status": "Beta", "category": "RMA", "website": "https://github.com/OCA/rma", diff --git a/rma_delivery/models/rma.py b/rma_delivery/models/rma.py index f6866ca20..18e9a34d5 100644 --- a/rma_delivery/models/rma.py +++ b/rma_delivery/models/rma.py @@ -32,12 +32,20 @@ def _prepare_returning_picking(self, picking_form, origin=None): ) return res - def create_replace(self, scheduled_date, warehouse, product, qty, uom): - existing_pickings = self.delivery_move_ids.mapped("picking_id") - res = super().create_replace(scheduled_date, warehouse, product, qty, uom) - new_pickings = self.delivery_move_ids.mapped("picking_id") - existing_pickings - for picking in new_pickings: + def _set_carrier(self, pickings): + for picking in pickings: picking.carrier_id = self._get_default_carrier_id( picking.company_id, picking.partner_id ) + + def create_replace(self, scheduled_date, warehouse, product, qty, uom): + existing_pickings = self.delivery_move_ids.picking_id + res = super().create_replace(scheduled_date, warehouse, product, qty, uom) + self._set_carrier(self.delivery_move_ids.picking_id - existing_pickings) + return res + + def create_return(self, scheduled_date, qty=None, uom=None): + existing_pickings = self.delivery_move_ids.picking_id + res = super().create_return(scheduled_date, qty=qty, uom=uom) + self._set_carrier(self.delivery_move_ids.picking_id - existing_pickings) return res diff --git a/rma_delivery/readme/CONTRIBUTORS.rst b/rma_delivery/readme/CONTRIBUTORS.rst index 94b6ba953..e0e8aa79d 100644 --- a/rma_delivery/readme/CONTRIBUTORS.rst +++ b/rma_delivery/readme/CONTRIBUTORS.rst @@ -1,3 +1,5 @@ * `Tecnativa `_: * David Vidal + +* Souheil Bejaoui - ACSONE SA/NV \ No newline at end of file diff --git a/rma_delivery/static/description/index.html b/rma_delivery/static/description/index.html index 5de1c892c..b4ed5a4f8 100644 --- a/rma_delivery/static/description/index.html +++ b/rma_delivery/static/description/index.html @@ -1,4 +1,3 @@ - @@ -369,7 +368,7 @@

Return Merchandise Authorization Management - Link with delive !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:70d83c2e2b826b0e4aee27f02ab2f1c8e37167477320a5faa88e70587c425c97 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module extends the functionality of the RMA module to allow to choose a default behavior for the shipping method used on the RMA returns to the customer.

Table of contents

@@ -417,7 +416,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.

@@ -435,6 +434,7 @@

Contributors

  • David Vidal
  • +
  • Souheil Bejaoui - ACSONE SA/NV <souheil.bejaoui@acsone.eu>
  • @@ -446,7 +446,7 @@

    Maintainers

    promote its widespread use.

    Current 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_delivery/tests/test_rma_delivery.py b/rma_delivery/tests/test_rma_delivery.py index 652106684..787e5ceaf 100644 --- a/rma_delivery/tests/test_rma_delivery.py +++ b/rma_delivery/tests/test_rma_delivery.py @@ -5,7 +5,7 @@ from odoo.addons.rma.tests.test_rma import TestRma -class TestRmaDelivery(TestRma): +class TestRmaDeliveryBase(TestRma): @classmethod def setUpClass(cls): super().setUpClass() @@ -46,6 +46,8 @@ def _return_to_customer(self, rma, delivery_type="return"): delivery_wizard.action_deliver() return rma.delivery_move_ids.picking_id + +class TestRmaDelivery(TestRmaDeliveryBase): def test_01_fixed_method(self): """Fixed method. RMA gets the company default carrier""" # Return picking diff --git a/setup/rma_delivery/odoo/addons/rma_delivery b/setup/rma_delivery/odoo/addons/rma_delivery new file mode 120000 index 000000000..93c206446 --- /dev/null +++ b/setup/rma_delivery/odoo/addons/rma_delivery @@ -0,0 +1 @@ +../../../../rma_delivery \ No newline at end of file diff --git a/setup/rma_delivery/setup.py b/setup/rma_delivery/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/rma_delivery/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)