[MIG] rma_sale: Migration to 13.0

This commit is contained in:
Ernesto Tejeda
2020-10-28 17:04:17 -04:00
committed by Pedro M. Baeza
parent 1267c92b72
commit 132f877db9
12 changed files with 75 additions and 59 deletions

View File

@@ -7,20 +7,20 @@ Return Merchandise Authorization Management - Link with Sales
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
: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/12.0/rma_sale
:target: https://github.com/OCA/rma/tree/13.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-12-0/rma-12-0-rma_sale
:target: https://translation.odoo-community.org/projects/rma-13-0/rma-13-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/12.0
:target: https://runbot.odoo-community.org/runbot/145/13.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:%2012.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:%2013.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.
@@ -121,6 +121,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/12.0/rma_sale>`_ project on GitHub.
This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/13.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,14 +3,14 @@
{
"name": "Return Merchandise Authorization Management - Link with Sales",
"summary": "Sale Order - Return Merchandise Authorization (RMA)",
"version": "12.0.1.5.2",
"development_status": "Beta",
"version": "13.0.1.0.0",
"development_status": "Production/Stable",
"category": "RMA",
"website": "https://github.com/OCA/rma",
"author": "Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["ernestotejeda"],
"license": "AGPL-3",
"depends": ["rma", "sale_stock",],
"depends": ["rma", "sale_stock"],
"data": [
"views/assets.xml",
"views/report_rma.xml",

View File

@@ -18,19 +18,19 @@ msgstr ""
"X-Generator: Weblate 3.10\n"
#. module: rma_sale
#: code:addons/rma_sale/controllers/sale_portal.py:39
#: code:addons/rma_sale/controllers/sale_portal.py:0
#, python-format
msgid " (Portal)"
msgstr " (Portal)"
#. module: rma_sale
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:42
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:0
#, python-format
msgid " has been created."
msgstr " ha sido creado."
#. module: rma_sale
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:44
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:0
#, python-format
msgid " have been created."
msgstr " han sido creados."
@@ -144,7 +144,7 @@ msgstr ""
"establecidos."
#. module: rma_sale
#: code:addons/rma_sale/models/sale.py:48
#: code:addons/rma_sale/models/sale.py:0
#: model_terms:ir.ui.view,arch_db:rma_sale.view_order_form
#, python-format
msgid "Create RMA"
@@ -290,7 +290,6 @@ msgid "Requested operation"
msgstr "Operación solicitada"
#. module: rma_sale
#: model:ir.model,name:rma_sale.model_sale_order
#: model:ir.model.fields,field_description:rma_sale.field_rma__order_id
msgid "Sale Order"
msgstr "Pedido de venta"
@@ -305,6 +304,11 @@ msgstr "Linea de Asistente de Orden de Venta - RMA "
msgid "Sale Order Rma Wizard"
msgstr "Asistente de Orden de Venta - RMA"
#. module: rma_sale
#: model:ir.model,name:rma_sale.model_sale_order
msgid "Sales Order"
msgstr ""
#. module: rma_sale
#: model:ir.model,name:rma_sale.model_sale_order_line
msgid "Sales Order Line"
@@ -323,7 +327,8 @@ msgstr "Movimiento de existencias"
#. module: rma_sale
#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template
msgid "The limit will decrease when the units in other RMAs are confirmed"
msgstr "El límite disminuirá cuando las unidades de otros RMAs sean confirmadas"
msgstr ""
"El límite disminuirá cuando las unidades de otros RMAs sean confirmadas"
#. module: rma_sale
#: model:ir.model.fields,field_description:rma_sale.field_sale_order_line_rma_wizard__uom_id
@@ -359,7 +364,7 @@ msgid "You can send a message in every RMA sent"
msgstr "Puede mandar un mensaje en cada RMA enviado"
#. module: rma_sale
#: code:addons/rma_sale/models/sale.py:34
#: code:addons/rma_sale/models/sale.py:0
#, python-format
msgid "You may only create RMAs from a confirmed or done sale order."
msgstr "Solo puedes crear RMAs desde una orden de venta confirmada o hecha."

View File

@@ -17,19 +17,19 @@ msgstr ""
"X-Generator: Weblate 3.10\n"
#. module: rma_sale
#: code:addons/rma_sale/controllers/sale_portal.py:39
#: code:addons/rma_sale/controllers/sale_portal.py:0
#, python-format
msgid " (Portal)"
msgstr " (Portal)"
#. module: rma_sale
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:42
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:0
#, python-format
msgid " has been created."
msgstr " foi criado(a)."
#. module: rma_sale
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:44
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:0
#, python-format
msgid " have been created."
msgstr " foi criado(a)."
@@ -140,7 +140,7 @@ msgstr ""
"mesma categoria. A conversão será feita com base nas proporções."
#. module: rma_sale
#: code:addons/rma_sale/models/sale.py:48
#: code:addons/rma_sale/models/sale.py:0
#: model_terms:ir.ui.view,arch_db:rma_sale.view_order_form
#, python-format
msgid "Create RMA"
@@ -285,7 +285,6 @@ msgid "Requested operation"
msgstr "Operação Requisitada"
#. module: rma_sale
#: model:ir.model,name:rma_sale.model_sale_order
#: model:ir.model.fields,field_description:rma_sale.field_rma__order_id
msgid "Sale Order"
msgstr "Pedido de Venda"
@@ -300,6 +299,11 @@ msgstr "Assistente da Linha do Pedido de Venda RMA"
msgid "Sale Order Rma Wizard"
msgstr "Assistente do Pedido de Venda RMA"
#. module: rma_sale
#: model:ir.model,name:rma_sale.model_sale_order
msgid "Sales Order"
msgstr ""
#. module: rma_sale
#: model:ir.model,name:rma_sale.model_sale_order_line
msgid "Sales Order Line"
@@ -349,7 +353,7 @@ msgid "You can send a message in every RMA sent"
msgstr ""
#. module: rma_sale
#: code:addons/rma_sale/models/sale.py:34
#: code:addons/rma_sale/models/sale.py:0
#, python-format
msgid "You may only create RMAs from a confirmed or done sale order."
msgstr ""

View File

@@ -1,12 +1,12 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * rma_sale
# * rma_sale
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -14,19 +14,19 @@ msgstr ""
"Plural-Forms: \n"
#. module: rma_sale
#: code:addons/rma_sale/controllers/sale_portal.py:39
#: code:addons/rma_sale/controllers/sale_portal.py:0
#, python-format
msgid " (Portal)"
msgstr ""
#. module: rma_sale
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:42
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:0
#, python-format
msgid " has been created."
msgstr ""
#. module: rma_sale
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:44
#: code:addons/rma_sale/wizard/sale_order_rma_wizard.py:0
#, python-format
msgid " have been created."
msgstr ""
@@ -120,16 +120,20 @@ msgstr ""
#. module: rma_sale
#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template
msgid "Comment anything relevant to the return, like serial numbers, a description of the issue, etc"
msgid ""
"Comment anything relevant to the return, like serial numbers, a description "
"of the issue, etc"
msgstr ""
#. module: rma_sale
#: model:ir.model.fields,help:rma_sale.field_sale_order_line_rma_wizard__uom_category_id
msgid "Conversion between Units of Measure can only occur if they belong to the same category. The conversion will be made based on the ratios."
msgid ""
"Conversion between Units of Measure can only occur if they belong to the "
"same category. The conversion will be made based on the ratios."
msgstr ""
#. module: rma_sale
#: code:addons/rma_sale/models/sale.py:48
#: code:addons/rma_sale/models/sale.py:0
#: model_terms:ir.ui.view,arch_db:rma_sale.view_order_form
#, python-format
msgid "Create RMA"
@@ -274,7 +278,6 @@ msgid "Requested operation"
msgstr ""
#. module: rma_sale
#: model:ir.model,name:rma_sale.model_sale_order
#: model:ir.model.fields,field_description:rma_sale.field_rma__order_id
msgid "Sale Order"
msgstr ""
@@ -289,6 +292,11 @@ msgstr ""
msgid "Sale Order Rma Wizard"
msgstr ""
#. module: rma_sale
#: model:ir.model,name:rma_sale.model_sale_order
msgid "Sales Order"
msgstr ""
#. module: rma_sale
#: model:ir.model,name:rma_sale.model_sale_order_line
msgid "Sales Order Line"
@@ -316,7 +324,9 @@ msgstr ""
#. module: rma_sale
#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template
msgid "Use the comment button to add relevant information regarding the RMA, like returned serial numbers or a description of the issue"
msgid ""
"Use the comment button to add relevant information regarding the RMA, like "
"returned serial numbers or a description of the issue"
msgstr ""
#. module: rma_sale
@@ -326,7 +336,8 @@ msgstr ""
#. module: rma_sale
#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template
msgid "You can only return as much product units as you received for this order"
msgid ""
"You can only return as much product units as you received for this order"
msgstr ""
#. module: rma_sale
@@ -335,13 +346,14 @@ msgid "You can send a message in every RMA sent"
msgstr ""
#. module: rma_sale
#: code:addons/rma_sale/models/sale.py:34
#: code:addons/rma_sale/models/sale.py:0
#, python-format
msgid "You may only create RMAs from a confirmed or done sale order."
msgstr ""
#. module: rma_sale
#: model_terms:ir.ui.view,arch_db:rma_sale.sale_order_portal_template
msgid "You're about to perform an RMA request. Our team will process it an will reach you once it's validated. Keep in mind that:"
msgid ""
"You're about to perform an RMA request. Our team will process it an will "
"reach you once it's validated. Keep in mind that:"
msgstr ""

View File

@@ -20,15 +20,15 @@ class Rma(models.Model):
allowed_picking_ids = fields.Many2many(
comodel_name="stock.picking", compute="_compute_allowed_picking_ids",
)
picking_id = fields.Many2one(domain="[('id', 'in', allowed_picking_ids)]",)
picking_id = fields.Many2one(domain="[('id', 'in', allowed_picking_ids)]")
allowed_move_ids = fields.Many2many(
comodel_name="sale.order.line", compute="_compute_allowed_move_ids",
)
move_id = fields.Many2one(domain="[('id', 'in', allowed_move_ids)]",)
move_id = fields.Many2one(domain="[('id', 'in', allowed_move_ids)]")
allowed_product_ids = fields.Many2many(
comodel_name="product.product", compute="_compute_allowed_product_ids",
)
product_id = fields.Many2one(domain="[('id', 'in', allowed_product_ids)]",)
product_id = fields.Many2one(domain="[('id', 'in', allowed_product_ids)]")
@api.depends("partner_id", "order_id")
def _compute_allowed_picking_ids(self):
@@ -81,5 +81,5 @@ class Rma(models.Model):
"""Inject salesman from sales order (if any)"""
res = super()._prepare_refund(invoice_form, origin)
if self.order_id:
invoice_form.user_id = self.order_id.user_id
invoice_form.invoice_user_id = self.order_id.user_id
return res

View File

@@ -12,7 +12,7 @@ class SaleOrder(models.Model):
rma_ids = fields.One2many(
comodel_name="rma", inverse_name="order_id", string="RMAs", copy=False,
)
rma_count = fields.Integer(string="RMA count", compute="_compute_rma_count",)
rma_count = fields.Integer(string="RMA count", compute="_compute_rma_count")
def _compute_rma_count(self):
rma_data = self.env["rma"].read_group(
@@ -48,7 +48,6 @@ class SaleOrder(models.Model):
return {
"name": _("Create RMA"),
"type": "ir.actions.act_window",
"view_type": "form",
"view_mode": "form",
"res_model": "sale.order.rma.wizard",
"res_id": wizard.id,

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="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.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/12.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-12-0/rma-12-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/12.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/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>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:%2012.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:%2013.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">
@@ -461,7 +461,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/12.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/13.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

@@ -13,12 +13,12 @@ class TestRmaSale(SavepointCase):
cls.sale_order = cls.env["sale.order"]
cls.product_1 = cls.product_product.create(
{"name": "Product test 1", "type": "product",}
{"name": "Product test 1", "type": "product"}
)
cls.product_2 = cls.product_product.create(
{"name": "Product test 2", "type": "product",}
{"name": "Product test 2", "type": "product"}
)
cls.partner = cls.res_partner.create({"name": "Partner test",})
cls.partner = cls.res_partner.create({"name": "Partner test"})
order_form = Form(cls.sale_order)
order_form.partner_id = cls.partner
with order_form.order_line.new() as line_form:
@@ -41,6 +41,7 @@ class TestRmaSale(SavepointCase):
rma_form.order_id = self.sale_order
rma_form.product_id = self.product_1
rma_form.product_uom_qty = 5
rma_form.location_id = self.sale_order.warehouse_id.rma_loc_id
rma = rma_form.save()
rma.action_confirm()
self.assertTrue(rma.reception_move_id)
@@ -69,7 +70,7 @@ class TestRmaSale(SavepointCase):
)
# Refund the RMA
user = self.env["res.users"].create(
{"login": "test_refund_with_so", "name": "Test",}
{"login": "test_refund_with_so", "name": "Test"}
)
order.user_id = user.id
rma.action_confirm()

View File

@@ -6,7 +6,7 @@
<field name="inherit_id" ref="sale.view_order_form" />
<field name="groups_id" eval="[(4, ref('rma.rma_group_user_own'))]" />
<field name="arch" type="xml">
<button name="action_done" position="after">
<button name="action_draft" position="after">
<button
name="action_create_rma"
type="object"

View File

@@ -3,8 +3,6 @@
from odoo import _, api, fields, models
from odoo.addons import decimal_precision as dp
class SaleOrderRmaWizard(models.TransientModel):
_name = "sale.order.rma.wizard"
@@ -71,7 +69,7 @@ class SaleOrderLineRmaWizard(models.TransientModel):
_name = "sale.order.line.rma.wizard"
_description = "Sale Order Line Rma Wizard"
wizard_id = fields.Many2one(comodel_name="sale.order.rma.wizard", string="Wizard",)
wizard_id = fields.Many2one(comodel_name="sale.order.rma.wizard", string="Wizard")
order_id = fields.Many2one(
comodel_name="sale.order",
default=lambda self: self.env["sale.order"].browse(
@@ -91,9 +89,7 @@ class SaleOrderLineRmaWizard(models.TransientModel):
comodel_name="uom.category", related="product_id.uom_id.category_id",
)
quantity = fields.Float(
string="Quantity",
digits=dp.get_precision("Product Unit of Measure"),
required=True,
string="Quantity", digits="Product Unit of Measure", required=True,
)
uom_id = fields.Many2one(
comodel_name="uom.uom",

View File

@@ -3,7 +3,6 @@
<record id="sale_order_create_rma_action" model="ir.actions.act_window">
<field name="name">Create RMAs</field>
<field name="res_model">sale.order.rma.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>