Error while trying to make a refund

Bug #1160750 reported by Patrick van den Eijk
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned
openerp-icm
Fix Committed
High
Sandy Carter (http://www.savoirfairelinux.com)

Bug Description

I have made an order and did the whole process of delivering the articles and making an invoice.

Now I go to the invoice which has been paid. On top of the screen is a button "Refund Invoice".

When I click on it, a small screen appears to get some information from the user. As reason I type "Manco" (without quotes) and click on "Create Refund".

This generates the following error:

    OpenERP Server Error

    Client Traceback (most recent call last):

    File "/usr/lib/pymodules/python2.7/openerp/addons/web/http.py", line 203, in dispatch

    response["result"] = method(self, **self.params)

    File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1133, in call_button

    action = self._call_kw(req, model, method, args, {})

    File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 1121, in _call_kw

    return getattr(req.session.model(model), method)(args, *kwargs)

    File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 43, in proxy

    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)

    File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 31, in proxy_method

    result = self.session.send(self.service_name, method, *args)

    File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 104, in send

    raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

    Server Traceback (most recent call last):

    File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 90, in send

    return openerp.netsvc.dispatch_rpc(service_name, method, args)

    File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 293, in dispatch_rpc

    result = ExportService.getService(service_name).dispatch(method, params)

    File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 626, in dispatch

    res = fn(db, uid, *params)

    File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 188, in execute_kw

    return self.execute(db, uid, obj, method, args, *kw or {})

    File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 131, in wrapper

    return f(self, dbname, args, *kwargs)

    File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 197, in execute

    res = self.execute_cr(cr, uid, obj, method, args, *kw)

    File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 185, in execute_cr

    return getattr(object, method)(cr, uid, args, *kw)

    File "/usr/lib/pymodules/python2.7/openerp/addons/account/wizard/account_invoice_refund.py", line 223, in invoice_refund

    return self.compute_refund(cr, uid, ids, data_refund, context=context)

    File "/usr/lib/pymodules/python2.7/openerp/addons/account/wizard/account_invoice_refund.py", line 149, in compute_refund

    refund_id = inv_obj.refund(cr, uid, [inv.id], date, period, description, journal_id, context=context)

    File "/usr/lib/pymodules/python2.7/openerp/addons/account/account_invoice.py", line 1233, in refund

    context=context)

    File "/usr/lib/pymodules/python2.7/openerp/addons/account/account_invoice.py", line 1197, in _prepare_refund

    invoice_lines = self._refund_cleanup_lines(cr, uid, invoice.invoice_line, context=context)

    TypeError: _refund_cleanup_lines() got an unexpected keyword argument 'context'

I have installed the latest version of V7 from nightly.openerp.com/7.0/nightly/deb/ ./

I am using Ubuntu 12.04.2, 64 bit.

Related branches

affects: account-invoicing → openobject-addons
Revision history for this message
Patrick van den Eijk (pvandeneijk) wrote :

Issue caused by the usage of an additional module (sale_commission), which redefined the method account_invoice._refund_cleanup_lines, but without the usage of context. In the redefined method super is called, without context as well.

After changing the definition and adding the possible passed context to super, the refund is working.

So this bug can be closed.

Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello Patrick,

I have checked your issue with latest trunk as well with 7.0. I did the same steps which is mentioned in your report. And its working fine.

So, would you please check it with latest code and also provide more information about your issue . So, due to that I can reproduce it.

I hope you understand. :)

Thanks & waiting for your answer.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hi Patrick,

As per your comment #1, I am closing this issue.

Thank You.

Changed in openobject-addons:
status: Incomplete → Invalid
Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

Patrick, you did right investigation.

module sale_commission is not a part of official module list of stable 7.0 where it's a communitary
module so one can't face this problem on stable release.

Thanks.

Changed in openerp-icm:
importance: Undecided → High
status: New → Confirmed
assignee: nobody → Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter)
Changed in openerp-icm:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.