[IMP] rephrase some error and warning messages in base_action_rule, base_calendar, base_crypt, base_report_designer and base_status

remove exclamation marks at the end of messages
remove first person usage ('I' and 'We')
remove unjustified capital letters
rephrase the clumsy form 'No <some attribute> is defined'

bzr revid: abo@openerp.com-20120806162817-241dzl664je6t1kt
This commit is contained in:
Antonin Bourguignon 2012-08-06 18:28:17 +02:00
parent 48e0915804
commit d7083b21fe
14 changed files with 255 additions and 260 deletions

View File

@ -37,7 +37,7 @@ def get_datetime(date_field):
date_split = date_field.split(' ')
if len(date_split) == 1:
date_field = date_split[0] + " 00:00:00"
return datetime.strptime(date_field[:19], '%Y-%m-%d %H:%M:%S')
@ -185,7 +185,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
self.post_action(cr, uid, [new_id], model, context=context)
return new_id
return wrapper
def _write(self, old_write, model, context=None):
"""
Return a wrapper around `old_write` calling both `old_write` and
@ -327,7 +327,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
reply_to = emailfrom
if not emailfrom:
raise osv.except_osv(_('Error!'),
_("No Email ID is found for your Company address!"))
_("No email ID found for your company address."))
return mail_message.schedule_with_attach(cr, uid, emailfrom, emails, name, body, model='base.action.rule', reply_to=reply_to, res_id=obj.id)

View File

@ -48,18 +48,18 @@ def get_recurrent_dates(rrulestring, exdate, startdate=None, exrule=None):
def todate(date):
val = parser.parse(''.join((re.compile('\d')).findall(date)))
return val
if not startdate:
startdate = datetime.now()
if not exdate:
exdate = []
rset1 = rrule.rrulestr(str(rrulestring), dtstart=startdate, forceset=True)
for date in exdate:
datetime_obj = todate(date)
rset1._exdate.append(datetime_obj)
if exrule:
rset1.exrule(rrule.rrulestr(str(exrule), dtstart=startdate))
@ -413,7 +413,7 @@ property or property parameter."),
cal = vobject.iCalendar()
event = cal.add('vevent')
if not event_obj.date_deadline or not event_obj.date:
raise osv.except_osv(_('Warning !'),_("First specified the date for Invitation."))
raise osv.except_osv(_('Warning !'),_("First you have to specify the date of the invitation."))
event.add('created').value = ics_datetime(time.strftime('%Y-%m-%d %H:%M:%S'))
event.add('dtstart').value = ics_datetime(event_obj.date)
event.add('dtend').value = ics_datetime(event_obj.date_deadline)
@ -995,11 +995,11 @@ class calendar_event(osv.osv):
@param context: A standard dictionary for contextual values
@return: dictionary of rrule value.
"""
result = {}
if not isinstance(ids, list):
ids = [ids]
for datas in self.read(cr, uid, ids, ['id','byday','recurrency', 'month_list','end_date', 'rrule_type', 'select1', 'interval', 'count', 'end_type', 'mo', 'tu', 'we', 'th', 'fr', 'sa', 'su', 'exrule', 'day', 'week_list' ], context=context):
event = datas['id']
if datas.get('interval', 0) < 0:
@ -1092,7 +1092,7 @@ rule or repeating pattern of time to exclude from the recurring rule."),
true, it will allow you to hide the event alarm information without removing it."),
'recurrency': fields.boolean('Recurrent', help="Recurrent Meeting"),
}
def default_organizer(self, cr, uid, context=None):
user_pool = self.pool.get('res.users')
user = user_pool.browse(cr, uid, uid, context=context)
@ -1189,23 +1189,23 @@ rule or repeating pattern of time to exclude from the recurring rule."),
byday = map(lambda x: x.upper(), filter(lambda x: datas.get(x) and x in weekdays, datas))
if byday:
return ';BYDAY=' + ','.join(byday)
return ''
return ''
def get_month_string(freq, datas):
if freq == 'monthly':
if datas.get('select1')=='date' and (datas.get('day') < 1 or datas.get('day') > 31):
raise osv.except_osv(_('Error!'), ("Please select proper Day of month."))
raise osv.except_osv(_('Error!'), ("Please select a proper day of the month."))
if datas.get('select1')=='day':
return ';BYDAY=' + datas.get('byday') + datas.get('week_list')
elif datas.get('select1')=='date':
return ';BYMONTHDAY=' + str(datas.get('day'))
return ''
def get_end_date(datas):
if datas.get('end_date'):
datas['end_date_new'] = ''.join((re.compile('\d')).findall(datas.get('end_date'))) + 'T235959Z'
return (datas.get('end_type') == 'count' and (';COUNT=' + str(datas.get('count'))) or '') +\
((datas.get('end_date_new') and datas.get('end_type') == 'end_date' and (';UNTIL=' + datas.get('end_date_new'))) or '')
@ -1216,32 +1216,32 @@ rule or repeating pattern of time to exclude from the recurring rule."),
interval_srting = datas.get('interval') and (';INTERVAL=' + str(datas.get('interval'))) or ''
return 'FREQ=' + freq.upper() + get_week_string(freq, datas) + interval_srting + get_end_date(datas) + get_month_string(freq, datas)
def _get_empty_rrule_data(self):
return {
'byday' : False,
'recurrency' : False,
'end_date' : False,
'rrule_type' : False,
'select1' : False,
'interval' : 0,
'count' : False,
'end_type' : False,
'mo' : False,
'tu' : False,
'we' : False,
'th' : False,
'fr' : False,
'sa' : False,
'su' : False,
'exrule' : False,
'day' : False,
'end_date' : False,
'rrule_type' : False,
'select1' : False,
'interval' : 0,
'count' : False,
'end_type' : False,
'mo' : False,
'tu' : False,
'we' : False,
'th' : False,
'fr' : False,
'sa' : False,
'su' : False,
'exrule' : False,
'day' : False,
'week_list' : False
}
#def _write_rrule(self, cr, uid, ids, field_value, rule_date=False, context=None):
# data = self._get_empty_rrule_data()
#
#
# if field_value:
# data['recurrency'] = True
# for event in self.browse(cr, uid, ids, context=context):
@ -1250,16 +1250,16 @@ rule or repeating pattern of time to exclude from the recurring rule."),
# data.update(update_data)
# #parse_rrule
# self.write(cr, uid, event.id, data, context=context)
def _parse_rrule(self, rule, data, date_start):
day_list = ['mo', 'tu', 'we', 'th', 'fr', 'sa', 'su']
rrule_type = ['yearly', 'monthly', 'weekly', 'daily']
r = rrule.rrulestr(rule, dtstart=datetime.strptime(date_start, "%Y-%m-%d %H:%M:%S"))
if r._freq > 0 and r._freq < 4:
data['rrule_type'] = rrule_type[r._freq]
data['count'] = r._count
data['interval'] = r._interval
data['end_date'] = r._until and r._until.strftime("%Y-%m-%d %H:%M:%S")
@ -1270,36 +1270,36 @@ rule or repeating pattern of time to exclude from the recurring rule."),
data[day_list[i]] = True
data['rrule_type'] = 'weekly'
#repeat monthly bynweekday ((weekday, weeknumber), )
if r._bynweekday:
if r._bynweekday:
data['week_list'] = day_list[r._bynweekday[0][0]].upper()
data['byday'] = r._bynweekday[0][1]
data['select1'] = 'day'
data['rrule_type'] = 'monthly'
data['rrule_type'] = 'monthly'
if r._bymonthday:
data['day'] = r._bymonthday[0]
data['select1'] = 'date'
data['rrule_type'] = 'monthly'
#yearly but for openerp it's monthly, take same information as monthly but interval is 12 times
if r._bymonth:
data['interval'] = data['interval'] * 12
#FIXEME handle forever case
#end of recurrence
#end of recurrence
#in case of repeat for ever that we do not support right now
if not (data.get('count') or data.get('end_date')):
data['count'] = 100
if data.get('count'):
data['end_type'] = 'count'
else:
data['end_type'] = 'end_date'
return data
data['end_type'] = 'end_date'
return data
def remove_virtual_id(self, ids):
if isinstance(ids, (str, int, long)):
return base_calendar_id2real_id(ids)
if isinstance(ids, (list, tuple)):
res = []
for id in ids:
@ -1345,7 +1345,7 @@ rule or repeating pattern of time to exclude from the recurring rule."),
def need_to_update(self, event_id, vals):
split_id = str(event_id).split("-")
if len(split_id) < 2:
return False
return False
else:
date_start = vals.get('date', '')
try:
@ -1409,7 +1409,7 @@ rule or repeating pattern of time to exclude from the recurring rule."),
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
if not context:
context = {}
if 'date' in groupby:
raise osv.except_osv(_('Warning !'), _('Group by date is not supported, use the calendar view instead.'))
virtual_id = context.get('virtual_id', True)
@ -1479,7 +1479,7 @@ rule or repeating pattern of time to exclude from the recurring rule."),
def copy(self, cr, uid, id, default=None, context=None):
if context is None:
context = {}
res = super(calendar_event, self).copy(cr, uid, base_calendar_id2real_id(id), default, context)
alarm_obj = self.pool.get('res.alarm')
alarm_obj.do_alarm_create(cr, uid, [res], self._name, 'date', context=context)

