Improved views
bzr revid: hda@tinyerp.com-20091029122637-ivzg394swp586k8x
This commit is contained in:
commit
a7a8066d42
|
@ -400,7 +400,6 @@
|
|||
<field name="date_deadline"/>
|
||||
<field name="remaining_hours" widget="float_time"/>
|
||||
<field name="progress" widget="progressbar"/>
|
||||
<field name="priority"/>
|
||||
<field name="state"/>
|
||||
<button name="do_open" states="pending,draft" string="Start Task" type="object" icon="gtk-execute" help="For changing to open state"/>
|
||||
<button groups="base.group_extended" name="%(wizard_delegate_task)d" states="pending,open,draft" string="Delegate" type="action" icon="gtk-execute" help="For changing to delegate state"/>
|
||||
|
@ -424,7 +423,6 @@
|
|||
<field name="date_deadline"/>
|
||||
<field name="remaining_hours" widget="float_time"/>
|
||||
<field name="progress" widget="progressbar"/>
|
||||
<field name="priority"/>
|
||||
<field name="state"/>
|
||||
<button name="do_open" states="pending,draft" string="Start Task" type="object" icon="gtk-execute" help="For changing to open state"/>
|
||||
<button groups="base.group_extended" name="%(wizard_delegate_task)d" states="pending,open,draft" string="Delegate" type="action" icon="gtk-execute" help="For changing to delegate state"/>
|
||||
|
|
|
@ -41,9 +41,10 @@ performing those tasks.
|
|||
'depends': ['project'],
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'project_gtd_data.xml',
|
||||
'project_gtd_view.xml',
|
||||
'project_gtd_wizard.xml'
|
||||
'project_gtd_wizard.xml',
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'demo_xml': ['project_gtd_demo.xml'],
|
||||
'installable': True,
|
||||
|
|
|
@ -25,27 +25,11 @@ from lxml import etree
|
|||
from mx import DateTime
|
||||
from mx.DateTime import now
|
||||
import time
|
||||
|
||||
import tools
|
||||
import netsvc
|
||||
from osv import fields, osv
|
||||
import ir
|
||||
|
||||
|
||||
class one2many_mod(fields.one2many):
|
||||
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None):
|
||||
if not context:
|
||||
context = {}
|
||||
res = {}
|
||||
num = name[4]
|
||||
for obj in obj.browse(cr, user, ids, context=context):
|
||||
res[obj.id] = []
|
||||
v = getattr(obj,'context'+num+'_id').id
|
||||
if v:
|
||||
ids2 = obj.pool.get(self._obj).search(cr, user, [(self._fields_id,'=',obj.id),('context_id','=',v)], limit=self._limit)
|
||||
for r in obj.pool.get(self._obj)._read_flat(cr, user, ids2, [self._fields_id], context=context, load='_classic_write'):
|
||||
res[r[self._fields_id]].append( r['id'] )
|
||||
return res
|
||||
|
||||
class project_gtd_context(osv.osv):
|
||||
_name = "project.gtd.context"
|
||||
_description = "Contexts"
|
||||
|
@ -58,37 +42,19 @@ class project_gtd_context(osv.osv):
|
|||
'sequence': lambda *args: 1
|
||||
}
|
||||
_order = "sequence, name"
|
||||
|
||||
project_gtd_context()
|
||||
|
||||
|
||||
class project_gtd_timebox(osv.osv):
|
||||
_name = "project.gtd.timebox"
|
||||
_order = "sequence"
|
||||
_columns = {
|
||||
'name': fields.char('Timebox', size=64, required=True, select=1),
|
||||
'user_id': fields.many2one('res.users', 'User', required=True, select=1),
|
||||
'child_ids': fields.one2many('project.gtd.timebox', 'parent_id', 'Child Timeboxes'),
|
||||
'parent_id': fields.many2one('project.gtd.timebox', 'Parent Timebox'),
|
||||
'task_ids': fields.one2many('project.task', 'timebox_id', 'Tasks'),
|
||||
'type': fields.selection([('daily','Daily'),('weekly','Weekly'),('monthly','Monthly'),('other','Other')], 'Type', required=True),
|
||||
'task1_ids': one2many_mod('project.task', 'timebox_id', 'Tasks'),
|
||||
'task2_ids': one2many_mod('project.task', 'timebox_id', 'Tasks'),
|
||||
'task3_ids': one2many_mod('project.task', 'timebox_id', 'Tasks'),
|
||||
'task4_ids': one2many_mod('project.task', 'timebox_id', 'Tasks'),
|
||||
'task5_ids': one2many_mod('project.task', 'timebox_id', 'Tasks'),
|
||||
'task6_ids': one2many_mod('project.task', 'timebox_id', 'Tasks'),
|
||||
'context1_id': fields.many2one('project.gtd.context', 'Context 1', required=True),
|
||||
'context2_id': fields.many2one('project.gtd.context', 'Context 2'),
|
||||
'context3_id': fields.many2one('project.gtd.context', 'Context 3'),
|
||||
'context4_id': fields.many2one('project.gtd.context', 'Context 4'),
|
||||
'context5_id': fields.many2one('project.gtd.context', 'Context 5'),
|
||||
'context6_id': fields.many2one('project.gtd.context', 'Context 6'),
|
||||
'col_project': fields.boolean('Project'),
|
||||
'col_date_start': fields.boolean('Date Start'),
|
||||
'col_priority': fields.boolean('Priority'),
|
||||
'col_deadline': fields.boolean('Deadline'),
|
||||
'col_planned_hours': fields.boolean('Planned Hours'),
|
||||
'col_effective_hours': fields.boolean('Effective Hours'),
|
||||
'sequence': fields.integer('Sequence'),
|
||||
'icon': fields.selection(tools.icons, 'Icon', size=64),
|
||||
}
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
res = super(project_gtd_timebox,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
|
||||
if (res['type']=='form') and ('record_id' in context):
|
||||
|
@ -141,15 +107,7 @@ class project_gtd_timebox(osv.osv):
|
|||
res['arch'] = xarch
|
||||
res['fields'] = xfields
|
||||
return res
|
||||
_defaults = {
|
||||
'type': lambda *args: 'daily',
|
||||
'col_project': lambda *args: True,
|
||||
'col_date_start': lambda *args: True,
|
||||
'col_priority': lambda *args: True,
|
||||
'col_deadline': lambda *args: False,
|
||||
'col_planned_hours': lambda *args: True,
|
||||
'col_effective_hours': lambda *args: False
|
||||
}
|
||||
|
||||
project_gtd_timebox()
|
||||
|
||||
class project_task(osv.osv):
|
||||
|
@ -158,12 +116,14 @@ class project_task(osv.osv):
|
|||
'timebox_id': fields.many2one('project.gtd.timebox', "Timebox"),
|
||||
'context_id': fields.many2one('project.gtd.context', "Context"),
|
||||
}
|
||||
|
||||
def copy_data(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
default = {}
|
||||
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)
|
||||
return ids and ids[0] or False
|
||||
|
@ -172,37 +132,55 @@ class project_task(osv.osv):
|
|||
}
|
||||
|
||||
def next_timebox(self, cr, uid, ids, *args):
|
||||
for timebox in self.browse(cr, uid , ids):
|
||||
if timebox.timebox_id.type=='daily':
|
||||
timebox_ids = self.pool.get('project.gtd.timebox').search(cr, uid, [('type','=','weekly')])
|
||||
if timebox_ids:
|
||||
self.write(cr, uid, ids, {'timebox_id' : timebox_ids[0]})
|
||||
if timebox.timebox_id.type=='weekly':
|
||||
timebox_ids = self.pool.get('project.gtd.timebox').search(cr, uid, [('type','=','monthly')])
|
||||
if timebox_ids:
|
||||
self.write(cr, uid, ids, {'timebox_id' : timebox_ids[0]})
|
||||
if timebox.timebox_id.type=='monthly':
|
||||
timebox_ids = self.pool.get('project.gtd.timebox').search(cr, uid, [('type','=','other')])
|
||||
if timebox_ids:
|
||||
self.write(cr, uid, ids, {'timebox_id':timebox_ids[0]})
|
||||
timebox_obj = self.pool.get('project.gtd.timebox')
|
||||
timebox_ids = timebox_obj.search(cr,uid,[])
|
||||
for task in self.browse(cr,uid,ids):
|
||||
timebox = task.timebox_id.id
|
||||
if timebox and timebox_ids.index(timebox) != len(timebox_ids)-1 :
|
||||
index = timebox_ids.index(timebox)
|
||||
else:
|
||||
index = -1
|
||||
self.write(cr, uid, task.id, {'timebox_id': timebox_ids[index+1]})
|
||||
return True
|
||||
|
||||
def prev_timebox(self, cr, uid, ids, *args):
|
||||
for timebox in self.browse(cr, uid , ids):
|
||||
if timebox.timebox_id.type=='other':
|
||||
timebox_ids = self.pool.get('project.gtd.timebox').search(cr, uid, [('type','=','monthly')])
|
||||
if timebox_ids:
|
||||
self.write(cr, uid, ids, {'timebox_id' : timebox_ids[0]})
|
||||
if timebox.timebox_id.type=='monthly':
|
||||
timebox_ids = self.pool.get('project.gtd.timebox').search(cr, uid, [('type','=','weekly')])
|
||||
if timebox_ids:
|
||||
self.write(cr, uid, ids, {'timebox_id' : timebox_ids[0]})
|
||||
if timebox.timebox_id.type=='weekly':
|
||||
timebox_ids = self.pool.get('project.gtd.timebox').search(cr, uid, [('type','=','daily')])
|
||||
if timebox_ids:
|
||||
self.write(cr, uid, ids, {'timebox_id':timebox_ids[0]})
|
||||
timebox_obj = self.pool.get('project.gtd.timebox')
|
||||
timebox_ids = timebox_obj.search(cr,uid,[])
|
||||
for task in self.browse(cr,uid,ids):
|
||||
timebox = task.timebox_id.id
|
||||
if timebox and timebox_ids.index(timebox) != 0 :
|
||||
index = timebox_ids.index(timebox)
|
||||
else:
|
||||
index = len(timebox_ids)
|
||||
self.write(cr, uid, task.id, {'timebox_id': timebox_ids[index - 1]})
|
||||
return True
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
res = super(project_task,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
|
||||
search_extended = False
|
||||
if res['type'] == 'search':
|
||||
search_extended ='''<newline/> <group colspan="2">'''
|
||||
timebox_obj = self.pool.get('project.gtd.timebox')
|
||||
for time in timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[])):
|
||||
if time.icon:
|
||||
icon = time.icon
|
||||
else :
|
||||
icon=""
|
||||
search_extended += ''' <filter domain="[('timebox_id','=', ''' + str(time.id) + ''')]" help = "Task Related to ''' + time.name + ''' Timeboxs" icon="''' + icon + '''" string="''' + time.name + '''"/>'''
|
||||
search_extended += '''</group>
|
||||
<group colspan="2">
|
||||
<field name="context_id" select="1" widget="selection"/>
|
||||
<field name="priority" select="1"/>
|
||||
</group>
|
||||
</search> '''
|
||||
if search_extended:
|
||||
res['arch'] = res['arch'].replace('</search>',search_extended)
|
||||
attrs_sel = self.pool.get('project.gtd.context').name_search(cr, uid, '', [], context=context)
|
||||
context_id_info = self.pool.get('project.task').fields_get(cr, uid, ['context_id'])
|
||||
context_id_info['context_id']['selection'] = attrs_sel
|
||||
res['fields'].update(context_id_info)
|
||||
return res
|
||||
|
||||
# Override read for using this method if context set !!!
|
||||
#_order = "((55-ascii(coalesce(priority,'2')))*2 + coalesce((date_start::date-current_date)/2,8))"
|
||||
project_task()
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="res.groups" id="group_project_getting">
|
||||
<field name="name">Project / Getting</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -25,51 +25,19 @@
|
|||
|
||||
<record model="project.gtd.timebox" id="timebox_daily">
|
||||
<field name="name">Daily</field>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="type">daily</field>
|
||||
<field name="context1_id" ref="context_office"/>
|
||||
<field name="context2_id" ref="context_car"/>
|
||||
<field name="context3_id" ref="context_travel"/>
|
||||
<field name="context4_id" ref="context_home"/>
|
||||
<field name="col_project" eval="False"/>
|
||||
<field name="col_effective_hours" eval="True"/>
|
||||
<field name="col_date_start" eval="False"/>
|
||||
<field name="icon">terp-hr</field>
|
||||
</record>
|
||||
<record model="project.gtd.timebox" id="timebox_weekly">
|
||||
<field name="name">Weekly</field>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="parent_id" ref="timebox_daily"/>
|
||||
<field name="type">weekly</field>
|
||||
<field name="context1_id" ref="context_office"/>
|
||||
<field name="context2_id" ref="context_car"/>
|
||||
<field name="context3_id" ref="context_travel"/>
|
||||
<field name="context4_id" ref="context_home"/>
|
||||
<field name="col_deadline" eval="True"/>
|
||||
<field name="col_effective_hours" eval="True"/>
|
||||
<field name="icon">terp-partner</field>
|
||||
</record>
|
||||
<record model="project.gtd.timebox" id="timebox_monthly">
|
||||
<field name="name">Monthly</field>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="type">other</field>
|
||||
<field name="parent_id" ref="timebox_weekly"/>
|
||||
<field name="context1_id" ref="context_office"/>
|
||||
<field name="context2_id" ref="context_car"/>
|
||||
<field name="context3_id" ref="context_travel"/>
|
||||
<field name="context4_id" ref="context_home"/>
|
||||
<field name="col_deadline" eval="True"/>
|
||||
<field name="col_effective_hours" eval="True"/>
|
||||
<field name="icon">terp-product</field>
|
||||
</record>
|
||||
<record model="project.gtd.timebox" id="timebox_lt">
|
||||
<field name="name">Long Term</field>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="type">other</field>
|
||||
<field name="parent_id" ref="timebox_monthly"/>
|
||||
<field name="context1_id" ref="context_office"/>
|
||||
<field name="context2_id" ref="context_car"/>
|
||||
<field name="context3_id" ref="context_travel"/>
|
||||
<field name="context4_id" ref="context_home"/>
|
||||
<field name="col_deadline" eval="True"/>
|
||||
<field name="col_effective_hours" eval="True"/>
|
||||
<field name="icon">terp-project</field>
|
||||
</record>
|
||||
|
||||
<record id="project.project_task_116" model="project.task">
|
||||
|
@ -104,6 +72,6 @@
|
|||
<field name="project_id" ref="project.project_project_22"/>
|
||||
<field name="name">Validation + latest modifications.</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1,204 +1,74 @@
|
|||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="view_gtd_context_tree">
|
||||
<field name="name">project.gtd.context.tree</field>
|
||||
<field name="model">project.gtd.context</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Context">
|
||||
<field name="name"/>
|
||||
<field name="project_default_id"/>
|
||||
</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>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Context">
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="project_default_id"/>
|
||||
</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>
|
||||
</record>
|
||||
|
||||
<menuitem name="Time Management" id="menu_open_gtd_time" parent="project.menu_definitions" groups="group_project_getting"/>
|
||||
<menuitem name="Contexts" id="menu_open_gtd_time_contexts" groups="group_project_getting" parent="menu_open_gtd_time" action="open_gtd_context_tree"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_gtd_context_tree">
|
||||
<field name="name">project.gtd.context.tree</field>
|
||||
<field name="model">project.gtd.context</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Context">
|
||||
<field name="name"/>
|
||||
<field name="project_default_id"/>
|
||||
</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>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Context">
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="project_default_id"/>
|
||||
</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>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="view_gtd_timebox_tree">
|
||||
<field name="name">project.gtd.timebox.tree</field>
|
||||
<field name="model">project.gtd.timebox</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Timebox">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="icon"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Time Management" id="menu_open_gtd_time" parent="project.menu_definitions"/>
|
||||
<menuitem name="Contexts" id="menu_open_gtd_time_contexts" parent="menu_open_gtd_time" action="open_gtd_context_tree"/>
|
||||
<record model="ir.ui.view" id="view_gtd_timebox_form">
|
||||
<field name="name">project.gtd.timebox.form</field>
|
||||
<field name="model">project.gtd.timebox</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Timeboxes">
|
||||
<separator string="Timebox Definition" colspan="4"/>
|
||||
<field name="name"/>
|
||||
<field name="sequence"/>
|
||||
<field name="icon"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_gtd_timebox_tree">
|
||||
<field name="name">project.gtd.timebox.tree</field>
|
||||
<field name="model">project.gtd.timebox</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="field_parent">child_ids</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Timebox">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="user_id"/>
|
||||
<field name="parent_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="open_gtd_timebox_tree">
|
||||
<field name="name">Timeboxes</field>
|
||||
<field name="res_model">project.gtd.timebox</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_gtd_timebox_tree"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_gtd_timebox_form">
|
||||
<field name="name">project.gtd.timebox.form</field>
|
||||
<field name="model">project.gtd.timebox</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Timeboxes">
|
||||
<separator string="Timebox Definition" colspan="4"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="user_id"/>
|
||||
<field name="parent_id"/>
|
||||
<separator string="Contexts" colspan="4"/>
|
||||
<field name="context1_id"/><newline/>
|
||||
<field name="context2_id"/><newline/>
|
||||
<field name="context3_id"/><newline/>
|
||||
<field name="context4_id"/><newline/>
|
||||
<field name="context5_id"/><newline/>
|
||||
<field name="context6_id"/>
|
||||
<separator string="Visible Columns" colspan="4"/>
|
||||
<field name="col_project"/>
|
||||
<field name="col_date_start"/>
|
||||
<field name="col_priority"/>
|
||||
<field name="col_deadline"/>
|
||||
<field name="col_planned_hours"/>
|
||||
<field name="col_effective_hours"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="open_gtd_timebox_tree">
|
||||
<field name="name">Timeboxes</field>
|
||||
<field name="res_model">project.gtd.timebox</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field name="domain">[('parent_id','=',False)]</field>
|
||||
</record>
|
||||
<record model="ir.actions.act_window" id="open_gtd_timebox_tree_my">
|
||||
<field name="name">My Timeboxes</field>
|
||||
<field name="res_model">project.gtd.timebox</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Timeboxes" id="menu_open_gtd_time_timeboxes" parent="menu_open_gtd_time" action="open_gtd_timebox_tree"/>
|
||||
<menuitem name="My Timeboxes" id="menu_open_gtd_time_my_timeboxes" parent="menu_open_gtd_time_timeboxes" action="open_gtd_timebox_tree_my"/>
|
||||
|
||||
<record model="ir.ui.view" id="task_inbox_view">
|
||||
<field name="name">project.task.gtd.inbox.tree</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="priority" eval="20"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Tasks" editable="bottom" colors="blue:timebox_id">
|
||||
<field name="name"/>
|
||||
<field name="timebox_id" required="1" domain="[('user_id','=',uid)]"/>
|
||||
<button name="next_timebox" string="Next Timebox" type="object" icon="gtk-indent" attrs="{'invisible':[('timebox_id.type','=','other')]}"/>
|
||||
<button name="prev_timebox" string="Previous Timebox" type="object" icon="gtk-indent" attrs="{'invisible':[('timebox_id.type','=','daily')]}"/>
|
||||
<field name="context_id" required="1"/>
|
||||
<field name="date_start"/>
|
||||
<field name="priority"/>
|
||||
<field name="date_deadline"/>
|
||||
<field name="planned_hours" widget="float_time" sum="Planned"
|
||||
on_change="onchange_planned(planned_hours,effective_hours)"/>
|
||||
<field name="remaining_hours" invisible="1"/>
|
||||
<field name="effective_hours" invisible="1"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_project_gtd_inbox_filter" model="ir.ui.view">
|
||||
<field name="name">project.task.gtd.inbox.select</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search timebox">
|
||||
<group col='6' colspan='4'>
|
||||
<filter icon="terp-project" string="Inbox" domain="[('user_id','=',uid)]" help="Inbox"/>
|
||||
<field name="timebox_id" select="1" widget="selection">
|
||||
<filter string="Daily Timebox" domain="[('timebox_id.type','=','daily')]" help="Daily Timebox"/>
|
||||
</field>
|
||||
<field name="context_id" select="1" widget="selection">
|
||||
<filter icon="terp-project" domain="[('context_id.name','=','Office')]" help="Office Context"/>
|
||||
<filter icon="terp-project" domain="[('context_id.name','=','Car')]" help="Car Context"/>
|
||||
<filter icon="terp-project" domain="[('context_id.name','=','Travel')]" help="Travel Context"/>
|
||||
<filter icon="terp-project" domain="[('context_id.name','=','Home')]" help="Home Context"/>
|
||||
</field>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select='1'/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="open_gtd_task_inbox">
|
||||
<field name="name">My Inbox</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="domain">[('user_id','=',uid),('state','in',('open','draft'))]</field>
|
||||
<field name="context">{'gtd_sort':True}</field>
|
||||
<field name="view_id" ref="task_inbox_view"/>
|
||||
<field name="search_view_id" ref="view_project_gtd_inbox_filter"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Time Management" id="menu_open_time" parent="project.menu_main"/>
|
||||
<menuitem name="My Inbox" id="menu_open_time_myinbox" parent="menu_open_time" action="open_gtd_task_inbox"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_gtd_timebox_treelist">
|
||||
<field name="name">project.gtd.timebox.treelist</field>
|
||||
<field name="model">project.gtd.timebox</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="field_parent">child_ids</field>
|
||||
<field name="priority">50</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Timeboxes">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window" id="open_gtd_timebox_all">
|
||||
<field name="name">My Timeboxes</field>
|
||||
<field name="res_model">project.gtd.timebox</field>
|
||||
<field name="domain">[('user_id','=',uid),('parent_id','=',False)]</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field name="view_id" ref="view_gtd_timebox_treelist"/>
|
||||
<field name="context">{'record_id':False}</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
name="My Timeboxes"
|
||||
id="menu_open_time_allinbox"
|
||||
parent="menu_open_time"
|
||||
action="open_gtd_timebox_all"/>
|
||||
<menuitem name="Timeboxes" id="menu_open_gtd_time_timeboxes" parent="menu_open_gtd_time" action="open_gtd_timebox_tree"/>
|
||||
|
||||
<record id="view_task_search_form" model="ir.ui.view">
|
||||
<field name="name">project.task.search.form</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="type">search</field>
|
||||
<field name="inherit_id" ref="project.view_task_search_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Task Edition">
|
||||
<group col="6" colspan="4">
|
||||
<field name="timebox_id" select="1" widget="selection">
|
||||
<filter string="Daily Timebox" domain="[('timebox_id.type','=','daily')]" help="Daily Timebox"/>
|
||||
<filter string="Inbox" domain="[('user_id','=',uid)]" help="Inbox"/>
|
||||
</field>
|
||||
<field name="context_id" select="1" widget="selection"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="project_task_tree">
|
||||
<field name="name">project.task.tree.timebox</field>
|
||||
<field name="model">project.task</field>
|
||||
|
@ -219,15 +89,59 @@
|
|||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="project.view_task_form2" />
|
||||
<field name="arch" type="xml">
|
||||
<notebook>
|
||||
<page string="TimeBox Configuration" position="inside">
|
||||
<separator string="Getting Things Done" colspan="4"/>
|
||||
<field name="context_id" select="2"/>
|
||||
<field name="timebox_id" select="1" domain="[('user_id', '=', uid)]"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<field name="progress" position="after">
|
||||
<newline/>
|
||||
<separator string="Getting Things Done" colspan="6"/>
|
||||
<newline/>
|
||||
<field name="context_id" select="2" widget="selection"/>
|
||||
<field name="timebox_id" select="1"/>
|
||||
<newline/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_project_task_tree2" model="ir.ui.view">
|
||||
<field name="name">project.task.tree</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="type">tree</field>
|
||||
<field eval="2" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="top" colors="grey:state in ('cancel','done');blue:remaining_hours<0;red:bool(date_deadline) & (date_deadline<current_date) & (state in ('draft','open'))" string="Tasks">
|
||||
<field name="sequence" string="Seq."/>
|
||||
<field name="name"/>
|
||||
<field name="project_id" icon="gtk-indent"/>
|
||||
<field name="user_id"/>
|
||||
<field name="date_deadline"/>
|
||||
<field name="remaining_hours" widget="float_time"/>
|
||||
<field name="progress" widget="progressbar"/>
|
||||
<field name="context_id" select="2" />
|
||||
<field name="timebox_id" select="1"/>
|
||||
<button name="next_timebox" string="Next Timebox" type="object" icon="gtk-print" />
|
||||
<button name="prev_timebox" string="Previous Timebox" type="object" icon="gtk-indent"/>
|
||||
<field name="priority"/>
|
||||
<field name="state"/>
|
||||
<button name="do_draft" states="open" string="Draft" type="object" icon="gtk-indent" help="For changing to draft state"/>
|
||||
<button name="do_open" states="pending,draft" string="Start Task" type="object" icon="gtk-execute" help="For changing to open state"/>
|
||||
<button name="do_reopen" states="done,cancelled" string="Reactivate" type="object" icon="gtk-convert" help="For reopening the tasks"/>
|
||||
<button name="do_pending" states="open" string="Pending" type="object" icon="gtk-media-pause" help="For changing to pending state"/>
|
||||
<button groups="base.group_extended" name="%(project.wizard_delegate_task)d" states="pending,open,draft" string="Delegate" type="action" icon="gtk-execute" help="For changing to delegate state"/>
|
||||
<button name="%(project.wizard_close_task)d" states="pending,open" string="Done" type="action" icon="gtk-jump-to" help="For changing to done state"/>
|
||||
<button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel" help="For cancelling the task"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_prject_task_tree">
|
||||
<field name="name">project.task</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_project_task_tree2"/>
|
||||
<field name="search_view_id" ref="project.view_task_search_form"/>
|
||||
</record>
|
||||
|
||||
<menuitem name="Tasks Inbox" groups="group_project_getting" id="menu_task_inbox" parent="project.menu_main" action="action_prject_task_tree"/>
|
||||
|
||||
<act_window name="My Inbox"
|
||||
domain="[('user_id', '=', uid),('state','in',('draft','open'))]"
|
||||
|
@ -267,23 +181,5 @@
|
|||
view_mode="tree,form"
|
||||
id="act_timebox_tasks"/>
|
||||
|
||||
<record id="project_normal_action_tree" model="ir.actions.act_window">
|
||||
<field name="name">TimeBox</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">project.task</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('timebox_id','child_of',[active_id])]</field>
|
||||
<field name="context">{'timebox_id':active_id}</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_project_category_open" model="ir.values">
|
||||
<field eval="'tree_but_open'" name="key2"/>
|
||||
<field eval="'project.gtd.timebox'" name="model"/>
|
||||
<field name="name">Tasks by Timebox</field>
|
||||
<field eval="'ir.actions.act_window,%d'%project_normal_action_tree" name="value"/>
|
||||
<field eval="True" name="object"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -5,12 +5,11 @@
|
|||
<wizard string="My Daily Timebox"
|
||||
model="project.gtd.timebox"
|
||||
name="project.gtd.timebox.daily"
|
||||
multi="True"
|
||||
id="open_gtd_timebox_daily"/>
|
||||
|
||||
<menuitem name="My Daily Timebox" id="menu_open_time_daily_inbox"
|
||||
parent="menu_open_time" action="open_gtd_timebox_daily"
|
||||
icon="STOCK_JUSTIFY_FILL" type="wizard"/>
|
||||
<!-- <menuitem name="My Daily Timebox" id="menu_open_time_daily_inbox" -->
|
||||
<!-- parent="menu_open_time" action="open_gtd_timebox_daily"-->
|
||||
<!-- icon="STOCK_JUSTIFY_FILL" type="wizard"/>-->
|
||||
|
||||
<wizard string="Plannify Timebox"
|
||||
model="project.gtd.timebox"
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_project_gtd_context,project.gtd.context,model_project_gtd_context,project.group_project_user,1,1,1,1
|
||||
access_project_gtd_timebox,project.gtd.timebox,model_project_gtd_timebox,project.group_project_user,1,1,1,1
|
||||
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
|
||||
"access_project_gtd_context","project.gtd.context","model_project_gtd_context","group_project_getting",1,1,1,1
|
||||
"access_project_gtd_timebox","project.gtd.timebox","model_project_gtd_timebox","group_project_getting",1,1,1,1
|
||||
|
|
|
|
@ -29,16 +29,13 @@ from tools.translate import _
|
|||
|
||||
class wiz_timebox_open(wizard.interface):
|
||||
def _open_timebox(self, cr, uid, data, context):
|
||||
tbtype = 'daily'
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
ids = pool.get('project.gtd.timebox').search(cr, uid, [('user_id','=',uid),('type','=',tbtype)])
|
||||
ids = pool.get('project.gtd.timebox').search(cr, uid, [])
|
||||
if not len(ids):
|
||||
raise wizard.except_wizard(_('Error !'), _('No timebox of the type "%s" defined !') % (tbtype,))
|
||||
view_type = 'form,tree'
|
||||
if len(ids) >= 1:
|
||||
domain = "[('id','in',["+','.join(map(str, ids))+"])]"
|
||||
else:
|
||||
domain = "[('user_id', '=', uid)]"
|
||||
value = {
|
||||
'domain': domain,
|
||||
'name': 'My Daily Timebox',
|
||||
|
|
|
@ -30,7 +30,7 @@ from tools.translate import _
|
|||
class wiz_timebox_empty(wizard.interface):
|
||||
def _empty(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
ids = pool.get('project.gtd.timebox').search(cr, uid, [('parent_id','=',data['id'])])
|
||||
ids = pool.get('project.gtd.timebox').search(cr, uid, [])
|
||||
if not len(ids):
|
||||
raise wizard.except_wizard(_('Error !'), _('No timebox child of this one !'))
|
||||
tids = pool.get('project.task').search(cr, uid, [('timebox_id','=',data['id'])])
|
||||
|
|
|
@ -41,7 +41,7 @@ _gtd_arch = """
|
|||
class wiz_timebox_fill(wizard.interface):
|
||||
def _fill(self, cr, uid, data, context):
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
ids = pool.get('project.gtd.timebox').search(cr, uid, [('parent_id','=',data['id']),('user_id','=',uid)], context=context)
|
||||
ids = pool.get('project.gtd.timebox').search(cr, uid, [], context=context)
|
||||
return {
|
||||
'timebox_id': ids and ids[0] or False,
|
||||
'timebox_to_id': data['id']
|
||||
|
|
Loading…
Reference in New Issue