bzr revid: fp@tinyerp.com-20100228105724-zs6204yhhh4kg5bt
This commit is contained in:
Fabien Pinckaers 2010-02-28 11:57:24 +01:00
parent 6f74c8ed75
commit 0ec35b56e5
9 changed files with 98 additions and 71 deletions

View File

@ -24,9 +24,9 @@ import crm_mailgate
import crm_action_rule
import crm_segmentation
import crm_meeting
import crm_opportunity
import crm_lead
import crm_phonecall
import crm_opportunity
import crm_claim
import crm_fundraising
import crm_helpdesk

View File

@ -220,7 +220,7 @@ class crm_case(osv.osv):
'name': fields.char('Description', size=1024, required=True),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the case without removing it."),
'description': fields.text('Your action'),
'section_id': fields.many2one('crm.case.section', 'Section', select=True, help='Section to which Case belongs to. Define Responsible user and Email account for mail gateway.'),
'section_id': fields.many2one('crm.case.section', 'Sales Team', select=True, help='Sales team to which Case belongs to. Define Responsible user and Email account for mail gateway.'),
'email_from': fields.char('Partner Email', size=128, help="These people will receive email."),
'email_cc': fields.char('Watchers Emails', size=252 , help="These people will receive a copy of the future" \
" communication between partner and users by email"),

View File

@ -22,11 +22,6 @@
from osv import fields,osv,orm
import crm
class crm_opportunity(osv.osv):
_name = "crm.opportunity"
_description = "Opportunity Cases"
crm_opportunity()
class crm_lead(osv.osv):
_name = "crm.lead"
_description = "Leads Cases"
@ -36,10 +31,21 @@ class crm_lead(osv.osv):
'name': fields.char('Lead Subject', size=64),
'categ_id': fields.many2one('crm.case.categ', 'Category', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.opportunity')]"),
'type_id': fields.many2one('crm.case.resource.type', 'Lead Type Name', domain="[('section_id','=',section_id),('object_id.model', '=', 'crm.lead')]"),
'partner_name': fields.char("Partner Name", size=64),
'partner_name2': fields.char('Contact', size=64),
'partner_name': fields.char("Lead Name", size=64),
'function': fields.many2one('res.partner.function', 'Function'),
'partner_address': fields.char("Address", size=64),
'partner_contact': fields.char('Contact', size=64),
'partner_phone': fields.char('Phone', size=32),
'partner_mobile': fields.char('Mobile', size=32),
'street': fields.char('Street', size=128),
'street2': fields.char('Street2', size=128),
'zip': fields.char('Zip', change_default=True, size=24),
'city': fields.char('City', size=128),
'state_id': fields.many2one("res.country.state", 'Fed. State', domain="[('country_id','=',country_id)]"),
'country_id': fields.many2one('res.country', 'Country'),
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
'probability': fields.float('Probability (%)'),
'date_closed': fields.datetime('Closed', readonly=True),
@ -54,7 +60,8 @@ class crm_lead(osv.osv):
"the partner mentality in relation to our services.The scale has" \
"to be created with a factor for each level from 0 (Very dissatisfied) to 10 (Extremely satisfied)."),
'opportunity_id': fields.many2one('crm.opportunity', 'Opportunity'),
'user_id': fields.many2one('res.users', 'Salesman'),
}
'user_id': fields.many2one('res.users', 'Salesman'),
'referred': fields.char('Referred By', size=32),
}
crm_lead()

View File

@ -29,7 +29,7 @@
<form string="Leads Form">
<group colspan="4" col="7">
<field name="partner_name" string="Partner Name" required="1"/>
<field name="partner_name2"/>
<field name="partner_contact"/>
<field name="user_id"/>
<button
string="Convert to Opportunity"
@ -121,7 +121,7 @@
<tree string="Leads Tree" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
<field name="create_date"/>
<field name="partner_name"/>
<field name="partner_name2"/>
<field name="partner_contact"/>
<field name="email_from"/>
<field name="partner_phone"/>
<button name="stage_previous" string="Previous" states="open,pending" type="object" icon="gtk-go-back"/>
@ -145,7 +145,7 @@
<calendar string="Meeting For Leads Generation" date_start="create_date" color="user_id" date_delay="duration">
<field name="name"/>
<field name="partner_name"/>
<field name="partner_name2"/>
<field name="partner_contact"/>
</calendar>
</field>
</record>

