[IMP] clean project_* code (DHS)

bzr revid: mra@mra-laptop-20100702143706-k5zeko7e9n7ikvk1
This commit is contained in:
Mustufa Rangwala 2010-07-02 20:07:06 +05:30
parent 5477d0de86
commit 26f266785e
40 changed files with 392 additions and 389 deletions

View File

@ -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",

View File

@ -21,8 +21,6 @@
<!-- <field name="domain">[('user_id','in',department_users_get())]</field>-->
<!-- </record>-->
<record id="board_project_manager_form" model="ir.ui.view">
<field name="name">board.project.manager.form</field>
<field name="model">board.board</field>

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -8,9 +8,11 @@
<field name="name">Project</field>
<field name="object">project.project</field>
</record>
<record id="req_link_task" model="res.request.link">
<field name="name">Project task</field>
<field name="object">project.task</field>
</record>
</data>
</openerp>

View File

@ -10,10 +10,8 @@
<form position="attributes">
<attribute name="string">Project Modules Installation</attribute>
</form>
<separator string="title" position="attributes">
<attribute name="string"
>Project Management</attribute>
<attribute name="string">Project Management</attribute>
</separator>
<xpath expr='//separator[@string="vsep"]' position='attributes'>
<attribute name='string'></attribute>
@ -55,6 +53,7 @@
<field name="action_id" ref="action_project_installer"/>
<field name="sequence">3</field>
</record>
<record id="project_ir_actions_todo_tree" model="ir.ui.view">
<field name="model">ir.actions.todo</field>
<field name="name">project_installer_action_replace</field>

View File

@ -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]

View File

@ -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
return wktime_cal

View File

@ -42,7 +42,6 @@
<field name="project_escalation_id"/>
<field name="warn_manager"/>
</group>
<newline/>
<group col="9" colspan="8">
<field name="state" select="1"/>
@ -517,6 +516,7 @@
<field name="view_type">form</field>
<field name="view_id" ref="task_type_tree"/>
</record>
<menuitem id="menu_tasks_config" name="Tasks" parent="project.menu_definitions" sequence="1"/>
<menuitem action="open_task_type_form" id="menu_task_types_view" parent="menu_tasks_config" sequence="1"/>
@ -545,7 +545,6 @@
</field>
</record>
<!-- User Form-->
<record id="view_project_users_form_simple" model="ir.ui.view">
<field name="name">res.users.project.form1</field>

View File

