summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorMartin Trigaux <mat@openerp.com>2013-05-24 10:55:34 +0200
committerMartin Trigaux <mat@openerp.com>2013-05-24 10:55:34 +0200
commitfcff0fcbea15f1db6eebae81660ec0ca8d2850c0 (patch)
tree986e70824b840ffd2107839764b4f524630abba6 /addons
parent41fd5d657da5d3d0a6d7e9dda851ec08d1a42d2c (diff)
[IMP] don't format 0 values
bzr revid: mat@openerp.com-20130524085534-coh7tjadajiu4bv3
Diffstat (limited to 'addons')
-rw-r--r--addons/hr_timesheet_sheet/static/src/js/timesheet.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/addons/hr_timesheet_sheet/static/src/js/timesheet.js b/addons/hr_timesheet_sheet/static/src/js/timesheet.js
index 90ce8eff39b..e7d13c425b6 100644
--- a/addons/hr_timesheet_sheet/static/src/js/timesheet.js
+++ b/addons/hr_timesheet_sheet/static/src/js/timesheet.js
@@ -166,12 +166,13 @@ openerp.hr_timesheet_sheet = function(instance) {
is_valid_value:function(value){
var split_value = value.split(":");
var valid_value = true;
- if (split_value.length > 2)return false;
+ if (split_value.length > 2)
+ return false;
_.detect(split_value,function(num){
if(isNaN(num)){
valid_value = false;
}
- })
+ });
return valid_value;
},
display_data: function() {
@@ -183,15 +184,15 @@ openerp.hr_timesheet_sheet = function(instance) {
self.get_box(account, day_count).val(self.sum_box(account, day_count, true)).change(function() {
var num = $(this).val();
if (self.is_valid_value(num)){
- num = Number(self.parse_client(num));
- }
+ num = (num == 0)?0:Number(self.parse_client(num));
+ }
if (isNaN(num)) {
$(this).val(self.sum_box(account, day_count, true));
} else {
account.days[day_count].lines[0].unit_amount += num - self.sum_box(account, day_count);
self.display_totals();
self.sync();
- if(!isNaN($(this).val())){
+ if(!isNaN($(this).val())){
$(this).val(self.sum_box(account, day_count, true));
}
}
@@ -269,7 +270,7 @@ openerp.hr_timesheet_sheet = function(instance) {
_.each(account.days[day_count].lines, function(line) {
line_total += line.unit_amount;
});
- return (show_value_in_hour)?this.format_client(line_total):line_total;
+ return (show_value_in_hour && line_total != 0)?this.format_client(line_total):line_total;
},
display_totals: function() {
var self = this;