View File

@ -511,7 +511,7 @@ class task(osv.osv):
dt_end = work_time[-1][1].strftime('%Y-%m-%d %H:%M:%S')
self.write(cr,uid,[task.id],{'date_start':date_start.strftime('%Y-%m-%d %H:%M:%S'),'date_end':dt_end})
def write(self, cr, uid, ids, vals,context=None):
def write_old(self, cr, uid, ids, vals,context=None):
if not context:
context = {}
@ -622,14 +622,13 @@ config_compute_remaining()
class message(osv.osv):
_name = "project.message"
_description = "Message"
_columns = {
'subject': fields.char('Subject', size=128, required="True"),
'description': fields.text('Description'),
'project_id': fields.many2one('project.project', 'Project', ondelete='cascade'),
'date': fields.date('Date'),
'date': fields.date('Date', required=1),
'user_id': fields.many2one('res.users', 'User', required="True"),
}
'description': fields.text('Description'),
}
def _default_project(self, cr, uid, context={}):
if 'project_id' in context and context['project_id']:
@ -638,7 +637,9 @@ class message(osv.osv):
_defaults = {
'user_id' : lambda self,cr,uid,ctx : uid,
'project_id':_default_project}
'date' : lambda self,cr,uid,ctx : time.strftime('%Y-%m-%d'),
'project_id':_default_project
}
message()

View File

@ -404,7 +404,7 @@
<field name="arch" type="xml">
<search string="Task Edition">
<group col="20" colspan="4">
<filter string="Current" domain="[('state','in',('open','draft','pending'))]" help="Draft, Open and Pending Tasks" icon="terp-project" default="1"/>
<filter string="Current" domain="[('state','in',('open','draft'))]" help="Draft, Open and Pending Tasks" icon="terp-project" default="1"/>
<filter string="In Progress" domain="[('state','=','open')]" help="Open Tasks" icon="terp-project"/>
<filter string="Pending" domain="[('state','=','pending')]" context="{'show_delegated':False}" help="Pending Tasks" icon="terp-project"/>
<separator orientation="vertical"/>
@ -583,7 +583,7 @@
<field name="arch" type="xml">
<form string="Messages">
<group colspan="6">
<field name="subject" select="1" string="Title"/>
<field name="subject" select="1"/>
<field name="project_id"/>
<field name="user_id" select="1"/>
<field name="date" select="2"/>
@ -600,11 +600,10 @@
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Messages">
<field name="subject" select="1"/>
<field name="description" select="1"/>
<field name="project_id" select="1"/>
<field name="date" select="1"/>
<field name="user_id" select="1"/>
<field name="subject" select="1"/>
<field name="user_id" select="1"/>
<field name="project_id" select="1"/>
<field name="date" select="1"/>
</tree>
</field>
</record>

View File

@ -171,7 +171,7 @@ class project_task(osv.osv):
tt = timebox_obj.browse(cr, uid, timebox_obj.search(cr,uid,[]))
search_extended ='''<newline/><group col="%d" expand="1" string="%s" groups="project_gtd.group_project_getting">''' % (len(tt)+7,_('Getting Things Done'))
search_extended += '''<filter domain="[('timebox_id','=', False)]" context="{'set_editable':True,'set_visible':True}" icon="gtk-new" string="%s"/>''' % (_('Inbox'),)
search_extended += '''<filter domain="[]" context="{'set_editable':True,'set_visible':True}" icon="gtk-new" string="%s"/>''' % (_('All'),)
search_extended += '''<filter domain="[('state', 'in', ('draft','open','pending'))]" context="{'set_editable':True,'set_visible':True}" icon="gtk-new" string="%s"/>''' % (_('All'),)
search_extended += '''<separator orientation="vertical"/>'''
for time in tt:
if time.icon:

View File