@ -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
)
""")

View File

@ -86,13 +86,13 @@
icon="terp-dialog-close"
name="done"
domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<separator orientation="vertical"/>
<field name="project_id">
<filter icon="terp-folder-blue"
string="My Projects"
help="My Projects" domain="[('project_id','=',uid)]"/>
help="My Projects" domain="[('project_id','=',uid)]"/>
</field>
<field name="user_id" widget="selection">
<filter icon="terp-personal"
string="My Task"
@ -110,7 +110,7 @@
<filter string="Project" name="project" icon="terp-folder-blue" context="{'group_by':'project_id'}"/>
<filter string="Assigned to" name="User" icon="terp-personal" context="{'group_by':'user_id'}" />
<separator orientation="vertical"/>
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}" />
<filter string="Partner" icon="terp-personal" context="{'group_by':'partner_id'}" />
<filter string="Task" icon="terp-stock_align_left_24" context="{'group_by':'name'}" />
<separator orientation="vertical"/>
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
@ -144,6 +144,7 @@
<field name="search_view_id" ref="view_task_project_user_search"/>
<field name="context">{'search_default_month':1,'search_default_project':1,'group_by_no_leaf':1,'group_by':[]}</field>
</record>
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report"/>
<!-- Views and action for project dashboard -->
@ -181,6 +182,7 @@
<field name="domain">[('uid','=',uid)]</field>
<field name="view_id" ref="view_project_vs_remaining_hours_graph"/>
</record>
<!-- Views and action for project issue dashboard -->
<record id="view_task_by_days_tree" model="ir.ui.view">
<field name="name">task.by.days.tree</field>

View File

@ -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()

View File

@ -5,9 +5,11 @@
<record id="group_project_finance" model="res.groups">
<field name="name">Project / Financial Manager</field>
</record>
<record id="group_project_manager" model="res.groups">
<field name="name">Project / Manager</field>
</record>
<record id="group_project_user" model="res.groups">
<field name="name">Project / User</field>
</record>

View File

@ -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:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -11,10 +11,10 @@
<label string="Send mail to the specified email address"/>
<separator string="" colspan="4"/>
<group colspan="4" col="6">
<newline/>
<field name="email"/>
<newline/>
<field name="description" />
<newline/>
<field name="email"/>
<newline/>
<field name="description" />
</group>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="_Close"/>
@ -36,4 +36,4 @@
</record>
</data>
</openerp>
</openerp>

View File

@ -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)

View File

@ -25,7 +25,7 @@
<field name="state" />
<newline/>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button icon="gtk-ok" name="validate" string="Validate" type="object"/>
</group>
</form>
@ -44,4 +44,4 @@
</record>
</data>
</openerp>
</openerp>

View File

@ -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,

View File

@ -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()

View File

@ -74,11 +74,11 @@
<record model="basic.calendar.fields" id="map_todo_10">
<field name="name" ref="caldav.field_todo_vtimezone"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','vtimezone'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<field name="name" ref="caldav.field_todo_vtimezone"/>
<field name="type_id" ref="caldav.calendar_lines_todo" />
<field name="field_id" search="[('name','=','vtimezone'),('model_id.model','=','calendar.todo')]" />
<field name="fn">field</field>
</record>
<record model="basic.calendar.fields" id="map_todo_11">
<field name="name" ref="caldav.field_todo_summary"/>

View File

@ -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"/>
<field name="attendee_ids" colspan="4"
<field name="attendee_ids" colspan="4"
nolabel="1" widget="one2many" mode="tree,form">
<tree string="Assignees details"
editable="top">
<tree string="Assignees details" editable="top">
<field name="email" />
<field name="role" select="1" />
<field name="state" />
@ -29,15 +28,12 @@
<field name="rsvp" select="1" />
<field name="cutype" select="1" />
<field name="role" select="1" />
<separator colspan="4"
string="" />
<separator colspan="4" string="" />
<field name="state" />
</page>
<page string="Other">
<field name="user_id"
select="1" />
<field name="partner_address_id"
select="1" />
<field name="user_id" select="1" />
<field name="partner_address_id" select="1" />
<newline />
</page>
</notebook>
@ -68,8 +64,7 @@
<field name="arch" type="xml">
<field name="progress" position="after">
<group colspan="2" col="4" >
<field name="rrule_type" string="Recurrency"
colspan="1" attrs="{'readonly':[('recurrent_uid','!=',False)]}"/>
<field name="rrule_type" string="Recurrency" colspan="1" attrs="{'readonly':[('recurrent_uid','!=',False)]}"/>
<button string="Edit All"
help="Edit all Ourrences of recurrent Task"
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
@ -85,44 +80,35 @@
<group col="4" colspan="6" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">
<separator string="Data for Custom Rule" colspan="8"/>
<group col="8" colspan="4">
<field name="freq" />
<field name="interval" />
<field name="count" />
<field name="end_date" />
<field name="freq" />
<field name="interval" />
<field name="count" />
<field name="end_date" />
</group>
<group col="14" colspan="4" name="Select weekdays"
attrs="{'invisible' : [('freq','!=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
<group col="14" colspan="4" name="Select weekdays"
attrs="{'invisible': [('freq','=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
</group>
<group col="10" colspan="4"
attrs="{'invisible' : [('freq','!=','monthly'), ('freq','!=','yearly')]}">
<group col="10" colspan="4" attrs="{'invisible': [('freq','!=','monthly'), ('freq','!=','yearly')]}">
<group col="2" colspan="1">
<field name="select1" />
<field name="select1" />
</group>
<group col="2" colspan="1"
attrs="{'invisible' : [('select1','=','day')]}">
<field name="day"
attrs="{'required' : [('select1','=','date')]}" />
<group col="2" colspan="1" attrs="{'invisible' : [('select1','=','day')]}">
<field name="day" attrs="{'required' : [('select1','=','date')]}" />
</group>
<group col="3" colspan="1"
attrs="{'invisible' : [('select1','=','date')]}">
<field name="byday" string="The"
attrs="{'required' : [('select1','=','day')]}" />
<field name="week_list" nolabel="1"
attrs="{'required' : [('select1','=','day')]}" />
<group col="3" colspan="1" attrs="{'invisible' : [('select1','=','date')]}">
<field name="byday" string="The" attrs="{'required' : [('select1','=','day')]}" />
<field name="week_list" nolabel="1" attrs="{'required' : [('select1','=','day')]}" />
</group>
<group col="1" colspan="1"
attrs="{'invisible' : [('freq','!=','yearly')]}">
<field name="month_list" string="of"
colspan="1"
attrs="{'required' : [('freq','=','yearly')]}" />
<group col="1" colspan="1" attrs="{'invisible' : [('freq','!=','yearly')]}">
<field name="month_list" string="of" colspan="1" attrs="{'required' : [('freq','=','yearly')]}" />
</group>
</group>
</group>
@ -144,7 +130,7 @@
<field name="rrule" invisible="1"/>
</field>
</field>
</record>
</record>
</data>
</openerp>

View File

@ -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:

View File

@ -67,7 +67,7 @@
<field name="planned_hours">24.0</field>
<field name="remaining_hours">24.0</field>
<field name="timebox_id" ref="timebox_weekly"/>
<field name="context_id" ref="context_office"/>
<field name="context_id" ref="context_office"/>
<field name="user_id" ref="base.user_root"/>
<field name="project_id" ref="project.project_project_22"/>
<field name="name">Validation + latest modifications.</field>
@ -100,7 +100,7 @@
<field name="planned_hours">24.0</field>
<field name="remaining_hours">24.0</field>
<field name="timebox_id" ref="timebox_weekly"/>
<field name="context_id" ref="context_office"/>
<field name="context_id" ref="context_office"/>
<field name="user_id" ref="base.user_root"/>
<field name="project_id" ref="project.project_project_22"/>
<field name="name">Validation + latest modifications.</field>

View File

@ -13,6 +13,7 @@
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_gtd_context_form">
<field name="name">project.gtd.context.form</field>
<field name="model">project.gtd.context</field>
@ -25,6 +26,7 @@
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_gtd_context_tree">
<field name="name">Contexts</field>
<field name="res_model">project.gtd.context</field>
@ -70,6 +72,7 @@
</record>
<menuitem name="Timeboxes" id="menu_open_gtd_time_timeboxes" parent="project.menu_tasks_config" action="open_gtd_timebox_tree"/>
<record model="ir.ui.view" id="project_task_tree">
<field name="name">project.task.tree.timebox</field>
<field name="model">project.task</field>

View File

@ -63,4 +63,4 @@ class project_timebox_empty(osv.osv_memory):
project_timebox_empty()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -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:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -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,

View File

@ -85,9 +85,7 @@
<field name="usage">menu</field>
<field name="view_id" ref="board_project_issue_form"/>
</record>
<menuitem
id="menu_deshboard_project_issue"
name="Project Issue Dashboard" parent="project.next_id_86"
<menuitem id="menu_deshboard_project_issue" name="Project Issue Dashboard" parent="project.next_id_86"
icon="terp-graph" action="open_board_project_issue"/>
</data>
</openerp>

View File

@ -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 users 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 users 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 users ID for security checks,
@param ids: List of update mails IDs
@param ids: List of update mails 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:

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<!--
Case Categories
-->
@ -11,6 +12,7 @@
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
</record>
<record model="crm.case.categ" id="feature_request_categ">
<field name="name">Feature Requests</field>
<field name="section_id" ref="crm.section_sales_department"/>
@ -25,7 +27,8 @@
<field name="name">Version 4.2</field>
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
</record>
</record>
<record model="crm.case.resource.type" id="type2">
<field name="name">Version 4.4</field>
<field name="section_id" ref="crm.section_sales_department"/>
@ -67,5 +70,6 @@
<field name="section_id" ref="crm.section_sales_department"/>
<field name="object_id" search="[('model','=','project.issue')]" model="ir.model"/>
</record>
</data>
</openerp>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<record id="crm_case_buginaccountsmodule0" model="project.issue">
<field name="partner_address_id" ref="base.res_partner_address_8"/>
<field eval="time.strftime('%Y-%m-08 10:15:00')" name="date"/>

View File

@ -2,7 +2,6 @@
<openerp>
<data>
######################## ISSUE TRACKING (menu) ###########################
<!--
ALL BUGS
@ -14,21 +13,24 @@
<field name="view_mode">tree,calendar</field>
<field name="view_id" ref="project_issue_tree_view"/>
<field name="domain" eval="[('categ_id','=',ref('bug_categ'))]"/>
<field name="context">{"search_default_user_id": uid,"search_default_current":1,"search_default_project_id":project_id}</field>
<field name="context">{"search_default_user_id": uid, "search_default_current":1, "search_default_project_id":project_id}</field>
<field name="search_view_id" ref="view_project_issue_filter"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view0">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="project_issue_tree_view"/>
<field name="act_window_id" ref="project_issue_categ_act0"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_calendar_view0">
<field name="sequence" eval="2"/>
<field name="view_mode">calendar</field>
<field name="view_id" ref="project_issue_calendar_view"/>
<field name="act_window_id" ref="project_issue_categ_act0"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view0">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>

View File

@ -31,58 +31,56 @@
<field name="arch" type="xml">
<form string="Issue Tracker Form">
<group colspan="4" col="6">
<field name="name"/>
<field name="project_id" required="True"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
<field name="user_id"/>
<field name="assigned_to" />
<field name="name"/>
<field name="project_id" required="True"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'project.issue')]"/>
<field name="user_id"/>
<field name="assigned_to" />
<group colspan="2" col="4">
<field name="stage_id" on_change="onchange_stage_id(stage_id)" domain="[('object_id.model', '=', 'project.issue')]" widget="selection"/>
<button icon="gtk-go-back" string="" name="stage_previous" type="object"/>
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
<field name="stage_id" on_change="onchange_stage_id(stage_id)" domain="[('object_id.model', '=', 'project.issue')]" widget="selection"/>
<button icon="gtk-go-back" string="" name="stage_previous" type="object"/>
<button icon="gtk-go-forward" string="" name="stage_next" type="object"/>
</group>
</group>
<notebook colspan="4">
<page string="General">
<group col="2" colspan="2">
<separator colspan="2" string="Communication"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/>
<field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>
<field name="email_from"/>
<separator colspan="2" string="Communication"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)"/>
<field name="partner_address_id" string="Contact" on_change="onchange_partner_address_id(partner_address_id, email_from)"/>
<field name="email_from"/>
</group>
<group col="3" colspan="2">
<separator colspan="3" string="Status"/>
<field name="type_id" colspan="3"/>
<field name="priority" colspan="3"/>
<field name="task_id" />
<button string="Convert To Task"
name="convert_issue_task"
icon="gtk-index" type="object"
attrs="{'invisible':[('task_id','!=',False)]}" />
<separator colspan="3" string="Status"/>
<field name="type_id" colspan="3"/>
<field name="priority" colspan="3"/>
<field name="task_id" />
<button string="Convert To Task" name="convert_issue_task" icon="gtk-index" type="object"
attrs="{'invisible':[('task_id','!=',False)]}" />
</group>
<separator string= "Description" colspan="4"/>
<field name="description" nolabel="1" colspan="4"/>
<separator colspan="4"/>
<group col="8" colspan="4">
<field name="state" />
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
<field name="state" />
<button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
<button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
<button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
<button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
<button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
<button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
</group>
</page>
<page string="Emails" groups="base.group_extended">
<group colspan="4">
<field colspan="4" name="email_cc" string="CC"/>
<field colspan="4" name="email_cc" string="CC"/>
</group>
<field name="message_ids" colspan="4" nolabel="1" mode="form,tree">
<form string="Communication history">
<group col="6" colspan="4">
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
<field name="date"/>
<field name="email_to"/>
<field name="email_from"/>
</group>
<notebook colspan="4">
<page string="Details">
@ -92,9 +90,7 @@
<field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
</page>
</notebook>
<button colspan="4"
string="Reply to Last Email"
name="%(crm.action_crm_send_mail)d"
<button colspan="4" string="Reply to Last Email" name="%(crm.action_crm_send_mail)d"
context="{'mail':'reply', 'model': 'project.issue', 'include_original' : True}"
icon="gtk-undo" type="action" />
</form>
@ -113,23 +109,23 @@
</page>
<page string="History" groups="base.group_extended">
<group col="2" colspan="2">
<separator colspan="2" string="Date"/>
<field name="create_date"/>
<field name="write_date" />
<field name="date_closed"/>
<field name="date_open"/>
<separator colspan="2" string="Date"/>
<field name="create_date"/>
<field name="write_date" />
<field name="date_closed"/>
<field name="date_open"/>
</group>
<group colspan="2" col="2">
<separator string="Statistics" colspan="2" col="2"/>
<field name="day_open"/>
<field name="day_close"/>
<field name="working_hours_open" widget="float_time"/>
<field name="working_hours_close" widget="float_time"/>
<separator string="Statistics" colspan="2" col="2"/>
<field name="day_open"/>
<field name="day_close"/>
<field name="working_hours_open" widget="float_time"/>
<field name="working_hours_close" widget="float_time"/>
</group>
<group colspan="2" col="2">
<separator string="References" colspan="2"/>
<field name="id"/>
<field name="active"/>
<separator string="References" colspan="2"/>
<field name="id"/>
<field name="active"/>
</group>
<field name="log_ids" nolabel="1" colspan="4">
<tree string="Logs">
@ -149,6 +145,7 @@
</form>
</field>
</record>
<record model="ir.ui.view" id="project_issue_tree_view">
<field name="name">Project Issue Tracker Tree</field>
<field name="model">project.issue</field>
@ -162,11 +159,9 @@
<field name="partner_id"/>
<field name="priority" string="Severity"/>
<field name="stage_id" string="Resolution"/>
<button icon="gtk-go-back" string=""
name="stage_previous" type="object"
<button icon="gtk-go-back" string="" name="stage_previous" type="object"
states="open,draft,pending,done,cancel" />
<button icon="gtk-go-forward" string=""
name="stage_next" type="object"
<button icon="gtk-go-forward" string="" name="stage_next" type="object"
states="open,draft,pending,done,cancel" />
<field name="type_id" string="Version"/>
<field name="user_id"/>
@ -193,14 +188,9 @@
<filter string="In Progress" domain="[('state','=','open')]" help="Open Issues" icon="terp-camera_test"/>
<filter string="Pending" domain="[('state','=','pending')]" help="Pending Issues" icon="terp-gtk-media-pause"/>
<separator orientation="vertical"/>
<filter icon="terp-go-today" string=" Today "
separator="1"
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
help="Today's bugs"
/>
<filter icon="terp-go-week"
string=" 7 Days " separator="1"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
<filter icon="terp-go-today" string=" Today " separator="1" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]" help="Today's bugs" />
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date', '&gt;=', (datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Bugs during last 7 days"
/>
<separator orientation="vertical"/>
@ -260,11 +250,9 @@
<field name="partner_id"/>
<field name="priority" string="Severity"/>
<field name="stage_id" string="Resolution"/>
<button icon="gtk-go-back" string=""
name="stage_previous" type="object"
<button icon="gtk-go-back" string="" name="stage_previous" type="object"
states="open,draft,pending,done,cancel" />
<button icon="gtk-go-forward" string=""
name="stage_next" type="object"
<button icon="gtk-go-forward" string="" name="stage_next" type="object"
states="open,draft,pending,done,cancel" />
<field name="type_id" string="Version"/>
<field name="user_id"/>
@ -286,16 +274,10 @@
<field name="arch" type="xml">
<search string="Feature Tracker Search">
<group>
<filter icon="terp-go-today" string=" Today "
separator="1"
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
help="Today's features"
/>
<filter icon="terp-go-week"
string=" 7 Days " separator="1"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
help="Features during last 7 days"
/>
<filter icon="terp-go-today" string=" Today " separator="1"
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]" help="Today's features"/>
<filter icon="terp-go-week" string=" 7 Days " separator="1"
domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')), ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]" help="Features during last 7 days"/>
</group>
<separator orientation="vertical"/>
<group>
@ -306,7 +288,6 @@
<filter icon="terp-camera_test" domain="[('state','=','open')]" help="Open Features"/>
</field>
<field name="project_id" select="1" string="Project"/>
</group>
</search>
</field>

View File

@ -13,7 +13,9 @@ class project_issue_report(osv.osv):
_name = "project.issue.report"
_auto = False
def _get_data(self, cr, uid, ids, field_name, arg, context={}):
def _get_data(self, cr, uid, ids, field_name, arg, context=None):
if context is None:
context = {}
""" @param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of case and section Datas IDs

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<data noupdate="1">
<record id="group_project_supporter" model="res.groups">
<field name="name">Project / Support Manager</field>

