Skip to content

Commit

Permalink
[FIX] purchase: keep reference to purchase order line
Browse files Browse the repository at this point in the history
When generating an invoice from a stock.picking, the reference to the purchase.order.line needs to be kept (e.g. this is needed by anglo-saxon for price valuation). (opw 600767)
  • Loading branch information
mart-e committed Sep 17, 2014
1 parent 6e0c73d commit 10c3b8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/purchase/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def copy(self, cr, uid, id, default=None, context=None):
return super(stock_move, self).copy(cr, uid, id, default, context)

def _create_invoice_line_from_vals(self, cr, uid, move, invoice_line_vals, context=None):
if move.purchase_line_id:
invoice_line_vals['purchase_line_id'] = move.purchase_line_id.id
invoice_line_id = super(stock_move, self)._create_invoice_line_from_vals(cr, uid, move, invoice_line_vals, context=context)
if move.purchase_line_id:
purchase_line = move.purchase_line_id
Expand Down

0 comments on commit 10c3b8c

Please sign in to comment.