** Patch added: "Correction of the files." https://bugs.launchpad.net/avanzosc/+bug/893934/+attachment/2605829/+files/bugfix.patch
-- You received this bug notification because you are a member of Avanzosc Developers, which is subscribed to Avanzosc developments. https://bugs.launchpad.net/bugs/893934 Title: account_tax_included: Wrong in definition of function refund. Status in Avanzosc OpenERP modules: New Bug description: Environment Information : System : Windows-Vista-6.1.7601-SP1 OS Name : nt Operating System Release : Vista Operating System Version : 6.1.7601 Operating System Architecture : 32bit Operating System Locale : sv_SE.cp1252 Python Version : 2.5.2 OpenERP-Client Version : 6.0.2 Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last): File "/opt/openerp/server/bin/netsvc.py", line 489, in dispatch result = ExportService.getService(service_name).dispatch(method, auth, params) File "/opt/openerp/server/bin/service/web_services.py", line 599, in dispatch res = fn(db, uid, *params) File "/opt/openerp/server/bin/osv/osv.py", line 122, in wrapper return f(self, dbname, *args, **kwargs) File "/opt/openerp/server/bin/osv/osv.py", line 176, in execute res = self.execute_cr(cr, uid, obj, method, *args, **kw) File "/opt/openerp/server/bin/osv/osv.py", line 167, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "/opt/openerp/server/bin/addons/account/wizard/account_invoice_refund.py", line 215, in invoice_refund return self.compute_refund(cr, uid, ids, data_refund, context=context) File "/opt/openerp/server/bin/addons/account/wizard/account_invoice_refund.py", line 140, in compute_refund refund_id = inv_obj.refund(cr, uid, [inv.id], date, period, description, journal_id) TypeError: refund() takes at most 7 arguments (8 given) Explaination and Fixes: The function refund in the file account/invoice.py has changed and is looking like this in OpenERP v6.0: ----- CUT ----- 1077) def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None): 1078) invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', ----- CUT ----- They have added an extra variable called journal_id. That variable isn't included when it is overwritten by the account_tax_include. So if we look at def refund in account_tax_include/invoice_tax_incl.py it looks like this: ----- CUT ----- def refund(self, cr, uid, ids, date=None, period_id=None, description=None): map_old_new = {} refund_ids = [] for old_inv_id in ids: new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description) refund_ids += new_id map_old_new[old_inv_id] = new_id[0] for old_inv_id in map_old_new.keys(): old_inv_record = self.read(cr, uid, [old_inv_id], ['price_type'])[0]['price_type'] self.write(cr, uid, [map_old_new[old_inv_id]], {'price_type' : old_inv_record}) return refund_ids ----- CUT ----- It should be modified to: ----- CUT ----- def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None): map_old_new = {} refund_ids = [] for old_inv_id in ids: new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description, journal_id=journal_id) refund_ids += new_id map_old_new[old_inv_id] = new_id[0] for old_inv_id in map_old_new.keys(): old_inv_record = self.read(cr, uid, [old_inv_id], ['price_type'])[0]['price_type'] self.write(cr, uid, [map_old_new[old_inv_id]], {'price_type' : old_inv_record}) return refund_ids ----- CUT ----- To manage notifications about this bug go to: https://bugs.launchpad.net/avanzosc/+bug/893934/+subscriptions -- Mailing list: https://launchpad.net/~avanzosc Post to : [email protected] Unsubscribe : https://launchpad.net/~avanzosc More help : https://help.launchpad.net/ListHelp

