Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix manual create sourcing #34

Merged
merged 4 commits into from
Nov 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
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