diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py
index fe3f93b492c..73ffe59f4f6 100644
--- a/addons/account/__openerp__.py
+++ b/addons/account/__openerp__.py
@@ -21,7 +21,6 @@
{
"name" : "Accounting and Financial Management",
"version" : "1.1",
- "depends" : ["product", "analytic", "process","board"],
"author" : "Tiny",
"category": 'Generic Modules/Accounting',
"description": """Financial and accounting module that covers:
@@ -42,6 +41,7 @@ The processes like maintaining of general ledger is done through the defined fin
grouping is maintained through journal) for a particular financial year and for preparation of vouchers there is a
module named account_vouchers
""",
+ "depends" : ["product", "analytic", "process","board"],
'website': 'http://www.openerp.com',
'init_xml': [],
'update_xml': [
diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml
index 53ba5453742..f36baf8a07d 100644
--- a/addons/account/project/project_view.xml
+++ b/addons/account/project/project_view.xml
@@ -207,7 +207,6 @@
-
@@ -342,7 +341,6 @@
account.analytic.line
form
tree,form
- [('journal_id','=',active_id)]
@@ -14,17 +13,6 @@
-
- All Analytic Accounts
- account.analytic.account
- form
- tree,form,graph
-
-
- []
-
-
-
Overpassed Accounts
account.analytic.account
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index 64c71c1a2e2..a82f3b1b5c9 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -24,7 +24,6 @@
-
@@ -38,13 +37,12 @@
-
+
-
@@ -81,20 +79,18 @@
+
account.analytic.account.tree
account.analytic.account
-
tree
-
-
@@ -110,7 +106,6 @@
-
diff --git a/addons/account_analytic_default/__init__.py b/addons/account_analytic_default/__init__.py
index 5206ec18324..1734f02dc57 100644
--- a/addons/account_analytic_default/__init__.py
+++ b/addons/account_analytic_default/__init__.py
@@ -20,4 +20,5 @@
##############################################################################
import account_analytic_default
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_default/__openerp__.py b/addons/account_analytic_default/__openerp__.py
index 9c3982990b3..537721a112e 100644
--- a/addons/account_analytic_default/__openerp__.py
+++ b/addons/account_analytic_default/__openerp__.py
@@ -19,11 +19,10 @@
#
##############################################################################
-
{
- 'name': 'Account Analytic Default',
- 'version': '1.0',
- 'category': 'Generic Modules/Accounting',
+ 'name' : 'Account Analytic Default',
+ 'version' : '1.0',
+ 'category' : 'Generic Modules/Accounting',
'description': """
Allows to automatically select analytic accounts based on criterions:
* Product
@@ -32,14 +31,15 @@ Allows to automatically select analytic accounts based on criterions:
* Company
* Date
""",
- 'author': 'Tiny',
- 'website': 'http://www.openerp.com',
- 'depends': ['account', 'sale'],
- 'init_xml': [],
+ 'author' : 'Tiny',
+ 'website' : 'http://www.openerp.com',
+ 'depends' : ['account', 'sale'],
+ 'init_xml' : [],
'update_xml': ['security/ir.model.access.csv', 'account_analytic_default_view.xml'],
- 'demo_xml': [],
+ 'demo_xml' : [],
'installable': True,
'active': False,
'certificate': '0074229833581',
}
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py
index 1db16ca8787..6df4ed83614 100644
--- a/addons/account_analytic_default/account_analytic_default.py
+++ b/addons/account_analytic_default/account_analytic_default.py
@@ -19,10 +19,10 @@
#
##############################################################################
-from osv import fields,osv
-from osv import orm
import time
+from osv import fields,osv
+
class account_analytic_default(osv.osv):
_name = 'account.analytic.default'
_description = 'Analytic Distribution'
@@ -38,7 +38,7 @@ class account_analytic_default(osv.osv):
'date_start': fields.date('Start Date'),
'date_stop': fields.date('End Date'),
}
- def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context={}):
+ def account_get(self, cr, uid, product_id=None, partner_id=None, user_id=None, date=None, context=None):
domain = []
if product_id:
domain += ['|',('product_id','=',product_id)]
@@ -71,7 +71,7 @@ class account_invoice_line(osv.osv):
_inherit = 'account.invoice.line'
_description = 'Invoice Line'
- def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}):
+ def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition=False, price_unit=False, address_invoice_id=False, currency_id=False, context=None):
res_prod = super(account_invoice_line,self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition, price_unit, address_invoice_id, currency_id=currency_id, context=context)
rec = self.pool.get('account.analytic.default').account_get(cr, uid, product, partner_id, uid, time.strftime('%Y-%m-%d'), context)
if rec:
@@ -101,7 +101,7 @@ class sale_order_line(osv.osv):
_inherit = 'sale.order.line'
# Method overridden to set the analytic account by default on criterion match
- def invoice_line_create(self, cr, uid, ids, context={}):
+ def invoice_line_create(self, cr, uid, ids, context=None):
create_ids = super(sale_order_line,self).invoice_line_create(cr, uid, ids, context)
if not ids:
return create_ids
@@ -117,6 +117,4 @@ class sale_order_line(osv.osv):
sale_order_line()
-
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_default/account_analytic_default_view.xml b/addons/account_analytic_default/account_analytic_default_view.xml
index a15ec5df775..d49fa04dffb 100644
--- a/addons/account_analytic_default/account_analytic_default_view.xml
+++ b/addons/account_analytic_default/account_analytic_default_view.xml
@@ -52,6 +52,7 @@
+
Analytic Defaults
account.analytic.default
@@ -59,10 +60,6 @@
tree,form
-
-
-
-
-
-
diff --git a/addons/account_analytic_plans/account_analytic_plans_view.xml b/addons/account_analytic_plans/account_analytic_plans_view.xml
index e93e3cd18a8..d5085b009da 100644
--- a/addons/account_analytic_plans/account_analytic_plans_view.xml
+++ b/addons/account_analytic_plans/account_analytic_plans_view.xml
@@ -89,7 +89,11 @@
-
+
+
@@ -124,16 +128,11 @@
-
-
-
-
-
-
+
account.analytic.plan.instance.line.form
account.analytic.plan.instance.line
@@ -234,7 +233,7 @@
-
+
account.analytic.default.form.plans
diff --git a/addons/account_analytic_plans/report/__init__.py b/addons/account_analytic_plans/report/__init__.py
index 512ea3239d2..2d401a6f1d8 100644
--- a/addons/account_analytic_plans/report/__init__.py
+++ b/addons/account_analytic_plans/report/__init__.py
@@ -20,5 +20,6 @@
##############################################################################
import crossovered_analytic
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_plans/report/crossovered_analytic.py b/addons/account_analytic_plans/report/crossovered_analytic.py
index 8f5d4b33317..e0414e4c954 100644
--- a/addons/account_analytic_plans/report/crossovered_analytic.py
+++ b/addons/account_analytic_plans/report/crossovered_analytic.py
@@ -19,20 +19,20 @@
#
##############################################################################
-import pooler
import time
+
from report import report_sxw
class crossovered_analytic(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(crossovered_analytic, self).__init__(cr, uid, name, context=context)
+ super(crossovered_analytic, self).__init__(cr, uid, name, context = context)
self.localcontext.update( {
'time': time,
'lines': self._lines,
'ref_lines' : self._ref_lines,
'find_children':self.find_children,
})
- self.base_amount=0.00
+ self.base_amount = 0.00
def find_children(self,ref_ids):
to_return_ids = []
@@ -153,23 +153,23 @@ class crossovered_analytic(report_sxw.rml_parse):
if not form['empty_line']:
res.append(result)
else:
- result={}
- res=[]
- result['id']=acc_id
+ result = {}
+ res = []
+ result['id'] = acc_id
data_account = acc_pool.browse(self.cr,self.uid,acc_id)
- result['acc_name']=data_account.name
+ result['acc_name'] = data_account.name
result['code'] = data_account.code
- result['amt']=result['qty']=result['perc']=0.00
+ result['amt'] = result['qty'] = result['perc'] = 0.00
if not form['empty_line']:
res.append(result)
for item in res:
- obj_acc=acc_pool.name_get(self.cr,self.uid,[item['id']])
- item['acc_name']=obj_acc[0][1]
+ obj_acc = acc_pool.name_get(self.cr,self.uid,[item['id']])
+ item['acc_name'] = obj_acc[0][1]
final.append(item)
return final
-report_sxw.report_sxw('report.account.analytic.account.crossovered.analytic', 'account.analytic.account', 'addons/account_analytic_plans/report/crossovered_analytic.rml',parser=crossovered_analytic, header=False)
+report_sxw.report_sxw('report.account.analytic.account.crossovered.analytic', 'account.analytic.account', 'addons/account_analytic_plans/report/crossovered_analytic.rml',parser = crossovered_analytic, header = False)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_plans/wizard/__init__.py b/addons/account_analytic_plans/wizard/__init__.py
index c91a0251b33..f5c73701ae1 100644
--- a/addons/account_analytic_plans/wizard/__init__.py
+++ b/addons/account_analytic_plans/wizard/__init__.py
@@ -21,5 +21,6 @@
import analytic_plan_create_model
import account_crossovered_analytic
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml b/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml
index 8c860169f56..5b20c2a6448 100644
--- a/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml
+++ b/addons/account_analytic_plans/wizard/account_crossovered_analytic_view.xml
@@ -8,17 +8,19 @@
form
diff --git a/addons/project/__openerp__.py b/addons/project/__openerp__.py
index 03b72e09e38..c3784c457b1 100644
--- a/addons/project/__openerp__.py
+++ b/addons/project/__openerp__.py
@@ -21,12 +21,12 @@
{
- "name" : "Project Management",
+ "name": "Project Management",
"version": "1.1",
- "author" : "Tiny",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Projects & Services",
- "depends" : ["product", "analytic", "process", "mail_gateway","board"],
+ "author": "Tiny",
+ "website": "http://www.openerp.com",
+ "category": "Generic Modules/Projects & Services",
+ "depends": ["product", "analytic", "process", "mail_gateway","board"],
"description": """Project management module that track multi-level projects, tasks,
work done on tasks, eso. It is able to render planning, order tasks, eso.
Dashboard for project members that includes:
@@ -35,7 +35,7 @@ work done on tasks, eso. It is able to render planning, order tasks, eso.
* Members list of project
* Issues
""",
- "init_xml" : [],
+ "init_xml": [],
"update_xml": [
"security/project_security.xml",
"wizard/project_task_delegate_view.xml",
diff --git a/addons/project/board_project_manager_view.xml b/addons/project/board_project_manager_view.xml
index 3c32361e5ec..f62c292e779 100644
--- a/addons/project/board_project_manager_view.xml
+++ b/addons/project/board_project_manager_view.xml
@@ -21,8 +21,6 @@
-
-
board.project.manager.form
board.board
diff --git a/addons/project/company.py b/addons/project/company.py
index f745739bf60..f0e66e468b4 100644
--- a/addons/project/company.py
+++ b/addons/project/company.py
@@ -28,9 +28,9 @@ class res_company(osv.osv):
help='This will set the unit of measure used in projects and tasks.\n' \
"If you use the timesheet linked to projects (project_timesheet module), don't " \
"forget to setup the right unit of measure in your employees.",
-
),
}
+
res_company()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/installer.py b/addons/project/installer.py
index dd18a2937a2..e35e1b72a6c 100644
--- a/addons/project/installer.py
+++ b/addons/project/installer.py
@@ -26,29 +26,29 @@ class project_installer(osv.osv_memory):
_columns = {
# Project Management
- 'project_long_term':fields.boolean('Long Term Planning',
+ 'project_long_term': fields.boolean('Long Term Planning',
help="Enables long-term projects tracking, including "
"multiple-phase projects and resource allocation handling."),
- 'project_wiki':fields.boolean('Specifications in a Wiki',
+ 'project_wiki': fields.boolean('Specifications in a Wiki',
help=""),
- 'hr_timesheet_sheet':fields.boolean('Timesheets',
+ 'hr_timesheet_sheet': fields.boolean('Timesheets',
help="Tracks and helps employees encode and validate timesheets "
"and attendance."),
- 'hr_timesheet_invoice':fields.boolean('Invoice Based on Hours',
+ 'hr_timesheet_invoice': fields.boolean('Invoice Based on Hours',
help="Helps generate invoice based on based on human resources "
"costs and general expenses."),
- 'account_budget':fields.boolean('Budgets',
+ 'account_budget': fields.boolean('Budgets',
help="Helps accountants manage analytic and crossover budgets."),
- 'project_messages':fields.boolean('Project Messages',
+ 'project_messages': fields.boolean('Project Messages',
help="Lets employees send messages to other members of the "
"projects they're working on."),
- 'project_crm':fields.boolean('Issues Tracker',
+ 'project_crm': fields.boolean('Issues Tracker',
help="Automatically synchronizes project tasks and crm cases."),
# Methodologies
- 'scrum':fields.boolean('SCRUM',
+ 'scrum': fields.boolean('SCRUM',
help="Implements and tracks the concepts and task types defined "
"in the SCRUM methodology."),
- 'project_gtd':fields.boolean('Getting Things Done',
+ 'project_gtd': fields.boolean('Getting Things Done',
help="Embeds the Getting Things Done concepts into OpenERP's "
"project management."),
}
@@ -56,3 +56,5 @@ class project_installer(osv.osv_memory):
'project_crm': True,
}
project_installer()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/project/project.py b/addons/project/project.py
index 07349e81c4d..169a2043b20 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -19,7 +19,6 @@
#
##############################################################################
from lxml import etree
-import mx.DateTime
import datetime
import time
@@ -37,7 +36,7 @@ class project_task_type(osv.osv):
_order = 'sequence'
_defaults = {
- 'sequence': lambda *args: 1
+ 'sequence': 1
}
project_task_type()
@@ -61,7 +60,9 @@ class project(osv.osv):
return super(project, self).search(cr, user, args, offset=offset, limit=limit, order=order,
context=context, count=count)
- def _complete_name(self, cr, uid, ids, name, args, context={}):
+ def _complete_name(self, cr, uid, ids, name, args, context=None):
+ if context is None:
+ context = {}
res = {}
for m in self.browse(cr, uid, ids, context=context):
res[m.id] = (m.parent_id and (m.parent_id.name + '/') or '') + m.name
@@ -71,7 +72,9 @@ class project(osv.osv):
return super(project, self).check_recursion(cursor, user, ids,
parent=parent)
- def onchange_partner_id(self, cr, uid, ids, part, context={}):
+ def onchange_partner_id(self, cr, uid, ids, part=False, context=None):
+ if context is None:
+ context = {}
partner_obj = self.pool.get('res.partner')
if not part:
return {'value':{'contact_id': False, 'pricelist_id': False}}
@@ -80,7 +83,9 @@ class project(osv.osv):
pricelist_id = pricelist.get('property_product_pricelist', False) and pricelist.get('property_product_pricelist')[0] or False
return {'value':{'contact_id': addr['contact'], 'pricelist_id': pricelist_id}}
- def _progress_rate(self, cr, uid, ids, names, arg, context={}):
+ def _progress_rate(self, cr, uid, ids, names, arg, context=None):
+ if context is None:
+ context = {}
res = {}.fromkeys(ids, 0.0)
progress = {}
if not ids:
@@ -118,11 +123,12 @@ class project(osv.osv):
if proj.tasks:
raise osv.except_osv(_('Operation Not Permitted !'), _('You can not delete a project with tasks. I suggest you to deactivate it.'))
return super(project, self).unlink(cr, uid, ids, *args, **kwargs)
+
_columns = {
'complete_name': fields.function(_complete_name, method=True, string="Project Name", type='char', size=250),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the project without removing it."),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of Projects."),
- 'category_id': fields.many2one('account.analytic.account','Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc."),
+ 'category_id': fields.many2one('account.analytic.account', 'Analytic Account', help="Link this project to an analytic account if you need financial management on projects. It enables you to connect projects with budgets, planning, cost and revenue analysis, timesheets on projects, etc."),
'priority': fields.integer('Sequence', help="Gives the sequence order when displaying a list of task"),
'warn_manager': fields.boolean('Warn Manager', help="If you check this field, the project manager will receive a request each time a task is completed by his team."),
'members': fields.many2many('res.users', 'project_user_rel', 'project_id', 'uid', 'Project Members', help="Project's member. Not used in any computation, just for information purpose."),
@@ -135,17 +141,17 @@ class project(osv.osv):
'warn_header': fields.text('Mail Header', help="Header added at the beginning of the email for the warning message sent to the customer when a task is closed."),
'warn_footer': fields.text('Mail Footer', help="Footer added at the beginning of the email for the warning message sent to the customer when a task is closed."),
'type_ids': fields.many2many('project.task.type', 'project_task_type_rel', 'project_id', 'type_id', 'Tasks Stages'),
- 'project_escalation_id' : fields.many2one('project.project','Project Escalation', help='If any issue is escalated from the current Project, it will be listed under the project selected here.'),
+ 'project_escalation_id': fields.many2one('project.project','Project Escalation', help='If any issue is escalated from the current Project, it will be listed under the project selected here.'),
}
_order = "sequence"
_defaults = {
- 'active': lambda *a: True,
- 'priority': lambda *a: 1,
- 'sequence': lambda *a: 10,
- 'warn_manager': lambda *a: True,
+ 'active': True,
+ 'priority': 1,
+ 'sequence': 10,
+ 'warn_manager': True,
}
def _check_dates(self, cr, uid, ids):
- leave = self.read(cr, uid, ids[0],['date_start','date'])
+ leave = self.read(cr, uid, ids[0], ['date_start', 'date'])
if leave['date_start'] and leave['date']:
if leave['date_start'] > leave['date']:
return False
@@ -162,31 +168,33 @@ class project(osv.osv):
(_check_dates, 'Error! project start-date must be lower then project end-date.', ['date_start', 'date']),
(_check_escalation, 'Error! You cannot assign escalation to the same project!', ['project_escalation_id'])
]
- def set_template(self, cr, uid, ids, context={}):
+ def set_template(self, cr, uid, ids, context=None):
res = self.setActive(cr, uid, ids, value=False, context=context)
return res
- def set_done(self, cr, uid, ids, context={}):
+ def set_done(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'close'}, context=context)
return True
- def set_cancel(self, cr, uid, ids, context={}):
+ def set_cancel(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'cancelled'}, context=context)
return True
- def set_pending(self, cr, uid, ids, context={}):
+ def set_pending(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'pending'}, context=context)
return True
- def set_open(self, cr, uid, ids, context={}):
+ def set_open(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'open'}, context=context)
return True
- def reset_project(self, cr, uid, ids, context={}):
- res = self.setActive(cr, uid, ids,value=True, context=context)
+ def reset_project(self, cr, uid, ids, context=None):
+ res = self.setActive(cr, uid, ids, value=True, context=context)
return res
- def copy(self, cr, uid, id, default={}, context={}):
+ def copy(self, cr, uid, id, default={}, context=None):
+ if context is None:
+ context = {}
proj = self.browse(cr, uid, id, context=context)
default = default or {}
context['active_test'] = False
@@ -199,13 +207,15 @@ class project(osv.osv):
cr.execute('update project_task set active=True where project_id IN %s',(tuple(ids),))
return res
- def duplicate_template(self, cr, uid, ids, context={}):
+ def duplicate_template(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
project_obj = self.pool.get('project.project')
data_obj = self.pool.get('ir.model.data')
task_obj = self.pool.get('project.task')
result = []
for proj in self.browse(cr, uid, ids, context=context):
- parent_id = context.get('parent_id',False) # check me where to pass context for parent id ??
+ parent_id = context.get('parent_id', False) # check me where to pass context for parent id ??
context.update({'analytic_project_copy': True})
new_id = project_obj.copy(cr, uid, proj.id, default = {
'name': proj.name +_(' (copy)'),
@@ -233,7 +243,7 @@ class project(osv.osv):
'view_mode': 'form,tree',
'res_model': 'project.project',
'view_id': False,
- 'res_id' : res_id,
+ 'res_id': res_id,
'views': [(form_view['res_id'],'form'),(tree_view['res_id'],'tree')],
'type': 'ir.actions.act_window',
'search_view_id': search_view['res_id'],
@@ -242,9 +252,13 @@ class project(osv.osv):
# return result
# set active value for a project, its sub projects and its tasks
- def setActive(self, cr, uid, ids, value=True, context={}):
+ def setActive(self, cr, uid, ids, value=True, context=None):
+ if context is None:
+ context = {}
task_obj = self.pool.get('project.task')
- for proj in self.browse(cr, uid, ids, context):
+ for proj in self.browse(cr, uid, ids, context=None):
+ if context is None:
+ context = {}
self.write(cr, uid, [proj.id], {'state': value and 'open' or 'template'}, context)
cr.execute('select id from project_task where project_id=%s', (proj.id,))
tasks_id = [x[0] for x in cr.fetchall()]
@@ -252,7 +266,9 @@ class project(osv.osv):
task_obj.write(cr, uid, tasks_id, {'active': value}, context=context)
child_ids = self.search(cr, uid, [('parent_id','=', proj.id)])
if child_ids:
- self.setActive(cr, uid, child_ids, value, context)
+ self.setActive(cr, uid, child_ids, value, context=None)
+ if context is None:
+ context = {}
return True
project()
@@ -262,13 +278,17 @@ class task(osv.osv):
_log_create = True
_date_name = "date_start"
- def _str_get(self, task, level=0, border='***', context={}):
+ def _str_get(self, task, level=0, border='***', context=None):
+ if context is None:
+ context = {}
return border+' '+(task.user_id and task.user_id.name.upper() or '')+(level and (': L'+str(level)) or '')+(' - %.1fh / %.1fh'%(task.effective_hours or 0.0,task.planned_hours))+' '+border+'\n'+ \
border[0]+' '+(task.name or '')+'\n'+ \
(task.description or '')+'\n\n'
# Compute: effective_hours, total_hours, progress
def _hours_get(self, cr, uid, ids, field_names, args, context=None):
+ if context is None:
+ context = {}
res = {}
cr.execute("SELECT task_id, COALESCE(SUM(hours),0) FROM project_task_work WHERE task_id IN %s GROUP BY task_id",(tuple(ids),))
hours = dict(cr.fetchall())
@@ -277,17 +297,17 @@ class task(osv.osv):
res[task.id]['progress'] = 0.0
if (task.remaining_hours + hours.get(task.id, 0.0)):
if task.state != 'done':
- res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 99.99),2)
+ res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 99.99), 2)
- if task.state in ('done','cancel'):
+ if task.state in ('done', 'cancel'):
res[task.id]['progress'] = 100.0
res[task.id]['delay_hours'] = res[task.id]['total_hours'] - task.planned_hours
return res
def onchange_planned(self, cr, uid, ids, planned = 0.0, effective = 0.0):
- return {'value':{'remaining_hours' : planned - effective}}
+ return {'value':{'remaining_hours': planned - effective}}
- def _default_project(self, cr, uid, context={}):
+ def _default_project(self, cr, uid, context=None):
if 'project_id' in context and context['project_id']:
return int(context['project_id'])
return False
@@ -296,17 +316,21 @@ class task(osv.osv):
# ('remaining_hours', 'CHECK (remaining_hours>=0)', 'Please increase and review remaining hours ! It can not be smaller than 0.'),
#]
- def copy_data(self, cr, uid, id, default={},context={}):
+ def copy_data(self, cr, uid, id, default={}, context=None):
+ if context is None:
+ context = {}
default = default or {}
default['work_ids'] = []
return super(task, self).copy_data(cr, uid, id, default, context)
- def _check_dates(self, cr, uid, ids, context={}):
- task = self.read(cr, uid, ids[0],['date_start', 'date_end'])
- if task['date_start'] and task['date_end']:
+ def _check_dates(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
+ task = self.read(cr, uid, ids[0], ['date_start', 'date_end'])
+ if task['date_start'] and task['date_end']:
if task['date_start'] > task['date_end']:
return False
- return True
+ return True
_columns = {
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the task without removing it."),
@@ -334,19 +358,19 @@ class task(osv.osv):
'delay_hours': fields.function(_hours_get, method=True, string='Delay Hours', multi='hours', store=True, help="Computed as difference of the time estimated by the project manager and the real time to close the task."),
'user_id': fields.many2one('res.users', 'Assigned to'),
- 'delegated_user_id': fields.related('child_ids','user_id',type='many2one', relation='res.users', string='Delegated To'),
+ 'delegated_user_id': fields.related('child_ids', 'user_id', type='many2one', relation='res.users', string='Delegated To'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'work_ids': fields.one2many('project.task.work', 'task_id', 'Work done'),
- 'manager_id': fields.related('project_id','category_id','user_id', type='many2one', relation='res.users', string='Project Manager'),
+ 'manager_id': fields.related('project_id', 'category_id', 'user_id', type='many2one', relation='res.users', string='Project Manager'),
'company_id': fields.many2one('res.company', 'Company'),
}
_defaults = {
- 'state': lambda *a: 'draft',
- 'priority': lambda *a: '2',
- 'progress': lambda *a: 0,
- 'sequence': lambda *a: 10,
- 'active': lambda *a: True,
- 'date_start': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'state': 'draft',
+ 'priority': '2',
+ 'progress': 0,
+ 'sequence': 10,
+ 'active': True,
+ 'date_start': time.strftime('%Y-%m-%d %H:%M:%S'),
'project_id': _default_project,
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'project.task', context=c)
}
@@ -360,6 +384,8 @@ class task(osv.osv):
#
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
users_obj = self.pool.get('res.users')
+ if context is None:
+ context = {}
obj_tm = users_obj.browse(cr, uid, uid, context).company_id.project_time_mode_id
tm = obj_tm and obj_tm.name or 'Hours'
@@ -519,11 +545,11 @@ class project_work(osv.osv):
'task_id': fields.many2one('project.task', 'Task', ondelete='cascade', required=True),
'hours': fields.float('Time Spent'),
'user_id': fields.many2one('res.users', 'Done by', required=True),
- 'company_id': fields.related('task_id','company_id',type='many2one',relation='res.company',string='Company',store=True)
+ 'company_id': fields.related('task_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True)
}
_defaults = {
'user_id': lambda obj, cr, uid, context: uid,
- 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S')
+ 'date': time.strftime('%Y-%m-%d %H:%M:%S')
}
_order = "date desc"
def create(self, cr, uid, vals, *args, **kwargs):
@@ -533,7 +559,9 @@ class project_work(osv.osv):
cr.execute('update project_task set remaining_hours=remaining_hours - %s where id=%s', (vals.get('hours',0.0), vals['task_id']))
return super(project_work,self).create(cr, uid, vals, *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 'hours' in vals and (not vals['hours']):
vals['hours'] = 0.00
if 'hours' in vals:
@@ -544,7 +572,7 @@ class project_work(osv.osv):
def unlink(self, cr, uid, ids, *args, **kwargs):
for work in self.browse(cr, uid, ids):
cr.execute('update project_task set remaining_hours=remaining_hours + %s where id=%s', (work.hours, work.task_id.id))
- return super(project_work,self).unlink(cr, uid, ids,*args, **kwargs)
+ return super(project_work,self).unlink(cr, uid, ids, *args, **kwargs)
project_work()
class config_compute_remaining(osv.osv_memory):
@@ -552,7 +580,7 @@ class config_compute_remaining(osv.osv_memory):
def _get_remaining(self,cr, uid, ctx):
task_obj = self.pool.get('project.task')
if 'active_id' in ctx:
- return task_obj.browse(cr,uid,ctx['active_id'],context=ctx).remaining_hours
+ return task_obj.browse(cr, uid, ctx['active_id'], context=ctx).remaining_hours
return False
_columns = {
@@ -603,15 +631,17 @@ class message(osv.osv):
'description': fields.text('Description'),
}
- def _default_project(self, cr, uid, context={}):
+ def _default_project(self, cr, uid, context=None):
+ if context is None:
+ context = {}
if 'project_id' in context and context['project_id']:
return int(context['project_id'])
return False
_defaults = {
- 'user_id' : lambda self,cr,uid,ctx : uid,
- 'date' : lambda self,cr,uid,ctx : time.strftime('%Y-%m-%d'),
- 'project_id':_default_project
+ 'user_id': lambda self,cr,uid,ctx: uid,
+ 'date': lambda self,cr,uid,ctx: time.strftime('%Y-%m-%d'),
+ 'project_id': _default_project
}
message()
@@ -637,4 +667,5 @@ class account_analytic_account(osv.osv):
return super(account_analytic_account, self).create(cr, uid, vals, context=context)
account_analytic_account()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/project_data.xml b/addons/project/project_data.xml
index 2addd68fa19..a931c96f635 100644
--- a/addons/project/project_data.xml
+++ b/addons/project/project_data.xml
@@ -8,9 +8,11 @@
Project
project.project
+
Project task
project.task
+
diff --git a/addons/project/project_installer.xml b/addons/project/project_installer.xml
index f7c46066178..12510f8b944 100644
--- a/addons/project/project_installer.xml
+++ b/addons/project/project_installer.xml
@@ -10,10 +10,8 @@
-
- Project Management
+ Project Management
@@ -55,6 +53,7 @@
3
+
ir.actions.todo
project_installer_action_replace
diff --git a/addons/project/project_mailgate.py b/addons/project/project_mailgate.py
index 5409aa4e752..b057c98b03d 100644
--- a/addons/project/project_mailgate.py
+++ b/addons/project/project_mailgate.py
@@ -77,7 +77,9 @@ class project_tasks(osv.osv):
getattr(self,act)(cr, uid, [id])
return True
- def message_followers(self, cr, uid, ids, context={}):
+ def message_followers(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
res = []
if isinstance(ids, (str, int, long)):
select = [ids]
diff --git a/addons/project/project_resource.py b/addons/project/project_resource.py
index 478fd4316bc..8ff68c94ea8 100644
--- a/addons/project/project_resource.py
+++ b/addons/project/project_resource.py
@@ -1,9 +1,10 @@
import pooler
import datetime
-def timeformat_convert(cr, uid, time_string, context={}):
+def timeformat_convert(cr, uid, time_string, context=None):
# Function to convert input time string:: 8.5 to output time string 8:30
-
+ if context is None:
+ context = {}
split_list = str(time_string).split('.')
hour_part = split_list[0]
mins_part = split_list[1]
@@ -78,4 +79,4 @@ def compute_working_calendar(cr,uid,calendar_id):
if non_working:
wktime_cal.append((non_working[:-1],time_range))
- return wktime_cal
\ No newline at end of file
+ return wktime_cal
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml
index ef7bb92d1d6..ad28bda6d6a 100644
--- a/addons/project/project_view.xml
+++ b/addons/project/project_view.xml
@@ -42,7 +42,6 @@
-
@@ -517,6 +516,7 @@
form
+
@@ -545,7 +545,6 @@
-
res.users.project.form1
diff --git a/addons/project/report/project_report.py b/addons/project/report/project_report.py
index ff8d2b2dfc1..fec1052b28b 100644
--- a/addons/project/report/project_report.py
+++ b/addons/project/report/project_report.py
@@ -29,14 +29,14 @@ class report_project_task_user(osv.osv):
_columns = {
'name': fields.char('Task Summary', size=128, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
- 'year': fields.char('Year',size=64,required=False, readonly=True),
- 'user_id':fields.many2one('res.users', 'Assigned To', readonly=True),
+ 'year': fields.char('Year', size=64, required=False, readonly=True),
+ 'user_id': fields.many2one('res.users', 'Assigned To', readonly=True),
'date_start': fields.date('Starting Date',readonly=True),
'no_of_days': fields.integer('# of Days', size=128, readonly=True),
- 'description': fields.text('Description',readonly=True),
- 'date_end': fields.date('Ending Date',readonly=True),
- 'date_deadline': fields.date('Deadline',readonly=True),
- 'project_id':fields.many2one('project.project', 'Project', readonly=True),
+ 'description': fields.text('Description', readonly=True),
+ 'date_end': fields.date('Ending Date', readonly=True),
+ 'date_deadline': fields.date('Deadline', readonly=True),
+ 'project_id': fields.many2one('project.project', 'Project', readonly=True),
'hours_planned': fields.float('Planned Hours', readonly=True),
'hours_effective': fields.float('Effective Hours', readonly=True),
'hours_delay': fields.float('Avg. Plan.-Eff.', readonly=True),
@@ -49,32 +49,21 @@ class report_project_task_user(osv.osv):
help="Number of Days to Open the task"),
'delay_endings_days': fields.float('Overpassed Deadline', digits=(16,2), readonly=True),
'nbr': fields.integer('# of tasks', readonly=True),
- 'priority' : fields.selection([('4','Very Low'),
- ('3','Low'),
- ('2','Medium'),
- ('1','Urgent'),
- ('0','Very urgent')],
- 'Importance',readonly=True),
- 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
- ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
- 'state': fields.selection([
- ('draft', 'Draft'),
- ('open', 'In Progress'),
- ('pending', 'Pending'),
- ('cancelled', 'Cancelled'),
- ('done', 'Done')],
- 'State', readonly=True),
- 'company_id': fields.many2one('res.company', 'Company',readonly=True, groups="base.group_multi_company"),
- 'partner_id': fields.many2one('res.partner', 'Partner',readonly=True),
- 'type': fields.many2one('project.task.type', 'Stage',readonly=True),
-
+ 'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'),
+('0','Very urgent')], 'Importance', readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')], 'Month', readonly=True),
+ 'state': fields.selection([('draft', 'Draft'), ('open', 'In Progress'), ('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')],'State', readonly=True),
+ 'company_id': fields.many2one('res.company', 'Company', readonly=True, groups="base.group_multi_company"),
+ 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
+ 'type': fields.many2one('project.task.type', 'Stage', readonly=True),
}
_order = 'name desc, project_id'
+
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'report_project_task_user')
cr.execute("""
- create view report_project_task_user as
- select
+ CREATE view report_project_task_user as
+ SELECT
(select 1 ) AS nbr,
t.id as id,
to_char(date_start, 'YYYY') as year,
@@ -102,9 +91,9 @@ class report_project_task_user(osv.osv):
(extract('epoch' from (t.date_end-t.create_date)))/(3600*24) as closing_days,
(extract('epoch' from (t.date_start-t.create_date)))/(3600*24) as opening_days,
(extract('epoch' from (t.date_deadline-t.date_end)))/(3600*24) as delay_endings_days
- from project_task t
+ FROM project_task t
- group by
+ GROUP BY
t.id,
remaining_hours,
t.effective_hours,
@@ -139,37 +128,38 @@ class project_vs_remaining_hours(osv.osv):
_columns = {
'project': fields.char('Project', size=128, required=True),
'remaining_hours': fields.float('Remaining Hours', readonly=True),
- 'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Close'),('template', 'Template')], 'State', required=True,readonly=True)
+ 'state': fields.selection([('draft','Draft'),('open','Open'), ('pending','Pending'),('cancelled', 'Cancelled'),('close','Close'),('template', 'Template')], 'State', required=True, readonly=True)
}
_order = 'project desc'
+
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'project_vs_remaining_hours')
cr.execute("""
- create or replace view project_vs_remaining_hours as (
+ CREATE or REPLACE view project_vs_remaining_hours as (
select
min(pt.id) as id,
aaa.user_id as uid,
aaa.name as project,
aaa.state,
sum(pt.remaining_hours) as remaining_hours
- from project_project as pp,
+ FROM project_project as pp,
account_analytic_account as aaa,
project_task as pt
- where aaa.id=pp.category_id and pt.project_id=pp.id and pp.category_id=aaa.id
- group by aaa.user_id,aaa.state,aaa.name
+ WHERE aaa.id=pp.category_id and pt.project_id=pp.id and pp.category_id=aaa.id
+ GROUP BY aaa.user_id,aaa.state,aaa.name
UNION All
- select
+ SELECT
min(pt.id) as id,
pur.uid as uid,
aaa.name as project,
aaa.state,
sum(pt.remaining_hours) as remaining_hours
- from project_project as pp,
+ FROM project_project as pp,
project_user_rel as pur,
account_analytic_account as aaa,
project_task as pt
- where pur.project_id=pp.id and pt.project_id=pp.id and pp.category_id=aaa.id
- group by pur.uid,aaa.state,aaa.name
+ WHERE pur.project_id=pp.id and pt.project_id=pp.id and pp.category_id=aaa.id
+ GROUP BY pur.uid,aaa.state,aaa.name
)
""")
project_vs_remaining_hours()
@@ -182,22 +172,23 @@ class task_by_days(osv.osv):
'day': fields.char('Day', size=128, required=True),
'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True),
'total_task': fields.float('Total tasks', readonly=True),
- 'project_id':fields.many2one('project.project','Project')
+ 'project_id':fields.many2one('project.project', 'Project')
}
_order = 'day desc'
+
def init(self, cr):
tools.sql.drop_view_if_exists(cr, 'task_by_days')
cr.execute("""
- create or replace view task_by_days as (
- select
+ CREATE or REPLACE view task_by_days as (
+ SELECT
min(pt.id) as id,
to_char(pt.create_date, 'YYYY-MM-DD') as day,
count(*) as total_task,
pt.state as state,
pt.project_id
- from
+ FROM
project_task as pt
- group by
+ GROUP BY
to_char(pt.create_date, 'YYYY-MM-DD'),pt.state,pt.project_id
)
""")
diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml
index 48119f307e0..9df6bd1f8ab 100644
--- a/addons/project/report/project_report_view.xml
+++ b/addons/project/report/project_report_view.xml
@@ -86,13 +86,13 @@
icon="terp-dialog-close"
name="done"
domain="[('state','=','done')]"/>
-
+
-
+ help="My Projects" domain="[('project_id','=',uid)]"/>
+
-
+
@@ -144,6 +144,7 @@
{'search_default_month':1,'search_default_project':1,'group_by_no_leaf':1,'group_by':[]}
+
@@ -181,6 +182,7 @@
[('uid','=',uid)]
+
task.by.days.tree
diff --git a/addons/project/res_partner.py b/addons/project/res_partner.py
index f0297cf6a72..351f28cb283 100644
--- a/addons/project/res_partner.py
+++ b/addons/project/res_partner.py
@@ -22,11 +22,13 @@
from osv import fields,osv
class res_partner(osv.osv):
+
""" Inherits partner and adds CRM information in the partner form """
_inherit = 'res.partner'
_columns = {
'task_ids': fields.one2many('project.task', 'partner_id', 'Tasks'),
}
+
res_partner()
diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml
index dbb28db165e..6071e644f34 100644
--- a/addons/project/security/project_security.xml
+++ b/addons/project/security/project_security.xml
@@ -5,9 +5,11 @@
Project / Financial Manager
+
Project / Manager
+
Project / User
diff --git a/addons/project/wizard/project_close_task.py b/addons/project/wizard/project_close_task.py
index 00752606bd0..b1cd933a4f7 100644
--- a/addons/project/wizard/project_close_task.py
+++ b/addons/project/wizard/project_close_task.py
@@ -33,9 +33,11 @@ class project_close_task(osv.osv_memory):
_columns = {
'email': fields.char('E-Mail', size=64, help="Email Address"),
'description': fields.text('Description'),
- }
+ }
- def _get_email(self, cr, uid, context={}):
+ def _get_email(self, cr, uid, context=None):
+ if context is None:
+ context = {}
email = ''
if 'task_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['task_id'])
@@ -44,7 +46,9 @@ class project_close_task(osv.osv_memory):
email = partner_id.address[0].email
return email
- def _get_desc(self, cr, uid, context={}):
+ def _get_desc(self, cr, uid, context=None):
+ if context is None:
+ context = {}
if 'task_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['task_id'])
return task.description or task.name
@@ -55,7 +59,9 @@ class project_close_task(osv.osv_memory):
'description': _get_desc,
}
- def confirm(self, cr, uid, ids, context={}):
+ def confirm(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
if not 'task_id' in context:
return {}
close_task = self.read(cr, uid, ids[0], [])
@@ -88,4 +94,4 @@ class project_close_task(osv.osv_memory):
return {}
project_close_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/wizard/project_close_task_view.xml b/addons/project/wizard/project_close_task_view.xml
index b9bace0aaef..f9206152b25 100644
--- a/addons/project/wizard/project_close_task_view.xml
+++ b/addons/project/wizard/project_close_task_view.xml
@@ -11,10 +11,10 @@
-
-
-
-
+
+
+
+
@@ -36,4 +36,4 @@
-
\ No newline at end of file
+
diff --git a/addons/project/wizard/project_task_delegate.py b/addons/project/wizard/project_task_delegate.py
index adfddcd8fd9..30fc02f9ca3 100644
--- a/addons/project/wizard/project_task_delegate.py
+++ b/addons/project/wizard/project_task_delegate.py
@@ -33,12 +33,11 @@ class project_task_delegate(osv.osv_memory):
'new_task_description': fields.text('New Task Description', help="Reinclude the description of the task in the task of the user"),
'planned_hours': fields.float('Planned Hours', help="Estimated time to close this task by the delegated user"),
'planned_hours_me': fields.float('Hours to Validate', required=True, help="Estimated time for you to validate the work done by the user to whom you delegate this task"),
- 'state': fields.selection([('pending','Pending'),
- ('done','Done'),
- ],'Validation State', required=True, help="New state of your own task. Pending will be reopened automatically when the delegated task is closed"),
- }
+ 'state': fields.selection([('pending','Pending'), ('done','Done'), ], 'Validation State', required=True, help="New state of your own task. Pending will be reopened automatically when the delegated task is closed"), }
- def _get_name(self, cr, uid, context={}):
+ def _get_name(self, cr, uid, context=None):
+ if context is None:
+ context = {}
if 'active_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
if task.name.startswith(_('CHECK: ')):
@@ -48,13 +47,17 @@ class project_task_delegate(osv.osv_memory):
return newname
return ''
- def _get_plan_hour(self, cr, uid, context={}):
+ def _get_plan_hour(self, cr, uid, context=None):
+ if context is None:
+ context = {}
if 'active_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
return task.remaining_hours
return 0.0
- def _get_prefix(self, cr, uid, context={}):
+ def _get_prefix(self, cr, uid, context=None):
+ if context is None:
+ context = {}
if 'active_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
if task.name.startswith(_('CHECK: ')):
@@ -64,7 +67,9 @@ class project_task_delegate(osv.osv_memory):
return _('CHECK: ')+ newname
return ''
- def _get_new_desc(self, cr, uid, context={}):
+ def _get_new_desc(self, cr, uid, context=None):
+ if context is None:
+ context = {}
if 'active_id' in context:
task = self.pool.get('project.task').browse(cr, uid, context['active_id'])
return task.description
@@ -79,7 +84,9 @@ class project_task_delegate(osv.osv_memory):
'state': 'pending',
}
- def validate(self, cr, uid, ids, context={}):
+ def validate(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
task_obj = self.pool.get('project.task')
delegate_data = self.read(cr, uid, ids, context=context)[0]
task = task_obj.browse(cr, uid, context['active_id'], context=context)
diff --git a/addons/project/wizard/project_task_delegate_view.xml b/addons/project/wizard/project_task_delegate_view.xml
index 65478e74f0b..762810eba64 100644
--- a/addons/project/wizard/project_task_delegate_view.xml
+++ b/addons/project/wizard/project_task_delegate_view.xml
@@ -25,7 +25,7 @@
-
+
@@ -44,4 +44,4 @@
-
\ No newline at end of file
+
diff --git a/addons/project_caldav/__openerp__.py b/addons/project_caldav/__openerp__.py
index b3e0be57cad..c8f379b18e5 100644
--- a/addons/project_caldav/__openerp__.py
+++ b/addons/project_caldav/__openerp__.py
@@ -20,15 +20,15 @@
##############################################################################
{
- "name" : "Caldav task management",
- "version" : "1.0",
- "author" : "Tiny",
- "category" : "Generic Modules/Others",
+ "name": "Caldav task management",
+ "version": "1.0",
+ "author": "Tiny",
+ "category": "Generic Modules/Others",
"description": """ Synchronize between Project task and Caldav Vtodo.""",
- "depends" : ["project", "caldav", "base_calendar"],
- "init_xml" : ["project_caldav_data.xml"],
- "demo_xml" : [],
- "update_xml" : ["project_caldav_view.xml"],
+ "depends": ["project", "caldav", "base_calendar"],
+ "init_xml": ["project_caldav_data.xml"],
+ "demo_xml": [],
+ "update_xml": ["project_caldav_view.xml"],
"active": False,
"website": "http://www.openerp.com",
"installable": True,
diff --git a/addons/project_caldav/project_caldav.py b/addons/project_caldav/project_caldav.py
index 62e18784887..b6a87516194 100644
--- a/addons/project_caldav/project_caldav.py
+++ b/addons/project_caldav/project_caldav.py
@@ -26,8 +26,8 @@ class project_task(osv.osv):
_name = "project.task"
_inherit = ["calendar.todo", "project.task"]
_columns = {
- 'write_date' : fields.datetime('Write Date'),
- 'create_date' : fields.datetime('Create Date'),
+ 'write_date': fields.datetime('Write Date'),
+ 'create_date': fields.datetime('Create Date'),
'attendee_ids': fields.many2many('calendar.attendee', \
'task_attendee_rel', 'task_id', 'attendee_id', 'Attendees'),
}
@@ -37,7 +37,9 @@ class project_task(osv.osv):
vals = todo_obj.import_cal(cr, uid, data, context=context)
return self.check_import(cr, uid, vals, context=context)
- def check_import(self, cr, uid, vals, context={}):
+ def check_import(self, cr, uid, vals, context=None):
+ if context is None:
+ context = {}
ids = []
for val in vals:
obj_tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.project_time_mode_id
@@ -65,7 +67,9 @@ class project_task(osv.osv):
ids.append(task_id)
return ids
- def export_cal(self, cr, uid, ids, context={}):
+ def export_cal(self, cr, uid, ids, context=None):
+ if context is None:
+ context = {}
task_datas = self.read(cr, uid, ids, [], context ={'read': True})
tasks = []
for task in task_datas:
@@ -75,8 +79,7 @@ class project_task(osv.osv):
todo_obj = self.pool.get('basic.calendar.todo')
ical = todo_obj.export_cal(cr, uid, tasks, context={'model': self._name})
calendar_val = ical.serialize()
- calendar_val = calendar_val.replace('"', '').strip()
- return calendar_val
+ return calendar_val.replace('"', '').strip()
project_task()
diff --git a/addons/project_caldav/project_caldav_data.xml b/addons/project_caldav/project_caldav_data.xml
index af0088cf72f..a6b7ef870f4 100644
--- a/addons/project_caldav/project_caldav_data.xml
+++ b/addons/project_caldav/project_caldav_data.xml
@@ -74,11 +74,11 @@
-
-
-
- field
-
+
+
+
+ field
+
diff --git a/addons/project_caldav/project_caldav_view.xml b/addons/project_caldav/project_caldav_view.xml
index 89ebe9e85da..3055fee85bc 100644
--- a/addons/project_caldav/project_caldav_view.xml
+++ b/addons/project_caldav/project_caldav_view.xml
@@ -14,10 +14,9 @@
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
icon="terp-partner" type="action"
context="{'model' : 'project.task'}" colspan="2"/>
-
-
+
@@ -29,15 +28,12 @@
-
+
-
-
+
+
@@ -68,8 +64,7 @@
-
+
-
+
diff --git a/addons/project_gtd/project_gtd.py b/addons/project_gtd/project_gtd.py
index d680e533505..c2222fdb5d6 100644
--- a/addons/project_gtd/project_gtd.py
+++ b/addons/project_gtd/project_gtd.py
@@ -46,7 +46,7 @@ class project_gtd_context(osv.osv):
'project_default_id': fields.many2one('project.project', 'Default Project', required=True),
}
_defaults = {
- 'sequence': lambda *args: 1
+ 'sequence': 1
}
_order = "sequence, name"
@@ -125,15 +125,18 @@ class project_task(osv.osv):
}
def copy_data(self, cr, uid, id, default=None, context=None):
+ if context is None:
+ context = {}
if not default:
default = {}
- default['timebox_id']=False
- default['context_id']=False
+ default['timebox_id'] = False
+ default['context_id'] = False
return super(project_task,self).copy_data(cr, uid, id, default, context)
- def _get_context(self,cr, uid, ctx):
- ids = self.pool.get('project.gtd.context').search(cr, uid, [], context=ctx)
+ def _get_context(self,cr, uid, context=None):
+ ids = self.pool.get('project.gtd.context').search(cr, uid, [], context=context)
return ids and ids[0] or False
+
_defaults = {
'context_id': _get_context
}
@@ -192,7 +195,7 @@ class project_task(osv.osv):
context_id_info['context_id']['selection'] = attrs_sel
res['fields'].update(context_id_info)
return res
+
project_task()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/project_gtd/project_gtd_demo.xml b/addons/project_gtd/project_gtd_demo.xml
index 06deb221f36..a696e901686 100644
--- a/addons/project_gtd/project_gtd_demo.xml
+++ b/addons/project_gtd/project_gtd_demo.xml
@@ -67,7 +67,7 @@
24.0
24.0
-
+
Validation + latest modifications.
@@ -100,7 +100,7 @@
24.0
24.0
-
+
Validation + latest modifications.
diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml
index f5639ea5629..919412cd27d 100644
--- a/addons/project_gtd/project_gtd_view.xml
+++ b/addons/project_gtd/project_gtd_view.xml
@@ -13,6 +13,7 @@
+
project.gtd.context.form
project.gtd.context
@@ -25,6 +26,7 @@
+
Contexts
project.gtd.context
@@ -70,6 +72,7 @@
+
project.task.tree.timebox
project.task
diff --git a/addons/project_gtd/wizard/project_gtd_empty.py b/addons/project_gtd/wizard/project_gtd_empty.py
index 4eb4de12c12..01629af87b4 100644
--- a/addons/project_gtd/wizard/project_gtd_empty.py
+++ b/addons/project_gtd/wizard/project_gtd_empty.py
@@ -63,4 +63,4 @@ class project_timebox_empty(osv.osv_memory):
project_timebox_empty()
-# 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_gtd/wizard/project_gtd_fill.py b/addons/project_gtd/wizard/project_gtd_fill.py
index 8b39dac16ae..34e4a8c2457 100644
--- a/addons/project_gtd/wizard/project_gtd_fill.py
+++ b/addons/project_gtd/wizard/project_gtd_fill.py
@@ -32,10 +32,14 @@ class project_timebox_fill(osv.osv_memory):
}
def _get_from_tb(self, cr, uid, context=None):
+ if context is None:
+ context = {}
ids = self.pool.get('project.gtd.timebox').search(cr, uid, [], context=context)
return ids and ids[0] or False
def _get_to_tb(self, cr, uid, context=None):
+ if context is None:
+ context = {}
if 'active_id' in context:
return context['active_id']
return False
@@ -58,4 +62,4 @@ class project_timebox_fill(osv.osv_memory):
project_timebox_fill()
-# 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_issue/__openerp__.py b/addons/project_issue/__openerp__.py
index 97f9e96afa0..ff90c5c131b 100644
--- a/addons/project_issue/__openerp__.py
+++ b/addons/project_issue/__openerp__.py
@@ -48,9 +48,9 @@
"board_project_issue_view.xml",
],
'demo_xml': ['project_issue_demo.xml'],
- 'test' : [
- 'test/convert_issue_to_task.yml',
- 'test/test_project_issue_states.yml'
+ 'test': [
+ 'test/convert_issue_to_task.yml',
+ 'test/test_project_issue_states.yml'
],
'installable': True,
'active': False,
diff --git a/addons/project_issue/board_project_issue_view.xml b/addons/project_issue/board_project_issue_view.xml
index 8b038d1036a..8fe05eddebe 100644
--- a/addons/project_issue/board_project_issue_view.xml
+++ b/addons/project_issue/board_project_issue_view.xml
@@ -85,9 +85,7 @@
menu
-
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index aebb7356405..f13f816b4ca 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -25,14 +25,14 @@ import re
import time
import mx.DateTime
from datetime import datetime, timedelta
+import binascii
+import collections
import tools
from crm import crm
from osv import fields,osv,orm
from osv.orm import except_orm
from tools.translate import _
-import collections
-import binascii
import tools
class project_issue(osv.osv, crm.crm_case):
@@ -54,7 +54,9 @@ class project_issue(osv.osv, crm.crm_case):
self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
return res
- def _compute_day(self, cr, uid, ids, fields, args, context={}):
+ def _compute_day(self, cr, uid, ids, fields, args, context=None):
+ if context is None:
+ context = {}
"""
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -66,7 +68,7 @@ class project_issue(osv.osv, crm.crm_case):
res_obj = self.pool.get('resource.resource')
res = {}
- for issue in self.browse(cr, uid, ids, context):
+ for issue in self.browse(cr, uid, ids, context=context):
for field in fields:
res[issue.id] = {}
duration = 0
@@ -102,13 +104,7 @@ class project_issue(osv.osv, crm.crm_case):
duration = float(ans.days)
if issue.project_id and issue.project_id.resource_calendar_id:
duration = float(ans.days) * 24
- new_dates = cal_obj.interval_min_get(cr,
- uid,
- issue.project_id.resource_calendar_id.id,
- mx.DateTime.strptime(issue.create_date, '%Y-%m-%d %H:%M:%S'),
- duration,
- resource=resource_id
- )
+ new_dates = cal_obj.interval_min_get(cr, uid, issue.project_id.resource_calendar_id.id, mx.DateTime.strptime(issue.create_date, '%Y-%m-%d %H:%M:%S'), duration, resource=resource_id)
no_days = []
date_until = mx.DateTime.strptime(date_until, '%Y-%m-%d %H:%M:%S')
for in_time, out_time in new_dates:
@@ -127,8 +123,8 @@ class project_issue(osv.osv, crm.crm_case):
'id': fields.integer('ID'),
'name': fields.char('Name', size=128, required=True),
'active': fields.boolean('Active', required=False),
- 'create_date': fields.datetime('Creation Date' , readonly=True),
- 'write_date': fields.datetime('Update Date' , readonly=True),
+ 'create_date': fields.datetime('Creation Date', readonly=True),
+ 'write_date': fields.datetime('Update Date', readonly=True),
'date_deadline': fields.date('Deadline'),
'date_closed': fields.datetime('Closed', readonly=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team', \
@@ -140,28 +136,22 @@ class project_issue(osv.osv, crm.crm_case):
domain="[('partner_id','=',partner_id)]"),
'company_id': fields.many2one('res.company', 'Company'),
'description': fields.text('Description'),
- 'state': fields.selection([
- ('draft', 'Draft'),
- ('open', 'Todo'),
- ('cancel', 'Cancelled'),
- ('done', 'Closed'),
- ('pending', 'Pending'),
- ], 'State', size=16, readonly=True,
+ 'state': fields.selection([('draft', 'Draft'), ('open', 'Todo'), ('cancel', 'Cancelled'), ('done', 'Closed'),('pending', 'Pending'), ], 'State', size=16, readonly=True,
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
\nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
- 'email_cc': fields.text('Watchers Emails', size=252 , help="These people\
+ 'email_cc': fields.text('Watchers Emails', size=252, help="These people\
will receive a copy of the future" \
" communication between partner and users by email"),
'date_open': fields.datetime('Opened', readonly=True),
# Project Issue fields
'date_closed': fields.datetime('Closed', readonly=True),
'date': fields.datetime('Date'),
- 'canal_id': fields.many2one('res.partner.canal', 'Channel',help="The channels represent the different communication modes available with the customer." \
+ 'canal_id': fields.many2one('res.partner.canal', 'Channel', help="The channels represent the different communication modes available with the customer." \
" With each commercial opportunity, you can indicate the canall which is this opportunity source."),
- 'categ_id': fields.many2one('crm.case.categ','Category', domain="[('object_id.model', '=', 'crm.project.bug')]"),
+ 'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('object_id.model', '=', 'crm.project.bug')]"),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Severity'),
'type_id': fields.many2one('crm.case.resource.type', 'Version', domain="[('object_id.model', '=', 'project.issue')]"),
'partner_name': fields.char("Employee's Name", size=64),
@@ -176,7 +166,7 @@ class project_issue(osv.osv, crm.crm_case):
method=True, multi='day_open', type="float", store=True),
'day_close': fields.function(_compute_day, string='Days to Close', \
method=True, multi='day_close', type="float", store=True),
- 'assigned_to' : fields.many2one('res.users', 'Assigned to'),
+ 'assigned_to': fields.many2one('res.users', 'Assigned to'),
'working_hours_open': fields.function(_compute_day, string='Working Hours to Open the Issue', \
method=True, multi='working_days_open', type="float", store=True),
'working_hours_close': fields.function(_compute_day, string='Working Hours to Close the Issue', \
@@ -194,15 +184,15 @@ class project_issue(osv.osv, crm.crm_case):
return False
_defaults = {
- 'active': lambda *a: 1,
+ 'active': 1,
'user_id': crm.crm_case._get_default_user,
'partner_id': crm.crm_case._get_default_partner,
'partner_address_id': crm.crm_case._get_default_partner_address,
'email_from': crm.crm_case. _get_default_email,
- 'state': lambda *a: 'draft',
+ 'state': 'draft',
'section_id': crm.crm_case. _get_section,
'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.helpdesk', context=c),
- 'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
+ 'priority': crm.AVAILABLE_PRIORITIES[2][0],
'project_id':_get_project,
}
@@ -229,9 +219,9 @@ class project_issue(osv.osv, crm.crm_case):
'partner_id': bug.partner_id.id,
'description':bug.description,
'date': bug.date,
- 'project_id':bug.project_id.id,
- 'priority':bug.priority,
- 'user_id':bug.assigned_to.id,
+ 'project_id': bug.project_id.id,
+ 'priority': bug.priority,
+ 'user_id': bug.assigned_to.id,
'planned_hours': 0.0,
})
@@ -269,7 +259,9 @@ class project_issue(osv.osv, crm.crm_case):
def convert_to_bug(self, cr, uid, ids, context=None):
return self._convert(cr, uid, ids, 'bug_categ', context=context)
- def onchange_stage_id(self, cr, uid, ids, stage_id, context={}):
+ def onchange_stage_id(self, cr, uid, ids, stage_id, context=None):
+ if context is None:
+ context = {}
if not stage_id:
return {'value':{}}
stage = self.pool.get('crm.case.stage').browse(cr, uid, stage_id, context)
@@ -300,7 +292,7 @@ class project_issue(osv.osv, crm.crm_case):
def message_new(self, cr, uid, msg, context):
"""
Automatically calls when new email message arrives
-
+
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks
@@ -312,7 +304,7 @@ class project_issue(osv.osv, crm.crm_case):
body = msg.get('body')
msg_from = msg.get('from')
priority = msg.get('priority')
-
+
vals = {
'name': subject,
'email_from': msg_from,
@@ -322,18 +314,18 @@ class project_issue(osv.osv, crm.crm_case):
}
if msg.get('priority', False):
vals['priority'] = priority
-
+
res = mailgate_pool.get_partner(cr, uid, msg.get('from'))
if res:
vals.update(res)
res = self.create(cr, uid, vals, context)
self.convert_to_bug(cr, uid, [res], context=context)
-
+
attachents = msg.get('attachments', [])
for attactment in attachents or []:
data_attach = {
'name': attactment,
- 'datas':binascii.b2a_base64(str(attachents.get(attactment))),
+ 'datas': binascii.b2a_base64(str(attachents.get(attactment))),
'datas_fname': attactment,
'description': 'Mail attachment',
'res_model': self._name,
@@ -343,17 +335,19 @@ class project_issue(osv.osv, crm.crm_case):
return res
- def message_update(self, cr, uid, ids, vals={}, msg="", default_act='pending', context={}):
- """
+ def message_update(self, cr, uid, ids, vals={}, msg="", default_act='pending', context=None):
+ if context is None:
+ context = {}
+ """
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
- @param ids: List of update mail’s IDs
+ @param ids: List of update mail’s IDs
"""
-
+
if isinstance(ids, (str, int, long)):
ids = [ids]
-
+
vals.update({
'description': msg['body']
})
@@ -361,9 +355,9 @@ class project_issue(osv.osv, crm.crm_case):
vals['priority'] = msg.get('priority')
maps = {
- 'cost':'planned_cost',
+ 'cost': 'planned_cost',
'revenue': 'planned_revenue',
- 'probability':'probability'
+ 'probability': 'probability'
}
vls = { }
for line in msg['body'].split('\n'):
@@ -372,7 +366,7 @@ class project_issue(osv.osv, crm.crm_case):
if res and maps.get(res.group(1).lower(), False):
key = maps.get(res.group(1).lower())
vls[key] = res.group(2).lower()
-
+
vals.update(vls)
res = self.write(cr, uid, ids, vals)
return res
@@ -399,4 +393,4 @@ class project(osv.osv):
}
project()
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_issue/project_issue_data.xml b/addons/project_issue/project_issue_data.xml
index a87039274f3..fb914dfaca2 100644
--- a/addons/project_issue/project_issue_data.xml
+++ b/addons/project_issue/project_issue_data.xml
@@ -1,6 +1,7 @@
+
@@ -11,6 +12,7 @@
+
Feature Requests
@@ -25,7 +27,8 @@
Version 4.2
-
+
+
Version 4.4
@@ -67,5 +70,6 @@
+
diff --git a/addons/project_issue/project_issue_demo.xml b/addons/project_issue/project_issue_demo.xml
index aee12ccf01e..ad6af0e02b0 100644
--- a/addons/project_issue/project_issue_demo.xml
+++ b/addons/project_issue/project_issue_demo.xml
@@ -1,6 +1,7 @@
+
diff --git a/addons/project_issue/project_issue_menu.xml b/addons/project_issue/project_issue_menu.xml
index fefdd496559..05080670e10 100644
--- a/addons/project_issue/project_issue_menu.xml
+++ b/addons/project_issue/project_issue_menu.xml
@@ -2,7 +2,6 @@
-
######################## ISSUE TRACKING (menu) ###########################
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..fd965e4c792 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
@@ -403,10 +403,9 @@
2010-02-24 05:00:00
2
- draft
-
-
+
+
Prepare Requirements Document
2010-03-08
@@ -422,10 +421,9 @@
2010-02-25 15:38:08
2
- draft
-
-
+
+
Define Website Goals, Purposes and Target Audience
2010-03-04
@@ -441,10 +439,9 @@
2010-02-25 15:42:42
2
- draft
-
-
+
+
Use Cases
2010-03-10
@@ -460,10 +457,9 @@
2010-02-25 15:51:00
2
- draft
-
-
+
+
Budget Planning
2010-03-31
@@ -479,10 +475,9 @@
2010-02-25 15:54:42
2
- draft
-
-
+
+
Quality Planning
2010-03-31
@@ -498,10 +493,9 @@
2010-02-25 15:55:11
2
- draft
-
-
+
+
Risk Management Planning
2010-03-31
@@ -517,10 +511,9 @@
2010-02-25 15:57:48
2
- draft
-
-
+
+
Create Project Schedules
2010-03-31
@@ -536,10 +529,9 @@
2010-02-25 16:04:16
2
- draft
-
-
+
+
Dataflow Design
2010-04-02
@@ -555,10 +547,9 @@
2010-02-25 16:05:43
2
- draft
-
-
+
+
User Interface Design
2010-04-10
@@ -574,10 +565,9 @@
2010-02-25 16:06:52
2
- draft
-
-
+
+
Task Level WBS
2010-04-07
@@ -593,10 +583,9 @@
2010-02-25 16:11:40
2
- draft
-
-
+
+
Modular Programming
2010-04-22
@@ -611,10 +600,9 @@
2010-02-25 16:13:10
2
- draft
-
-
+
+
Integrate Modules
2010-04-24
@@ -629,10 +617,9 @@
2010-02-25 16:14:32
2
- draft
-
-
+
+
Unit Testing
2010-04-24
@@ -647,10 +634,9 @@
2010-02-25 16:15:38
2
- draft
-
-
+
+
Regression Test
2010-04-24
@@ -665,10 +651,9 @@
2010-02-25 16:17:04
2
- draft
-
-
+
+
Documentation
2010-04-24
@@ -683,10 +668,9 @@
2010-02-25 16:17:42
2
- draft
-
-
+
+
Performance Tuning
2010-04-24
@@ -701,10 +685,9 @@
2010-02-25 16:21:15
2
- draft
-
-
+
+
Deploy Website
2010-04-26
@@ -719,10 +702,9 @@
2010-02-25 16:22:09
2
- draft
-
-
+
+
Presentation
2010-04-28
@@ -737,10 +719,9 @@
2010-02-25 16:36:02
2
- draft
-
-
+
+
Deployment
2010-04-28
@@ -756,10 +737,9 @@
2010-02-25 16:36:43
2
- draft
-
-
+
+
Presentation
2010-04-29
@@ -775,10 +755,9 @@
2010-02-25 17:22:46
2
- draft
-
-
+
+
Modules Integration
2010-04-24
@@ -794,10 +773,9 @@
2010-02-25 17:34:32
2
- draft
-
-
+
+
Unit Testing
2010-04-24
@@ -813,10 +791,9 @@
2010-02-25 17:35:46
2
- draft
-
-
+
+
Modular Testing
2010-04-24
@@ -832,10 +809,9 @@
2010-02-25 17:36:27
2
- draft
-
-
+
+
Documentation
2010-04-28
@@ -851,10 +827,9 @@
2010-02-25 17:37:03
2
- draft
-
-
+
+
Performance Tuning
2010-04-27
@@ -871,10 +846,9 @@
2010-03-01 12:00:00
2
- draft
-
-
+
+
Modular Programming
2010-04-22
@@ -882,5 +856,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 @@