From cefc0545707f17d8b8376a671faaca4566f93240 Mon Sep 17 00:00:00 2001 From: Michael Tietz Date: Fri, 25 Aug 2023 14:40:40 +0200 Subject: [PATCH] [FIX] rma_sale: set payment_term from order --- rma_sale/README.rst | 16 ++++++++++------ rma_sale/models/rma.py | 2 ++ rma_sale/readme/CONTRIBUTORS.rst | 1 + rma_sale/static/description/index.html | 9 ++++++--- rma_sale/tests/test_rma_sale.py | 3 +++ 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/rma_sale/README.rst b/rma_sale/README.rst index e201a8ad1..a833d582b 100644 --- a/rma_sale/README.rst +++ b/rma_sale/README.rst @@ -2,10 +2,13 @@ Return Merchandise Authorization Management - Link with Sales ============================================================= -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2a6959fc8bc5fac3e9535b55c4f5ef4d2781e1d60e95730c84b1cc802dfdde74 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Return Merchandise Authorization Management - Link with Sales .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :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/14.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/rma&target_branch=14.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| 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 @@ -78,7 +81,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 +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -103,6 +106,7 @@ Contributors * Chafique Delli * Giovanni Serra - Ooops +* Michael Tietz (MT Software) Maintainers ~~~~~~~~~~~ diff --git a/rma_sale/models/rma.py b/rma_sale/models/rma.py index 7b120fe2b..ddfc82725 100644 --- a/rma_sale/models/rma.py +++ b/rma_sale/models/rma.py @@ -1,4 +1,5 @@ # Copyright 2020 Tecnativa - Ernesto Tejeda +# Copyright 2023 Michael Tietz (MT Software) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import api, fields, models @@ -94,6 +95,7 @@ def _prepare_refund(self, invoice_form, origin): res = super()._prepare_refund(invoice_form, origin) if self.order_id: invoice_form.invoice_user_id = self.order_id.user_id + invoice_form.invoice_payment_term_id = self.order_id.payment_term_id return res def _get_refund_line_price_unit(self): diff --git a/rma_sale/readme/CONTRIBUTORS.rst b/rma_sale/readme/CONTRIBUTORS.rst index 75646b6d3..1ebe5ca2f 100644 --- a/rma_sale/readme/CONTRIBUTORS.rst +++ b/rma_sale/readme/CONTRIBUTORS.rst @@ -7,3 +7,4 @@ * Chafique Delli * Giovanni Serra - Ooops +* Michael Tietz (MT Software) diff --git a/rma_sale/static/description/index.html b/rma_sale/static/description/index.html index 6b5cec819..15ece8e4b 100644 --- a/rma_sale/static/description/index.html +++ b/rma_sale/static/description/index.html @@ -3,7 +3,7 @@ - + Return Merchandise Authorization Management - Link with Sales