Amit Dodiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-573828-ado into 
lp:openobject-addons/6.0.

Requested reviews:
  Amit Dodiya (OpenERP) (ado-openerp)
  Naresh(OpenERP) (nch-openerp)
  Xavier ALT (OpenERP) (xal-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-573828-ado/+merge/102434

Hello,

"[FIX] Payment term of a supplier is not transferred when creating the invoice 
with invoicing control is from picking"

Steps to reproduce:
1). Add Payment term in a supplier(Ex:Axelor)
2). Create purchase order with invoicing control = from picking
3). Confirm the purchase order, complete the reception and create invoice from 
picking
You will see the payment term you select in supplier is not in the created 
invoice, Payment term should be there.

Regards,
Amit

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-573828-ado/+merge/102434
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-573828-ado.
=== modified file 'purchase/stock.py'
--- purchase/stock.py	2012-03-26 14:26:25 +0000
+++ purchase/stock.py	2012-08-23 10:55:23 +0000
@@ -131,6 +131,7 @@
                 context=context)
         picking_ids = result.keys()
         invoice_ids = result.values()
+        invoice_vals = {}
         invoices = {}
         for invoice in invoice_obj.browse(cr, uid, invoice_ids,
                 context=context):
@@ -143,8 +144,13 @@
             purchase_lines = picking.purchase_id.order_line
             invoice_created = invoices[result[picking.id]]
 
+            if picking.purchase_id.partner_id.property_payment_term:
+                invoice_vals.update({'payment_term' : picking.purchase_id.partner_id.property_payment_term.id})
+            
             if picking.purchase_id.fiscal_position:
-                invoice_obj.write(cr, uid, [invoice_created.id], {'fiscal_position': picking.purchase_id.fiscal_position.id}, context=context)
+                invoice_vals.update({'fiscal_position': picking.purchase_id.fiscal_position.id})
+
+            invoice_obj.write(cr, uid, [invoice_created.id], invoice_vals, context=context)
 
             for purchase_line in purchase_lines:
                 if purchase_line.product_id.type == 'service' and purchase_line.invoiced == False:

_______________________________________________
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