[FIX] rma: Avoid set invoice_payment_term_id from partner default value in refund.

TT37690
This commit is contained in:
Víctor Martínez
2022-06-22 17:06:05 +02:00
committed by Pedro M. Baeza
parent e52f18b66d
commit ad4bce575e
5 changed files with 20 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
{
"name": "Return Merchandise Authorization Management",
"summary": "Return Merchandise Authorization (RMA)",
"version": "14.0.2.3.1",
"version": "14.0.3.0.0",
"development_status": "Production/Stable",
"category": "RMA",
"website": "https://github.com/OCA/rma",

View File

@@ -6,8 +6,6 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-03-07 16:33+0000\n"
"PO-Revision-Date: 2022-03-07 16:33+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -818,6 +816,18 @@ msgstr ""
msgid "Group By"
msgstr ""
#. module: rma
#: model:ir.model.fields,field_description:rma.field_res_company__rma_return_grouping
#: model:ir.model.fields,field_description:rma.field_res_config_settings__rma_return_grouping
#: model:ir.model.fields,field_description:rma.field_rma_delivery_wizard__rma_return_grouping
msgid "Group RMA returns by customer address and warehouse"
msgstr ""
#. module: rma
#: model_terms:ir.ui.view,arch_db:rma.res_config_settings_view_form
msgid "Group RMA returns by customer and warehouse."
msgstr ""
#. module: rma
#: model:ir.model.fields,field_description:rma.field_account_move__id
#: model:ir.model.fields,field_description:rma.field_account_move_line__id

View File

@@ -1048,6 +1048,8 @@ class Rma(models.Model):
"""
self.ensure_one()
invoice_form.partner_id = self.partner_invoice_id
# Avoid set partner default value
invoice_form.invoice_payment_term_id = self.env["account.payment.term"]
def _prepare_refund_line(self, line_form):
"""Hook method for preparing a refund line Form.

View File

@@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Return Merchandise Authorization Management</title>
<style type="text/css">

View File

@@ -39,6 +39,9 @@ class TestRma(SavepointCase):
{
"name": "Partner test",
"property_account_receivable_id": cls.account_receiv.id,
"property_payment_term_id": cls.env.ref(
"account.account_payment_term_30days"
).id,
}
)
cls.partner_invoice = cls.res_partner.create(
@@ -273,6 +276,7 @@ class TestRmaCase(TestRma):
rma.action_refund()
self.assertEqual(rma.refund_id.move_type, "out_refund")
self.assertEqual(rma.refund_id.state, "draft")
self.assertFalse(rma.refund_id.invoice_payment_term_id)
self.assertEqual(rma.refund_line_id.product_id, rma.product_id)
self.assertEqual(rma.refund_line_id.quantity, 10)
self.assertEqual(rma.refund_line_id.product_uom_id, rma.product_uom)