View File

@ -25,22 +25,22 @@
'name': 'Add the Timesheet support for Issue Management in Project Management',
'version': '1.0',
'category': 'Generic Modules/CRM & SRM',
'description': """
This module adds the Timesheet support for the Issues/Bugs Management in Project
""",
'description': """
This module adds the Timesheet support for the Issues/Bugs Management in Project
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': [
'project_issue',
'hr_timesheet_sheet',
],
],
'init_xml': [
],
],
'update_xml': [
'project_issue_sheet_view.xml',
],
],
'demo_xml': [
],
],
'installable': True,
'active': False,
}

View File

@ -24,25 +24,30 @@ from tools.translate import _
class project_issue(osv.osv):
_inherit = 'project.issue'
_description = 'project issue'
_columns = {
'timesheet_ids' : fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'),
'analytic_account_id': fields.related('project_id','category_id',string='Analytic Account')
'timesheet_ids': fields.one2many('hr.analytic.timesheet', 'issue_id', 'Timesheets'),
'analytic_account_id': fields.related('project_id', 'category_id', string='Analytic Account')
}
project_issue()
class account_analytic_line(osv.osv):
_inherit = 'account.analytic.line'
_description = 'account analytic line'
_columns = {
'create_date' : fields.datetime('Create Date', readonly=True),
}
}
account_analytic_line()
class hr_analytic_issue(osv.osv):
_inherit = 'hr.analytic.timesheet'
_description = 'hr analytic timesheet'
_columns = {
'issue_id' : fields.many2one('project.issue', 'Issue'),
}
hr_analytic_issue()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -17,7 +17,6 @@
<field name="account_id" invisible="0" domain="[('partner_id', '=', parent.partner_id)]" on_change="on_change_account_id(account_id)"/>
<field name="name"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
<field invisible="1" name="journal_id"/>
<field invisible="1" name="product_id"/>
<field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>

View File

@ -403,7 +403,6 @@
<field name="date_start">2010-02-24 05:00:00</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -422,7 +421,6 @@
<field name="date_start">2010-02-25 15:38:08</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -441,7 +439,6 @@
<field name="date_start">2010-02-25 15:42:42</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -460,7 +457,6 @@
<field name="date_start">2010-02-25 15:51:00</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -479,7 +475,6 @@
<field name="date_start">2010-02-25 15:54:42</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -498,7 +493,6 @@
<field name="date_start">2010-02-25 15:55:11</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -517,7 +511,6 @@
<field name="date_start">2010-02-25 15:57:48</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -536,7 +529,6 @@
<field name="date_start">2010-02-25 16:04:16</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -555,7 +547,6 @@
<field name="date_start">2010-02-25 16:05:43</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -574,7 +565,6 @@
<field name="date_start">2010-02-25 16:06:52</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -593,7 +583,6 @@
<field name="date_start">2010-02-25 16:11:40</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -611,7 +600,6 @@
<field name="date_start">2010-02-25 16:13:10</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -629,7 +617,6 @@
<field name="date_start">2010-02-25 16:14:32</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -647,7 +634,6 @@
<field name="date_start">2010-02-25 16:15:38</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -665,7 +651,6 @@
<field name="date_start">2010-02-25 16:17:04</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -683,7 +668,6 @@
<field name="date_start">2010-02-25 16:17:42</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -701,7 +685,6 @@
<field name="date_start">2010-02-25 16:21:15</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -719,7 +702,6 @@
<field name="date_start">2010-02-25 16:22:09</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -737,7 +719,6 @@
<field name="date_start">2010-02-25 16:36:02</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -756,7 +737,6 @@
<field name="date_start">2010-02-25 16:36:43</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -775,7 +755,6 @@
<field name="date_start">2010-02-25 17:22:46</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -794,7 +773,6 @@
<field name="date_start">2010-02-25 17:34:32</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -813,7 +791,6 @@
<field name="date_start">2010-02-25 17:35:46</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -832,7 +809,6 @@
<field name="date_start">2010-02-25 17:36:27</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -851,7 +827,6 @@
<field name="date_start">2010-02-25 17:37:03</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>
@ -871,7 +846,6 @@
<field name="date_start">2010-03-01 12:00:00</field>
<field name="company_id" ref="base.main_company"/>
<field name="priority">2</field>
<field name="state">draft</field>
<field name="project_id" ref="project_project_openerpwebsitedevelopment0"/>
<field eval="[(6, 0, [])]" name="child_ids"/>
<field eval="[(6, 0, [])]" name="parent_ids"/>