@ -206,9 +206,19 @@ scrum_product_backlog()
class scrum_task(osv.osv):
_name = 'project.task'
_inherit = 'project.task'
def _get_task(self, cr, uid, ids, context={}):
result = {}
for line in self.pool.get('scrum.product.backlog').browse(cr, uid, ids, context=context):
for task in line.tasks_id:
result[task.id] = True
return result.keys()
_columns = {
'product_backlog_id': fields.many2one('scrum.product.backlog', 'Product Backlog'),
'sprint_id': fields.related('product_backlog_id','sprint_id', type='many2one', relation='scrum.sprint', string='Sprint'),#, store=True),
'sprint_id': fields.related('product_backlog_id','sprint_id', type='many2one', relation='scrum.sprint', string='Sprint',
store={
'project.task': (lambda self, cr, uid, ids, c={}: ids, ['product_backlog_id'], 10),
'scrum.product.backlog': (_get_task, ['sprint_id'], 10)
}),
}
def onchange_backlog_id(self, cr, uid, backlog_id):
if not backlog_id:

View File

@ -67,10 +67,10 @@
<field name="sequence"/>
<field name="active" select="1"/>
<group colspan="6" col="8">
<field name="effective_hours" widget="float_time"/>
<field name="planned_hours" widget="float_time"/>
<field name="expected_hours" widget="float_time"/>
<field name="progress" widget="progressbar"/>
<field name="effective_hours" widget="float_time"/>
<field name="planned_hours" widget="float_time"/>
<field name="expected_hours" widget="float_time"/>
<field name="progress" widget="progressbar"/>
</group>
</group>
<notebook colspan="4">
@ -83,11 +83,11 @@
</notebook>
<group col="7" colspan="4">
<field name="state" select="1" readonly="1"/>
<button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-jump-to"/>
<button type="action" string="Convert to Task" name="%(wizard_scrum_backlog_task)d" states="draft,pending" icon="gtk-execute"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
<button type="object" string="Close" name="button_close" states="open,pending" icon="gtk-jump-to"/>
<button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>
<button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-jump-to"/>
<button type="action" string="Convert to Task" name="%(wizard_scrum_backlog_task)d" states="draft,pending" icon="gtk-execute"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
<button type="object" string="Close" name="button_close" states="open,pending" icon="gtk-jump-to"/>
<button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>
</group>
</form>
</field>
@ -124,11 +124,12 @@
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="20">
<filter string="Users" icon="terp-project" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Project" icon="terp-project" domain="[]" context="{'group_by':'project_id'}"/>
<filter string="Sprint" icon="terp-project" domain="[]" context="{'group_by':'sprint_id'}"/>
<filter string="Responsible" icon="terp-project" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="State" icon="terp-project" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
@ -163,7 +164,7 @@
<field name="progress" widget="progressbar"/>
<field name="effective_hours" sum="Effective hours" widget="float_time"/>
<field name="planned_hours" sum="Planned hours" widget="float_time"/>
<field name="expected_hours" sum="Expected hours" widget="float_time"/>
<field name="expected_hours" sum="Expected hours" widget="float_time"/>
<field name="state"/>
<button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-jump-to"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
@ -182,14 +183,23 @@
<field name="project_id" on_change="onchange_project_id(project_id)"/>
<notebook colspan="4">
<page string="Sprint Info">
<field name="date_start" select="1"/>
<field name="date_stop"/>
<field name="product_owner_id"/>
<field name="scrum_master_id"/>
<field name="effective_hours" widget="float_time"/>
<field name="planned_hours" widget="float_time"/>
<field name="expected_hours" widget="float_time"/>
<field name="progress" widget="progressbar"/>
<group colspan="2" col="2">
<separator string="Owners"/>
<field name="product_owner_id"/>
<field name="scrum_master_id"/>
</group>
<group colspan="2" col="2">
<separator string="Dates"/>
<field name="date_start" select="1"/>
<field name="date_stop"/>
</group>
<group colspan="2" col="2">
<separator string="Planning"/>
<field name="planned_hours" widget="float_time"/>
<field name="expected_hours" widget="float_time"/>
<field name="effective_hours" widget="float_time"/>
<field name="progress" widget="progressbar"/>
</group>
</page>
<page string="Daily Meetings">
<field colspan="4" name="meeting_ids" nolabel="1" widget="one2many_list"/>
@ -203,11 +213,11 @@
</notebook>
<group col="6" colspan="4">
<field name="state" readonly="1"/>
<button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-jump-to"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
<button type="object" string="Close" name="button_close" states="open,pending" icon="gtk-jump-to"/>
<button type="object" string="Open" name="button_open" states="draft,pending" icon="gtk-jump-to"/>
<button type="object" string="Pending" name="button_pending" states="open" icon="gtk-media-pause"/>
<button type="object" string="Close" name="button_close" states="open,pending" icon="gtk-jump-to"/>
<button type="object" string="Set to Draft" name="button_draft" states="cancel,done" icon="gtk-convert"/>
</group>
</group>
</form>
</field>
</record>
@ -235,12 +245,12 @@
<newline/>
<group expand="1" string="Group By..." colspan="4" col="20">
<filter string="Project" icon="terp-project" domain="[]" context="{'group_by':'project_id'}"/>
<filter string="Masters" icon="terp-project" domain="[]" context="{'group_by':'scrum_master_id'}"/>
<filter string="Masters" icon="terp-project" domain="[]" context="{'group_by':'scrum_master_id'}"/>
<filter string="Product owner" icon="terp-project" domain="[]" context="{'group_by':'product_owner_id'}"/>
<filter string="State" icon="terp-project" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Start Date" icon="terp-project" domain="[]" context="{'group_by':'date_start'}"/>
</group>
</group>
</search>
</field>
</record>
@ -299,32 +309,32 @@
</form>
</field>
</record>
<record id="view_scrum_meeting_search" model="ir.ui.view">
<field name="name">scrum.meeting.search</field>
<field name="model">scrum.meeting</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Scrum Sprint">
<group col="10" colspan="4">
<field name="name"/>
<field name="sprint_id" widget="selection"/>
<field name="date"/>
</group>
<group col="10" colspan="4">
<field name="name"/>
<field name="sprint_id" widget="selection"/>
<field name="date"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="20">
<filter string="Sprint" icon="terp-project" domain="[]" context="{'group_by':'sprint_id'}"/>
<filter string="Date" icon="terp-project" domain="[]" context="{'group_by':'date'}"/>
</group>
</search>
</search>
</field>
</record>
<record id="action_meeting_form" model="ir.actions.act_window">
<field name="name">Scrum Meetings</field>
<field name="res_model">scrum.meeting</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_scrum_meeting_search"/>
</record>
<menuitem sequence="30"
@ -405,10 +415,10 @@
<field name="name">project.task.tree.scrum</field>
<field name="model">project.task</field>
<field name="type">tree</field>
<field name="inherit_id" ref="project.view_task_tree2"/>
<field name="inherit_id" ref="project.view_task_tree2"/>
<field name="arch" type="xml">
<field name="user_id" position="after">
<field name="sprint_id" invisible="1"/>
<field name="sprint_id" invisible="context.get('sprint_invisible',True)"/>
<field name="product_backlog_id" invisible="1"/>
</field>
</field>
@ -436,7 +446,7 @@
<field domain="[('project_id','=',project_id)]" name="product_backlog_id" select="1"/>
</xpath>
</field>
</record>
</record>
<record id="view_task_search_form2" model="ir.ui.view">
<field name="name">project.task.scrum.search</field>
@ -445,8 +455,8 @@
<field name="inherit_id" ref="project.view_task_search_form"/>
<field name="arch" type="xml">
<field name="project_id" position="after">
<field name="sprint_id" widget="selection">
<filter icon="terp-project" string="Current" domain="[('state','=','open')]" help="Current Sprints"/>
<field name="sprint_id" widget="selection" context="{'sprint_invisible':False}">
<filter icon="terp-project" string="Current" context="{'sprint_invisible':False}" domain="[('state','=','open')]" help="Current Sprints"/>
</field>
</field>
</field>
@ -459,9 +469,9 @@
<field name="inherit_id" ref="project.view_task_search_form"/>
<field name="arch" type="xml">
<xpath expr="/search/group[@string='Group By...']/filter[@string='End Date']" position="after">
<!-- <filter string="Sprint" icon="terp-project" domain="[]" context="{'group_by':'sprint_id'}"/> -->
<filter string="Sprint" icon="terp-project" domain="[]" context="{'group_by':'sprint_id'}"/>
<filter string="Backlog" icon="terp-project" domain="[]" context="{'group_by':'product_backlog_id'}"/>
<separator orientation="vertical"/>
<separator orientation="vertical"/>
</xpath>
</field>
</record>