[MERGE] merge pap branch for the project related changes

bzr revid: mra@mra-laptop-20100701090844-6x9lqvultagarq2l
This commit is contained in:
Mustufa Rangwala 2010-07-01 14:38:44 +05:30
commit fc502ff3c4
8 changed files with 56 additions and 40 deletions

View File

@ -206,6 +206,7 @@ class project(osv.osv):
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 ??
context.update({'analytic_project_copy': True})
new_id = project_obj.copy(cr, uid, proj.id, default = {
'name': proj.name +_(' (copy)'),
'state':'open',
@ -213,13 +214,10 @@ class project(osv.osv):
result.append(new_id)
cr.execute('select id from project_task where project_id=%s', (proj.id,))
res = cr.fetchall()
for (tasks_id,) in res:
task_obj.copy(cr, uid, tasks_id, default = {
'project_id': new_id,
'active':True}, context=context)
child_ids = self.search(cr, uid, [('parent_id','=', proj.id)], context=context)
child_ids = self.search(cr, uid, [('parent_id','=', proj.category_id.id)], context=context)
parent_id = self.read(cr, uid, new_id, ['category_id'])['category_id'][0]
if child_ids:
self.duplicate_template(cr, uid, child_ids, context={'parent_id': new_id})
self.duplicate_template(cr, uid, child_ids, context={'parent_id': parent_id})
if result and len(result):
res_id = result[0]
@ -316,7 +314,7 @@ class task(osv.osv):
'description': fields.text('Description'),
'priority' : fields.selection([('4','Very Low'), ('3','Low'), ('2','Medium'), ('1','Urgent'), ('0','Very urgent')], 'Importance'),
'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of tasks."),
'type': fields.many2one('project.task.type', 'Stage'),
'type': fields.many2one('project.task.type', 'Stage',),
'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 \'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\'.'),
@ -626,4 +624,17 @@ class users(osv.osv):
}
users()
class account_analytic_account(osv.osv):
_inherit = 'account.analytic.account'
_description = 'Analytic Account'
def create(self, cr, uid, vals, context=None):
if context is None:
context = {}
if vals.get('child_ids', False) and context.get('analytic_project_copy', False):
vals['child_ids'] = []
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

@ -39,8 +39,8 @@
<group col="2" colspan="2" name="misc">
<separator colspan="2" string="Miscelleanous"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
<field name="warn_manager"/>
<field name="project_escalation_id"/>
<field name="warn_manager"/>
</group>
<newline/>
@ -55,11 +55,10 @@
<button
string="New Project Based on Template"
name="duplicate_template" type="object"
states="template" icon="gtk-new"/>
states="template" icon="gtk-new" context="{'parent_id':parent_id}"/>
</group>
</page>
<page string="Members">
<separator colspan="4" string="Project's members"/>
<field colspan="4" name="members" nolabel="1"/>
</page>
<page groups="base.group_extended" string="Partner Info">
@ -103,6 +102,7 @@
<field name="complete_name" string="Project Name"/>
<field name="user_id" string="Project Manager"/>
<field name="partner_id" string="Partner"/>
<field name="parent_id" invisible="1"/>
<field name="effective_hours" widget="float_time"/>
<field name="total_hours" widget="float_time"/>
<field name="state"/>
@ -117,7 +117,7 @@
<field name="arch" type="xml">
<search string="Search Project">
<group col='15' colspan='4'>
<filter icon="terp-document-new" string="Draft" domain="[('state', 'in',('draft'))]" help="Draft Projects" default="1"/>
<filter icon="terp-document-new" string="Draft" domain="[('state', 'in',('draft',))]" help="Draft Projects" default="1"/>
<filter icon="terp-check" string="Current" name="Current" domain="[('state', 'in',('open','pending'))]" help="Open and Pending Projects" default="1"/>
<separator orientation="vertical"/>
<filter icon="terp-personal" string="Manager" name="Manager" domain="[('user_id', '=', uid)]" help="Projects in which I am a manager."/>
@ -129,6 +129,7 @@
</group>
<newline />
<group expand="0" string="Group By..." colspan="4" col="20" groups="base.group_extended">
<filter string="Parent" name="Parent" icon="terp-personal" domain = "[]" context="{'group_by':'parent_id'}"/>
<filter string="Users" name="Users" icon="terp-personal" domain = "[]" context="{'group_by':'user_id'}"/>
<filter string="Partner" name="Partner" icon="terp-personal" domain = "[]" context="{'group_by':'partner_id'}"/>
</group>
@ -493,7 +494,7 @@
<form string="Task Stage">
<field name="name" select="1"/>
<field name="sequence"/>
<field colspan="4" name="description" select="1"/>
<field colspan="4" name="description"/>
</form>
</field>
</record>

