From d28479fec1a2ff4e656fb39c6924bcfe1f285fb6 Mon Sep 17 00:00:00 2001 From: "Denis Vermylen (dve)" Date: Tue, 5 Jul 2016 16:10:09 +0200 Subject: [PATCH] [FIX] hr_timesheet: hr_timesheet_demo.yml data adapted to be coherent with attendance demo data --- addons/hr_timesheet/hr_timesheet_demo.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/hr_timesheet/hr_timesheet_demo.yml b/addons/hr_timesheet/hr_timesheet_demo.yml index a6e3276adb0..4225d319f01 100644 --- a/addons/hr_timesheet/hr_timesheet_demo.yml +++ b/addons/hr_timesheet/hr_timesheet_demo.yml @@ -2,11 +2,12 @@ Creating demo data that require looking for accounts - !python {model: ir.model.data} : | - import time + from datetime import datetime + from dateutil.relativedelta import relativedelta vals = { 'name': 'Requirements analysis and specification', 'user_id': ref('base.user_root'), - 'date': time.strftime('%Y-%m-%d'), + 'date': (datetime.now()+relativedelta(days=-1)).strftime('%Y-%m-%d'), 'unit_amount': 2.00, 'product_id': ref('product.product_product_1'), 'product_uom_id': ref('product.product_uom_hour'), @@ -17,7 +18,7 @@ vals = { 'name': 'Design and specification', 'user_id': ref('base.user_root'), - 'date': time.strftime('%Y-%m-%d'), + 'date': (datetime.now()+relativedelta(days=-1)).strftime('%Y-%m-%d'), 'unit_amount': 1.00, 'product_id': ref('product.product_product_1'), 'product_uom_id': ref('product.product_uom_hour'), @@ -28,7 +29,7 @@ vals = { 'name': 'Coding and module testing', 'user_id': ref('base.user_root'), - 'date': time.strftime('%Y-%m-%d'), + 'date': (datetime.now()+relativedelta(days=-1)).strftime('%Y-%m-%d'), 'unit_amount': 3.00, 'product_id': ref('product.product_product_1'), 'product_uom_id': ref('product.product_uom_hour'), @@ -39,7 +40,7 @@ vals = { 'name': 'Integration and system testing', 'user_id': ref('base.user_root'), - 'date': time.strftime('%Y-%m-%d'), + 'date': (datetime.now()+relativedelta(days=-1)).strftime('%Y-%m-%d'), 'unit_amount': 1.00, 'product_id': ref('product.product_product_1'), 'product_uom_id': ref('product.product_uom_hour'), @@ -50,7 +51,7 @@ vals = { 'name': 'Delivery and maintenance', 'user_id': ref('base.user_root'), - 'date': time.strftime('%Y-%m-%d'), + 'date': (datetime.now()+relativedelta(days=-1)).strftime('%Y-%m-%d'), 'unit_amount': 1.00, 'product_id': ref('product.product_product_1'), 'product_uom_id': ref('product.product_uom_hour'),