Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

3

when refund an invoice no origin reference

By
Andreas Maertens
on 4/19/13, 10:44 AM 3,397 views

When I refund from an invoice there is no origin reference given. How do I link them? Couldn't find reason in Source, any help is kindly welcome.

Andreas

I've been tinkering with OpenERP since V5. Returns & refunds have been the weakest part of the whole system for me. No visual indicator on an invoice that it has been returned always leads to problems.

Mike Lindsay
on 4/19/13, 2:45 PM

I made an addon for that issue, adding invoice.internal_number to origin in refund invoice. That works so far and at least lets have a linking. I wonder, why this is not done in public account addon.

Andreas Maertens
on 4/23/13, 10:54 AM

Hello! I've the same problem, no trackback from refund to original invoice. Can you give me some indications on how to implement this in my installation or where I can download the addon? Thanks.

Andrea Trincia
on 5/6/13, 10:45 AM

http://v6apps.openerp.com/addon/6767 - this works well in version 7.0 but I changed the name of the tab to 'Refunded From'.

Bista Solutions US, Ray Carnes
on 5/7/13, 8:11 PM
0

Andreas Maertens

--Andreas Maertens--
912
| 5 5 7
Finsterwalde, Germany
--Andreas Maertens--

I develop odoo8.0 modules

Andreas Maertens
On 5/7/13, 9:02 AM

According to Andrea Trincia asked me to show her how to add invoice id to refund I will show my solution here that of course could have been done better. This just solved my issue I got on that point.

I made an addon with that account_invoice.py file:

# -*- coding: utf-8 -*-
from openerp.osv import fields, osv

class account_invoice(osv.osv):
    _name= 'account.invoice'
    _inherit= 'account.invoice'

    def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None, context=None):
        invoice_obj = self.pool.get('account.invoice')

        new_ids = super(account_invoice, self).refund(cr, uid, ids, date, period_id, description, journal_id, context)

        for refund_id ,invoice in zip(new_ids, self.browse(cr, uid, ids)):
            self.write(cr, uid, refund_id, {'origin': invoice.internal_number})

        return new_ids

account_invoice()

This just adds the id of invoice to origin field. There might have been a one2one connection between but that has not been necessary for my issue.

Comment from the Question:

http://v6apps.openerp.com/addon/6767 - this works well in version 7.0 but I changed the name of the tab to 'Refunded From'. Ray Carnes (May 8 '13)

Andreas Maertens
on 5/14/13, 7:30 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 4/19/13, 10:44 AM
Seen: 3397 times
Last updated: 3/16/15, 8:10 AM