View File

@ -90,8 +90,8 @@
<field name="project_id">
<filter icon="terp-folder-blue"
string="My Projects"
help="My Projects"
domain="[('project_id','=',context.get('project_id', False)]"/>
help="My Projects" domain="[('project_id','=',uid)]"/>
</field>
<field name="user_id" widget="selection">
<filter icon="terp-personal"

View File

@ -8,12 +8,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="My Daily Timebox">
<label string="You can open Daily Timebox"/>
<newline/>
<group colspan="4" col="6">
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button name="open_tb" icon="gtk-ok" string="_Open Timebox" type="object" default_focus="1"/>
<group width="340" height="70">
<label string="You can open Daily Timebox"/>
<newline/>
<group>
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button name="open_tb" icon="gtk-ok" string="_Open Timebox" type="object" default_focus="1"/>
</group>
</group>
</form>
</field>
</record>

View File

@ -8,10 +8,11 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Empty Timebox">
<label string="Timebox Empty Process Completed Successfully."/>
<group colspan="4" col="6">
<button icon="gtk-ok" colspan="4" special="cancel" string="_Ok"/>
</group>
<group width="345" height="70">
<label string="Timebox Empty Process Completed Successfully." />
<newline/>
<button icon="gtk-ok" special="cancel" string="_Ok" colspan="1"/><label colspan="1"/>
</group>
</form>
</field>
</record>

View File

@ -105,6 +105,7 @@
<field name="description"/>
</tree>
</field>
<separator colspan="4"/>
<button colspan="4" string="Send New Email"
name="%(crm.action_crm_send_mail)d"
context="{'mail':'new', 'model': 'project.issue'}"
@ -156,6 +157,7 @@
<tree string="Issue Tracker Tree" colors="red:state=='open';blue:state=='pending';grey:state in ('cancel', 'done')">
<field name="id"/>
<field name="create_date"/>
<field name="project_id" invisible="1"/>
<field name="name"/>
<field name="partner_id"/>
<field name="priority" string="Severity"/>

View File

@ -131,7 +131,7 @@
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12" groups="base.group_extended">
<field name="partner_id" />
<field name="partner_id"/>
<field name="assigned_to" widget="selection"/>
<separator orientation="vertical"/>
<field name="priority" />

View File

@ -107,23 +107,7 @@
<button string="Cancel" name="set_cancel" states="draft,open,pending" icon="gtk-cancel"/>
</group>
</page>
<page string="Other Info">
<group colspan="2" col="2">
<separator string="Constraints" colspan="2"/>
<field name="constraint_date_start"/>
<field name="constraint_date_end"/>
</group>
<group colspan="2" col="2">
<separator string="Scheduling" colspan="2"/>
<field name="sequence"/>
</group>
<separator colspan="4" string="Previous Phases"/>
<field colspan="4" name="previous_phase_ids" nolabel="1"/>
<separator colspan="4" string="Next Phases"/>
<field colspan="4" name="next_phase_ids" nolabel="1"/>
</page>
<page string="Task Detail">
<separator colspan="4" string="Project's Tasks"/>
<field colspan="4" name="task_ids" context="{'default_project_id' :project_id}" nolabel="1">
<tree editable="bottom" string="Project's Tasks">
<field name="name"/>
@ -158,6 +142,21 @@
</field>
<button name="%(action_project_schedule_tasks)d" string="Schedule Tasks" type="action" icon="gtk-jump-to"/>
</page>
<page string="Other Info">
<group colspan="2" col="2">
<separator string="Constraints" colspan="2"/>
<field name="constraint_date_start"/>
<field name="constraint_date_end"/>
</group>
<group colspan="2" col="2">
<separator string="Scheduling" colspan="2"/>
<field name="sequence"/>
</group>
<separator colspan="4" string="Previous Phases"/>
<field colspan="4" name="previous_phase_ids" nolabel="1"/>
<separator colspan="4" string="Next Phases"/>
<field colspan="4" name="next_phase_ids" nolabel="1"/>
</page>
</notebook>
<newline/>
</form>