Mayur Maheshwari(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-opw-579389-port-mma into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-579389-port-mma/+merge/136633

Hello,

Invoice date of Create Invoices wizard is not considered while creating 
invoices.

Steps to reproduce:
1. Create Sales Order and confirm it.
2. open a list view and select that sale order now Create Invoice through make 
invoice wizard and provide the Invoice date.
     So Provided date will not be shown in generated invoice.

code is forward port from 6.1


Thanks,
Mayur

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-579389-port-mma/+merge/136633
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-opw-579389-port-mma.
=== modified file 'sale/sale.py'
--- sale/sale.py	2012-11-26 15:51:39 +0000
+++ sale/sale.py	2012-11-28 12:14:23 +0000
@@ -366,7 +366,7 @@
             'comment': order.note,
             'payment_term': order.payment_term and order.payment_term.id or False,
             'fiscal_position': order.fiscal_position.id or order.partner_id.property_account_position.id,
-            'date_invoice': context.get('date_invoice', False),
+            'date_invoice': context.get('date_inv', False),
             'company_id': order.company_id.id,
             'user_id': order.user_id and order.user_id.id or False
         }
@@ -508,8 +508,11 @@
         if not invoices:
             for o in self.browse(cr, uid, ids, context=context):
                 for i in o.invoice_ids:
+                    date_inv = context.get('date_inv', False)
                     if i.state == 'draft':
-                        return i.id
+                        if date_inv:
+                            invoice.write(cr, uid, [i.id], {'date_invoice': date_inv})
+                        continue
         for val in invoices.values():
             if grouped:
                 res = self._make_invoice(cr, uid, val[0][0], reduce(lambda x, y: x + y, [l for o, l in val], []), context=context)

_______________________________________________
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