← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-779064-ron into lp:openobject-addons

 

Rohan Nayani(Open ERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-779064-ron into lp:openobject-addons.

Requested reviews:
  Rucha (Open ERP) (rpa-openerp)
Related bugs:
  Bug #779064 in OpenERP Addons: "incorrect invoice price - average price + real time missing code"
  https://bugs.launchpad.net/openobject-addons/+bug/779064

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-779064-ron/+merge/61216
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-779064-ron/+merge/61216
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-779064-ron.
=== modified file 'purchase/stock.py'
--- purchase/stock.py	2011-02-25 14:53:47 +0000
+++ purchase/stock.py	2011-05-17 08:57:29 +0000
@@ -91,7 +91,10 @@
 
     def _get_price_unit_invoice(self, cursor, user, move_line, type):
         if move_line.purchase_line_id:
-            return move_line.purchase_line_id.price_unit
+            if move_line.purchase_line_id.order_id.invoice_method == 'picking':
+                return move_line.price_unit
+            else:
+                return move_line.purchase_line_id.price_unit
         return super(stock_picking, self)._get_price_unit_invoice(cursor, user, move_line, type)
 
     def _get_discount_invoice(self, cursor, user, move_line):


Follow ups