[MERGE] crm fixes
bzr revid: fp@tinyerp.com-20120920073824-tvu3u0khtvqw2eka
This commit is contained in:
commit
8e6135b43a
|
@ -53,7 +53,7 @@ class crm_meeting(base_state, osv.Model):
|
|||
'partner_ids': fields.many2many('res.partner', 'crm_meeting_partner_rel', 'meeting_id','partner_id',
|
||||
string='Attendees', states={'done': [('readonly', True)]}),
|
||||
'state': fields.selection(
|
||||
[('draft', 'Unconfirmed'), ('open', 'Confirmed'), ('cancel', 'Cancelled'), ('done', 'Done')],
|
||||
[('draft', 'Unconfirmed'), ('open', 'Confirmed')],
|
||||
string='Status', size=16, readonly=True),
|
||||
# Meeting fields
|
||||
'name': fields.char('Meeting Subject', size=128, required=True, states={'done': [('readonly', True)]}),
|
||||
|
|
|
@ -69,9 +69,7 @@
|
|||
<field name="model">crm.meeting</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Meetings" version="7.0">
|
||||
<header>
|
||||
<field name="state" invisible="True"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
|
|
|
@ -69,7 +69,7 @@ class base_stage(object):
|
|||
return False
|
||||
return uid
|
||||
|
||||
def onchange_partner_address_id(self, cr, uid, ids, add, email=False):
|
||||
def onchange_partner_address_id(self, cr, uid, ids, add, email=False, context=None):
|
||||
""" This function returns value of partner email based on Partner Address
|
||||
:param add: Id of Partner's address
|
||||
:param email: Partner's email ID
|
||||
|
@ -77,10 +77,20 @@ class base_stage(object):
|
|||
data = {'value': {'email_from': False, 'phone':False}}
|
||||
if add:
|
||||
address = self.pool.get('res.partner').browse(cr, uid, add)
|
||||
data['value'] = {'email_from': address and address.email or False ,
|
||||
'phone': address and address.phone or False}
|
||||
if 'phone' not in self._columns:
|
||||
del data['value']['phone']
|
||||
data['value'] = {'partner_name': address and address.name or False,
|
||||
'email_from': address and address.email or False,
|
||||
'phone': address and address.phone or False,
|
||||
'street': address and address.street or False,
|
||||
'street2': address and address.street2 or False,
|
||||
'city': address and address.city or False,
|
||||
'state_id': address.state_id and address.state_id.id or False,
|
||||
'zip': address and address.zip or False,
|
||||
'country_id': address.country_id and address.country_id.id or False,
|
||||
}
|
||||
fields = self.fields_get(cr, uid, context=context or {})
|
||||
for key in data['value'].keys():
|
||||
if key not in fields:
|
||||
del data['value'][key]
|
||||
return data
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part, email=False):
|
||||
|
|
|
@ -92,9 +92,10 @@ class crm_case_stage(osv.osv):
|
|||
_defaults = {
|
||||
'sequence': lambda *args: 1,
|
||||
'probability': lambda *args: 0.0,
|
||||
'state': 'draft',
|
||||
'state': 'open',
|
||||
'fold': False,
|
||||
'type': 'both',
|
||||
'case_default': True,
|
||||
}
|
||||
|
||||
class crm_case_section(osv.osv):
|
||||
|
|
|
@ -104,27 +104,25 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Phone Call" version="7.0">
|
||||
<header>
|
||||
<button name="case_close" string="Held" type="object" class="oe_highlight"
|
||||
<button name="case_close" string="Call Done" type="object" class="oe_highlight"
|
||||
states="open,pending"/>
|
||||
<button name="case_reset" string="Reset to Todo" type="object"
|
||||
states="cancel"/>
|
||||
<button string="Convert to Opportunity"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
type="action"
|
||||
attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state','!=', 'open')]}"/>
|
||||
<button string="Convert to Opportunity" class="oe_highlight"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
type="action"
|
||||
attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state','!=', 'done')]}"/>
|
||||
<button string="Schedule Other Call"
|
||||
name="%(phonecall_to_phonecall_act)d"
|
||||
type="action"/>
|
||||
<button string="Schedule a Meeting" name="action_make_meeting" type="object"/>
|
||||
<button name="case_cancel" string="Cancel" type="object"
|
||||
states="draft,open,pending"/>
|
||||
<field name="state" widget="statusbar" nolabel="1" statusbar_visible="open,done"/>
|
||||
</header>
|
||||
<sheet string="Phone Call">
|
||||
<div class="oe_right">
|
||||
<button string="Convert to Opportunity"
|
||||
name="%(phonecall2opportunity_act)d"
|
||||
type="action"
|
||||
attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state', 'not in', ('open', 'done'))]}"/>
|
||||
<button string="Schedule Other Call"
|
||||
name="%(phonecall_to_phonecall_act)d"
|
||||
type="action"/>
|
||||
<button string="Schedule a Meeting" name="action_make_meeting" type="object"/>
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
<label for="name" string="Title"/>
|
||||
|
@ -135,6 +133,7 @@
|
|||
</div>
|
||||
<h2><field name="partner_phone"/></h2>
|
||||
</div>
|
||||
|
||||
<group col="4">
|
||||
<field name="date"/>
|
||||
<field name="user_id"/>
|
||||
|
|
|
@ -130,10 +130,10 @@
|
|||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='buttons']" position="inside">
|
||||
<button type="action"
|
||||
string="Schedule a Meeting"
|
||||
string="Meetings"
|
||||
name="%(base_calendar.action_crm_meeting)d"
|
||||
context="{'search_default_partner_ids': active_id, 'default_partner_ids' : [active_id]}"/>
|
||||
<button type="action" string="Schedule a Call"
|
||||
<button type="action" string="Calls"
|
||||
name="%(crm.crm_case_categ_phone_create_partner)d"
|
||||
context="{'search_default_partner_id': active_id, 'default_duration': 1.0}" />
|
||||
<button type="action" string="Opportunities" attrs="{'invisible': [('customer', '=', False)]}"
|
||||
|
|
|
@ -444,11 +444,9 @@ class sugar_import(import_framework):
|
|||
import Tasks
|
||||
"""
|
||||
task_state = {
|
||||
'Completed' : 'done',
|
||||
'Completed' : 'open',
|
||||
'Not Started':'draft',
|
||||
'In Progress': 'open',
|
||||
'Pending Input': 'draft',
|
||||
'deferred': 'cancel'
|
||||
}
|
||||
|
||||
def import_task(self, val):
|
||||
|
|
Loading…
Reference in New Issue