Skip to content

Commit

Permalink
Merge f2a1a0f into 9fd6a2a
Browse files Browse the repository at this point in the history
  • Loading branch information
lepistone committed Nov 10, 2014
2 parents 9fd6a2a + f2a1a0f commit 31ec756
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion framework_agreement_sourcing/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#
##############################################################################
{'name': 'Framework agreement integration in sourcing',
'version': '1.0',
'version': '1.1',
'author': 'Camptocamp',
'maintainer': 'Camptocamp',
'category': 'NGO',
Expand Down
21 changes: 14 additions & 7 deletions logistic_requisition/model/logistic_requisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,20 @@ def _get_total_cost(self):
total_cost += source_line.total_cost
line.amount_total = total_cost

date = line.requisition_id.date
from_curr = line.requisition_id.currency_id.with_context(date=date)
to_curr = line.requisition_id.company_id.currency_id

total_cost_company += from_curr.compute(total_cost, to_curr,
round=False)
line.amount_total_company = total_cost_company
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

@api.multi
def view_stock_by_location(self):
Expand Down
1 change: 0 additions & 1 deletion logistic_requisition/view/logistic_requisition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@
<field name="proposed_qty" class="oe_inline"/>
<field name="proposed_uom_id" class="oe_inline"/>
</div>
<field name="currency_id"/>
<field name="unit_cost" widget="monetary"
options="{'currency_field': 'currency_id'}"/>
<field name="total_cost" widget="monetary"
Expand Down

0 comments on commit 31ec756

Please sign in to comment.