From d75238e77ceac8188f4f836c1dc254d952f4a42c Mon Sep 17 00:00:00 2001
From: Ernesto Tejeda
Date: Wed, 28 Oct 2020 17:04:17 -0400
Subject: [PATCH] [MIG] rma_sale: Migration to 13.0
---
rma_sale/README.rst | 10 +++++-----
rma_sale/__manifest__.py | 6 +++---
rma_sale/models/rma.py | 8 ++++----
rma_sale/models/sale.py | 3 +--
rma_sale/static/description/index.html | 6 +++---
rma_sale/tests/test_rma_sale.py | 9 +++++----
rma_sale/views/sale_views.xml | 2 +-
rma_sale/wizard/sale_order_rma_wizard.py | 8 ++------
rma_sale/wizard/sale_order_rma_wizard_views.xml | 1 -
9 files changed, 24 insertions(+), 29 deletions(-)
diff --git a/rma_sale/README.rst b/rma_sale/README.rst
index 992936bb..43111230 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/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 `_.
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.
@@ -121,6 +121,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 e39a5e20..c63d3bdb 100644
--- a/rma_sale/__manifest__.py
+++ b/rma_sale/__manifest__.py
@@ -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",
diff --git a/rma_sale/models/rma.py b/rma_sale/models/rma.py
index e4b87f2f..4fc540c1 100644
--- a/rma_sale/models/rma.py
+++ b/rma_sale/models/rma.py
@@ -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
diff --git a/rma_sale/models/sale.py b/rma_sale/models/sale.py
index 4346b501..d2b58601 100644
--- a/rma_sale/models/sale.py
+++ b/rma_sale/models/sale.py
@@ -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,
diff --git a/rma_sale/static/description/index.html b/rma_sale/static/description/index.html
index 1f416779..6fab589d 100644
--- a/rma_sale/static/description/index.html
+++ b/rma_sale/static/description/index.html
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
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.
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.