Rifakat (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.0-opw-51189-rha into
lp:openobject-addons/6.0.
Requested reviews:
Priyesh (OpenERP) (pso-openerp)
Related bugs:
Bug #903841 in OpenERP Addons: "salesman and fiscal position not copied from
invoice to refund"
https://bugs.launchpad.net/openobject-addons/+bug/903841
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-51189-rha/+merge/85790
Hello,
Salesman and fiscal position not copied whenever we create any refund invoice
from the invoice. It always takes current logged in user.
Thanks for your review,
Rifakat
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-51189-rha/+merge/85790
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.0-opw-51189-rha.
=== modified file 'account/invoice.py'
--- account/invoice.py 2011-11-24 08:32:27 +0000
+++ account/invoice.py 2011-12-15 04:43:25 +0000
@@ -1076,7 +1076,12 @@
return map(lambda x: (0,0,x), lines)
def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None):
- invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'address_invoice_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id'])
+ invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment',\
+ 'date_due', 'partner_id', 'address_contact_id',\
+ 'address_invoice_id', 'partner_contact',\
+ 'partner_insite', 'partner_ref', 'payment_term',\
+ 'account_id', 'currency_id', 'invoice_line',\
+ 'tax_line', 'journal_id', 'user_id', 'fiscal_position'])
obj_invoice_line = self.pool.get('account.invoice.line')
obj_invoice_tax = self.pool.get('account.invoice.tax')
obj_journal = self.pool.get('account.journal')
@@ -1125,7 +1130,8 @@
})
# take the id part of the tuple returned for many2one fields
for field in ('address_contact_id', 'address_invoice_id', 'partner_id',
- 'account_id', 'currency_id', 'payment_term', 'journal_id'):
+ 'account_id', 'currency_id', 'payment_term', 'journal_id',
+ 'user_id', 'fiscal_position'):
invoice[field] = invoice[field] and invoice[field][0]
# create the new invoice
new_ids.append(self.create(cr, uid, invoice))
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp