merged from trunk
bzr revid: apa@tinyerp.com-20100527102427-1iwaftktctjywxy0
This commit is contained in:
@@ -47,6 +47,8 @@ class project(osv.osv):
|
||||
_inherits = {'account.analytic.account':"category_id"}
|
||||
|
||||
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
|
||||
if context is None:
|
||||
context = {}
|
||||
if user == 1:
|
||||
return super(project, self).search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
|
||||
if context and context.has_key('user_prefence') and context['user_prefence']:
|
||||
@@ -266,13 +268,11 @@ class task(osv.osv):
|
||||
hours = dict(cr.fetchall())
|
||||
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]['progress'] = 0.0
|
||||
if (task.remaining_hours + hours.get(task.id, 0.0)):
|
||||
if task.state =='done':
|
||||
res[task.id]['progress'] = 100.0
|
||||
else:
|
||||
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)
|
||||
else:
|
||||
res[task.id]['progress'] = 0.0
|
||||
|
||||
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
|
||||
@@ -559,6 +559,8 @@ class config_compute_remaining(osv.osv_memory):
|
||||
}
|
||||
|
||||
def compute_hours(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
task_obj = self.pool.get('project.task')
|
||||
request = self.pool.get('res.request')
|
||||
if 'active_id' in context:
|
||||
|
||||
@@ -31,8 +31,10 @@
|
||||
'author': 'Tiny',
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': [
|
||||
'crm',
|
||||
'project',
|
||||
'hr_timesheet_sheet',
|
||||
'project_long_term',
|
||||
],
|
||||
'init_xml': [
|
||||
'project_issue_data.xml'
|
||||
|
||||
@@ -113,7 +113,6 @@ class project_issue(osv.osv, crm.crm_case):
|
||||
'thread_id': fields.many2one('mailgate.thread', 'Thread', required=False),
|
||||
'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),
|
||||
'date_deadline': fields.date('Deadline'),
|
||||
@@ -173,7 +172,6 @@ class project_issue(osv.osv, crm.crm_case):
|
||||
return False
|
||||
|
||||
_defaults = {
|
||||
'active': lambda *a: 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,
|
||||
|
||||
@@ -82,11 +82,8 @@
|
||||
<separator string="Statistics" colspan="2" col="2"/>
|
||||
<field name="day_open"/>
|
||||
<field name="day_close"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="References" colspan="2"/>
|
||||
<field name="id"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
<field name="log_ids" nolabel="1" colspan="4">
|
||||
<tree string="Logs">
|
||||
@@ -143,6 +140,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Issue Tracker Tree" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="id"/>
|
||||
<field name="create_date"/>
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="priority" string="Severity"/>
|
||||
@@ -155,6 +153,7 @@
|
||||
states="open,draft,pending,done,cancel" />
|
||||
<field name="type_id" string="Version"/>
|
||||
<field name="user_id"/>
|
||||
<field name="assigned_to"/>
|
||||
<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"/>
|
||||
@@ -172,21 +171,18 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Issue Tracker Search">
|
||||
<group>
|
||||
<group colspan="4" col="20">
|
||||
<filter icon="gtk-home" string=" Today "
|
||||
separator="1"
|
||||
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
|
||||
help="Todays's bugs"
|
||||
help="Today's bugs"
|
||||
/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days " separator="1"
|
||||
domain="[('date','<', time.strftime('%%Y-%%m-%%d')), ('date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Bugs during last 7 days"
|
||||
/>
|
||||
|
||||
</group>
|
||||
<separator orientation="vertical"/>
|
||||
<group>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" select='1' string="Subject"/>
|
||||
<field name="user_id" select="1" widget="selection"/>
|
||||
<field name="state" select="1">
|
||||
@@ -196,7 +192,7 @@
|
||||
<field name="project_id" select="1" widget="selection" string="Project"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="1" string="Group By..." colspan="16" groups="base.group_extended">
|
||||
<group expand="1" string="Group By..." colspan="4" col="20" groups="base.group_extended">
|
||||
<filter string="Stage" icon="terp-crm" domain="[]"
|
||||
context="{'group_by':'stage_id'}" />
|
||||
<filter string="Priority" icon="terp-crm" domain="[]"
|
||||
@@ -271,7 +267,7 @@
|
||||
<filter icon="gtk-home" string=" Today "
|
||||
separator="1"
|
||||
domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"
|
||||
help="Todays's features"
|
||||
help="Today's features"
|
||||
/>
|
||||
<filter icon="gtk-media-rewind"
|
||||
string=" 7 Days " separator="1"
|
||||
|
||||
@@ -27,13 +27,13 @@
|
||||
"depends" : ["project", "resource"],
|
||||
"description": """
|
||||
|
||||
Long Term Project management module that track planning, scheduling, resources allocation.
|
||||
Long Term Project management module that tracks planning, scheduling, resources allocation.
|
||||
Mainly used with Big project management.
|
||||
- Project Phases will be maintained by Manager of the project
|
||||
- Compute Phase Scheduling: Compute start date and end date of the phases which are in draft,open and pending state of the project given.
|
||||
If no project given then all the draft,open and pending states phases will be taken
|
||||
- Compute Task Scheduling: This works same as the scheduler button on project.phase. It takes the project as arguement and computes all the open,draft and pending tasks
|
||||
- Schedule Tasks: All the tasks which are in draft,pending and open states are scheduled with taking the phase's start date
|
||||
If no project given then all the draft,open and pending state phases will be taken
|
||||
- Compute Task Scheduling: This works same as the scheduler button on project.phase. It takes the project as argument and computes all the open,draft and pending tasks
|
||||
- Schedule Tasks: All the tasks which are in draft,pending and open state are scheduled with taking the phase's start date
|
||||
|
||||
""",
|
||||
"init_xml" : [],
|
||||
|
||||
@@ -33,7 +33,7 @@ class project_phase(osv.osv):
|
||||
data_phase = self.browse(cr, uid, ids[0], context=context)
|
||||
prev_ids = data_phase.previous_phase_ids
|
||||
next_ids = data_phase.next_phase_ids
|
||||
# it should nither be in prev_ids nor in next_ids
|
||||
# it should neither be in prev_ids nor in next_ids
|
||||
if (data_phase in prev_ids) or (data_phase in next_ids):
|
||||
return False
|
||||
ids = [id for id in prev_ids if id in next_ids]
|
||||
@@ -234,7 +234,7 @@ class project_resource_allocation(osv.osv):
|
||||
_columns = {
|
||||
'resource_id': fields.many2one('resource.resource', 'Resource', required=True),
|
||||
'phase_id': fields.many2one('project.phase', 'Project Phase', required=True),
|
||||
'useability': fields.float('Useability', help="Useability of this ressource for this project phase in percentage (=50%)"),
|
||||
'useability': fields.float('Usability', help="Usability of this resource for this project phase in percentage (=50%)"),
|
||||
}
|
||||
_defaults = {
|
||||
'useability': 100,
|
||||
|
||||
@@ -66,7 +66,7 @@ class report_intrastat(osv.osv):
|
||||
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
|
||||
'supply_units':fields.float('Supply Units', readonly=True),
|
||||
'ref':fields.char('Source document',size=64, readonly=True),
|
||||
'code': fields.char('Country code', size="2", readonly=True),
|
||||
'code': fields.char('Country code', size=2, readonly=True),
|
||||
'intrastat_id': fields.many2one('report.intrastat.code', 'Intrastat code', readonly=True),
|
||||
'weight': fields.float('Weight', readonly=True),
|
||||
'value': fields.float('Value', readonly=True),
|
||||
|
||||
Reference in New Issue
Block a user