[14.0][MIG] rma_sale module

This commit is contained in:
Chafique
2020-12-10 17:59:24 +01:00
committed by Pedro M. Baeza
parent 2cab64f4e7
commit 1b470773f9
9 changed files with 46 additions and 19 deletions

View File

@@ -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 <https://github.com/OCA/rma/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 <https://github.com/OCA/rma/issues/new?body=module:%20rma_sale%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/rma/issues/new?body=module:%20rma_sale%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -100,6 +100,8 @@ Contributors
* Pedro M. Baeza
* David Vidal
* Chafique Delli <chafique.delli@akretion.com>
Maintainers
~~~~~~~~~~~
@@ -121,6 +123,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-ernestotejeda|
This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/13.0/rma_sale>`_ project on GitHub.
This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/14.0/rma_sale>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -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",

View File

@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -204,8 +204,14 @@ msgid "Description"
msgstr ""
#. module: rma_sale
#: model:ir.model.fields,field_description:rma_sale.field_res_company__display_name
#: model:ir.model.fields,field_description:rma_sale.field_res_config_settings__display_name
#: model:ir.model.fields,field_description:rma_sale.field_rma__display_name
#: model:ir.model.fields,field_description:rma_sale.field_sale_order__display_name
#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line__display_name
#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__display_name
#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__display_name
#: model:ir.model.fields,field_description:rma_sale.field_stock_move__display_name
msgid "Display Name"
msgstr ""
@@ -224,8 +230,14 @@ msgid "Full page RMA creation"
msgstr ""
#. module: rma_sale
#: model:ir.model.fields,field_description:rma_sale.field_res_company__id
#: model:ir.model.fields,field_description:rma_sale.field_res_config_settings__id
#: model:ir.model.fields,field_description:rma_sale.field_rma__id
#: model:ir.model.fields,field_description:rma_sale.field_sale_order__id
#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line__id
#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__id
#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard__id
#: model:ir.model.fields,field_description:rma_sale.field_stock_move__id
msgid "ID"
msgstr ""
@@ -235,8 +247,14 @@ msgid "If no requested operation is set, the RMA won't be correctly fulfilled"
msgstr ""
#. module: rma_sale
#: model:ir.model.fields,field_description:rma_sale.field_res_company____last_update
#: model:ir.model.fields,field_description:rma_sale.field_res_config_settings____last_update
#: model:ir.model.fields,field_description:rma_sale.field_rma____last_update
#: model:ir.model.fields,field_description:rma_sale.field_sale_order____last_update
#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line____last_update
#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard____last_update
#: model:ir.model.fields,field_description:rma_sale.field_sale_order_rma_wizard____last_update
#: model:ir.model.fields,field_description:rma_sale.field_stock_move____last_update
msgid "Last Modified on"
msgstr ""

View File

@@ -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)

View File

@@ -3,3 +3,5 @@
* Ernesto Tejeda
* Pedro M. Baeza
* David Vidal
* Chafique Delli <chafique.delli@akretion.com>

View File

@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 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
3 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

View File

@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/rma/tree/13.0/rma_sale"><img alt="OCA/rma" src="https://img.shields.io/badge/github-OCA%2Frma-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/rma-13-0/rma-13-0-rma_sale"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/145/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/rma/tree/14.0/rma_sale"><img alt="OCA/rma" src="https://img.shields.io/badge/github-OCA%2Frma-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/rma-14-0/rma-14-0-rma_sale"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/145/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows you to link a sales order to an RMA.
This can be done by creating an RMA from scratch and selecting the sales
order, creating one or more RMAs from a sales order form view or from a sales
@@ -430,7 +430,7 @@ number greater than the order line product quantity.</li>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/rma/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/rma/issues/new?body=module:%20rma_sale%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/rma/issues/new?body=module:%20rma_sale%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -450,6 +450,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>David Vidal</li>
</ul>
</li>
<li>Chafique Delli &lt;<a class="reference external" href="mailto:chafique.delli&#64;akretion.com">chafique.delli&#64;akretion.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -461,7 +462,7 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/ernestotejeda"><img alt="ernestotejeda" src="https://github.com/ernestotejeda.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rma/tree/13.0/rma_sale">OCA/rma</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/rma/tree/14.0/rma_sale">OCA/rma</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@@ -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)

View File

@@ -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):