diff --git a/rma_sale/README.rst b/rma_sale/README.rst index 65178c1c..7b81c85c 100644 --- a/rma_sale/README.rst +++ b/rma_sale/README.rst @@ -14,13 +14,13 @@ Return Merchandise Authorization Management - Link with Sales :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/13.0/rma_sale + :target: https://github.com/OCA/rma/tree/14.0/rma_sale :alt: OCA/rma .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/rma-13-0/rma-13-0-rma_sale + :target: https://translation.odoo-community.org/projects/rma-14-0/rma-14-0-rma_sale :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/145/13.0 + :target: https://runbot.odoo-community.org/runbot/145/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -79,7 +79,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 smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -99,6 +99,8 @@ Contributors * Ernesto Tejeda * Pedro M. Baeza * David Vidal + +* Chafique Delli Maintainers ~~~~~~~~~~~ @@ -121,6 +123,6 @@ Current `maintainer `__: |maintainer-ernestotejeda| -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_sale/__manifest__.py b/rma_sale/__manifest__.py index 5637c003..0e0f628d 100644 --- a/rma_sale/__manifest__.py +++ b/rma_sale/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Return Merchandise Authorization Management - Link with Sales", "summary": "Sale Order - Return Merchandise Authorization (RMA)", - "version": "13.0.2.0.0", + "version": "14.0.1.0.0", "development_status": "Production/Stable", "category": "RMA", "website": "https://github.com/OCA/rma", @@ -12,6 +12,7 @@ "license": "AGPL-3", "depends": ["rma", "sale_stock"], "data": [ + "security/ir.model.access.csv", "views/assets.xml", "views/report_rma.xml", "views/rma_views.xml", diff --git a/rma_sale/models/rma.py b/rma_sale/models/rma.py index d3e251b3..4ffc5e5f 100644 --- a/rma_sale/models/rma.py +++ b/rma_sale/models/rma.py @@ -40,9 +40,9 @@ class Rma(models.Model): def _compute_allowed_picking_ids(self): domain = [("state", "=", "done"), ("picking_type_id.code", "=", "outgoing")] for rec in self: - # if rec.partner_id: - commercial_partner = rec.partner_id.commercial_partner_id - domain.append(("partner_id", "child_of", commercial_partner.id)) + if rec.partner_id: + commercial_partner = rec.partner_id.commercial_partner_id + domain.append(("partner_id", "child_of", commercial_partner.id)) if rec.order_id: domain.append(("sale_id", "=", rec.order_id.id)) rec.allowed_picking_ids = self.env["stock.picking"].search(domain) diff --git a/rma_sale/readme/CONTRIBUTORS.rst b/rma_sale/readme/CONTRIBUTORS.rst index d4052271..49a9884e 100644 --- a/rma_sale/readme/CONTRIBUTORS.rst +++ b/rma_sale/readme/CONTRIBUTORS.rst @@ -3,3 +3,5 @@ * Ernesto Tejeda * Pedro M. Baeza * David Vidal + +* Chafique Delli diff --git a/rma_sale/security/ir.model.access.csv b/rma_sale/security/ir.model.access.csv new file mode 100644 index 00000000..f8a2b32b --- /dev/null +++ b/rma_sale/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_sale_order_rma_wizard_user_all,sale.order.rma.wizard.user.all,model_sale_order_rma_wizard,rma.rma_group_user_all,1,1,1,1 +access_sale_order_line_rma_wizard_user_all,sale.order.line.rma.wizard.user.all,model_sale_order_line_rma_wizard,rma.rma_group_user_all,1,1,1,1 diff --git a/rma_sale/tests/test_rma_sale.py b/rma_sale/tests/test_rma_sale.py index 236a5a5f..b49c9d47 100644 --- a/rma_sale/tests/test_rma_sale.py +++ b/rma_sale/tests/test_rma_sale.py @@ -79,7 +79,7 @@ class TestRmaSale(SavepointCase): order.user_id = user.id rma.action_confirm() rma.reception_move_id.quantity_done = rma.product_uom_qty - rma.reception_move_id.picking_id.action_done() + rma.reception_move_id.picking_id._action_done() rma.action_refund() self.assertEqual(rma.refund_id.user_id, user) @@ -88,7 +88,7 @@ class TestRmaSale(SavepointCase): wizard = self._rma_sale_wizard(self.sale_order) rma = self.env["rma"].browse(wizard.create_and_open_rma()["res_id"]) rma.reception_move_id.quantity_done = rma.product_uom_qty - rma.reception_move_id.picking_id.action_done() + rma.reception_move_id.picking_id._action_done() wizard = self._rma_sale_wizard(self.sale_order) self.assertEqual( wizard.line_ids.quantity, @@ -106,7 +106,7 @@ class TestRmaSale(SavepointCase): delivery_wizard.action_deliver() picking = rma.delivery_move_ids.picking_id picking.move_lines.quantity_done = rma.product_uom_qty - picking.action_done() + picking._action_done() # The product is returned to the customer, so we should be able to make # another RMA in the future wizard = self._rma_sale_wizard(self.sale_order) diff --git a/rma_sale/wizard/sale_order_rma_wizard.py b/rma_sale/wizard/sale_order_rma_wizard.py index 338f1eca..2ad8274b 100644 --- a/rma_sale/wizard/sale_order_rma_wizard.py +++ b/rma_sale/wizard/sale_order_rma_wizard.py @@ -144,16 +144,16 @@ class SaleOrderLineRmaWizard(models.TransientModel): @api.depends("picking_id") def _compute_move_id(self): for record in self: + move_id = False if record.picking_id: - record.move_id = record.picking_id.move_lines.filtered( + move_id = record.picking_id.move_lines.filtered( lambda r: ( r.sale_line_id == record.sale_line_id and r.sale_line_id.product_id == record.product_id and r.sale_line_id.order_id == record.order_id ) ) - else: - record.move_id = False + record.move_id = move_id @api.depends("order_id") def _compute_allowed_product_ids(self):