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

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons_issue12_sales-mma/+merge/128216

Hello 

    I have fixed the issue of when no product in sale order line and invoice 
based on delivery at the time invoice is created for that line . 

Thanks
Mayur
   
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons_issue12_sales-mma/+merge/128216
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-addons_issue12_sales-mma.
=== modified file 'sale/sale.py'
--- sale/sale.py	2012-10-02 20:40:23 +0000
+++ sale/sale.py	2012-10-05 10:49:39 +0000
@@ -735,13 +735,13 @@
         if (line.order_id.invoice_quantity=='order'):
             if line.product_uos:
                 return line.product_uos_qty or 0.0
-            return line.product_uom_qty
+        return line.product_uom_qty
 
     def _get_line_uom(self, cr, uid, line, context=None):
         if (line.order_id.invoice_quantity=='order'):
             if line.product_uos:
                 return line.product_uos.id
-            return line.product_uom.id
+        return line.product_uom.id
 
     def _prepare_order_line_invoice_line(self, cr, uid, line, account_id=False, context=None):
         """Prepare the dict of values to create the new invoice line for a

=== modified file 'sale_stock/stock.py'
--- sale_stock/stock.py	2012-07-26 20:56:59 +0000
+++ sale_stock/stock.py	2012-10-05 10:49:39 +0000
@@ -183,6 +183,16 @@
                             'invoiced': True,
                             'invoice_lines': [(6, 0, [invoice_line_id])],
                         })
+                if not sale_line.product_id:
+                    vals = order_line_obj._prepare_order_line_invoice_line(cursor, user, sale_line, False, context)
+                    if vals:
+                        vals['invoice_id'] = invoices[result[picking.id]].id
+                        invoice_line_id = invoice_line_obj.create(cursor, user, vals, context=context)
+                        order_line_obj.write(cursor, user, [sale_line.id], {
+                            'invoiced': True,
+                            'invoice_lines': [(6, 0, [invoice_line_id])],
+                        })
+
         return result
 
 # Redefinition of the new field in order to update the model stock.picking.out in the orm

_______________________________________________
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