diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index c8ee9553cb8..73ae3b3b809 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -306,7 +306,7 @@ class CalDAV(object): if cal_data.name.lower() == 'organizer': dmail = { 'name': cal_data.params.get('CN', ['',])[0], 'email': cal_data.value.lower().replace('mailto:',''), - # TODO: company? + # TODO: company? } self.ical_set(cal_data.name.lower(), mailto2str(dmail), 'value') continue @@ -382,7 +382,7 @@ class CalDAV(object): ical.contents['vevent'].append(revents) #END if data.get('recurrent_uid', None): - # Change the UID value in case of modified event from any recurrent event + # Change the UID value in case of modified event from any recurrent event uidval = openobjectid2uid(cr, data['recurrent_uid'], model) vevent.add('uid').value = uidval elif field == 'attendee' and data[map_field]: @@ -412,7 +412,7 @@ class CalDAV(object): if exfield: # Set exdates according to timezone value # This is the case when timezone mapping comes after the exdate mapping - # and we have exdate value available + # and we have exdate value available exfield.params['TZID'] = [tzval.title()] exdates_updated = [] for exdate in exdates: @@ -432,7 +432,7 @@ class CalDAV(object): if tzval: # Set exdates according to timezone value # This is the case when timezone mapping comes before the exdate mapping - # and we have timezone value available + # and we have timezone value available exfield.params['TZID'] = [tzval.title()] exdates_updated = [] for exdate in exdates: @@ -448,7 +448,7 @@ class CalDAV(object): dtfield.value = self.format_date_tz(parser.parse(data[map_field]), tzval.title()) else: dtfield.value = parser.parse(data[map_field]) - + elif map_type == 'utc'and data[map_field]: if tzval: local = pytz.timezone (tzval.title()) @@ -554,7 +554,7 @@ class CalDAV(object): @param data_id: Get Data’s ID or False @param context: A standard dictionary for contextual values """ - + ical_data = content self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, context) parsedCal = vobject.readOne(ical_data) @@ -602,7 +602,7 @@ class Calendar(CalDAV, osv.osv): 'calendar_order': fields.integer('Order', help="For supporting clients, the order of this folder among the calendars"), 'has_webcal': fields.boolean('WebCal', required=True, help="Also export a .ics entry next to the calendar folder, with WebCal content."), } - + _defaults = { 'has_webcal': False, } @@ -635,7 +635,7 @@ class Calendar(CalDAV, osv.osv): node = res_node_calendar('%s.ics' %data.id, parent, ctx, data, line.object_id.model, data.id) res.append(node) return res - + def get_cal_max_modified(self, cr, uid, ids, parent=None, domain=None, context=None): if context is None: @@ -732,7 +732,7 @@ class Calendar(CalDAV, osv.osv): _logger.debug("Skipping custom node %s.", child.name) else: _logger.debug("Skipping node %s.", child.name) - + res = [] for obj_name in list(set(objs)): obj = self.pool.get(obj_name) @@ -781,7 +781,7 @@ class basic_calendar_line(osv.osv): """ cr.execute("SELECT COUNT(id) FROM basic_calendar_lines \ - WHERE name=%s AND calendar_id=%s", + WHERE name=%s AND calendar_id=%s", (vals.get('name'), vals.get('calendar_id'))) res = cr.fetchone() if res: @@ -793,13 +793,13 @@ basic_calendar_line() class basic_calendar_alias(osv.osv): """ Mapping of client filenames to ORM ids of calendar records - + Since some clients insist on putting arbitrary filenames on the .ics data - they send us, and they won't respect the redirection "Location:" header, + they send us, and they won't respect the redirection "Location:" header, we have to store those filenames and allow clients to call our calendar records with them. Note that adding a column to all tables that would possibly hold calendar- - mapped data won't work. The user is always allowed to specify more + mapped data won't work. The user is always allowed to specify more calendars, on any arbitrary ORM object, without need to alter those tables' data or structure """ @@ -810,7 +810,7 @@ class basic_calendar_alias(osv.osv): select=1, help='The calendar/line this mapping applies to'), 'res_id': fields.integer('Res. ID', required=True, select=1), } - + _sql_constraints = [ ('name_cal_uniq', 'UNIQUE(cal_line_id, name)', _('The same filename cannot apply to two records!')), ] @@ -1192,7 +1192,7 @@ class Alarm(CalDAV, osv.osv_memory): elif isinstance(child.value, datetime): # TODO # remember, spec says this datetime is in UTC - raise NotImplementedError("We cannot parse absolute triggers.") + raise NotImplementedError("Cannot parse absolute triggers.") if not seconds: duration = abs(days) related = days > 0 and 'after' or 'before' diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py index 56b5393c535..7608e1301bd 100644 --- a/addons/crm/crm_action_rule.py +++ b/addons/crm/crm_action_rule.py @@ -59,7 +59,7 @@ class base_action_rule(osv.osv): else: reply_to = emailfrom if not emailfrom: - raise osv.except_osv(_('Error!'), _("There is no Email for your Company address.")) + raise osv.except_osv(_('Error!'), _("There is no email for your company address.")) return mail_message.schedule_with_attach(cr, uid, emailfrom, emails, name, body, model=obj._name, reply_to=reply_to, res_id=obj.id) def do_check(self, cr, uid, action, obj, context=None): diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 799c0385297..e4a6b0980d7 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -280,7 +280,7 @@ class crm_lead(base_stage, osv.osv): obj_id = super(crm_lead, self).create(cr, uid, vals, context) self.create_send_note(cr, uid, [obj_id], context=context) return obj_id - + def onchange_stage_id(self, cr, uid, ids, stage_id, context=None): if not stage_id: return {'value':{}} @@ -789,8 +789,8 @@ class crm_lead(base_stage, osv.osv): for lead in self.browse(cr, uid, ids, context): if (not lead.section_id.allow_unlink) and (lead.state != 'draft'): raise osv.except_osv(_('Error'), - _("You cannot delete lead '%s'; because it is not in 'Draft' state. " \ - "You should better cancel it, instead of deleting it.") % lead.name) + _("You cannot delete lead '%s' because it is not in 'Draft' state. " \ + "You can still cancel it, instead of deleting it.") % lead.name) return super(crm_lead, self).unlink(cr, uid, ids, context) def write(self, cr, uid, ids, vals, context=None): @@ -864,12 +864,12 @@ class crm_lead(base_stage, osv.osv): """ Override of the (void) default notification method. """ stage_name = self.pool.get('crm.case.stage').name_get(cr, uid, [stage_id], context=context)[0][1] return self.message_append_note(cr, uid, ids, body= _("Stage changed to %s.") % (stage_name), context=context) - + def case_get_note_msg_prefix(self, cr, uid, lead, context=None): if isinstance(lead, (int, long)): lead = self.browse(cr, uid, [lead], context=context)[0] return ('Opportunity' if lead.type == 'opportunity' else 'Lead') - + def create_send_note(self, cr, uid, ids, context=None): for id in ids: message = _("%s has been created.")% (self.case_get_note_msg_prefix(cr, uid, id, context=context)) @@ -896,7 +896,7 @@ class crm_lead(base_stage, osv.osv): message = _("%s partner is now set to %s." % (self.case_get_note_msg_prefix(cr, uid, lead, context=context), lead.partner_id.name)) lead.message_append_note(body=message) return True - + def convert_opportunity_send_note(self, cr, uid, lead, context=None): message = _("Lead has been converted to an opportunity.") lead.message_append_note(body=message) diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index 42f84575328..547d3ed299e 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -99,7 +99,7 @@ class crm_lead2opportunity_partner(osv.osv_memory): lead_obj = self.pool.get('crm.lead') for lead in lead_obj.browse(cr, uid, context.get('active_ids', []), context=context): if lead.state in ['done', 'cancel']: - raise osv.except_osv(_("Warning !"), _("Closed/Cancelled Leads cannot be converted into Opportunity.")) + raise osv.except_osv(_("Warning !"), _("Closed/Cancelled leads cannot be converted into opportunities.")) return False def _convert_opportunity(self, cr, uid, ids, vals, context=None): @@ -110,7 +110,7 @@ class crm_lead2opportunity_partner(osv.osv_memory): lead_ids = vals.get('lead_ids', []) user_ids = vals.get('user_ids', False) team_id = vals.get('section_id', False) - return lead.convert_opportunity(cr, uid, lead_ids, partner_id, user_ids, team_id, context=context) + return lead.convert_opportunity(cr, uid, lead_ids, partner_id, user_ids, team_id, context=context) def _merge_opportunity(self, cr, uid, ids, opportunity_ids, action='merge', context=None): #TOFIX: is it usefully ? @@ -131,7 +131,7 @@ class crm_lead2opportunity_partner(osv.osv_memory): """ if not context: context = {} - + lead = self.pool.get('crm.lead') lead_ids = context.get('active_ids', []) data = self.browse(cr, uid, ids, context=context)[0] diff --git a/addons/crm_partner_assign/partner_geo_assign.py b/addons/crm_partner_assign/partner_geo_assign.py index 94db5461956..9134f427c5d 100644 --- a/addons/crm_partner_assign/partner_geo_assign.py +++ b/addons/crm_partner_assign/partner_geo_assign.py @@ -34,7 +34,7 @@ def geo_find(addr): xml = urllib.urlopen(url).read() except Exception, e: raise osv.except_osv(_('Network error'), - _('Cannot contact geolocation servers, please make sure you have a working internet connection (%s).') % e) + _('Cannot contact geolocation servers. Please make sure that your internet connection is up and running (%s).') % e) if '' in xml: return None @@ -46,11 +46,11 @@ def geo_find(addr): def geo_query_address(street=None, zip=None, city=None, state=None, country=None): if country and ',' in country and (country.endswith(' of') or country.endswith(' of the')): # put country qualifier in front, otherwise GMap gives wrong results, - # e.g. 'Congo, Democratic Republic of the' => 'Democratic Republic of the Congo' - country = '{1} {0}'.format(*country.split(',',1)) - return tools.ustr(', '.join(filter(None, [street, - ("%s %s" % (zip or '', city or '')).strip(), - state, + # e.g. 'Congo, Democratic Republic of the' => 'Democratic Republic of the Congo' + country = '{1} {0}'.format(*country.split(',',1)) + return tools.ustr(', '.join(filter(None, [street, + ("%s %s" % (zip or '', city or '')).strip(), + state, country]))) class res_partner_grade(osv.osv):