跳至内容
菜单
此问题已终结
1 回复
10931 查看

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.

编写者

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.

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.

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

编写者 最佳答案

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)

相关帖文 回复 查看 活动
2
7月 18
3137
8
3月 19
5307
2
9月 17
5822
1
6月 16
4310
8
8月 15
9243