diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index 397938f3442..5fad62a0b03 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -846,18 +846,20 @@ result = rules.NET > categories.NET * 0.10''', rule = self.browse(cr, uid, rule_id, context=context) if rule.amount_select == 'fix': try: - return rule.amount_fix, eval(rule.quantity, localdict), 100.0 + return rule.amount_fix, float(eval(rule.quantity, localdict)), 100.0 except: raise osv.except_osv(_('Error!'), _('Wrong quantity defined for salary rule %s (%s).')% (rule.name, rule.code)) elif rule.amount_select == 'percentage': try: - return eval(rule.amount_percentage_base, localdict), eval(rule.quantity, localdict), rule.amount_percentage + return (float(eval(rule.amount_percentage_base, localdict)), + float(eval(rule.quantity, localdict)), + rule.amount_percentage) except: raise osv.except_osv(_('Error!'), _('Wrong percentage base or quantity defined for salary rule %s (%s).')% (rule.name, rule.code)) else: try: eval(rule.amount_python_compute, localdict, mode='exec', nocopy=True) - return localdict['result'], 'result_qty' in localdict and localdict['result_qty'] or 1.0, 'result_rate' in localdict and localdict['result_rate'] or 100.0 + return float(localdict['result']), 'result_qty' in localdict and localdict['result_qty'] or 1.0, 'result_rate' in localdict and localdict['result_rate'] or 100.0 except: raise osv.except_osv(_('Error!'), _('Wrong python code defined for salary rule %s (%s).')% (rule.name, rule.code)) diff --git a/addons/hr_timesheet_sheet/static/src/xml/timesheet.xml b/addons/hr_timesheet_sheet/static/src/xml/timesheet.xml index 7ac7330f2d3..c9911e60518 100644 --- a/addons/hr_timesheet_sheet/static/src/xml/timesheet.xml +++ b/addons/hr_timesheet_sheet/static/src/xml/timesheet.xml @@ -36,7 +36,7 @@
-
+
Total
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index abca85df6ef..363fdc620bd 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1095,10 +1095,12 @@ class purchase_order_line(osv.osv): context_partner.update( {'lang': lang, 'partner_id': partner_id} ) product = product_product.browse(cr, uid, product_id, context=context_partner) #call name_get() with partner in the context to eventually match name and description in the seller_ids field - dummy, name = product_product.name_get(cr, uid, product_id, context=context_partner)[0] - if product.description_purchase: - name += '\n' + product.description_purchase - res['value'].update({'name': name}) + if not name or not uom_id: + # The 'or not uom_id' part of the above condition can be removed in master. See commit message of the rev. introducing this line. + dummy, name = product_product.name_get(cr, uid, product_id, context=context_partner)[0] + if product.description_purchase: + name += '\n' + product.description_purchase + res['value'].update({'name': name}) # - set a domain on product_uom res['domain'] = {'product_uom': [('category_id','=',product.uom_id.category_id.id)]} diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index dead323d2d2..994c83e4fbe 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -237,7 +237,7 @@ - + @@ -419,7 +419,7 @@ - +