Skip to content
Snippets Groups Projects
Commit 50e4c783 authored by Harshad Modi's avatar Harshad Modi
Browse files

[MERGE]

bzr revid: hmo@tinyerp.com-20101015142524-8r31ieysjbo794s7
parents 40f4295a 7c80d515
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0"?>
<openerp>
<data>
<menuitem id="base.menu_mail_gateway" name="Email"
parent="base.menu_base_config" sequence="1" />
<record model="ir.ui.view" id="view_mailgate_message_form">
<field name="name">mailgate.message.form</field>
<field name="model">mailgate.message</field>
......@@ -85,6 +89,20 @@
</field>
</record>
<record id="action_view_mail_message" model="ir.actions.act_window">
<field name="name">Message</field>
<field name="res_model">mailgate.message</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_mailgate_message_search"/>
</record>
<record model="ir.ui.view" id="view_mailgate_thread_form">
<field name="name">mailgate.thread.form</field>
<field name="model">mailgate.thread</field>
......@@ -134,6 +152,9 @@
</field>
</record>
<!-- Emails action-->
<record model="ir.actions.act_window" id="action_view_mailgate_thread">
<field name="name">Mailgateway Threads</field>
......@@ -192,5 +213,8 @@
src_model="mailgate.message"
domain="[('res_id', '=', res_id),('res_model','=',model)]"/>
<menuitem id="menu_email_gateway_form"
parent="base.menu_mail_gateway" action="action_view_mail_message" />
</data>
</openerp>
......@@ -189,13 +189,13 @@ class project(osv.osv):
'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.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),
'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.", states={'close':[('readonly',True)], 'cancelled':[('readonly',True)]}),
'tasks': fields.one2many('project.task', 'project_id', "Project tasks"),
'planned_hours': fields.function(_progress_rate, multi="progress", method=True, string='Planned Time', help="Sum of planned hours of all tasks related to this project and its child projects.",
'planned_hours': fields.function(_progress_rate, multi="progress", method=True, string='Planned Time', help="Sum of planned hours of all tasks related to this project and its child projects.",
store = {
'project.project': (lambda self, cr, uid, ids, c={}: ids, ['tasks'], 10),
'project.task': (_get_project_task, ['planned_hours', 'effective_hours', 'remaining_hours', 'total_hours', 'progress', 'delay_hours'], 10),
'project.task.work': (_get_project_work, ['hours'], 10),
}),
'effective_hours': fields.function(_progress_rate, multi="progress", method=True, string='Time Spent', help="Sum of spent hours of all tasks related to this project and its child projects.",
'effective_hours': fields.function(_progress_rate, multi="progress", method=True, string='Time Spent', help="Sum of spent hours of all tasks related to this project and its child projects.",
store = {
'project.project': (lambda self, cr, uid, ids, c={}: ids, ['tasks'], 10),
'project.task': (_get_project_task, ['planned_hours', 'effective_hours', 'remaining_hours', 'total_hours', 'progress', 'delay_hours'], 10),
......@@ -395,10 +395,15 @@ class task(osv.osv):
if hours.get(task.id, False):
dur_in_user_uom = uom_obj._compute_qty(cr, uid, default_uom, hours.get(task.id, 0.0), user_uom)
hours[task.id] = dur_in_user_uom
timespent=0
for task in self.browse(cr, uid, ids, context=context):
res[task.id] = {'effective_hours': hours.get(task.id, 0.0), 'total_hours': task.remaining_hours + hours.get(task.id, 0.0)}
res[task.id]['delay_hours'] = res[task.id]['total_hours'] - task.planned_hours
# res[task.id]['delay_hours'] = res[task.id]['total_hours'] - task.planned_hours
for ctimespent in task.work_ids:
timespent=timespent+ctimespent.hours
res[task.id]['delay_hours'] = task.planned_hours - timespent
res[task.id]['progress'] = 0.0
if (task.remaining_hours + hours.get(task.id, 0.0)):
res[task.id]['progress'] = round(min(100.0 * hours.get(task.id, 0.0) / res[task.id]['total_hours'], 99.99),2)
......@@ -463,7 +468,7 @@ class task(osv.osv):
'description': fields.text('Description'),
'priority': fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Priority'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of tasks."),
'type_id': fields.many2one('project.task.type', 'Stage',),
'type_id': fields.many2one('project.task.type', 'Type',),
'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\
\n If the task is over, the states is set to \'Done\'.'),
......
......@@ -305,13 +305,15 @@
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<tree colors="grey:state in ('cancelled','done');blue:remaining_hours&lt;0 and state in ('pending');red:date_deadline and (date_deadline&lt;current_date) and (state in ('draft','open'))" string="Tasks">
<field name="id"/>
<field name="sequence" invisible="not context.get('seq_visible', False)"/>
<field name="name"/>
<field name="project_id" icon="gtk-indent" domain="['|',('user_id','=',uid),('members','=',uid)]" invisible="context.get('user_invisible', False)"/>
<field name="user_id" invisible="context.get('user_invisible', False)"/>
<field name="delegated_user_id" invisible="context.get('show_delegated', True)"/>
<field name="remaining_hours" widget="float_time" sum="Remaining Hours" on_change="onchange_remaining(remaining_hours,planned_hours)"/>
<field name="planned_hours" widget="float_time" invisible="1"/>
<field name="planned_hours"/>
<field name="delay_hours"/>
<field name="date_deadline" invisible="context.get('set_visible',False)"/>
<field name="type_id" groups="base.group_extended" invisible="context.get('set_visible',False)"/>
<button name="next_type" invisible="context.get('set_visible',False)"
......@@ -325,7 +327,7 @@
<field name="date_end" invisible="1"/>
<field name="progress" widget="progressbar" invisible="context.get('set_visible',False)"/>
<field name="state" invisible="context.get('set_visible',False)"/>
<button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel" help="For cancelling the task"/>
<button name="do_cancel" states="draft,open,pending" string="Cancel" type="object" icon="gtk-cancel" help="For cancelling the task"/>
<button name="do_open" states="pending,draft,done,cancel" string="Start Task" type="object" icon="gtk-execute" help="For changing to open state" invisible="context.get('set_visible',False)"/>
<button groups="base.group_extended" name="%(action_project_task_delegate)d" states="pending,open,draft" string="Delegate" type="action" icon="gtk-sort-descending" help="For changing to delegate state"/>
<button name="action_close" states="draft,pending,open" string="Done" type="object" icon="terp-dialog-close" help="For changing to done state"/>
......@@ -500,7 +502,7 @@
<act_window context="{'search_default_user_id': [active_id]}" id="act_res_users_2_project_project" name="User's projects" res_model="project.project" src_model="res.users" view_mode="tree,form" view_type="form"/>
<act_window
context="{'search_default_project_id': [active_id]}"
domain="[('project_id', '=', active_id)]"
id="act_project_project_2_project_task_all"
name="Tasks"
res_model="project.task"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment