[IMP]: Minor Code improvements (For tooptips) in crm modules

bzr revid: rpa@tinyerp.com-20100512131601-b1vkwfe2f6ker8eq
This commit is contained in:
rpa (Open ERP) 2010-05-12 18:46:01 +05:30
parent b5a61d1504
commit b03b10a559
7 changed files with 79 additions and 65 deletions

View File

@ -580,7 +580,7 @@ class res_alarm(osv.osv):
are both optional, but if one occurs, so MUST the other"""),
'repeat': fields.integer('Repeat'),
'active': fields.boolean('Active', help="If the active field is set to \
true, it will allow you to hide the event alarm information without removing it.")
true, it will allow you to hide the event alarm information without removing it.")
}
_defaults = {
'trigger_interval': lambda *x: 'minutes',
@ -992,9 +992,9 @@ class calendar_event(osv.osv):
'Show as'),
'base_calendar_url': fields.char('Caldav URL', size=264),
'exdate': fields.text('Exception Date/Times', help="This property \
defines the list of date/time exceptions for arecurring calendar component."),
defines the list of date/time exceptions for arecurring calendar component."),
'exrule': fields.char('Exception Rule', size=352, help="defines a \
rule or repeating pattern for anexception to a recurrence set"),
rule or repeating pattern for an exception to a recurrence set"),
'rrule': fields.function(_get_rulestring, type='char', size=124, method=True, \
string='Recurrent Rule', store=True, \
fnct_inv=_set_rrulestring, help='Defines a\
@ -1044,7 +1044,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
'event_id', 'attendee_id', 'Attendees'),
'allday': fields.boolean('All Day'),
'active': fields.boolean('Active', help="If the active field is set to \
true, it will allow you to hide the event alarm information without removing it.")
true, it will allow you to hide the event alarm information without removing it.")
}
_defaults = {

View File

@ -44,7 +44,7 @@ class base_calendar_invite_attendee(osv.osv_memory):
'contact_ids': fields.many2many('res.partner.address', 'invite_contact_rel',
'invite_id', 'contact_id', 'Contacts'),
'send_mail': fields.boolean('Send mail?', help='Check this if you want to \
send an Email to Invited Person')
send an Email to Invited Person')
}
_defaults = {

View File

@ -37,39 +37,26 @@ class crm_segmentation(osv.osv):
'description': fields.text('Description'),
'categ_id': fields.many2one('res.partner.category', 'Partner Category',\
required=True, help='The partner category that will be \
added to partners that match the segmentation criterions after computation.'),
'exclusif': fields.boolean('Exclusive', help='Check if the category is \
limited to partners that match the segmentation criterions.\
If checked, remove the category from partners that doesn\'t \
match segmentation criterions'),
added to partners that match the segmentation criterions after computation.'),
'exclusif': fields.boolean('Exclusive', help='Check if the category is limited to partners that match the segmentation criterions.\
\nIf checked, remove the category from partners that doesn\'t match segmentation criterions'),
'state': fields.selection([('not running','Not Running'),\
('running','Running')], 'Execution Status', readonly=True),
'partner_id': fields.integer('Max Partner ID processed'),
'segmentation_line': fields.one2many('crm.segmentation.line', \
'segmentation_id', 'Criteria', required=True),
'som_interval': fields.integer('Days per Periode', help="A period is the \
average number of days between two cycle of sale or\
purchase for this segmentation. It's mainly used to\
detect if a partner has not purchased or buy for a too \
long time, so we suppose that his state of mind has \
decreased because he probably bought goods to another \
supplier. Use this functionality for recurring businesses."),
'som_interval_max': fields.integer('Max Interval', help="The computation \
is made on all events that occured during this \
interval, the past X periods."),
'som_interval_decrease': fields.float('Decrease (0>1)', help="If the \
partner has not purchased (or bought) \
during a period, decrease the state of \
mind by this factor. It\'s a multiplication"),
'som_interval': fields.integer('Days per Periode', help="A period is the average number of days between two cycle of sale or purchase for this segmentation.\
\nIt's mainly used to detect if a partner has not purchased or buy for a too long time, \
\nso we suppose that his state of mind has decreased because he probably bought goods to another supplier. \
\nUse this functionality for recurring businesses."),
'som_interval_max': fields.integer('Max Interval', help="The computation is made on all events that occured during this interval, the past X periods."),
'som_interval_decrease': fields.float('Decrease (0>1)', help="If the "\
"partner has not purchased (or bought) during a "\
"period, decrease the state of mind by this factor. It\'s a multiplication"),
'som_interval_default': fields.float('Default (0=None)', help="Default \
state of mind for period preceeding the \
'Max Interval' computation. This is the \
starting state of mind by default if the \
partner has no event."),
'sales_purchase_active': fields.boolean('Use The Sales Purchase Rules',\
help='Check if you want to use this tab as\
part of the segmentation rule. If not \
checked, the criteria beneath will be ignored')
state of mind for period preceeding the 'Max Interval' computation. \
This is the starting state of mind by default if the partner has no event."),
'sales_purchase_active': fields.boolean('Use The Sales Purchase Rules', help='Check if you want to use this tab as part of the segmentation rule. If not checked, the criteria beneath will be ignored')
}
_defaults = {
'partner_id': lambda *a: 0,

View File

@ -26,6 +26,7 @@ from tools.translate import _
import tools
class crm_lead_forward_to_partner(osv.osv_memory):
"""Forwards lead history"""
_name = 'crm.lead.forward.to.partner'
_columns = {
@ -43,6 +44,13 @@ class crm_lead_forward_to_partner(osv.osv_memory):
}
def get_whole_history(self, cr, uid, ids, context=None):
"""This function gets whole communication history and returns as top posting style
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of history IDs
@param context: A standard dictionary for contextual values
"""
whole = []
for hist_id in ids:
whole.append(self.get_latest_history(cr, uid, hist_id, context=context))
@ -50,6 +58,13 @@ class crm_lead_forward_to_partner(osv.osv_memory):
return whole or ''
def get_latest_history(self, cr, uid, hist_id, context=None):
"""This function gets latest communication and returns as top posting style
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param hist_id: Id of latest history
@param context: A standard dictionary for contextual values
"""
log_pool = self.pool.get('mailgate.message')
hist = log_pool.browse(cr, uid, hist_id, context=context)
header = '-------- Original Message --------'
@ -61,27 +76,34 @@ class crm_lead_forward_to_partner(osv.osv_memory):
original = '\n'.join(original)
return original
def on_change_email(self, cr, uid, ids, user, partner):
"""
def on_change_email(self, cr, uid, ids, user):
"""This function fills email information based on user selected
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of Mails IDs
@param user: Changed User id
@param partner: Changed Partner id
"""
if (not partner and not user):
if not user:
return {'value': {'email_to': False}}
email = False
if partner:
addr = self.pool.get('res.partner').address_get(cr, uid, [partner], ['contact'])
if addr and addr['contact']:
email = self.pool.get('res.partner.address').read(cr, uid, addr['contact'] , ['email'])['email']
elif user:
addr = self.pool.get('res.users').read(cr, uid, user, ['address_id'])['address_id']
if addr:
email = self.pool.get('res.partner.address').read(cr, uid, addr[0] , ['email'])['email']
addr = self.pool.get('res.users').read(cr, uid, user, ['address_id'])['address_id']
if addr:
email = self.pool.get('res.partner.address').read(cr, uid, addr[0] , ['email'])['email']
return {'value': {'email_to': email}}
def on_change_history(self, cr, uid, ids, history, context=None):
"""Gives message body according to type of history selected
* info: Forward the case information
* whole: Send the whole history
* latest: Send the latest histoy
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of history IDs
@param context: A standard dictionary for contextual values
"""
#TODO: ids and context are not comming
res = False
msg_val = ''
@ -111,6 +133,14 @@ class crm_lead_forward_to_partner(osv.osv_memory):
return res
def on_change_partner(self, cr, uid, ids, partner_id):
"""This function fills address information based on partner/user selected
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of Mails IDs
@param user: Changed User id
@param partner: Changed Partner id
"""
if not partner_id:
return {'value' : {'email_to' : False, 'address_id': False}}

