Xavier ALT (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-51189-xal into 
lp:openobject-addons/6.1.

Requested reviews:
  OpenERP R&D Team (openerp-dev)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-51189-xal/+merge/96177

Hi,

This is a forward-port of OPW 51189.

On invoice "refund", keep original salesman and fiscal_position.

Thanks,
Xavier
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-51189-xal/+merge/96177
Your team OpenERP R&D Team is requested to review the proposed merge of 
lp:~openerp-dev/openobject-addons/6.1-opw-51189-xal into 
lp:openobject-addons/6.1.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py	2012-02-16 19:11:07 +0000
+++ account/account_invoice.py	2012-03-06 16:48:52 +0000
@@ -1092,7 +1092,7 @@
         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')
@@ -1141,7 +1141,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

Reply via email to