From 0758edcbb6cf5e80049dce313c6569cb2a070ce2 Mon Sep 17 00:00:00 2001 From: Aaron Henriquez Date: Wed, 17 Apr 2019 10:31:37 +0200 Subject: [PATCH] [FIX]set the analytic account to PO from RMA --- rma_purchase_analytic/wizards/rma_add_purchase.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rma_purchase_analytic/wizards/rma_add_purchase.py b/rma_purchase_analytic/wizards/rma_add_purchase.py index db0459f1..ca930abe 100644 --- a/rma_purchase_analytic/wizards/rma_add_purchase.py +++ b/rma_purchase_analytic/wizards/rma_add_purchase.py @@ -13,3 +13,15 @@ class RmaAddPurchase(models.TransientModel): data = super(RmaAddPurchase, self)._prepare_rma_line_from_po_line(line) data.update(analytic_account_id=line.analytic_account_id.id) return data + + +class RmaLineMakePurchaseOrder(models.TransientModel): + _inherit = "rma.order.line.make.purchase.order" + _description = "Make Purchases Order from RMA Line" + + + @api.model + def _prepare_purchase_order_line(self, po, item): + res = super(RmaLineMakePurchaseOrder, self)._prepare_purchase_order_line(po, line) + res['analytic_account_id'] = item.analytic_account_id.id + return vals