[MIG] rma_sale: Migration to 15.0

This commit is contained in:
Alex Vining
2022-09-20 10:28:14 -04:00
parent 133e2ff3bd
commit eafdd41634
7 changed files with 22 additions and 32 deletions

View File

@@ -3,7 +3,7 @@
{
"name": "Return Merchandise Authorization Management - Link with Sales",
"summary": "Sale Order - Return Merchandise Authorization (RMA)",
"version": "14.0.2.1.0",
"version": "15.0.1.0.0",
"development_status": "Production/Stable",
"category": "RMA",
"website": "https://github.com/OCA/rma",
@@ -13,7 +13,6 @@
"depends": ["rma", "sale_stock"],
"data": [
"security/ir.model.access.csv",
"views/assets.xml",
"views/report_rma.xml",
"views/rma_views.xml",
"views/sale_views.xml",
@@ -21,4 +20,10 @@
"views/res_config_settings_views.xml",
"wizard/sale_order_rma_wizard_views.xml",
],
"assets": {
"web.assets_frontend": [
"/rma_sale/static/src/js/rma_portal_form.js",
"/rma_sale/static/src/scss/rma_sale.scss",
],
},
}

View File

@@ -105,8 +105,9 @@ class Rma(models.Model):
def _prepare_refund_line(self, line_form):
"""Add line data"""
super()._prepare_refund_line(line_form)
res = super()._prepare_refund_line(line_form)
line = self.sale_line_id
if line:
line_form.discount = line.discount
line_form.sequence = line.sequence
return res

View File

@@ -86,13 +86,14 @@ class SaleOrder(models.Model):
"""Search for possible RMA refunds and link them to the order. We
don't want to link their sale lines as that would unbalance the
qtys to invoice wich isn't correct for this case"""
super()._get_invoiced()
res = super()._get_invoiced()
for order in self:
refunds = order.sudo().rma_ids.mapped("refund_id")
if not refunds:
continue
order.invoice_ids += refunds
order.invoice_count = len(order.invoice_ids)
return res
class SaleOrderLine(models.Model):

View File

@@ -1,10 +1,10 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests import Form, SavepointCase
from odoo.tests import Form, TransactionCase
class TestRmaSale(SavepointCase):
class TestRmaSale(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestRmaSale, cls).setUpClass()

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="assets_frontend" inherit_id="web.assets_frontend" name="Request RMA">
<xpath expr="//link[last()]" position="after">
<script
type="text/javascript"
src="/rma_sale/static/src/js/rma_portal_form.js"
/>
<link
rel="stylesheet"
type="text/scss"
href="/rma_sale/static/src/scss/rma_sale.scss"
/>
</xpath>
</template>
</odoo>

View File

@@ -66,9 +66,9 @@
<i
t-attf-class="text-secondary fa #{address.type == 'delivery' and 'fa-truck' or 'fa-user'}"
/>
<t t-esc="address.name" />
<t t-out="address.name" />
</strong>
<pre><h6 t-esc="address.contact_address" /></pre>
<pre><h6 t-out="address.contact_address" /></pre>
</input>
</label>
</div>
@@ -93,7 +93,7 @@
<t t-if="data['quantity'] > 0 and data['picking']">
<tr>
<td class="text-left">
<span t-esc="data['product'].display_name" />
<span t-out="data['product'].display_name" />
<input
type="hidden"
t-attf-name="#{data_index}-product_id"
@@ -119,7 +119,7 @@
style="max-width: 60px;"
/>
<span
t-esc="data['uom'].name"
t-out="data['uom'].name"
groups="uom.group_uom"
/>
<input
@@ -131,7 +131,7 @@
</td>
<td class="text-left">
<span
t-esc="data['picking'] and data['picking'].name"
t-out="data['picking'] and data['picking'].name"
/>
<input
type="hidden"
@@ -147,7 +147,7 @@
<option value="">---</option>
<t t-foreach="operations" t-as="operation">
<option t-att-value="operation.id">
<t t-esc="operation.name" />
<t t-out="operation.name" />
</option>
</t>
</select>
@@ -251,7 +251,7 @@
class="btn btn-sm btn-secondary"
>
<span class="fa fa-reply" role="img" aria-label="RMA" title="RMA" />
<span t-esc="sale_order.rma_count" />
<span t-out="sale_order.rma_count" />
<span>RMA</span>
</a>
</span>
@@ -286,7 +286,7 @@
<t t-set="card_header">
<h5 class="mb-0">
<span>
RMA request for order <t t-esc="sale_order.name" />
RMA request for order <t t-out="sale_order.name" />
</span>
</h5>
</t>
@@ -315,7 +315,7 @@
<t t-else="">
<li class="breadcrumb-item active">
<a t-if="sale_order" t-att-href="default_url"><t
t-esc="sale_order.name"
t-out="sale_order.name"
/></a>
</li>
</t>

View File

@@ -124,7 +124,6 @@ class SaleOrderLineRmaWizard(models.TransientModel):
related="product_id.uom_id.category_id",
)
quantity = fields.Float(
string="Quantity",
digits="Product Unit of Measure",
required=True,
)