View File

@ -92,7 +92,7 @@ send an Email to Invited Person')
else:
return {'type': 'ir.actions.act_window_close'}
if type == 'internal':
if not datas.get('user_ids'):
raise osv.except_osv(_('Error!'), ("Please select any user."))
for user_id in datas.get('user_ids'):
@ -141,7 +141,7 @@ send an Email to Invited Person')
if not mail_to:
name = map(lambda x: x[1], filter(lambda x: type==x[0], \
self._columns['type'].selection))
raise osv.except_osv(_('Error!'), _("%s must have an email address to send mail.") %(name[0]))
raise osv.except_osv(_('Error!'), _("%s must have an email address to send mail.") %(name[0]))
att_obj._send_mail(cr, uid, attendees, mail_to, \
email_from = current_user.user_email or tools.config.get('email_from', False))

View File

@ -139,7 +139,7 @@ class users(osv.osv):
def set_pw(self, cr, uid, id, name, value, args, context):
if not value:
raise osv.except_osv(_('Error!'), _("Please specify the password !"))
raise osv.except_osv(_('Error!'), _("You have to specify a password."))
obj = pooler.get_pool(cr.dbname).get('res.users')
if not hasattr(obj, "_salt_cache"):
@ -181,8 +181,8 @@ class users(osv.osv):
cr = pooler.get_db(db).cursor()
return self._login(cr, db, login, password)
except Exception:
_logger.exception('Cannot authenticate!')
return Exception('Access is denied!')
_logger.exception('Cannot authenticate.')
return Exception('Access denied.')
finally:
if cr is not None:
cr.close()
@ -196,9 +196,9 @@ class users(osv.osv):
else:
# Return early if no one has a login name like that.
return False
stored_pw = self.maybe_encrypt(cr, stored_pw, id)
if not stored_pw:
# means couldn't encrypt or user is not active!
return False
@ -210,16 +210,16 @@ class users(osv.osv):
obj._salt_cache = {}
salt = obj._salt_cache[id] = stored_pw[len(magic_md5):11]
encrypted_pw = encrypt_md5(password, salt)
# Check if the encrypted password matches against the one in the db.
cr.execute("""UPDATE res_users
SET date=now() AT TIME ZONE 'UTC'
WHERE id=%s AND password=%s AND active
RETURNING id""",
RETURNING id""",
(int(id), encrypted_pw.encode('utf-8')))
res = cr.fetchone()
cr.commit()
if res:
return res[0]
else:
@ -249,13 +249,13 @@ class users(osv.osv):
stored_login = cr.fetchone()
if stored_login:
stored_login = stored_login[0]
res = self._login(cr, db, stored_login, passwd)
if not res:
raise security.ExceptionNoTb('AccessDenied')
else:
salt = self._salt_cache[db][uid]
cr.execute('SELECT COUNT(*) FROM res_users WHERE id=%s AND password=%s AND active',
cr.execute('SELECT COUNT(*) FROM res_users WHERE id=%s AND password=%s AND active',
(int(uid), encrypt_md5(passwd, salt)))
res = cr.fetchone()[0]
finally:
@ -271,10 +271,10 @@ class users(osv.osv):
else:
self._uid_cache[db] = {uid: passwd}
return bool(res)
def maybe_encrypt(self, cr, pw, id):
""" Return the password 'pw', making sure it is encrypted.
If the password 'pw' is not encrypted, then encrypt all active passwords
in the db. Returns the (possibly newly) encrypted password for 'id'.
"""
@ -296,4 +296,5 @@ class users(osv.osv):
return pw
users()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -138,7 +138,7 @@ class DomApi(DomApiGeneral):
if self.styles_dom.getElementsByTagName("style:page-master").__len__()<>0:
self.page_master = self.styles_dom.getElementsByTagName("style:page-master")[0]
if self.styles_dom.getElementsByTagName("style:page-layout").__len__()<>0 :
self.page_master = self.styles_dom.getElementsByTagName("style:page-layout")[0]
self.page_master = self.styles_dom.getElementsByTagName("style:page-layout")[0]
self.document = self.content_dom.getElementsByTagName("office:document-content")[0]
def buildStylePropertiesDict(self):
@ -307,16 +307,16 @@ def sxw2rml(sxw_file, xsl, output='.', save_pict=False):
tool = PyOpenOffice(output, save_pict = save_pict)
res = tool.unpackNormalize(sxw_file)
f = StringIO(xsl)
styledoc = etree.parse(f)
style = etree.XSLT(styledoc)
f = StringIO(res)
doc = etree.parse(f)
result = style(doc)
root = etree.XPathEvaluator(result)("/document/stylesheet")
if root:
root=root[0]
images = etree.Element("images")
@ -341,7 +341,7 @@ if __name__ == "__main__":
parser.add_option("-o", "--output", dest="output", default='.', help="directory of image output")
(opt, args) = parser.parse_args()
if len(args) != 1:
parser.error("Incorrect number of arguments!")
parser.error("Incorrect number of arguments.")
import sys

View File

@ -3,31 +3,31 @@
# Portions of this file are under the following copyright and license:
#
#
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
#
#
#
# and other portions are under the following copyright and license:
#
#
# OpenERP, Open Source Management Solution>..
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -145,7 +145,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ):
self.aSearchResult =self.sock.execute( database, uid, self.password, self.dModel[modelSelectedItem], 'name_search', self.win.getEditText("txtSearchName"))
self.win.removeListBoxItems("lstResource", 0, self.win.getListBoxItemCount("lstResource"))
if self.aSearchResult == []:
ErrorDialog("No search result is found !", "", "Search ERROR" )
ErrorDialog("No search result found.", "", "Search Error.")
return
for result in self.aSearchResult:
@ -172,7 +172,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ):
docinfo = oDoc2.getDocumentInfo()
if oDoc2.getURL() == "":
ErrorDialog("Please save your file.", "", "Saving ERROR!" )
ErrorDialog("You should save your file.", "", "Saving Error.")
return None
url = oDoc2.getURL()
@ -180,7 +180,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ):
url = self.doc2pdf(url[7:])
if url == None:
ErrorDialog( "Problem in creating PDF!", "", "PDF Error!" )
ErrorDialog( "Problem in creating PDF.", "", "PDF Error.")
return None
url = url[7:]
@ -193,7 +193,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ):
docinfo = oDoc2.getDocumentInfo()
if self.win.getListBoxSelectedItem("lstResourceType") == "":
ErrorDialog("Please select resource type.", "", "Selection ERROR!" )
ErrorDialog("You have to select a resource type.", "", "Selection Error." )
return
res = self.send_attachment( docinfo.getUserFieldValue(3), docinfo.getUserFieldValue(2) )
@ -201,11 +201,11 @@ class AddAttachment(unohelper.Base, XJobExecutor ):
def btnOkWithInformation_clicked(self,oActionEvent):
if self.win.getListBoxSelectedItem("lstResourceType") == "":
ErrorDialog( "Please select resource type.", "", "Selection ERROR!" )
ErrorDialog( "You have to select a resource type.", "", "Selection Error." )
return
if self.win.getListBoxSelectedItem("lstResource") == "" or self.win.getListBoxSelectedItem("lstmodel") == "":
ErrorDialog("Please select Model and Resource.","","Selection ERROR!")
ErrorDialog("You have to select Model and Resource.", "", "Selection Error.")
return
resourceid = None
@ -215,7 +215,7 @@ class AddAttachment(unohelper.Base, XJobExecutor ):
break
if resourceid == None:
ErrorDialog("No resource is selected !", "", "Resource ERROR!" )
ErrorDialog("No resource is selected.", "", "Resource Error." )
return
res = self.send_attachment( self.dModel[self.win.getListBoxSelectedItem('lstmodel')], resourceid )

View File

@ -3,31 +3,31 @@
# Portions of this file are under the following copyright and license:
#
#
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
#
#
#
# and other portions are under the following copyright and license:
#
#
# OpenERP, Open Source Management Solution>..
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -106,7 +106,7 @@ class ExportToRML( unohelper.Base, XJobExecutor ):
import traceback,sys
info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
self.logobj.log_write('ExportToRML',LOG_ERROR, info)
ErrorDialog("Cannot save the file to the hard drive.", "Exception: %s !" % e, "Error" )
ErrorDialog("Cannot save the file to the hard drive.", "Exception: %s." % e, "Error" )
def GetAFileName(self):
sFilePickerArgs = Array(10)

View File

@ -3,31 +3,31 @@
# Portions of this file are under the following copyright and license:
#
#
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
#
#
#
# and other portions are under the following copyright and license:
#
#
# OpenERP, Open Source Management Solution>..
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -64,7 +64,6 @@ if __name__<>'package':
database="test"
uid = 3
#
class ModifyExistingReport(unohelper.Base, XJobExecutor):
def __init__(self,ctx):
self.ctx = ctx
@ -167,11 +166,11 @@ class ModifyExistingReport(unohelper.Base, XJobExecutor):
if oDoc2.hasLocation() and not oDoc2.isReadonly():
oDoc2.store()
ErrorDialog("Download is Completed.","Your file has been placed here :\n ."+ fp_name,"Download Message !")
ErrorDialog("Download is completed.","Your file has been placed here :\n ."+ fp_name,"Download Message !")
obj=Logger()
obj.log_write('Modify Existing Report',LOG_INFO, ':successful download report %s using database %s' % (self.report_with_id[selectedItemPos][2], database))
except Exception, e:
ErrorDialog("Report has not been downloaded.", "Report: %s\nDetails: %s" % ( fp_name, str(e) ),"Download Message !")
ErrorDialog("The report could not be downloaded.", "Report: %s\nDetails: %s" % ( fp_name, str(e) ),"Download Message !")
import traceback,sys
info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
self.logobj.log_write('ModifyExistingReport', LOG_ERROR, info)
@ -193,15 +192,15 @@ class ModifyExistingReport(unohelper.Base, XJobExecutor):
str_value='ir.actions.report.xml,'+str(id)
ids = self.sock.execute(database, uid, self.password, 'ir.values' , 'search',[('value','=',str_value)])
if ids:
rec = self.sock.execute(database, uid, self.password, 'ir.values', 'unlink', ids,)
rec = self.sock.execute(database, uid, self.password, 'ir.values', 'unlink', ids,)
else :
pass
if temp:
ErrorDialog("Report","Report has been Delete:\n ."+name,"Message !")
self.logobj.log_write('Delete Report',LOG_INFO, ':successful delete report %s using database %s' % (name, database))
ErrorDialog("Report", "The report could not be deleted:\n"+name+".", "Message !")
self.logobj.log_write('Delete Report', LOG_INFO, ': report %s successfully deleted using database %s.' % (name, database))
else:
ErrorDialog("Report","Report has not Delete:\n ."+name," Message !")
ErrorDialog("Report", "The report could not be deleted:\n"+name+".", "Message !")
self.win.endExecute()

View File

@ -3,31 +3,31 @@
# Portions of this file are under the following copyright and license:
#
#
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
#
#
#
# and other portions are under the following copyright and license:
#
#
# OpenERP, Open Source Management Solution>..
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -65,8 +65,6 @@ if __name__<>'package':
database="report"
uid = 3
#
#
class SendtoServer(unohelper.Base, XJobExecutor):
Kind = {
'PDF' : 'pdf',
@ -172,8 +170,8 @@ class SendtoServer(unohelper.Base, XJobExecutor):
}
res = self.sock.execute(database, uid, self.password, 'ir.values' , 'create',rec )
else :
ErrorDialog(" Report Name is already given !\n\n\n Please specify other name.","","Report Name !")
self.logobj.log_write('SendToServer',LOG_WARNING, ':Report name all ready given DB %s' % (database))
ErrorDialog("This name is already used for another report.\nPlease try with another name.", "", "Report Name !")
self.logobj.log_write('SendToServer',LOG_WARNING, ': report name already used DB %s' % (database))
self.win.endExecute()
except Exception,e:
import traceback,sys
@ -205,8 +203,8 @@ class SendtoServer(unohelper.Base, XJobExecutor):
self.logobj.log_write('SendToServer',LOG_INFO, ':Report %s successfully send using %s'%(params['name'],database))
self.win.endExecute()
else:
ErrorDialog("Either Report Name or Technical Name is blank !\nPlease specify appropriate Name.","","Blank Field ERROR !")
self.logobj.log_write('SendToServer',LOG_WARNING, ':Either Report Name or Technical Name is blank')
ErrorDialog("Either report name or technical name is blank.\nPlease specify an appropriate name.","","Blank Field Error !")
self.logobj.log_write('SendToServer',LOG_WARNING, ': either report name or technical name is blank.')
self.win.endExecute()
def getID(self):

View File

@ -3,31 +3,31 @@
# Portions of this file are under the following copyright and license:
#
#
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
#
#
#
# and other portions are under the following copyright and license:
#
#
# OpenERP, Open Source Management Solution>..
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -86,7 +86,7 @@ class ServerParameter( unohelper.Base, XJobExecutor ):
self.win.addButton('btnOK',-2 ,-5, 60,15,'Connect' ,actionListenerProc = self.btnOk_clicked )
self.win.addButton('btnPrevious',15 -80 ,-5,50,15,'Previous',actionListenerProc = self.btnPrevious_clicked)
self.win.addButton('btnCancel',-2 - 110 - 5 ,-5, 35,15,'Cancel' ,actionListenerProc = self.btnCancel_clicked )
sValue=""
if docinfo.getUserFieldValue(0)<>"":
global url
@ -100,8 +100,8 @@ class ServerParameter( unohelper.Base, XJobExecutor ):
# sValue="Could not connect to the server!"
# self.lstDatabase.addItem("Could not connect to the server!",0)
elif res == 0:
sValue="No Database is found !"
self.lstDatabase.addItem("No Database is found !",0)
sValue="No database found !"
self.lstDatabase.addItem("No database found !",0)
else:
self.win.addComboListBox("lstDatabase", -2,28,123,15, True)
self.lstDatabase = self.win.getControl( "lstDatabase" )
@ -129,12 +129,12 @@ class ServerParameter( unohelper.Base, XJobExecutor ):
self.sock=RPCSession(url)
UID = self.sock.login(sDatabase,sLogin,sPassword)
if not UID or UID==-1 :
ErrorDialog("Connection Refuse...","Please enter valid Login/Password.")
ErrorDialog("Connection denied.", "Please enter valid login/password.")
# self.win.endExecute()
ids_module =self.sock.execute(sDatabase, UID, sPassword, 'ir.module.module', 'search', [('name','=','base_report_designer'),('state', '=', 'installed')])
if not len(ids_module):
ErrorDialog("Please install base_report_designer module.", "", "Module Uninstalled Error !")
self.logobj.log_write('Module is not found.',LOG_WARNING, ':base_report_designer not install in database %s.' % (sDatabase))
self.logobj.log_write('Module not found.',LOG_WARNING, ': base_report_designer not installed in database %s.' % (sDatabase))
#self.win.endExecute()
else:
desktop=getDesktop()
@ -153,11 +153,11 @@ class ServerParameter( unohelper.Base, XJobExecutor ):
#docinfo.setUserFieldValue(2,self.win.getListBoxSelectedItem("lstDatabase"))
#docinfo.setUserFieldValue(3,"")
ErrorDialog(" You can start creating your report in \n \t the current document.","After Creating sending to the server.","Message !")
self.logobj.log_write('successful login',LOG_INFO, ':successful login from %s using database %s' % (sLogin, sDatabase))
ErrorDialog("You can start creating your report in the current document.", "After creating, sending to the server.", "Message !")
self.logobj.log_write('successful login',LOG_INFO, ': successful login from %s using database %s' % (sLogin, sDatabase))
self.win.endExecute()
def btnCancel_clicked( self, oActionEvent ):
self.win.endExecute()
@ -165,7 +165,7 @@ class ServerParameter( unohelper.Base, XJobExecutor ):
self.win.endExecute()
Change(None)
self.win.endExecute()
if __name__<>"package" and __name__=="__main__":
ServerParameter(None)

View File

@ -3,31 +3,31 @@
# Portions of this file are under the following copyright and license:
#
#
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
#
#
#
# and other portions are under the following copyright and license:
#
#
# OpenERP, Open Source Management Solution>..
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -175,7 +175,7 @@ class AddLang(unohelper.Base, XJobExecutor ):
res = self.sock.execute(database, uid, self.password, sObject , 'read',[ids[0]])
self.win.setEditText("txtUName",res[0][sMain[sMain.rfind("/")+1:]])
else:
ErrorDialog("Please select the Language field.")
ErrorDialog("Please select a language.")
except:
import traceback;traceback.print_exc()
@ -261,7 +261,7 @@ class AddLang(unohelper.Base, XJobExecutor ):
self.win.endExecute()
else:
ErrorDialog("Please fill appropriate data in Name field \nor select particular value from the list of fields.")
ErrorDialog("Please fill appropriate data in name field \nor select particular value from the list of fields.")
def btnCancel_clicked( self, oActionEvent ):
self.win.endExecute()

View File

@ -56,14 +56,14 @@ class mysocket:
while totalsent < size:
sent = self.sock.send(msg[totalsent:])
if sent == 0:
raise RuntimeError, "Socket connection broken!"
raise RuntimeError, "Socket connection broken."
totalsent = totalsent + sent
def myreceive(self):
buf=''
while len(buf) < 8:
chunk = self.sock.recv(8 - len(buf))
if chunk == '':
raise RuntimeError, "Socket connection broken!"
raise RuntimeError, "Socket connection broken."
buf += chunk
size = int(buf)
buf = self.sock.recv(1)
@ -75,7 +75,7 @@ class mysocket:
while len(msg) < size:
chunk = self.sock.recv(size-len(msg))
if chunk == '':
raise RuntimeError, "Socket connection broken!"
raise RuntimeError, "Socket connection broken."
msg = msg + chunk
msgio = cStringIO.StringIO(msg)
unpickler = cPickle.Unpickler(msgio)
@ -90,6 +90,4 @@ class mysocket:
return res[0]
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -3,31 +3,31 @@
# Portions of this file are under the following copyright and license:
#
#
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
# Copyright (c) 2003-2004 Danny Brewer
# d29583@groovegarden.com
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See: http://www.gnu.org/licenses/lgpl.html
#
#
#
# and other portions are under the following copyright and license:
#
#
# OpenERP, Open Source Management Solution>..
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@ -100,8 +100,7 @@ class modify(unohelper.Base, XJobExecutor ):
RepeatIn( start_group1, group2, stop_group1, item, True )
else:
ErrorDialog(
"Please place your cursor at begaining of field \n"
"which you want to modify.",""
"Please place your cursor at beginning of field that you want to modify.",""
)
else:

View File

@ -25,7 +25,7 @@ from tools.translate import _
class base_stage(object):
""" Base utility mixin class for objects willing to manage their stages.
Object that inherit from this class should inherit from mailgate.thread
to have access to the mail gateway, as well as Chatter. Objects
to have access to the mail gateway, as well as Chatter. Objects
subclassing this class should define the following colums:
- ``date_open`` (datetime field)
- ``date_closed`` (datetime field)
@ -104,13 +104,13 @@ class base_stage(object):
def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None):
""" Find stage, with a given (optional) domain on the search,
ordered by the order parameter. If several stages match the
ordered by the order parameter. If several stages match the
search criterions, the first one will be returned, according
to the requested search order.
This method is meant to be overriden by subclasses. That way
specific behaviors can be achieved for every class inheriting
from base_stage.
:param cases: browse_record of cases
:param section_id: section limitating the search, given for
a generic search (for example default search).
@ -202,7 +202,7 @@ class base_stage(object):
if case.section_id.parent_id.user_id:
data['user_id'] = case.section_id.parent_id.user_id.id
else:
raise osv.except_osv(_('Error !'), _("You are already at the top level of your sales-team category.\n That is why you cannot escalate."))
raise osv.except_osv(_('Error !'), _("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore."))
self.write(cr, uid, [case.id], data, context=context)
case.case_escalate_send_note(case.section_id.parent_id, context=context)
cases = self.browse(cr, uid, ids, context=context)
@ -221,7 +221,7 @@ class base_stage(object):
self.case_set(cr, uid, [case.id], 'open', data, context=context)
self.case_open_send_note(cr, uid, [case.id], context=context)
return True
def case_close(self, cr, uid, ids, context=None):
""" Closes case """
self.case_set(cr, uid, ids, 'done', {'active': True, 'date_closed': fields.datetime.now()}, context=context)
@ -250,14 +250,14 @@ class base_stage(object):
""" Generic method for setting case. This methods wraps the update
of the record, as well as call to _action and browse_record
case setting to fill the cache.
:params new_state_name: the new state of the record; this method
will call ``stage_set_with_state_name``
that will find the stage matching the
new state, using the ``stage_find`` method.
:params new_stage_id: alternatively, you may directly give the
new stage of the record
:params state_name: the new value of the state, such as
:params state_name: the new value of the state, such as
'draft' or 'close'.
:params update_values: values that will be added with the state
update when writing values to the record.
@ -370,20 +370,20 @@ class base_stage(object):
l.append(case.user_id.user_email)
res[case.id] = l
return res
# ******************************
# Notifications
# ******************************
def case_get_note_msg_prefix(self, cr, uid, id, context=None):
""" Default prefix for notifications. For example: "%s has been
""" Default prefix for notifications. For example: "%s has been
<b>closed</b>.". As several models will inherit from base_stage,
this method returns a void string. Class using base_stage
will have to override this method to define the prefix they
want to display.
"""
return ''
def stage_set_send_note(self, cr, uid, ids, stage_id, context=None):
""" Send a notification when the stage changes. This method has
to be overriden, because each document will have its particular
@ -391,7 +391,7 @@ class base_stage(object):
crm.case.stage).
"""
return True
def case_open_send_note(self, cr, uid, ids, context=None):
for id in ids:
msg = _('%s has been <b>opened</b>.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
@ -421,7 +421,7 @@ class base_stage(object):
msg = _('%s has been <b>renewed</b>.') % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
self.message_append_note(cr, uid, [id], body=msg, context=context)
return True
def case_escalate_send_note(self, cr, uid, ids, new_section=None, context=None):
for id in ids:
if new_section: