Files
stock-rma/rma_sale/wizards/rma_refund.py
2020-03-09 13:30:06 +01:00

22 lines
593 B
Python

# Copyright 2020 ForgeFlow S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo import api, fields, models
class RmaRefund(models.TransientModel):
_inherit = "rma.refund"
@api.returns("rma.order.line")
def _prepare_item(self, line):
res = super(RmaRefund, self)._prepare_item(line)
res["sale_line_id"] = line.sale_line_id.id
return res
class RmaRefundItem(models.TransientModel):
_inherit = "rma.refund.item"
sale_line_id = fields.Many2one(
comodel_name="sale.order.line", string="Sale Order Line"
)