Skip to content

Commit

Permalink
comment in the code to logger.warning
Browse files Browse the repository at this point in the history
  • Loading branch information
lepistone committed Nov 12, 2014
1 parent f2a1a0f commit 3d27db6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions logistic_requisition/model/logistic_requisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,19 +529,19 @@ def _get_total_cost(self):
line.amount_total = total_cost

requisition = line.requisition_id
# if we do not know the requisition, then this method is probably
# called like an on_change, before saving. In that case, we return
# instead of crashing. The result of that is that the
# amount_total_company field will be updated only when we save.
# It might be that that can be improved by improving the view. This
# check will pose no problem in that case.
if requisition:
date = requisition.date
from_curr = requisition.currency_id.with_context(date=date)
to_curr = requisition.company_id.currency_id
total_cost_company += from_curr.compute(total_cost, to_curr,
round=False)
line.amount_total_company = total_cost_company
else:
_logger.warning(
"Total in currency not computed: requisition not passed "
"to the onchange method. This can probably be avoided "
"improving the view."
)

@api.multi
def view_stock_by_location(self):
Expand Down

0 comments on commit 3d27db6

Please sign in to comment.