diff --git a/addons/project_long_term/__init__.py b/addons/project_long_term/__init__.py
index 8efcc1a0007..6b9b2613f3f 100644
--- a/addons/project_long_term/__init__.py
+++ b/addons/project_long_term/__init__.py
@@ -22,4 +22,4 @@
import project_long_term
import wizard
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_long_term/__openerp__.py b/addons/project_long_term/__openerp__.py
index 7bc0e3c9984..dfcddb75b48 100644
--- a/addons/project_long_term/__openerp__.py
+++ b/addons/project_long_term/__openerp__.py
@@ -18,13 +18,14 @@
# along with this program. If not, see .
#
##############################################################################
+
{
- "name" : "Long Term Project Management",
+ "name": "Long Term Project Management",
"version": "1.1",
- "author" : "Tiny",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Projects & Services",
- "depends" : ["project", "resource"],
+ "author": "Tiny",
+ "website": "http://www.openerp.com",
+ "category": "Generic Modules/Projects & Services",
+ "depends": ["project", "resource"],
"description": """
Long Term Project management module that tracks planning, scheduling, resources allocation.
@@ -36,9 +37,9 @@
- Schedule Tasks: All the tasks which are in draft,pending and open state are scheduled with taking the phase's start date
""",
- "init_xml" : [],
- "demo_xml" : ["project_long_term_demo.xml"],
- "test" : [
+ "init_xml": [],
+ "demo_xml": ["project_long_term_demo.xml"],
+ "test": [
'test/schedule_project_phases.yml',
'test/schedule_project_tasks.yml',
'test/schedule_phase_tasks.yml'
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py
index f1c40a4c8ba..4520e798f4e 100644
--- a/addons/project_long_term/project_long_term.py
+++ b/addons/project_long_term/project_long_term.py
@@ -29,7 +29,10 @@ class project_phase(osv.osv):
_name = "project.phase"
_description = "Project Phase"
- def _check_recursion(self, cr, uid, ids, context={}):
+ def _check_recursion(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+
data_phase = self.browse(cr, uid, ids[0], context=context)
prev_ids = data_phase.previous_phase_ids
next_ids = data_phase.next_phase_ids
@@ -45,7 +48,7 @@ class project_phase(osv.osv):
next_ids = [rec.id for rec in next_ids]
# iter prev_ids
while prev_ids:
- cr.execute('select distinct prv_phase_id from project_phase_rel where next_phase_id IN %s',(tuple(prev_ids),))
+ cr.execute('SELECT distinct prv_phase_id FROM project_phase_rel WHERE next_phase_id IN %s', (tuple(prev_ids),))
prv_phase_ids = filter(None, map(lambda x: x[0], cr.fetchall()))
if data_phase.id in prv_phase_ids:
return False
@@ -55,7 +58,7 @@ class project_phase(osv.osv):
prev_ids = prv_phase_ids
# iter next_ids
while next_ids:
- cr.execute('select distinct next_phase_id from project_phase_rel where prv_phase_id IN %s',(tuple(next_ids),))
+ cr.execute('SELECT distinct next_phase_id FROM project_phase_rel WHERE prv_phase_id IN %s', (tuple(next_ids),))
next_phase_ids = filter(None, map(lambda x: x[0], cr.fetchall()))
if data_phase.id in next_phase_ids:
return False
@@ -65,19 +68,19 @@ class project_phase(osv.osv):
next_ids = next_phase_ids
return True
- def _check_dates(self, cr, uid, ids, context={}):
+ def _check_dates(self, cr, uid, ids, context=None):
for phase in self.read(cr, uid, ids, ['date_start', 'date_end'], context=context):
if phase['date_start'] and phase['date_end'] and phase['date_start'] > phase['date_end']:
return False
return True
- def _check_constraint_start(self, cr, uid, ids, context={}):
+ def _check_constraint_start(self, cr, uid, ids, context=None):
phase = self.read(cr, uid, ids[0], ['date_start', 'constraint_date_start'], context=context)
if phase['date_start'] and phase['constraint_date_start'] and phase['date_start'] < phase['constraint_date_start']:
return False
return True
- def _check_constraint_end(self, cr, uid, ids, context={}):
+ def _check_constraint_end(self, cr, uid, ids, context=None):
phase = self.read(cr, uid, ids[0], ['date_end', 'constraint_date_end'], context=context)
if phase['date_end'] and phase['constraint_date_end'] and phase['date_end'] > phase['constraint_date_end']:
return False
@@ -97,7 +100,7 @@ class project_phase(osv.osv):
'product_uom': fields.many2one('product.uom', 'Duration UoM', required=True, help="UoM (Unit of Measure) is the unit of measurement for Duration"),
'task_ids': fields.one2many('project.task', 'phase_id', "Project Tasks"),
'resource_ids': fields.one2many('project.resource.allocation', 'phase_id', "Project Resources"),
- 'responsible_id':fields.many2one('res.users', 'Responsible'),
+ 'responsible_id': fields.many2one('res.users', 'Responsible'),
'state': fields.selection([('draft', 'Draft'), ('open', 'In Progress'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
help='If the phase is created the state \'Draft\'.\n If the phase is started, the state becomes \'In Progress\'.\n If review is needed the phase is in \'Pending\' state.\
\n If the phase is over, the states is set to \'Done\'.')
@@ -116,7 +119,7 @@ class project_phase(osv.osv):
#(_check_constraint_end, 'Phase must end-before constraint end Date.', ['date_end', 'constraint_date_end']),
]
- def onchange_project(self, cr, uid, ids, project, context={}):
+ def onchange_project(self, cr, uid, ids, project, context=None):
result = {}
project_obj = self.pool.get('project.project')
if project:
@@ -126,7 +129,9 @@ class project_phase(osv.osv):
return {'value': result}
return {'value': {'date_start': []}}
- def _check_date_start(self, cr, uid, phase, date_end, context={}):
+ def _check_date_start(self, cr, uid, phase, date_end, context=None):
+ if context is None:
+ context = {}
"""
Check And Compute date_end of phase if change in date_start < older time.
"""
@@ -147,7 +152,9 @@ class project_phase(osv.osv):
dt_start = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S')
self.write(cr, uid, [phase.id], {'date_start': dt_start, 'date_end': date_end.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
- def _check_date_end(self, cr, uid, phase, date_start, context={}):
+ def _check_date_end(self, cr, uid, phase, date_start, context=None):
+ if context is None:
+ context = {}
"""
Check And Compute date_end of phase if change in date_end > older time.
"""
@@ -168,11 +175,11 @@ class project_phase(osv.osv):
dt_end = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
self.write(cr, uid, [phase.id], {'date_start': date_start.strftime('%Y-%m-%d %H:%M:%S'), 'date_end': dt_end}, context=context)
- def write(self, cr, uid, ids, vals, context={}):
+ def write(self, cr, uid, ids, vals, context=None):
resource_calendar_obj = self.pool.get('resource.calendar')
resource_obj = self.pool.get('resource.resource')
uom_obj = self.pool.get('product.uom')
- if not context:
+ if context is None:
context = {}
if context.get('scheduler',False):
return super(project_phase, self).write(cr, uid, ids, vals, context=context)
@@ -191,7 +198,7 @@ class project_phase(osv.osv):
# Change the date_start and date_end
# for previous and next phases respectively based on valid condition
if vals.get('date_start', False) and vals['date_start'] < phase.date_start:
- dt_start = mx.DateTime.strptime(vals['date_start'],'%Y-%m-%d %H:%M:%S')
+ dt_start = mx.DateTime.strptime(vals['date_start'], '%Y-%m-%d %H:%M:%S')
work_times = resource_calendar_obj.interval_get(cr, uid, calendar_id, dt_start, avg_hours or 0.0, resource_id and resource_id[0] or False)
if work_times:
vals['date_end'] = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
@@ -214,7 +221,7 @@ class project_phase(osv.osv):
self.write(cr, uid, ids, {'state': 'open'})
return True
- def set_pending(self, cr, uid, ids,*args):
+ def set_pending(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state': 'pending'})
return True
diff --git a/addons/project_long_term/project_long_term_data.xml b/addons/project_long_term/project_long_term_data.xml
index 32d041544cc..8da591f1337 100644
--- a/addons/project_long_term/project_long_term_data.xml
+++ b/addons/project_long_term/project_long_term_data.xml
@@ -1,6 +1,7 @@
+
Project
@@ -10,5 +11,6 @@
Project task
project.task
+
diff --git a/addons/project_long_term/project_long_term_demo.xml b/addons/project_long_term/project_long_term_demo.xml
index 657658eba46..b688e45876a 100644
--- a/addons/project_long_term/project_long_term_demo.xml
+++ b/addons/project_long_term/project_long_term_demo.xml
@@ -8,151 +8,151 @@
en_US
Demo User1
-
+
Mr Demo
-
-
+
+
demo1
demo1
-
+
en_US
Manager1
-
+
-
-
+
+
manager1
manager1
-
+
en_US
Manager2
-
+
-
-
+
+
manager2
manager2
-
+
en_US
user1
-
+
-
-
+
+
user1
USER1
-
+
en_US
user2
-
+
-
-
+
+
user2
user2
-
+
en_US
user_finance
-
+
-
-
+
+
user_finance
user_finance
-
+
en_US
user_design1
-
+
-
-
+
+
user_design1
user_design1
-
+
en_US
user_design2
-
+
-
-
+
+
user_design2
user_design2
-
+
en_US
user_developer1
-
+
-
-
+
+
user_developer1
user_developer1
-
+
en_US
user_developer2
-
+
-
-
+
+
user_developer2
user_developer1
-
+
@@ -161,43 +161,43 @@
user_tester1
-
-
+
+
user_tester1
user_tester1
-
+
en_US
user_tester2
-
+
-
-
+
+
user_tester2
user_tester2
-
+
en_US
user_analyst
-
+
-
-
+
+
user_analyst
user_analyst
-
+
@@ -255,17 +255,17 @@
open
normal
Develop an OpenERP Website.
-
+
2010-04-30
-
+
OpenERP Website Development
-
+
Information Gathering and Understanding
@@ -280,7 +280,7 @@
-
+
Planning
@@ -295,7 +295,7 @@
-
+
Web Design
@@ -310,7 +310,7 @@
-
+
Development, Integration and Testing
@@ -325,7 +325,7 @@
-
+
Website Deployment
@@ -405,8 +405,8 @@
2
draft
-
-
+
+
Prepare Requirements Document
2010-03-08
@@ -424,8 +424,8 @@
2
draft
-
-
+
+
Define Website Goals, Purposes and Target Audience
2010-03-04
@@ -443,8 +443,8 @@
2
draft
-
-
+
+
Use Cases
2010-03-10
@@ -462,8 +462,8 @@
2
draft
-
-
+
+
Budget Planning
2010-03-31
@@ -481,8 +481,8 @@
2
draft
-
-
+
+
Quality Planning
2010-03-31
@@ -500,8 +500,8 @@
2
draft
-
-
+
+
Risk Management Planning
2010-03-31
@@ -519,8 +519,8 @@
2
draft
-
-
+
+
Create Project Schedules
2010-03-31
@@ -538,8 +538,8 @@
2
draft
-
-
+
+
Dataflow Design
2010-04-02
@@ -557,8 +557,8 @@
2
draft
-
-
+
+
User Interface Design
2010-04-10
@@ -576,8 +576,8 @@
2
draft
-
-
+
+
Task Level WBS
2010-04-07
@@ -595,8 +595,8 @@
2
draft
-
-
+
+
Modular Programming
2010-04-22
@@ -613,8 +613,8 @@
2
draft
-
-
+
+
Integrate Modules
2010-04-24
@@ -631,8 +631,8 @@
2
draft
-
-
+
+
Unit Testing
2010-04-24
@@ -649,8 +649,8 @@
2
draft
-
-
+
+
Regression Test
2010-04-24
@@ -667,8 +667,8 @@
2
draft
-
-
+
+
Documentation
2010-04-24
@@ -685,8 +685,8 @@
2
draft
-
-
+
+
Performance Tuning
2010-04-24
@@ -703,8 +703,8 @@
2
draft
-
-
+
+
Deploy Website
2010-04-26
@@ -721,8 +721,8 @@
2
draft
-
-
+
+
Presentation
2010-04-28
@@ -739,8 +739,8 @@
2
draft
-
-
+
+
Deployment
2010-04-28
@@ -758,8 +758,8 @@
2
draft
-
-
+
+
Presentation
2010-04-29
@@ -777,8 +777,8 @@
2
draft
-
-
+
+
Modules Integration
2010-04-24
@@ -796,8 +796,8 @@
2
draft
-
-
+
+
Unit Testing
2010-04-24
@@ -815,8 +815,8 @@
2
draft
-
-
+
+
Modular Testing
2010-04-24
@@ -834,8 +834,8 @@
2
draft
-
-
+
+
Documentation
2010-04-28
@@ -853,8 +853,8 @@
2
draft
-
-
+
+
Performance Tuning
2010-04-27
@@ -873,8 +873,8 @@
2
draft
-
-
+
+
Modular Programming
2010-04-22
@@ -882,5 +882,6 @@
+
diff --git a/addons/project_long_term/project_long_term_report.xml b/addons/project_long_term/project_long_term_report.xml
index 3bbbce1874c..d8fe2a4fa6e 100644
--- a/addons/project_long_term/project_long_term_report.xml
+++ b/addons/project_long_term/project_long_term_report.xml
@@ -1,7 +1,9 @@
+
+
diff --git a/addons/project_long_term/project_long_term_wizard.xml b/addons/project_long_term/project_long_term_wizard.xml
index ea43762653c..7f3668c6b1a 100644
--- a/addons/project_long_term/project_long_term_wizard.xml
+++ b/addons/project_long_term/project_long_term_wizard.xml
@@ -6,7 +6,7 @@
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -35,7 +35,7 @@
form
form
- {'record_id' : active_id}
+ {'record_id': active_id}
new
@@ -43,4 +43,4 @@
parent="menu_phase_schedule" action="action_project_compute_phases"/>
-
\ No newline at end of file
+
diff --git a/addons/project_long_term/wizard/project_compute_tasks.py b/addons/project_long_term/wizard/project_compute_tasks.py
index bd569abf90e..f7f1c9dc613 100644
--- a/addons/project_long_term/wizard/project_compute_tasks.py
+++ b/addons/project_long_term/wizard/project_compute_tasks.py
@@ -69,7 +69,7 @@ class project_compute_tasks(osv.osv_memory):
resource_id = resource_obj.search(cr, uid, [('user_id', '=', user.id)], context=context)
if resource_id:
# resource = resource_obj.browse(cr, uid, resource_id, context=context)[0]
- resource = resource_obj.read(cr, uid, resource_id, ['calendar_id','time_efficiency'], context=context)[0]
+ resource = resource_obj.read(cr, uid, resource_id, ['calendar_id', 'time_efficiency'], context=context)[0]
if resource.get('calendar_id', False):
leaves = wkcal.compute_leaves(cr, uid, calendar_id , resource_id[0], resource['calendar_id'] and resource['calendar_id'][0] or False)
time_efficiency = resource.get('time_efficiency')
@@ -126,7 +126,7 @@ class project_compute_tasks(osv.osv_memory):
s_date = t.start.to_datetime()
e_date = t.end.to_datetime()
if loop_no == 0:
- project_obj.write(cr, uid, [project_id], {'date' : e_date}, context=context)
+ project_obj.write(cr, uid, [project_id], {'date': e_date}, context=context)
else:
ctx = context.copy()
ctx.update({'scheduler': True})
diff --git a/addons/project_long_term/wizard/project_compute_tasks_view.xml b/addons/project_long_term/wizard/project_compute_tasks_view.xml
index eff475b4f11..bf6fe379048 100644
--- a/addons/project_long_term/wizard/project_compute_tasks_view.xml
+++ b/addons/project_long_term/wizard/project_compute_tasks_view.xml
@@ -34,4 +34,4 @@
parent="menu_phase_schedule" action="action_project_compute_tasks"/>
-
\ No newline at end of file
+
diff --git a/addons/project_long_term/wizard/project_schedule_tasks.py b/addons/project_long_term/wizard/project_schedule_tasks.py
index 78ad2166698..f0ad7c51dae 100644
--- a/addons/project_long_term/wizard/project_schedule_tasks.py
+++ b/addons/project_long_term/wizard/project_schedule_tasks.py
@@ -40,6 +40,8 @@ class project_schedule_task(osv.osv_memory):
}
def default_get(self, cr, uid, fields_list, context=None):
+ if context is None:
+ context = {}
res = super(project_schedule_task, self).default_get(cr, uid, fields_list, context)
self.compute_date(cr, uid, context=context)
return res
@@ -70,6 +72,8 @@ class project_schedule_task(osv.osv_memory):
return resource_objs
def compute_date(self, cr, uid, context=None):
+ if context is None:
+ context = {}
"""
Schedule the tasks according to resource available and priority.
"""
@@ -152,7 +156,7 @@ class project_schedule_task(osv.osv_memory):
'date_end': e_date.strftime('%Y-%m-%d %H:%M:%S'),
'user_id': user_id[0]},
context=ctx)
- loop_no +=1
+ loop_no += 1
return {}
project_schedule_task()
diff --git a/addons/project_long_term/wizard/project_schedule_tasks_view.xml b/addons/project_long_term/wizard/project_schedule_tasks_view.xml
index b62a3c107d9..f8e2f2d828b 100644
--- a/addons/project_long_term/wizard/project_schedule_tasks_view.xml
+++ b/addons/project_long_term/wizard/project_schedule_tasks_view.xml
@@ -25,9 +25,9 @@
form
form
- {'record_id' : active_id}
+ {'record_id': active_id}
new
-
\ No newline at end of file
+
diff --git a/addons/project_long_term/wizard/working_calendar.py b/addons/project_long_term/wizard/working_calendar.py
index ba8ec7db150..d52bd54b437 100644
--- a/addons/project_long_term/wizard/working_calendar.py
+++ b/addons/project_long_term/wizard/working_calendar.py
@@ -18,21 +18,27 @@
# along with this program. If not, see .
#
##############################################################################
+
import datetime
import pooler
-def convert_timeformat(cr, uid, time_string, context={}):
+def convert_timeformat(cr, uid, time_string, context=None):
+ if context is None:
+ context = {}
""" Convert input time string: 8.5 to output time string 8:30."""
split_list = str(time_string).split('.')
hour_part = split_list[0]
mins_part = split_list[1]
- round_mins = int(round(float(mins_part) * 60,-2))
+ round_mins = int(round(float(mins_part) * 60,-2))
converted_string = hour_part + ':' + str(round_mins)[0:2]
return converted_string
-def compute_leaves(cr, uid, calendar_id, resource_id=False, resource_calendar=False, context={}):
+def compute_leaves(cr, uid, calendar_id, resource_id=False, resource_calendar=False, context=None):
+
+ if context is None:
+ context = {}
"""Compute the leaves from the working calendar of the resource.
@@ -63,7 +69,10 @@ def compute_leaves(cr, uid, calendar_id, resource_id=False, resource_calendar=Fa
leave_list.sort()
return leave_list
-def compute_working_calendar(cr, uid, calendar_id, context={}):
+def compute_working_calendar(cr, uid, calendar_id, context=None):
+
+ if context is None:
+ context = {}
"""Change the format of working calendar from 'Openerp' format to bring it into 'Faces' format.
@@ -103,7 +112,7 @@ def compute_working_calendar(cr, uid, calendar_id, context={}):
for k,v in wk_time.items():
wktime_cal.append(tuple(v))
# Add for the non-working days like: [('sat, sun', '8:00-8:00')]
- for k,v in wk_days.items():
+ for k, v in wk_days.items():
if week_days.has_key(k):
week_days.pop(k)
for v in week_days.itervalues():
@@ -111,4 +120,4 @@ def compute_working_calendar(cr, uid, calendar_id, context={}):
if non_working:
wktime_cal.append((non_working[:-1], time_range))
return wktime_cal
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_messages/__openerp__.py b/addons/project_messages/__openerp__.py
index 134b4cc80c2..eb2bc24dc7c 100644
--- a/addons/project_messages/__openerp__.py
+++ b/addons/project_messages/__openerp__.py
@@ -21,10 +21,10 @@
{
- "name" : "In-Project Messaging System",
- "version" : "1.0",
- "depends" : ["project"],
- "author" : "Tiny",
+ "name": "In-Project Messaging System",
+ "version": "1.0",
+ "depends": ["project"],
+ "author": "Tiny",
"description": """
This module provides the functionality to send messages within a project.'
A user can send messages individually to other user also he can broadcast
diff --git a/addons/project_messages/project_messages.py b/addons/project_messages/project_messages.py
index ab7f96b71d4..657405c0921 100644
--- a/addons/project_messages/project_messages.py
+++ b/addons/project_messages/project_messages.py
@@ -18,6 +18,7 @@
# along with this program. If not, see .
#
##############################################################################
+
from osv import fields, osv
import netsvc
@@ -29,16 +30,15 @@ class messages(osv.osv):
logger = netsvc.Logger()
_columns = {
- 'from_id':fields.many2one('res.users', 'From', ondelete="CASCADE"),
- 'to_id':fields.many2one('res.users', 'To', ondelete="CASCADE"),
- 'project_id':fields.many2one('project.project', 'Project',
+ 'from_id': fields.many2one('res.users', 'From', ondelete="CASCADE"),
+ 'to_id': fields.many2one('res.users', 'To', ondelete="CASCADE"),
+ 'project_id': fields.many2one('project.project', 'Project',
required=True, ondelete="CASCADE"),
- 'message':fields.text('Message', required=True),
+ 'message': fields.text('Message', required=True),
}
-
_defaults = {
- 'from_id':lambda self, cr, uid, context: uid,
- 'to_id':None,
+ 'from_id': lambda self, cr, uid, context: uid,
+ 'to_id': None,
}
def broadcast(self, cr, uid, project_id, message, context=None):
@@ -67,6 +67,7 @@ class project_with_message(osv.osv):
'project.messages', 'project_id', 'Messages',
domain="[('to_id','in',[uid,False])]"),
}
+
project_with_message()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_mrp/__init__.py b/addons/project_mrp/__init__.py
index b310d99d87d..766b70ff911 100644
--- a/addons/project_mrp/__init__.py
+++ b/addons/project_mrp/__init__.py
@@ -21,4 +21,3 @@
import mrp
import project_mrp
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_mrp/mrp.py b/addons/project_mrp/mrp.py
index 98b05248a66..dc5d52e241d 100644
--- a/addons/project_mrp/mrp.py
+++ b/addons/project_mrp/mrp.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,35 +15,38 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
from osv import fields, osv, orm
+
import tools
class procurement_order(osv.osv):
_name = "procurement.order"
_inherit = "procurement.order"
-
- def action_produce_assign_service(self, cr, uid, ids, context={}):
+
+ def action_produce_assign_service(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
for procurement in self.browse(cr, uid, ids):
sline = self.pool.get('sale.order.line')
content = ''
sale_order = self.pool.get('sale.order')
so_ref = procurement.name.split(':')[0]
- order_ids = sale_order.search(cr, uid, [('name','=',so_ref)], context)
+ order_ids = sale_order.search(cr, uid, [('name', '=', so_ref)], context)
if order_ids:
- sale_ids = sale_order.read(cr, uid, order_ids[0],['order_line'],context=context)['order_line']
+ sale_ids = sale_order.read(cr, uid, order_ids[0], ['order_line'], context=context)['order_line']
else:
so_ref = procurement.origin.split(':')[0]
- sale_ids = sline.search(cr, uid, [('procurement_id','=',procurement.id)], context)
+ sale_ids = sline.search(cr, uid, [('procurement_id', '=',procurement.id)], context)
l = None
project_id = None
analytic_account_id = False
partner_id = False
-
+
for line in sline.browse(cr, uid, sale_ids, context=context):
content += (line.notes or '')
l = line
@@ -53,28 +56,28 @@ class procurement_order(osv.osv):
partner_id = line.order_id.partner_id.id
content+="\n\n"+line.order_id.project_id.complete_name
break
-
+
# Creating a project for task.Project is created from Procurement.
project_obj = self.pool.get('project.project')
proj_name = tools.ustr(so_ref)
- proj_exist_id = project_obj.search(cr, uid, [('name','=',proj_name)], context=context)
+ proj_exist_id = project_obj.search(cr, uid, [('name', '=', proj_name)], context=context)
if not proj_exist_id:
- project_id = project_obj.create(cr, uid, {'name':proj_name, 'partner_id':partner_id})
+ project_id = project_obj.create(cr, uid, {'name': proj_name, 'partner_id': partner_id})
else:
project_id = proj_exist_id[0]
-
- self.write(cr, uid, [procurement.id], {'state':'running'})
-
+
+ self.write(cr, uid, [procurement.id], {'state': 'running'})
+
name_task = ('','')
if procurement.product_id.type == 'service':
proc_name = procurement.name
if procurement.origin == proc_name:
proc_name = procurement.product_id.name
-
+
name_task = (procurement.origin, proc_name or '')
else:
name_task = (procurement.product_id.name or procurement.origin, procurement.name or '')
-
+
task_id = self.pool.get('project.task').create(cr, uid, {
'name': '%s:%s' % name_task,
'date_deadline': procurement.date_planned,
@@ -90,8 +93,9 @@ class procurement_order(osv.osv):
'company_id': procurement.company_id.id,
'project_id': project_id,
},context=context)
+
return task_id
+
procurement_order()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/project_mrp/project_mrp.py b/addons/project_mrp/project_mrp.py
index b606bbfe8fa..09820d44c71 100644
--- a/addons/project_mrp/project_mrp.py
+++ b/addons/project_mrp/project_mrp.py
@@ -49,4 +49,4 @@ class project_task(osv.osv):
project_task()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_mrp/project_mrp_workflow.xml b/addons/project_mrp/project_mrp_workflow.xml
index cd242e7f699..751634816e3 100644
--- a/addons/project_mrp/project_mrp_workflow.xml
+++ b/addons/project_mrp/project_mrp_workflow.xml
@@ -1,11 +1,11 @@
-
-
-
-
- subflow.done
-
-
+
+
+
+
+ subflow.done
+
+
diff --git a/addons/project_planning/__init__.py b/addons/project_planning/__init__.py
index 8f933a8ce2e..3cf91b8b9f7 100644
--- a/addons/project_planning/__init__.py
+++ b/addons/project_planning/__init__.py
@@ -23,4 +23,3 @@ import project_planning
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_planning/board_project_planning_view.xml b/addons/project_planning/board_project_planning_view.xml
index 3dfbd250b31..b48ab78dec2 100644
--- a/addons/project_planning/board_project_planning_view.xml
+++ b/addons/project_planning/board_project_planning_view.xml
@@ -13,5 +13,6 @@
"
+
diff --git a/addons/project_planning/project_planning.py b/addons/project_planning/project_planning.py
index 23fb780f334..260113016cb 100644
--- a/addons/project_planning/project_planning.py
+++ b/addons/project_planning/project_planning.py
@@ -20,16 +20,17 @@
#
##############################################################################
+import time
+import mx.DateTime
+
from osv import fields, osv
from tools.translate import _
-import time
-import mx.DateTime
class one2many_mod3(fields.one2many):
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
if not context:
- context = {}
+ context = context
res = {}
for obj in obj.browse(cr, user, ids, context=context):
res[obj.id] = []
@@ -48,7 +49,7 @@ class report_account_analytic_planning(osv.osv):
_name = "report_account_analytic.planning"
_description = "Planning"
- def _get_total_planned(self, cr, uid, ids, name, args, context):
+ def _get_total_planned(self, cr, uid, ids, name, args, context=None):
result = {}
for plan in self.browse(cr, uid, ids, context):
plan_hrs=0.0
@@ -59,7 +60,7 @@ class report_account_analytic_planning(osv.osv):
result[plan.id] = plan_hrs
return result
- def _get_total_free(self, cr, uid, ids, name, args, context):
+ def _get_total_free(self, cr, uid, ids, name, args, context=None):
result = {}
for plan in self.browse(cr, uid, ids, context):
total_free = 0.0
@@ -69,7 +70,9 @@ class report_account_analytic_planning(osv.osv):
result[plan.id] = total_free
return result
- def _check_planning_responsible(self, cr, uid, ids, context={}):
+ def _check_planning_responsible(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
for obj_plan in self.browse(cr, uid, ids, context=context):
cr.execute("""
SELECT id FROM report_account_analytic_planning plan
@@ -92,23 +95,23 @@ class report_account_analytic_planning(osv.osv):
'name': fields.char('Planning Name', required=True, size=32, states={'done':[('readonly', True)]}),
'code': fields.char('Code', size=32, states={'done':[('readonly', True)]}),
'user_id': fields.many2one('res.users', 'Responsible', required=True, states={'done':[('readonly', True)]}),
- 'date_from':fields.date('Start Date', required=True, states={'done':[('readonly', True)]}),
+ 'date_from': fields.date('Start Date', required=True, states={'done':[('readonly', True)]}),
'date_to':fields.date('End Date', required=True, states={'done':[('readonly', True)]}),
'line_ids': fields.one2many('report_account_analytic.planning.line', 'planning_id', 'Planning lines', states={'done':[('readonly', True)]}),
'stat_ids': fields.one2many('report_account_analytic.planning.stat', 'planning_id', 'Planning analysis', readonly=True),
- 'state': fields.selection([('draft','Draft'),('open', 'Open'), ('done', 'Done'),('cancel','Cancelled')], 'Status', required=True),
- 'business_days' : fields.integer('Business Days', required=True, states={'done':[('readonly', True)]}, help='Set here the number of working days within this planning for one person full time'),
+ 'state': fields.selection([('draft', 'Draft'), ('open', 'Open'), ('done', 'Done'), ('cancel', 'Cancelled')], 'Status', required=True),
+ 'business_days': fields.integer('Business Days', required=True, states={'done':[('readonly', True)]}, help='Set here the number of working days within this planning for one person full time'),
'planning_user_ids': one2many_mod3('report_account_analytic.planning.user', 'planning_id', 'Planning By User'),
'planning_account': fields.one2many('report_account_analytic.planning.account', 'planning_id', 'Planning By Account'),
- 'total_planned' : fields.function(_get_total_planned, method=True, string='Total Planned'),
- 'total_free' : fields.function(_get_total_free, method=True, string='Total Free'),
+ 'total_planned': fields.function(_get_total_planned, method=True, string='Total Planned'),
+ 'total_free': fields.function(_get_total_free, method=True, string='Total Free'),
}
_defaults = {
- 'date_from': lambda *a: time.strftime('%Y-%m-01'),
- 'date_to': lambda *a: (mx.DateTime.now()+mx.DateTime.RelativeDateTime(months=1, day=1, days=-1)).strftime('%Y-%m-%d'),
+ 'date_from': time.strftime('%Y-%m-01'),
+ 'date_to': (mx.DateTime.now()+mx.DateTime.RelativeDateTime(months=1, day=1, days=-1)).strftime('%Y-%m-%d'),
'user_id': lambda self, cr, uid, c: uid,
- 'state': lambda *args: 'draft',
- 'business_days' : lambda *a: 20,
+ 'state': 'draft',
+ 'business_days': 20,
}
_order = 'date_from desc'
@@ -116,19 +119,27 @@ class report_account_analytic_planning(osv.osv):
(_check_planning_responsible, 'Invalid planning ! Planning dates can\'t overlap for the same responsible. ', ['user_id'])
]
- def action_open(self, cr, uid, id, context={}):
+ def action_open(self, cr, uid, id, context=None):
+ if context is None:
+ context = {}
self.write(cr, uid, id, {'state' : 'open'}, context=context)
return True
- def action_cancel(self, cr, uid, id, context={}):
+ def action_cancel(self, cr, uid, id, context=None):
+ if context is None:
+ context = {}
self.write(cr, uid, id, {'state' : 'cancel'}, context=context)
return True
- def action_draft(self, cr, uid, id, context={}):
+ def action_draft(self, cr, uid, id, context=None):
+ if context is None:
+ context = {}
self.write(cr, uid, id, {'state' : 'draft'}, context=context)
return True
- def action_done(self, cr, uid, id, context={}):
+ def action_done(self, cr, uid, id, context=None):
+ if context is None:
+ context = {}
self.write(cr, uid, id, {'state' : 'done'}, context=context)
return True
@@ -139,10 +150,12 @@ class report_account_analytic_planning_line(osv.osv):
_description = "Planning Line"
_rec_name = 'user_id'
- def name_get(self, cr, uid, ids, context={}):
+ def name_get(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
if not len(ids):
return []
- reads = self.read(cr, uid, ids, ['user_id','planning_id','note'], context)
+ reads = self.read(cr, uid, ids, ['user_id', 'planning_id', 'note'], context)
res = []
for record in reads:
name = '['+record['planning_id'][1]
@@ -155,7 +168,9 @@ class report_account_analytic_planning_line(osv.osv):
res.append((record['id'], name))
return res
- def _amount_base_uom(self, cr, uid, ids, name, args, context):
+ def _amount_base_uom(self, cr, uid, ids, name, args, context=None):
+ if context is None:
+ context = {}
users_obj = self.pool.get('res.users')
result = {}
tm = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
@@ -168,7 +183,7 @@ class report_account_analytic_planning_line(osv.osv):
return result
_columns = {
- 'account_id':fields.many2one('account.analytic.account', 'Analytic account', required=True),
+ 'account_id': fields.many2one('account.analytic.account', 'Analytic account', required=True),
'planning_id': fields.many2one('report_account_analytic.planning', 'Planning', required=True, ondelete='cascade'),
'user_id': fields.many2one('res.users', 'User'),
'amount': fields.float('Quantity', required=True),
@@ -177,7 +192,7 @@ class report_account_analytic_planning_line(osv.osv):
'amount_in_base_uom': fields.function(_amount_base_uom, method=True, string='Quantity in base uom', store=True),
'task_ids': fields.one2many('project.task', 'planning_line_id', 'Planning Tasks'),
}
- _order = 'user_id,account_id'
+ _order = 'user_id, account_id'
report_account_analytic_planning_line()
@@ -199,7 +214,7 @@ class project_task(osv.osv):
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
if not context:
- context = {}
+ context = context
if not context.get('planning'):
return super(project_task,self).search(cr, user, args, offset, limit, order, context)
cr.execute(" SELECT t.id, t.name \
@@ -211,15 +226,15 @@ class project_task(osv.osv):
project_task()
-
class report_account_analytic_planning_user(osv.osv):
_name = "report_account_analytic.planning.user"
_description = "Planning by User"
_rec_name = 'user_id'
_auto = False
-
- def _get_tasks(self, cr, uid, ids, name, args, context):
+ def _get_tasks(self, cr, uid, ids, name, args, context=None):
+ if context is None:
+ context = {}
users_obj = self.pool.get('res.users')
result = {}
tm = users_obj.browse(cr, uid, uid, context=context).company_id.project_time_mode_id
@@ -243,7 +258,9 @@ class report_account_analytic_planning_user(osv.osv):
result[line.id] = 0
return result
- def _get_free(self, cr, uid, ids, name, args, context):
+ def _get_free(self, cr, uid, ids, name, args, context=None):
+ if context is None:
+ context = {}
result = {}
for line in self.browse(cr, uid, ids, context):
if line.user_id:
@@ -252,7 +269,9 @@ class report_account_analytic_planning_user(osv.osv):
result[line.id] = 0.0
return result
- def _get_timesheets(self, cr, uid, ids, name, args, context):
+ def _get_timesheets(self, cr, uid, ids, name, args, context=None):
+ if context is None:
+ context = {}
users_obj = self.pool.get('res.users')
result = {}
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
@@ -275,9 +294,9 @@ class report_account_analytic_planning_user(osv.osv):
_columns = {
'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'),
'user_id': fields.many2one('res.users', 'User', readonly=True),
- 'tasks' : fields.function(_get_tasks, method=True, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'),
+ 'tasks': fields.function(_get_tasks, method=True, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'),
'plan_tasks': fields.float('Time Planned on Tasks', readonly=True, help='This value is given by the sum of time allocation with task(s) linked, expressed in days.'),
- 'free' : fields.function(_get_free, method=True, string='Unallocated Time', readonly=True,help='Computed as \
+ 'free': fields.function(_get_free, method=True, string='Unallocated Time', readonly=True, help='Computed as \
Business Days - (Time Allocation of Tasks + Time Allocation without Tasks + Holiday Leaves)'),
'plan_open': fields.float('Time Allocation without Tasks', readonly=True,help='This value is given by the sum of time allocation without task(s) linked, expressed in days.'),
'holiday': fields.float('Leaves',help='This value is given by the total of validated leaves into the \'Date From\' and \'Date To\' of the planning.'),
@@ -361,7 +380,9 @@ class report_account_analytic_planning_account(osv.osv):
_rec_name = 'account_id'
_auto = False
- def _get_tasks(self, cr, uid, ids, name, args, context):
+ def _get_tasks(self, cr, uid, ids, name, args, context=None):
+ if context is None:
+ context = {}
users_obj = self.pool.get('res.users')
result = {}
tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
@@ -386,7 +407,9 @@ class report_account_analytic_planning_account(osv.osv):
result[line.id] = cr.fetchall()[0][0] / div * div2
return result
- def _get_timesheets(self, cr, uid, ids, name, args, context):
+ def _get_timesheets(self, cr, uid, ids, name, args, context=None):
+ if context is None:
+ context = {}
users_obj = self.pool.get('res.users')
result = {}
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
@@ -409,10 +432,10 @@ class report_account_analytic_planning_account(osv.osv):
_columns = {
'planning_id': fields.many2one('report_account_analytic.planning', 'Planning'),
'account_id': fields.many2one('account.analytic.account', 'Analytic account', readonly=True),
- 'tasks' : fields.function(_get_tasks, method=True, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'),
- 'plan_tasks': fields.float('Time Allocation of Tasks', readonly=True,help='This value is given by the sum of time allocation with the checkbox \'Assigned in Taks\' set to TRUE expressed in days.'),
- 'plan_open': fields.float('Time Allocation without Tasks', readonly=True,help='This value is given by the sum of time allocation with the checkbox \'Assigned in Taks\' set to FALSE, expressed in days.'),
- 'timesheet': fields.function(_get_timesheets, method=True, string='Timesheet',help='This value is given by the sum of all work encoded in the timesheet(s) between the \'Date From\' and \'Date To\' of the planning.'),
+ 'tasks': fields.function(_get_tasks, method=True, string='Remaining Tasks', help='This value is given by the sum of work remaining to do on the task for this planning, expressed in days.'),
+ 'plan_tasks': fields.float('Time Allocation of Tasks', readonly=True, help='This value is given by the sum of time allocation with the checkbox \'Assigned in Taks\' set to TRUE expressed in days.'),
+ 'plan_open': fields.float('Time Allocation without Tasks', readonly=True, help='This value is given by the sum of time allocation with the checkbox \'Assigned in Taks\' set to FALSE, expressed in days.'),
+ 'timesheet': fields.function(_get_timesheets, method=True, string='Timesheet', help='This value is given by the sum of all work encoded in the timesheet(s) between the \'Date From\' and \'Date To\' of the planning.'),
}
def init(self, cr):
@@ -448,7 +471,6 @@ class report_account_analytic_planning_account(osv.osv):
)
""")
-
report_account_analytic_planning_account()
class report_account_analytic_planning_stat(osv.osv):
@@ -459,7 +481,9 @@ class report_account_analytic_planning_stat(osv.osv):
_log_access = False
_order = 'planning_id,user_id'
- def _sum_amount_real(self, cr, uid, ids, name, args, context):
+ def _sum_amount_real(self, cr, uid, ids, name, args, context=None):
+ if context is None:
+ context = {}
users_obj = self.pool.get('res.users')
result = {}
tm2 = users_obj.browse(cr, uid, uid, context).company_id.planning_time_mode_id
@@ -469,15 +493,17 @@ class report_account_analytic_planning_stat(osv.osv):
div2 = 1.0
for line in self.browse(cr, uid, ids, context):
if line.user_id:
- cr.execute('''select sum(acc.unit_amount/uom.factor) from account_analytic_line acc
+ cr.execute('''SELECT sum(acc.unit_amount/uom.factor) FROM account_analytic_line acc
LEFT JOIN product_uom uom ON (uom.id = acc.product_uom_id)
-where user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.id, line.account_id.id, line.planning_id.date_from, line.planning_id.date_to))
+WHERE user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.id, line.account_id.id, line.planning_id.date_from, line.planning_id.date_to))
else:
- cr.execute('select sum(unit_amount) from account_analytic_line where account_id=%s and date>=%s and date<=%s', (line.account_id.id, line.planning_id.date_from, line.planning_id.date_to))
+ cr.execute('SELECT sum(unit_amount) FROM account_analytic_line WHERE account_id=%s AND date>=%s AND date<=%s', (line.account_id.id, line.planning_id.date_from, line.planning_id.date_to))
result[line.id] = cr.fetchone()[0] * div2
return result
- def _sum_amount_tasks(self, cr, uid, ids, name, args, context):
+ def _sum_amount_tasks(self, cr, uid, ids, name, args, context=None):
+ if context is None:
+ context = {}
users_obj = self.pool.get('res.users')
result = {}
tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
@@ -496,12 +522,12 @@ where user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.i
where = 'user_id=' + str(line.user_id.id) + ' and '
cr.execute('''select
sum(planned_hours)
- from
+ FROM
project_task
- where
+ WHERE
''' + where + '''
- project_id in (select id from project_project where category_id=%s) and
- date_close>=%s and
+ project_id IN (select id from project_project where category_id=%s) AND
+ date_close>=%s AND
date_close<=%s''', (
line.account_id.id,
line.planning_id.date_from,
@@ -523,23 +549,24 @@ where user_id=%s and account_id=%s and date>=%s and date<=%s''', (line.user_id.i
def init(self, cr):
cr.execute("""
create or replace view report_account_analytic_planning_stat as (
- select
+ SELECT
min(l.id) as id,
l.user_id as user_id,
a.user_id as manager_id,
l.account_id as account_id,
sum(l.amount/u.factor) as sum_amount,
l.planning_id
- from
+ FROM
report_account_analytic_planning_line l
- left join
+ LEFT JOIN
report_account_analytic_planning a on (a.id = l.planning_id)
- left join
+ LEFT JOIN
product_uom u on (l.amount_unit = u.id)
- group by
+ GROUP BY
l.planning_id, l.user_id, l.account_id, a.user_id
)
""")
+
report_account_analytic_planning_stat()
class res_company(osv.osv):
@@ -547,9 +574,8 @@ class res_company(osv.osv):
_columns = {
'planning_time_mode_id': fields.many2one('product.uom', 'Planning Time Unit',
help='This will set the unit of measure used in plannings.',
-
),
}
res_company()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/project_planning/report/__init__.py b/addons/project_planning/report/__init__.py
index e68279cad8d..9a6ca02408e 100644
--- a/addons/project_planning/report/__init__.py
+++ b/addons/project_planning/report/__init__.py
@@ -19,6 +19,4 @@
#
##############################################################################
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_retro_planning/__init__.py b/addons/project_retro_planning/__init__.py
index f8b889e85d7..1cad9d6fd91 100644
--- a/addons/project_retro_planning/__init__.py
+++ b/addons/project_retro_planning/__init__.py
@@ -20,4 +20,3 @@
##############################################################################
import project_retro_planning
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_retro_planning/__openerp__.py b/addons/project_retro_planning/__openerp__.py
index e53b6b01233..aa0b106bbad 100644
--- a/addons/project_retro_planning/__openerp__.py
+++ b/addons/project_retro_planning/__openerp__.py
@@ -19,7 +19,6 @@
#
##############################################################################
-
{
'name': 'Project Retro planning',
'version': '0.1',
diff --git a/addons/project_retro_planning/project_retro_planning.py b/addons/project_retro_planning/project_retro_planning.py
index 34272791f96..48244b49d67 100644
--- a/addons/project_retro_planning/project_retro_planning.py
+++ b/addons/project_retro_planning/project_retro_planning.py
@@ -19,12 +19,14 @@
#
##############################################################################
-from datetime import date,timedelta,datetime
+from datetime import date, timedelta, datetime
import time
+
from osv import fields, osv
class project_project(osv.osv):
_inherit = 'project.project'
+
def write(self, cr, uid, ids,vals, *args, **kwargs):
if 'date' in vals and vals['date']:
data_project = self.browse(cr, uid, ids)
@@ -43,4 +45,3 @@ class project_project(osv.osv):
project_project()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_timesheet/__init__.py b/addons/project_timesheet/__init__.py
index 4d23d3c1a90..ceae2d0185a 100644
--- a/addons/project_timesheet/__init__.py
+++ b/addons/project_timesheet/__init__.py
@@ -22,4 +22,3 @@ import project_timesheet
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_timesheet/__openerp__.py b/addons/project_timesheet/__openerp__.py
index d87bb7eb2fc..009d83a03fd 100644
--- a/addons/project_timesheet/__openerp__.py
+++ b/addons/project_timesheet/__openerp__.py
@@ -19,7 +19,6 @@
#
##############################################################################
-
{
'name': 'Project Timesheet',
'version': '1.0',
diff --git a/addons/project_timesheet/process/project_timesheet_process.xml b/addons/project_timesheet/process/project_timesheet_process.xml
index bfabe6ba5ad..adf4d197e40 100644
--- a/addons/project_timesheet/process/project_timesheet_process.xml
+++ b/addons/project_timesheet/process/project_timesheet_process.xml
@@ -39,7 +39,6 @@
-
@@ -71,7 +70,5 @@
-
-
-
\ No newline at end of file
+
diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py
index 44e9048f253..e125ccbe784 100644
--- a/addons/project_timesheet/project_timesheet.py
+++ b/addons/project_timesheet/project_timesheet.py
@@ -93,6 +93,8 @@ class project_work(osv.osv):
return super(project_work,self).create(cr, uid, vals, *args, **kwargs)
def write(self, cr, uid, ids, vals, context=None):
+ if context is None:
+ context = {}
vals_line = {}
obj = self.pool.get('hr.analytic.timesheet')
timesheet_obj = self.pool.get('hr.analytic.timesheet')
@@ -152,7 +154,9 @@ class task(osv.osv):
return super(task,self).unlink(cr, uid, ids, *args, **kwargs)
- def write(self, cr, uid, ids,vals,context={}):
+ def write(self, cr, uid, ids,vals,context=None):
+ if context is None:
+ context = {}
if (vals.has_key('project_id') and vals['project_id']) or (vals.has_key('name') and vals['name']):
vals_line = {}
hr_anlytic_timesheet = self.pool.get('hr.analytic.timesheet')
@@ -178,6 +182,8 @@ class project_project(osv.osv):
_inherit = "project.project"
def name_get(self, cr, user, ids, context=None):
+ if context is None:
+ context = {}
result = []
for project in self.browse(cr, user, ids, context):
name = "[%s] %s" % (project.category_id and project.category_id.code or '?', project.name)
@@ -187,4 +193,3 @@ class project_project(osv.osv):
project_project()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_timesheet/report/__init__.py b/addons/project_timesheet/report/__init__.py
index 232b71a8975..24e75e1cf35 100644
--- a/addons/project_timesheet/report/__init__.py
+++ b/addons/project_timesheet/report/__init__.py
@@ -20,4 +20,3 @@
##############################################################################
import task_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_timesheet/report/task_report.py b/addons/project_timesheet/report/task_report.py
index 1e1a165b169..e98ced268cb 100644
--- a/addons/project_timesheet/report/task_report.py
+++ b/addons/project_timesheet/report/task_report.py
@@ -128,7 +128,6 @@ class report_timesheet_task_user(osv.osv):
}
-
def init(self, cr):
cr.execute(""" create or replace view report_timesheet_task_user as (
select
@@ -156,4 +155,3 @@ class report_timesheet_task_user(osv.osv):
report_timesheet_task_user()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_timesheet/report/task_report_view.xml b/addons/project_timesheet/report/task_report_view.xml
index 5886d5351dd..5b9aa9d5a04 100644
--- a/addons/project_timesheet/report/task_report_view.xml
+++ b/addons/project_timesheet/report/task_report_view.xml
@@ -9,7 +9,6 @@