View File

@ -42,17 +42,18 @@ class crm_claim(osv.osv, crm.crm_case):
'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
'ref2' : fields.reference('Reference 2', selection=crm._links_get, size=128),
'canal_id': fields.many2one('res.partner.canal', 'Channel', \
help="The channels represent the different communication\
modes available with the customer." \
" With each commercial opportunity, you can indicate the\
canall which is this opportunity source."),
help="The channels represent the different communication"\
"modes available with the customer." \
" With each commercial opportunity, you can indicate the"\
"canall which is this opportunity source."),
'planned_revenue': fields.float('Planned Revenue'),
'planned_cost': fields.float('Planned Costs'),
'som': fields.many2one('res.partner.som', 'State of Mind', \
help="The minds states allow to define a value scale which represents" \
"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)."),
help="The minds states allow to define a value scale "\
"which represents 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)"),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.claim')]"),
@ -62,15 +63,14 @@ class crm_claim(osv.osv, crm.crm_case):
('object_id.model', '=', 'crm.claim')]"),
'user_id': fields.many2one('res.users', 'Responsible'),
'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.'),
select=True, help="Sales team to which Case belongs to."\
"Define Responsible user and Email account for"\
" mail gateway."),
'company_id': fields.many2one('res.company', 'Company'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \
domain="[('partner_id','=',partner_id)]"),
'email_cc': fields.text('Watchers Emails', size=252 , help="These people\
will receive a copy of the future" \
" communication between partner and users by email"),
'email_cc': fields.text('Watchers Emails', size=252, help="These people will receive a copy of the future communication between partner and users by email"),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'partner_name': fields.char("Employee's Name", size=64),
'partner_mobile': fields.char('Mobile', size=32),

