diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py
index 0abe79f01c6..20ec20f3f32 100644
--- a/addons/account/account_analytic_line.py
+++ b/addons/account/account_analytic_line.py
@@ -125,7 +125,7 @@ class account_analytic_line(osv.osv):
# Compute the cost based on the price type define into company
# property_valuation_price_type property
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id,
- date,unit=False, context=None):
+ unit=False, context=None):
if context==None:
context={}
uom_obj = self.pool.get('product.uom')
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index a730a172f09..dbbfc0cc9c3 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -163,19 +163,19 @@
tree
-
+
-
-
+
+
-
+
-
+
@@ -232,16 +232,16 @@
diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py
index 4c2ca16ce0c..5064eef8ff1 100644
--- a/addons/hr_expense/hr_expense.py
+++ b/addons/hr_expense/hr_expense.py
@@ -212,12 +212,18 @@ class hr_expense_line(osv.osv):
'date_value' : lambda *a: time.strftime('%Y-%m-%d'),
}
_order = "sequence"
- def onchange_product_id(self, cr, uid, ids, product_id, uom_id, context={}):
+ def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context={}):
v={}
if product_id:
product=self.pool.get('product.product').browse(cr,uid,product_id, context=context)
v['name']=product.name
- v['unit_amount']=product.standard_price
+
+ # Compute based on pricetype of employee company
+ pricetype_id = self.pool.get('hr.employee').browse(cr,uid,employee_id).user_id.company_id.property_valuation_price_type.id
+ pricetype=self.pool.get('product.price.type').browse(cr,uid,pricetype_id)
+ amount_unit=product.price_get(pricetype.field, context)[product.id]
+
+ v['unit_amount']=amount_unit
if not uom_id:
v['uom_id']=product.uom_id.id
return {'value':v}
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index 184f95a4c3f..3d0e3dde899 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -58,8 +58,8 @@