[MERGE] branch merged with lp:~openerp-dev/openobject-addons/trunk-dev-addons1
bzr revid: mso@mso-20100427070956-1bqv7nzopjggl7uc bzr revid: mso@mso-20100428045415-y9uze0nlpjwyy7p8
This commit is contained in:
@@ -1062,7 +1062,7 @@ class account_move(osv.osv):
|
||||
# Example:
|
||||
# difference == 0.01 is OK iff price_accuracy <= 1!
|
||||
# difference == 0.0001 is OK iff price_accuracy <= 3!
|
||||
if abs(amount) < 10 ** -(int(config['price_accuracy'])):
|
||||
if abs(amount) < 10 ** -(int(config['price_accuracy'])+1):
|
||||
if not len(line_draft_ids):
|
||||
continue
|
||||
self.pool.get('account.move.line').write(cr, uid, line_draft_ids, {
|
||||
|
||||
@@ -7,13 +7,13 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.0\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2010-03-29 15:32+0000\n"
|
||||
"Last-Translator: Carlo Vettore <Unknown>\n"
|
||||
"PO-Revision-Date: 2010-04-26 07:46+0000\n"
|
||||
"Last-Translator: eLBati - albatos.com <lorenzo.battistini@albatos.com>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-17 04:06+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-28 03:44+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account
|
||||
@@ -1192,7 +1192,7 @@ msgstr "Report tassa"
|
||||
#: wizard_button:account.analytic.account.chart,init,open:0
|
||||
#: wizard_button:account.chart,init,open:0
|
||||
msgid "Open Charts"
|
||||
msgstr "Conti aperti"
|
||||
msgstr "Apri"
|
||||
|
||||
#. module: account
|
||||
#: wizard_view:account.fiscalyear.close.state,init:0
|
||||
@@ -2301,6 +2301,8 @@ msgstr ""
|
||||
#: wizard_view:account.chart,init:0
|
||||
msgid "(If you do not select Fiscal year it will take all open fiscal years)"
|
||||
msgstr ""
|
||||
"Se non si seleziona un anno fiscale, verranno visualizzati tutti gli anni "
|
||||
"fiscali aperti"
|
||||
|
||||
#. module: account
|
||||
#: help:account.invoice.tax,base_code_id:0
|
||||
@@ -4429,7 +4431,7 @@ msgstr ""
|
||||
#. module: account
|
||||
#: wizard_view:account.wizard_paid_open,init:0
|
||||
msgid "Open Invoice"
|
||||
msgstr "Fattura aperta"
|
||||
msgstr "Apri fattura"
|
||||
|
||||
#. module: account
|
||||
#: model:process.node,note:account.process_node_draftstatement0
|
||||
|
||||
@@ -7,13 +7,13 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.0\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2010-04-25 17:34+0000\n"
|
||||
"PO-Revision-Date: 2010-04-27 19:28+0000\n"
|
||||
"Last-Translator: Grzegorz Grzelak (Cirrus.pl) <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-26 03:42+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-28 03:44+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account
|
||||
@@ -2087,7 +2087,7 @@ msgstr "Wydatki"
|
||||
#. module: account
|
||||
#: field:account.journal,invoice_sequence_id:0
|
||||
msgid "Invoice Sequence"
|
||||
msgstr "Numeracja faktury"
|
||||
msgstr "Numeracja faktur"
|
||||
|
||||
#. module: account
|
||||
#: wizard_view:account.automatic.reconcile,init:0
|
||||
|
||||
@@ -7,13 +7,13 @@ msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 5.0.4\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2010-04-25 21:20+0000\n"
|
||||
"PO-Revision-Date: 2010-04-26 09:10+0000\n"
|
||||
"Last-Translator: Martin Volf <Unknown>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-26 03:41+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-28 03:44+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: account_tax_include
|
||||
@@ -24,12 +24,12 @@ msgstr "Neplatný XML pro zobrazení architektury"
|
||||
#. module: account_tax_include
|
||||
#: field:account.invoice,price_type:0
|
||||
msgid "Price method"
|
||||
msgstr ""
|
||||
msgstr "Metoda určování cen"
|
||||
|
||||
#. module: account_tax_include
|
||||
#: model:ir.module.module,shortdesc:account_tax_include.module_meta_information
|
||||
msgid "Invoices and prices with taxes included"
|
||||
msgstr ""
|
||||
msgstr "Faktury a ceny včetně daní"
|
||||
|
||||
#. module: account_tax_include
|
||||
#: selection:account.invoice,price_type:0
|
||||
|
||||
@@ -30,19 +30,26 @@ import tools
|
||||
#objects_proxy = netsvc.ExportService.getService('object').__class__
|
||||
class recording_objects_proxy(osv_pool):
|
||||
def execute(self, *args, **argv):
|
||||
if len(args) >= 6 and isinstance(args[5], dict):
|
||||
if args[3] == 'create':
|
||||
_old_args = args[4].copy()
|
||||
elif args[3] == 'write':
|
||||
_old_args = args[5].copy()
|
||||
elif len(args) >= 5 and isinstance(args[4], dict):
|
||||
_old_args = args[4].copy()
|
||||
else:
|
||||
_old_args = None
|
||||
res = super(recording_objects_proxy, self).execute(*args, **argv)
|
||||
pool = pooler.get_pool(args[0])
|
||||
mod = pool.get('ir.module.record')
|
||||
|
||||
if mod and mod.recording:
|
||||
if args[3] not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink'):
|
||||
if _old_args is not None:
|
||||
args[5].update(_old_args)
|
||||
if args[5]:
|
||||
mod.recording_data.append(('query', args, argv,res))
|
||||
if args[3] == 'create':
|
||||
args[4].update(_old_args)
|
||||
elif args[3] == 'write':
|
||||
args[5].update(_old_args)
|
||||
mod.recording_data.append(('query', args, argv,res))
|
||||
return res
|
||||
|
||||
def exec_workflow(self, *args, **argv):
|
||||
@@ -125,7 +132,8 @@ class base_module_record(osv.osv):
|
||||
name = filter(lambda x: x in string.letters, (data.get('name','') or '').lower())
|
||||
except:
|
||||
name=''
|
||||
val = model.replace('.','_')+'_'+name+ str(i)
|
||||
# name=data.get('name','') or ''.lower()
|
||||
val = model.replace('.','_')+'_'+ name + str(i)
|
||||
i+=1
|
||||
if val not in self.ids.values():
|
||||
break
|
||||
@@ -146,7 +154,6 @@ class base_module_record(osv.osv):
|
||||
|
||||
def _create_record(self, cr, uid, doc, model, data, record_id, noupdate=False):
|
||||
|
||||
data_pool = self.pool.get('ir.model.data')
|
||||
model_pool = self.pool.get(model)
|
||||
|
||||
record = doc.createElement('record')
|
||||
@@ -196,12 +203,26 @@ class base_module_record(osv.osv):
|
||||
fname = model_pool._columns[key]._fields_id
|
||||
else:
|
||||
fname = model_pool._inherit_fields[key][2]._fields_id
|
||||
valitem[2][fname] = record_id
|
||||
newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1])
|
||||
if not newid:
|
||||
if valitem[0] == 0:
|
||||
newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
|
||||
valitem[1]=newid
|
||||
else:
|
||||
newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1])
|
||||
if not newid:
|
||||
newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
|
||||
valitem[1]=newid
|
||||
self.ids[(fields[key]['relation'], valitem[1])] = newid
|
||||
|
||||
# if valitem[0] in (0,1):
|
||||
# if key in model_pool._columns:
|
||||
# fname = model_pool._columns[key]._fields_id
|
||||
# else:
|
||||
# fname = model_pool._inherit_fields[key][2]._fields_id
|
||||
# valitem[2][fname] = record_id
|
||||
# newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1])
|
||||
# if not newid:
|
||||
# newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
|
||||
# self.ids[(fields[key]['relation'], valitem[1])] = newid
|
||||
#
|
||||
childrecord, update = self._create_record(cr, uid, doc, fields[key]['relation'],valitem[2], newid)
|
||||
noupdate = noupdate or update
|
||||
record_list += childrecord
|
||||
@@ -245,7 +266,7 @@ class base_module_record(osv.osv):
|
||||
for key,val in data.items():
|
||||
if ((key in defaults[model]) and (val == defaults[model][key])) and not(fields[key].get('required',False)):
|
||||
continue
|
||||
if not (val or (fields[key]['type']=='boolean')):
|
||||
if not (val or (fields[key]['type']=='function')):
|
||||
continue
|
||||
elif fields[key]['type'] in ('boolean',):
|
||||
if not val:
|
||||
@@ -267,12 +288,9 @@ class base_module_record(osv.osv):
|
||||
fname = model_pool._columns[key]._fields_id
|
||||
else:
|
||||
fname = model_pool._inherit_fields[key][2]._fields_id
|
||||
valitem[2][fname] = record_id
|
||||
newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1])
|
||||
if not newid:
|
||||
newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
|
||||
self.ids[(fields[key]['relation'], valitem[1])] = newid
|
||||
childrecord = self._create_yaml_record(cr, uid, fields[key]['relation'],valitem[2], newid)
|
||||
del valitem[2][fname] #delete parent_field from child's fields list
|
||||
|
||||
childrecord = self._create_yaml_record(cr, uid, fields[key]['relation'],valitem[2], None)
|
||||
items[0].append(childrecord['attrs'])
|
||||
attrs[key] = items
|
||||
elif fields[key]['type'] in ('many2many',):
|
||||
@@ -289,11 +307,11 @@ class base_module_record(osv.osv):
|
||||
if m2m[0]:
|
||||
attrs[key] = m2m
|
||||
else:
|
||||
val=val.replace('"','\'')
|
||||
try:
|
||||
attrs[key]=str(val)
|
||||
except:
|
||||
attrs[key]=tools.ustr(val)
|
||||
attrs[key]=attrs[key].replace('"','\'')
|
||||
record['attrs'] = attrs
|
||||
return record
|
||||
|
||||
@@ -311,7 +329,7 @@ class base_module_record(osv.osv):
|
||||
for f in filter(lambda a: isinstance(obj._columns[a], fields.function)\
|
||||
and (not obj._columns[a].store),obj._columns):
|
||||
del data[f]
|
||||
|
||||
|
||||
for key,val in data.items():
|
||||
if result.has_key(key):
|
||||
continue
|
||||
@@ -361,16 +379,16 @@ class base_module_record(osv.osv):
|
||||
def _generate_object_xml(self, cr, uid, rec, recv, doc, result=None):
|
||||
record_list = []
|
||||
noupdate = False
|
||||
if rec[4]=='write':
|
||||
for id in rec[5]:
|
||||
id,update = self._get_id(cr, uid, rec[3], id)
|
||||
if rec[3]=='write':
|
||||
for id in rec[4]:
|
||||
id,update = self._get_id(cr, uid, rec[2], id)
|
||||
noupdate = noupdate or update
|
||||
if not id:
|
||||
continue
|
||||
record,update = self._create_record(cr, uid, doc, rec[3], rec[6], id)
|
||||
record,update = self._create_record(cr, uid, doc, rec[2], rec[5], id)
|
||||
noupdate = noupdate or update
|
||||
record_list += record
|
||||
|
||||
|
||||
elif rec[4] in ('menu_create',):
|
||||
for id in rec[5]:
|
||||
id,update = self._get_id(cr, uid, rec[3], id)
|
||||
@@ -487,7 +505,10 @@ class base_module_record(osv.osv):
|
||||
yaml_file += str(object) + '''\n\n'''
|
||||
else:
|
||||
record= self._generate_object_yaml(cr, uid, rec[1],rec[3])
|
||||
yaml_file+="!comment Creating an %s record"%(record['model']) + '''\n'''
|
||||
if self.mode == "create" or self.mode == "copy":
|
||||
yaml_file+="!comment Creating a %s record"%(record['model']) + '''\n'''
|
||||
else:
|
||||
yaml_file+="!comment Modifying a %s record"%(record['model']) + '''\n'''
|
||||
object= yaml.load(unicode('''\n !record %s \n'''%record,'iso-8859-1'))
|
||||
yaml_file += str(object) + '''\n'''
|
||||
attrs=yaml.dump(object.attrs, default_flow_style=False)
|
||||
|
||||
@@ -168,8 +168,8 @@ class email_parser(object):
|
||||
|
||||
def _decode_header(self, s):
|
||||
from email.Header import decode_header
|
||||
s = decode_header(s)
|
||||
return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s))
|
||||
s = decode_header(s)
|
||||
return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or []))
|
||||
|
||||
def msg_new(self, msg):
|
||||
message = self.msg_body_get(msg)
|
||||
|
||||
@@ -137,7 +137,8 @@ class email_server(osv.osv):
|
||||
('imap','IMAP Server'),
|
||||
],'State', select=True, readonly=False),
|
||||
'is_ssl':fields.boolean('SSL ?', required=False),
|
||||
'date': fields.date('Date'),
|
||||
'attach':fields.boolean('Add Attachments ?', required=False),
|
||||
'date': fields.date('Date', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'user' : fields.char('User Name', size=256, required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'password' : fields.char('Password', size=1024, invisible=True, required=True, readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'note': fields.text('Description'),
|
||||
@@ -292,17 +293,18 @@ class email_server(osv.osv):
|
||||
else:
|
||||
logger.notifyChannel('imap', netsvc.LOG_WARNING, 'method def message_new is not define in model %s' % (model_pool._name))
|
||||
return False
|
||||
|
||||
# for attactment in attachents or []:
|
||||
# data_attach = {
|
||||
# 'name': attactment,
|
||||
# 'datas':binascii.b2a_base64(str(attachents.get(attactment))),
|
||||
# 'datas_fname': attactment,
|
||||
# 'description': 'Mail attachment',
|
||||
# 'res_model': server.object_id.model,
|
||||
# 'res_id': res_id,
|
||||
# }
|
||||
# self.pool.get('ir.attachment').create(cr, uid, data_attach)
|
||||
|
||||
if server.attach:
|
||||
for attactment in attachents or []:
|
||||
data_attach = {
|
||||
'name': attactment,
|
||||
'datas':binascii.b2a_base64(str(attachents.get(attactment))),
|
||||
'datas_fname': attactment,
|
||||
'description': 'Mail attachment',
|
||||
'res_model': server.object_id.model,
|
||||
'res_id': res_id,
|
||||
}
|
||||
self.pool.get('ir.attachment').create(cr, uid, data_attach)
|
||||
|
||||
if server.action_id:
|
||||
action_pool = self.pool.get('ir.actions.server')
|
||||
@@ -319,10 +321,15 @@ class email_server(osv.osv):
|
||||
his_id = history_pool.create(cr, uid, res)
|
||||
|
||||
return res_id
|
||||
|
||||
def __fetch_mail(self, cr, uid, ids, context={}):
|
||||
sendmail_thread = threading.Thread(target=self.fetch_mail, args=(cr, uid, ids))
|
||||
sendmail_thread.start()
|
||||
|
||||
def set_draft(self, cr, uid, ids, context={}):
|
||||
self.write(cr, uid, ids , {'state':'draft'})
|
||||
return True
|
||||
|
||||
def button_fetch_mail(self, cr, uid, ids, context={}):
|
||||
self.fetch_mail(cr, uid, ids)
|
||||
# sendmail_thread = threading.Thread(target=self.fetch_mail, args=(cr, uid, ids))
|
||||
# sendmail_thread.start()
|
||||
return True
|
||||
|
||||
def _fetch_mails(self, cr, uid, ids=False, context={}):
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" select="1" colspan="4"/>
|
||||
<field name="type" select="1" on_change="onchange_server_type(type, is_ssl)"/>
|
||||
|
||||
<field name="date" select="1"/>
|
||||
<field name="is_ssl" select="1" on_change="onchange_server_type(type, is_ssl)"/>
|
||||
<field name="attach"/>
|
||||
<field name="active" select="1"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Server & Login">
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Server Information" colspan="2"/>
|
||||
<field name="is_ssl" select="1" on_change="onchange_server_type(type, is_ssl)"/>
|
||||
<field name="server" />
|
||||
<field name="port" />
|
||||
</group>
|
||||
@@ -58,7 +58,8 @@
|
||||
</notebook>
|
||||
<group col="6" colspan="4">
|
||||
<field name="state" select="1"/>
|
||||
<button string="Fetch Emails" type="object" name="__fetch_mail"/>
|
||||
<button string="Fetch Emails" type="object" name="button_fetch_mail"/>
|
||||
<button string="Set to Draft" type="object" name="set_draft"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -8,13 +8,13 @@ msgstr ""
|
||||
"Project-Id-Version: pt_BR\n"
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n"
|
||||
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
|
||||
"PO-Revision-Date: 2010-02-22 19:37+0000\n"
|
||||
"PO-Revision-Date: 2010-04-27 11:00+0000\n"
|
||||
"Last-Translator: Luiz Fernando M.França <Unknown>\n"
|
||||
"Language-Team: <pt@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-17 03:55+0000\n"
|
||||
"X-Launchpad-Export-Date: 2010-04-28 03:44+0000\n"
|
||||
"X-Generator: Launchpad (build Unknown)\n"
|
||||
|
||||
#. module: project
|
||||
@@ -461,7 +461,7 @@ msgstr "Tempo Planejado"
|
||||
#: view:project.task:0
|
||||
#: view:project.task.work:0
|
||||
msgid "Task Work"
|
||||
msgstr "Trabalho na Tarefa"
|
||||
msgstr "Tarefas realizadas"
|
||||
|
||||
#. module: project
|
||||
#: selection:res.company,project_time_mode:0
|
||||
|
||||
@@ -68,7 +68,9 @@ class smtpclient(osv.osv):
|
||||
_columns = {
|
||||
'name' : fields.char('Server Name', size=256, required=True),
|
||||
'from_email' : fields.char('Email From', size=256),
|
||||
'email' : fields.char('Email Address', size=256, required=True, readonly=True, states={'new':[('readonly',False)]}),
|
||||
'email':fields.char('Email Address', size=256, required=True, readonly=True, states={'new':[('readonly',False)]}),
|
||||
'cc_to':fields.char('Send copy to', size=256, readonly=True, states={'new':[('readonly',False)]}, help="use comma to supply multiple address. email@domain.com, email2@domain.com"),
|
||||
'bcc_to':fields.char('Send blind copy to', size=256, readonly=True, states={'new':[('readonly',False)]}, help="use comma to supply multiple address. email@domain.com, email2@domain.com"),
|
||||
'user' : fields.char('User Name', size=256, readonly=True, states={'new':[('readonly',False)]}),
|
||||
'password' : fields.char('Password', size=1024, invisible=True, readonly=True, states={'new':[('readonly',False)]}),
|
||||
'server' : fields.char('SMTP Server', size=256, required=True, readonly=True, states={'new':[('readonly',False)]}),
|
||||
@@ -386,7 +388,7 @@ class smtpclient(osv.osv):
|
||||
emailto = [emailto]
|
||||
|
||||
ir_pool = self.pool.get('ir.attachment')
|
||||
|
||||
|
||||
for to in emailto:
|
||||
msg = MIMEMultipart()
|
||||
msg['Subject'] = tools.ustr(subject)
|
||||
@@ -420,7 +422,13 @@ class smtpclient(osv.osv):
|
||||
msg['X-OpenERP-Server-Host'] = socket.gethostname()
|
||||
msg['X-OpenERP-Server-Version'] = release.version
|
||||
msg['Message-Id'] = "<%s-openerp-@%s>" % (time.time(), socket.gethostname())
|
||||
|
||||
|
||||
if smtp_server.cc_to:
|
||||
msg['Cc'] = smtp_server.cc_to
|
||||
|
||||
if smtp_server.bcc_to:
|
||||
msg['Bcc'] = smtp_server.bcc_to
|
||||
|
||||
#attach files from disc
|
||||
for file in attachments:
|
||||
part = MIMEBase('application', "octet-stream")
|
||||
@@ -442,8 +450,8 @@ class smtpclient(osv.osv):
|
||||
data = {
|
||||
'to':to,
|
||||
'server_id':server_id,
|
||||
'cc':False,
|
||||
'bcc':False,
|
||||
'cc':smtp_server.cc_to or False,
|
||||
'bcc':smtp_server.bcc_to or False,
|
||||
'name':subject,
|
||||
'body':body,
|
||||
'serialized_message':message,
|
||||
@@ -499,7 +507,7 @@ class smtpclient(osv.osv):
|
||||
self.open_connection(cr, uid, ids, email.server_id.id)
|
||||
|
||||
try:
|
||||
self.smtpServer[email.server_id.id].sendmail(email.server_id.email, email.to, tools.ustr(email.serialized_message))
|
||||
self.smtpServer[email.server_id.id].sendmail(email.server_id.email, [email.to, email.cc, email.bcc], tools.ustr(email.serialized_message))
|
||||
message = "message sent successfully to %s from %s server" % (email.to, email.server_id.name)
|
||||
logger.notifyChannel('smtp', netsvc.LOG_INFO, message)
|
||||
except Exception, e:
|
||||
@@ -539,6 +547,7 @@ class smtpclient(osv.osv):
|
||||
return result
|
||||
|
||||
def set_to_draft(self, cr, uid, ids, context={}):
|
||||
self.stop_process(cr, uid, ids, context)
|
||||
self.write(cr, uid, ids, {'state':'new', 'code':False})
|
||||
return True
|
||||
|
||||
@@ -555,17 +564,19 @@ class smtpclient(osv.osv):
|
||||
'interval_type':'minutes',
|
||||
'user_id':uid,
|
||||
'numbercall':-1,
|
||||
'doall':False
|
||||
'doall':False,
|
||||
'active':False
|
||||
}
|
||||
id = self.pool.get('ir.cron').create(cr, uid, res)
|
||||
self.write(cr, uid, ids, {'process_id':id})
|
||||
|
||||
return True
|
||||
|
||||
def start_process(self, cr, uid, ids, context={}):
|
||||
process = self.browse(cr, uid, ids[0], context)
|
||||
if not process.process_id:
|
||||
if not process.process_id or process.state != 'confirm':
|
||||
raise osv.except_osv(_('SMTP Server Error !'), _('Server is not Verified, Please Verify the Server !'))
|
||||
|
||||
|
||||
pid = process.process_id.id
|
||||
self.pool.get('ir.cron').write(cr, uid, [pid], {'active':True})
|
||||
self.write(cr, uid, ids, {'pstate':'running'})
|
||||
|
||||
@@ -77,6 +77,12 @@
|
||||
<field name="delete_queue" select="2" />
|
||||
<field name="delete_queue_period" select="2" attrs="{'readonly':[('delete_queue','not in',['content','all'])]}"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Email Copy Configuration" colspan="2" />
|
||||
<field name="cc_to" select="2" />
|
||||
<field name="bcc_to" select="2" />
|
||||
</group>
|
||||
|
||||
<newline/>
|
||||
<separator string="Server Information" colspan="4"/>
|
||||
<group col="3" colspan="4">
|
||||
|
||||
@@ -48,7 +48,7 @@ class verifycode(wizard.interface):
|
||||
if code == data['form']['code']:
|
||||
if server_pool.create_process(cr, uid, [data['id']], context={}):
|
||||
server_pool.write(cr, uid, [data['id']], {'state':'confirm', 'pstate':'running'})
|
||||
print 'process created'
|
||||
server_pool.start_process(cr, uid, [data['id']], context)
|
||||
else:
|
||||
raise osv.except_osv(_('Error'), _('Verification failed. Invalid Verification Code!'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user