View File

@ -39,15 +39,12 @@ class crm_fundraising(osv.osv, crm.crm_case):
'date_deadline': fields.date('Deadline'),
'user_id': fields.many2one('res.users', 'Responsible'),
'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.'),
select=True, help='Sales team to which Case belongs to. Define Responsible user and Email account for mail gateway.'),
'company_id': fields.many2one('res.company', 'Company'),
'partner_id': fields.many2one('res.partner', 'Partner'),
'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \
domain="[('partner_id','=',partner_id)]"),
'email_cc': fields.text('Watchers Emails', size=252 , help="These people\
will receive a copy of the future" \
" communication between partner and users by email"),
'email_cc': fields.text('Watchers Emails', size=252 , help="These people will receive a copy of the future communication between partner and users by email"),
'email_from': fields.char('Email', size=128, help="These people will receive email."),
'date_closed': fields.datetime('Closed', readonly=True),
'date': fields.datetime('Date'),
@ -72,8 +69,8 @@ class crm_fundraising(osv.osv, crm.crm_case):
'ref': fields.reference('Reference', selection=crm._links_get, size=128),
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
'canal_id': fields.many2one('res.partner.canal', 'Channel', \
help="The channels represent the different communication \
modes available with the customer." \
help="The channels represent the different communication "\
"modes available with the customer." \
" With each commercial opportunity, you can indicate\
the canall which is this opportunity source."),
'som': fields.many2one('res.partner.som', 'State of Mind', \

View File

@ -63,8 +63,8 @@ class crm_helpdesk(osv.osv, crm.crm_case):
'som': fields.many2one('res.partner.som', 'State of Mind', \
help="The minds states allow to define a value scale which represents" \
"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)."),
"to be created with a factor for each level from 0" \
"(Very dissatisfied) to 10 (Extremely satisfied)."),
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="[('section_id','=',section_id),\
('object_id.model', '=', 'crm.helpdesk')]"),