Skip to content

Commit

Permalink
[FIX] purchase: propagate analytic accounts when invoicing on incomin…
Browse files Browse the repository at this point in the history
…g shipments

Closes #5127
  • Loading branch information
adrienpeiffer authored and odony committed Feb 9, 2015
1 parent ca70367 commit 675357b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions addons/purchase/stock.py
Expand Up @@ -59,6 +59,7 @@ def copy(self, cr, uid, id, default=None, context=None):
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_vals['account_analytic_id'] = move.purchase_line_id.account_analytic_id.id or False,
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

3 comments on commit 675357b

@gurneyalex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit broke the build of OCA/stock-logistics-workflow: https://travis-ci.org/OCA/stock-logistics-workflow/jobs/50039271

@gurneyalex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an automated test would have caught this stupid typo...

@lepistone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@odony the comma at the end crashes every time there is no analytic account. Please revert or fix. Thanks!

Please sign in to comment.