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

Requested reviews:
  Rucha (Open ERP) (rpa-openerp)
Related bugs:
  Bug #689666 in OpenERP Addons: "[PS] Problem with pricelist and automatic 
procurement"
  https://bugs.launchpad.net/openobject-addons/+bug/689666

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

Hello,

purchase:set a stranded price when PO is automatically created by procurement.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-689666-mma/+merge/64647
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-689666-mma.
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py	2011-04-26 07:39:18 +0000
+++ purchase/purchase.py	2011-06-15 09:18:22 +0000
@@ -790,7 +790,7 @@
             if seller_qty:
                 qty = max(qty,seller_qty)
 
-            price = pricelist_obj.price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, partner_id, {'uom': uom_id})[pricelist_id]
+            price_uni = pricelist_obj.price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, partner_id, {'uom': uom_id})[pricelist_id]
 
             newdate = datetime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S')
             newdate = (newdate - relativedelta(days=company.po_lead)) - relativedelta(days=seller_delay)
@@ -800,6 +800,11 @@
 
             product = prod_obj.browse(cr, uid, procurement.product_id.id, context=context)
 
+            if price_uni == False:
+                price = product.standard_price
+            else:
+                price = price_uni
+
             line = {
                 'name': product.partner_ref,
                 'product_qty': qty,

_______________________________________________
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