[MERGE] import_sugarcrm tfr
bzr revid: al@openerp.com-20110922095531-oivmvia4zdnz1rkn
This commit is contained in:
commit
feca0a787f
|
@ -70,7 +70,6 @@
|
|||
</record>
|
||||
<record id="base_setup_installer_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_base_setup_installer"/>
|
||||
<field name="category_id" ref="base.category_administration_config"/>
|
||||
<field name="sequence">2</field>
|
||||
</record>
|
||||
|
||||
|
@ -222,7 +221,6 @@
|
|||
</record>
|
||||
<record id="base_setup_company_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_base_setup_company"/>
|
||||
<field name="category_id" ref="base.category_administration_config"/>
|
||||
<field name="sequence">1</field>
|
||||
</record>
|
||||
<!-- register Upload Logo configuration wizard -->
|
||||
|
|
|
@ -30,6 +30,7 @@ class crm_installer(osv.osv_memory):
|
|||
'crm_helpdesk': fields.boolean('Helpdesk', help="Manages a Helpdesk service."),
|
||||
'crm_fundraising': fields.boolean('Fundraising', help="This may help associations in their fundraising process and tracking."),
|
||||
'crm_claim': fields.boolean('Claims', help="Manages the suppliers and customers claims, including your corrective or preventive actions."),
|
||||
'import_sugarcrm': fields.boolean('Import Data from SugarCRM', help="Help you to import and update data from SugarCRM to OpenERP"),
|
||||
'crm_caldav': fields.boolean('Calendar Synchronizing', help="Helps you to synchronize the meetings with other calendar clients and mobiles."),
|
||||
'sale_crm': fields.boolean('Opportunity to Quotation', help="Create a Quotation from an Opportunity."),
|
||||
'fetchmail': fields.boolean('Fetch Emails', help="Allows you to receive E-Mails from POP/IMAP server."),
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
<field name="wiki_sale_faq" groups="base.group_extended"/>
|
||||
<field name="sale_crm" invisible="1" groups="base.group_extended"/>
|
||||
<field name="crm_caldav"/>
|
||||
<field name="import_sugarcrm"/>
|
||||
<field name="fetchmail"/>
|
||||
<field name="thunderbird"/>
|
||||
<field name="outlook"/>
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<field name="section_id" widget="selection"
|
||||
groups="base.group_extended"/>
|
||||
</group><group col="2" colspan="2">
|
||||
<separator colspan="2" string="Contact"/>
|
||||
<separator colspan="2" string="Contacts"/>
|
||||
<field name="partner_id" string="Partner"
|
||||
on_change="onchange_partner_id(partner_id)" />
|
||||
<field name="partner_address_id"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
'website': 'http://www.openerp.com',
|
||||
'depends': ['base'],
|
||||
'init_xml': [],
|
||||
'update_xml': [],
|
||||
'update_xml': ["import_base_view.xml"],
|
||||
'demo_xml': [],
|
||||
'test': [], #TODO provide test
|
||||
'installable': True,
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem name="Import" id="menu_import_crm" parent="base.menu_base_partner"/>
|
||||
</data>
|
||||
</openerp>
|
|
@ -22,11 +22,13 @@ import pprint
|
|||
import mapper
|
||||
import pooler
|
||||
import tools
|
||||
|
||||
from tools.translate import _
|
||||
|
||||
from threading import Thread
|
||||
import datetime
|
||||
import logging
|
||||
import StringIO
|
||||
import traceback
|
||||
pp = pprint.PrettyPrinter(indent=4)
|
||||
|
||||
|
||||
|
@ -46,8 +48,10 @@ class import_framework(Thread):
|
|||
"""
|
||||
DO_NOT_FIND_DOMAIN = [('id', '=', 0)]
|
||||
|
||||
#TODO don't use context to pass credential parameters
|
||||
def __init__(self, obj, cr, uid, instance_name, module_name, email_to_notify=False, context=None):
|
||||
Thread.__init__(self)
|
||||
self.external_id_field = 'id'
|
||||
self.obj = obj
|
||||
self.cr = cr
|
||||
self.uid = uid
|
||||
|
@ -56,10 +60,9 @@ class import_framework(Thread):
|
|||
self.context = context or {}
|
||||
self.email = email_to_notify
|
||||
self.table_list = []
|
||||
self.logger = logging.getLogger('import_framework')
|
||||
self.initialize()
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Abstract Method to be implemented in
|
||||
the real instance
|
||||
|
@ -71,6 +74,13 @@ class import_framework(Thread):
|
|||
"""
|
||||
pass
|
||||
|
||||
def init_run(self):
|
||||
"""
|
||||
call after intialize run in the thread, not in the main process
|
||||
TO use for long initialization operation
|
||||
"""
|
||||
pass
|
||||
|
||||
def get_data(self, table):
|
||||
"""
|
||||
@return: a list of dictionaries
|
||||
|
@ -78,6 +88,22 @@ class import_framework(Thread):
|
|||
"""
|
||||
return [{}]
|
||||
|
||||
def get_link(self, from_table, ids, to_table):
|
||||
"""
|
||||
@return: a dictionaries that contains the association between the id (from_table)
|
||||
and the list (to table) of id linked
|
||||
"""
|
||||
return {}
|
||||
|
||||
def get_external_id(self, data):
|
||||
"""
|
||||
@return the external id
|
||||
the default implementation return self.external_id_field (that has 'id') by default
|
||||
if the name of id field is different, you can overwrite this method or change the value
|
||||
of self.external_id_field
|
||||
"""
|
||||
return data[self.external_id_field]
|
||||
|
||||
def get_mapping(self):
|
||||
"""
|
||||
@return: { TABLE_NAME : {
|
||||
|
@ -140,7 +166,7 @@ class import_framework(Thread):
|
|||
and each data_i have a external id => in data_id['id']
|
||||
"""
|
||||
if not datas:
|
||||
return (0, 'No data in this table')
|
||||
return (0, 'No data found')
|
||||
mapping['id'] = 'id_new'
|
||||
res = []
|
||||
|
||||
|
@ -154,14 +180,15 @@ class import_framework(Thread):
|
|||
for k, field_name in self_dependencies:
|
||||
data[k] = data.get(field_name) and self._generate_xml_id(data.get(field_name), table)
|
||||
|
||||
data['id_new'] = self._generate_xml_id(data['id'], table)
|
||||
data['id_new'] = self._generate_xml_id(self.get_external_id(data), table)
|
||||
fields, values = self._fields_mapp(data, mapping, table)
|
||||
res.append(values)
|
||||
|
||||
model_obj = self.obj.pool.get(model)
|
||||
if not model_obj:
|
||||
raise ValueError("%s is not a valid model name" % model)
|
||||
|
||||
raise ValueError(_("%s is not a valid model name") % model)
|
||||
self.logger.debug(_("fields imported : "))
|
||||
self.logger.debug(fields)
|
||||
(p, r, warning, s) = model_obj.import_data(self.cr, self.uid, fields, res, mode='update', current_module=self.module_name, noupdate=True, context=self.context)
|
||||
for (field, field_name) in self_dependencies:
|
||||
self._import_self_dependencies(model_obj, field, datas)
|
||||
|
@ -296,10 +323,14 @@ class import_framework(Thread):
|
|||
"""
|
||||
domain_search = not domain_search and [('name', 'ilike', name)] or domain_search
|
||||
obj = self.obj.pool.get(model)
|
||||
if not obj: #if the model doesn't exist
|
||||
return False
|
||||
|
||||
xml_id = self._generate_xml_id(name, table)
|
||||
xml_ref = self.mapped_id_if_exist(model, domain_search, table, name)
|
||||
fields.append('id')
|
||||
data.append(xml_id)
|
||||
|
||||
obj.import_data(self.cr, self.uid, fields, [data], mode='update', current_module=self.module_name, noupdate=True, context=self.context)
|
||||
return xml_ref or xml_id
|
||||
|
||||
|
@ -343,8 +374,10 @@ class import_framework(Thread):
|
|||
"""
|
||||
self.data_started = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
self.cr = pooler.get_db(self.cr.dbname).cursor()
|
||||
error = False
|
||||
result = []
|
||||
try:
|
||||
result = []
|
||||
self.init_run()
|
||||
imported = set() #to invoid importing 2 times the sames modules
|
||||
for table in self.table_list:
|
||||
to_import = self.get_mapping()[table].get('import', True)
|
||||
|
@ -352,16 +385,22 @@ class import_framework(Thread):
|
|||
res = self._resolve_dependencies(self.get_mapping()[table].get('dependencies', []), imported)
|
||||
result.extend(res)
|
||||
if to_import:
|
||||
self.logger.debug(_("import : ") + table )
|
||||
(position, warning) = self._import_table(table)
|
||||
result.append((table, position, warning))
|
||||
imported.add(table)
|
||||
self.cr.commit()
|
||||
|
||||
|
||||
except Exception, err:
|
||||
sh = StringIO.StringIO()
|
||||
traceback.print_exc(file=sh)
|
||||
error = sh.getvalue()
|
||||
print error
|
||||
finally:
|
||||
self.cr.close()
|
||||
|
||||
self.date_ended = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||
self._send_notification_email(result)
|
||||
|
||||
self._send_notification_email(result, error)
|
||||
|
||||
def _resolve_dependencies(self, dep, imported):
|
||||
"""
|
||||
|
@ -375,25 +414,29 @@ class import_framework(Thread):
|
|||
res = self._resolve_dependencies(self.get_mapping()[dependency].get('dependencies', []), imported)
|
||||
result.extend(res)
|
||||
if to_import:
|
||||
self.logger.debug("import dependency : " + dependency)
|
||||
r = self._import_table(dependency)
|
||||
(position, warning) = r
|
||||
result.append((dependency, position, warning))
|
||||
imported.add(dependency)
|
||||
return result
|
||||
|
||||
def _send_notification_email(self, result):
|
||||
if not self.email:
|
||||
return
|
||||
def _send_notification_email(self, result, error):
|
||||
if not self.email or not self.email[0]:
|
||||
return False
|
||||
|
||||
tools.email_send(
|
||||
'import_sugarcrm@module.openerp',
|
||||
'import@module.openerp',
|
||||
self.email,
|
||||
self.get_email_subject(result),
|
||||
self.get_email_body(result),
|
||||
self.get_email_subject(result, error),
|
||||
self.get_email_body(result, error),
|
||||
)
|
||||
logger = logging.getLogger('import_sugarcam')
|
||||
logger.info("Import finished, notification email sended")
|
||||
if error:
|
||||
self.logger.error(_("Import failed due to an unexpected error"))
|
||||
else:
|
||||
self.logger.info(_("Import finished, notification email sended"))
|
||||
|
||||
def get_email_subject(self, result):
|
||||
def get_email_subject(self, result, error=False):
|
||||
"""
|
||||
This method define the subject of the email send by openerp at the end of import
|
||||
@param result: a list of tuple
|
||||
|
@ -401,9 +444,11 @@ class import_framework(Thread):
|
|||
@return the subject of the mail
|
||||
|
||||
"""
|
||||
return "Import of your data finished at %s" % self.date_ended
|
||||
if error:
|
||||
return _("Data Import failed at %s due to an unexpected error") % self.date_ended
|
||||
return _("Import of your data finished at %s") % self.date_ended
|
||||
|
||||
def get_email_body(self, result):
|
||||
def get_email_body(self, result, error=False):
|
||||
"""
|
||||
This method define the body of the email send by openerp at the end of import. The body is separated in two part
|
||||
the header (@see get_body_header), and the generate body with the list of table and number of record imported.
|
||||
|
@ -414,19 +459,43 @@ class import_framework(Thread):
|
|||
|
||||
"""
|
||||
|
||||
body = "started at %s and finished at %s \n" % (self.data_started, self.date_ended)
|
||||
body = _("started at %s and finished at %s \n") % (self.data_started, self.date_ended)
|
||||
if error:
|
||||
body += _("but failed, in consequence no data were imported to keep database consistency \n error : \n") + error
|
||||
|
||||
for (table, nb, warning) in result:
|
||||
if not warning:
|
||||
warning = "with no warning"
|
||||
warning = _("with no warning")
|
||||
else:
|
||||
warning = "with warning : %s" % warning
|
||||
body += "%s records were imported from table %s, %s \n" % (nb, table, warning)
|
||||
warning = _("with warning : %s") % warning
|
||||
body += _("%s has been successfully imported from %s %s, %s \n") % (nb, self.instance_name, table, warning)
|
||||
return self.get_body_header(result) + "\n\n" + body
|
||||
|
||||
def get_body_header(self, result):
|
||||
"""
|
||||
@return the first sentences written in the mail's body
|
||||
"""
|
||||
return "The import of data \n instance name : %s \n" % self.instance_name
|
||||
return _("The import of data \n instance name : %s \n") % self.instance_name
|
||||
|
||||
#For example of use see import_sugarcrm
|
||||
|
||||
#TODO documentation test
|
||||
def run_test(self):
|
||||
back_get_data = self.get_data
|
||||
back_get_link = self.get_link
|
||||
back_init = self.initialize
|
||||
self.get_data = self.get_data_test
|
||||
self.get_link = self.get_link_test
|
||||
self.initialize = self.intialize_test
|
||||
self.run()
|
||||
self.get_data = back_get_data
|
||||
self.get_link = back_get_link
|
||||
self.initialize = back_init
|
||||
|
||||
def get_data_test(self, table):
|
||||
return [{}]
|
||||
|
||||
def get_link_test(self, from_table, ids, to_table):
|
||||
return {}
|
||||
|
||||
def intialize_test(self):
|
||||
pass
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import tools
|
||||
|
||||
class mapper(object):
|
||||
"""
|
||||
|
@ -50,14 +50,13 @@ class concat(mapper):
|
|||
Use : contact('field_name1', 'field_name2', delimiter='_')
|
||||
concat value of fields using the delimiter, delimiter is optional
|
||||
and by default is a space
|
||||
|
||||
"""
|
||||
def __init__(self, *arg, **delimiter):
|
||||
self.arg = arg
|
||||
self.delimiter = delimiter and delimiter.get('delimiter', ' ') or ' '
|
||||
|
||||
def __call__(self, external_values):
|
||||
return self.delimiter.join(map(lambda x : external_values.get(x,''), self.arg))
|
||||
return self.delimiter.join(map(lambda x : tools.ustr(external_values.get(x,'')), self.arg))
|
||||
|
||||
class ppconcat(mapper):
|
||||
"""
|
||||
|
@ -71,7 +70,7 @@ class ppconcat(mapper):
|
|||
self.delimiter = delimiter and delimiter.get('delimiter', ' ') or '\n\n'
|
||||
|
||||
def __call__(self, external_values):
|
||||
return self.delimiter.join(map(lambda x : x + ": " + external_values.get(x,''), self.arg))
|
||||
return self.delimiter.join(map(lambda x : x + ": " + tools.ustr(external_values.get(x,'')), self.arg))
|
||||
|
||||
class const(mapper):
|
||||
"""
|
||||
|
@ -105,7 +104,6 @@ class value(mapper):
|
|||
val = external_values.get(self.fallback, self.default)
|
||||
return val
|
||||
|
||||
|
||||
|
||||
class map_val(mapper):
|
||||
"""
|
||||
|
@ -169,5 +167,3 @@ class call(mapper):
|
|||
else:
|
||||
args.append(arg)
|
||||
return self.fun(external_values, *args)
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# 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 the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import import_sugarcrm
|
||||
import sugar
|
||||
import wizard
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# 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 the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
'name': 'Import SugarCRM Data into OpenERP Module.',
|
||||
'version': '1.0',
|
||||
'category': 'Generic Modules',
|
||||
'description': """This Module Import SugarCRM "Leads", "Opportunities", "Users", "Accounts",
|
||||
"Contacts", "Employees", Meetings, Phonecalls, Emails, and Project, Project Tasks Data into OpenERP Module.""",
|
||||
'author': 'OpenERP SA',
|
||||
'website': 'http://www.openerp.com',
|
||||
'depends': ['import_base','crm', 'document'],
|
||||
'init_xml': [],
|
||||
'update_xml': ["wizard/import_message_view.xml",
|
||||
"import_sugarcrm_view.xml"],
|
||||
'demo_xml': [],
|
||||
'test': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
Install the SOAP framwwork for Python :
|
||||
1. download the soap framework from http://pypi.python.org/pypi/ZSI/
|
||||
extract the file “ZSI-2.0-rc3.tar.gz” and run following 2 commands
|
||||
./setup.py build
|
||||
./setup.py install
|
||||
this will install soap framework for python.
|
||||
|
||||
or use the ZSI package of your distribution
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,105 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Import Sugarcrm Form View -->
|
||||
<record model="ir.ui.view" id="view_import_sugarcrm_form">
|
||||
<field name="name">import.sugarcrm.form</field>
|
||||
<field name="model">import.sugarcrm</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Import Data From SugarCRM">
|
||||
<group col="8" >
|
||||
<group colspan="2" col="1" width="200">
|
||||
<label colspan="2" string="Import your data from SugarCRM :"/>
|
||||
<label colspan="2" string="" />
|
||||
<label colspan="2" string="Use the SugarSoap API URL (read tooltip) and a full access SugarCRM login."/>
|
||||
<label colspan="2" string="" />
|
||||
<label colspan="2" string="Choose data you want to import. Click 'Import' to get data manually or 'Schedule Reccurent Imports' to get recurrently and automatically data."/>
|
||||
<label colspan="2" string="" />
|
||||
<label colspan="2" string="If you make recurrent or ponctual import, data already in OpenERP will be updated by SugarCRM data."/>
|
||||
<label colspan="2" string="" />
|
||||
<label colspan="2" string="Do not forget the email address to be notified of the success of the import."/>
|
||||
<label colspan="2" />
|
||||
<label colspan="2" string="Online documentation:"/>
|
||||
<label colspan="2" string="(Comming Soon)"/>
|
||||
<label colspan="2" string=""/>
|
||||
</group>
|
||||
<separator string="" orientation="vertical" colspan="1" rowspan="24" />
|
||||
<group colspan="4">
|
||||
<separator string="Login Information" colspan="3"/>
|
||||
<field name="url" colspan="4" widget="url"/>
|
||||
<field name="username"/>
|
||||
<newline/>
|
||||
<field name="password" password="True" />
|
||||
<separator string="" colspan="4"/>
|
||||
<group colspan="4" col="6">
|
||||
<group colspan="1" col="2">
|
||||
<separator string="Address Book" colspan="4"/>
|
||||
<field name="user" />
|
||||
<field name= "account" />
|
||||
<field name= "contact" />
|
||||
</group>
|
||||
<group colspan="1" col="1">
|
||||
<separator string="CRM" colspan="4"/>
|
||||
<field name="opportunity" />
|
||||
<field name= "call" />
|
||||
<field name= "meeting" />
|
||||
<field name= "claim" />
|
||||
|
||||
</group>
|
||||
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Project" colspan="4"/>
|
||||
<field name= "project" />
|
||||
<field name= "project_task" />
|
||||
<field name= "bug"/>
|
||||
</group>
|
||||
<group colspan="1" col="2">
|
||||
<separator string="HR" colspan="4"/>
|
||||
<field name="employee" />
|
||||
<separator string="Document" colspan="4"/>
|
||||
<field name="email_history"/>
|
||||
<field name= "document" />
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<separator string="Email Notification When Import is finished" colspan="4"/>
|
||||
<field name="email_from" widget="email" string="Email Address to Notify"/>
|
||||
</group>
|
||||
<group colspan="4" groups="base.group_no_one">
|
||||
<separator string="Multi Instance Management" colspan="4"/>
|
||||
<field name="instance_name"/>
|
||||
</group>
|
||||
<separator string="" colspan="4" />
|
||||
<group colspan="4" col="6">
|
||||
<label string="" colspan="2"/>
|
||||
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
|
||||
<button name="import_from_scheduler_all" groups="base.group_extended" string="_Schedule Recurrent Imports"
|
||||
type="object" icon="gtk-execute" />
|
||||
<button name="import_all" string="_Import"
|
||||
type="object" icon="terp-camera_test"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Import Sugarcrm Action -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_import_sugarcrm">
|
||||
<field name="name">Import SugarCRM</field>
|
||||
<field name="res_model">import.sugarcrm</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_id" ref="view_import_sugarcrm_form"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem name="Import SugarCRM" id="menu_sugarcrm_import" parent="import_base.menu_import_crm" action="action_import_sugarcrm" icon="STOCK_EXECUTE"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# 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 the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
import hashlib
|
||||
from sugarsoap_services import *
|
||||
from sugarsoap_services_types import *
|
||||
from osv import osv
|
||||
from tools.translate import _
|
||||
import base64
|
||||
from lxml import etree
|
||||
import tools
|
||||
import import_sugarcrm
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
class LoginError(Exception): pass
|
||||
|
||||
def login(username, password, url):
|
||||
setURL(url)
|
||||
loc = sugarsoapLocator()
|
||||
portType = loc.getsugarsoapPortType(url)
|
||||
request = loginRequest()
|
||||
uauth = ns0.user_auth_Def(request)
|
||||
request._user_auth = uauth
|
||||
|
||||
uauth._user_name = username
|
||||
uauth._password = hashlib.md5(password).hexdigest()
|
||||
uauth._version = '1.1'
|
||||
try:
|
||||
response = portType.login(request)
|
||||
except:
|
||||
raise osv.except_osv(_('Error !'), _('Authentication error !\nBad Username or Password bad SugarSoap Api url !'))
|
||||
if -1 == response._return._id:
|
||||
raise LoginError(response._return._error._description)
|
||||
|
||||
return (portType, response._return._id)
|
||||
|
||||
def relation_search(portType, sessionid, module_name=None, module_id=None, related_module=None, query=None, deleted=None):
|
||||
se_req = get_relationshipsRequest()
|
||||
se_req._session = sessionid
|
||||
se_req._module_name = module_name
|
||||
se_req._module_id = module_id
|
||||
se_req._related_module = related_module
|
||||
se_resp = portType.get_relationships(se_req)
|
||||
ans_list = []
|
||||
if se_resp:
|
||||
list = se_resp._return.get_element_ids()
|
||||
for i in list:
|
||||
ans_list.append(i.get_element_id())
|
||||
return ans_list
|
||||
|
||||
def attachment_search(portType, sessionid, module_name, module_id=None):
|
||||
se_req = get_note_attachmentRequest()
|
||||
se_req._session = sessionid
|
||||
se_req._id = module_id
|
||||
se_req._module_name = module_name
|
||||
se_resp = portType.get_note_attachment(se_req)
|
||||
file = se_resp._return._note_attachment.File
|
||||
filename = se_resp._return._note_attachment.Filename
|
||||
return file, filename
|
||||
|
||||
def user_get_attendee_list(portType, sessionid, module_name=None, module_id=None):
|
||||
se_req = get_attendee_listRequest()
|
||||
se_req._session = sessionid
|
||||
se_req._module_name = module_name
|
||||
se_req._id = module_id
|
||||
se_resp = portType.get_attendee_list(se_req)
|
||||
list = se_resp.get_element_return()
|
||||
arch = base64.decodestring(list.Result)
|
||||
eview = etree.XML(arch)
|
||||
attendee_list = []
|
||||
for child in eview:
|
||||
attendee_dict = {}
|
||||
for ch in child.getchildren():
|
||||
attendee_dict[ch.tag] = tools.ustr(ch.text)
|
||||
attendee_list.append(attendee_dict)
|
||||
return attendee_list
|
||||
|
||||
def get_contact_by_email(portType, username, password, email_address=None):
|
||||
se_req = contact_by_emailRequest()
|
||||
se_req._user_name = username
|
||||
se_req._password = password
|
||||
se_req._email_address = email_address
|
||||
try:
|
||||
se_resp = portType.contact_by_email(se_req)
|
||||
email_list = []
|
||||
for list in se_resp.get_element_return():
|
||||
if list.Email_address in email_list:
|
||||
continue
|
||||
elif list.Email_address:
|
||||
email_list.append(list.Email_address)
|
||||
return email_list
|
||||
except Exception,e:
|
||||
logging.getLogger('sugarcrm_soap').error('Exception: %s\n' % (tools.ustr(e)))
|
||||
return False
|
||||
|
||||
def get_document_revision_search(portType, sessionid, module_id=None):
|
||||
se_req = get_document_revisionRequest()
|
||||
se_req._session = sessionid
|
||||
se_req._i = module_id
|
||||
se_resp = portType.get_document_list(se_req)
|
||||
file = se_resp._return.Document_revision.File
|
||||
filename = se_resp._return.Document_revision.Filename
|
||||
return file, filename
|
||||
|
||||
|
||||
def email_search(portType, sessionid, module_name, module_id, select_fields=None):
|
||||
se_req = get_entryRequest()
|
||||
se_req._session = sessionid
|
||||
se_req._module_name = module_name
|
||||
se_req._id = module_id
|
||||
se_req._select_fields = select_fields
|
||||
|
||||
se_resp = portType.get_entry(se_req)
|
||||
ans_list = []
|
||||
if se_resp:
|
||||
list = se_resp._return._entry_list
|
||||
|
||||
for i in list:
|
||||
ans_dir = {}
|
||||
for j in i._name_value_list:
|
||||
ans_dir[tools.ustr(j._name)] = tools.ustr(j._value)
|
||||
#end for
|
||||
ans_list.append(ans_dir)
|
||||
#end for
|
||||
return ans_list
|
||||
|
||||
def search(portType, sessionid, module_name, offset, max_results, query=None, order_by=None, select_fields=None, deleted=None):
|
||||
se_req = get_entry_listRequest()
|
||||
se_req._session = sessionid
|
||||
se_req._module_name = module_name
|
||||
if query != None:
|
||||
se_req._query = query
|
||||
se_req._order_by = order_by
|
||||
se_req._offset = offset
|
||||
se_req._select_fields = select_fields
|
||||
se_req._max_results = max_results
|
||||
se_req._deleted = deleted
|
||||
se_resp = portType.get_entry_list(se_req)
|
||||
ans_list = []
|
||||
if se_resp:
|
||||
list = se_resp._return._entry_list
|
||||
for i in list:
|
||||
ans_dir = {}
|
||||
for j in i._name_value_list:
|
||||
ans_dir[tools.ustr(j._name)] = import_sugarcrm.unescape_htmlentities(tools.ustr(j._value))
|
||||
#end for
|
||||
ans_list.append(ans_dir)
|
||||
#end for
|
||||
return ans_list
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,646 @@
|
|||
##################################################
|
||||
# sugarsoap_services_types.py
|
||||
# generated by ZSI.generate.wsdl2python
|
||||
##################################################
|
||||
from osv import osv
|
||||
from tools.translate import _
|
||||
try:
|
||||
import ZSI
|
||||
import ZSI.TCcompound
|
||||
from ZSI.TC import TypeDefinition
|
||||
from ZSI.TC import _get_type_definition as GTD
|
||||
from ZSI.generate.pyclass import pyclass_type
|
||||
except ImportError:
|
||||
raise osv.except_osv(_('ZSI Import Error!'), _('Please install SOAP for python - ZSI-2.0-rc3.tar.gz from http://pypi.python.org/pypi/ZSI/'))
|
||||
|
||||
##############################
|
||||
# targetNamespace
|
||||
# http://www.sugarcrm.com/sugarcrm
|
||||
##############################
|
||||
|
||||
class ns0:
|
||||
targetNamespace = "http://www.sugarcrm.com/sugarcrm"
|
||||
|
||||
class contact_detail_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "contact_detail")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#Unused variable ns.
|
||||
#ns = ns0.contact_detail_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="email_address", aname="_email_address", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="name1", aname="_name1", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="name2", aname="_name2", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="association", aname="_association", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="id", aname="_id", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="msi_id", aname="_msi_id", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="type", aname="_type", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._email_address = None
|
||||
self._name1 = None
|
||||
self._name2 = None
|
||||
self._association = None
|
||||
self._id = None
|
||||
self._msi_id = None
|
||||
self._type = None
|
||||
return
|
||||
Holder.__name__ = "contact_detail_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class contact_detail_array_Def(ZSI.TC.Array, TypeDefinition):
|
||||
#complexType/complexContent base="SOAP-ENC:Array"
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "contact_detail_array")
|
||||
def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):
|
||||
ofwhat = ns0.contact_detail_Def(None, typed=False)
|
||||
atype = (u'http://www.sugarcrm.com/sugarcrm', u'contact_detail[]')
|
||||
ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)
|
||||
|
||||
class user_detail_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "user_detail")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.user_detail_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="email_address", aname="_email_address", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="user_name", aname="_user_name", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="first_name", aname="_first_name", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="last_name", aname="_last_name", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="department", aname="_department", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="id", aname="_id", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="title", aname="_title", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._email_address = None
|
||||
self._user_name = None
|
||||
self._first_name = None
|
||||
self._last_name = None
|
||||
self._department = None
|
||||
self._id = None
|
||||
self._title = None
|
||||
return
|
||||
Holder.__name__ = "user_detail_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class user_detail_array_Def(ZSI.TC.Array, TypeDefinition):
|
||||
#complexType/complexContent base="SOAP-ENC:Array"
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "user_detail_array")
|
||||
def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):
|
||||
ofwhat = ns0.user_detail_Def(None, typed=False)
|
||||
atype = (u'http://www.sugarcrm.com/sugarcrm', u'user_detail[]')
|
||||
ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)
|
||||
|
||||
class note_attachment_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "note_attachment")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
# ns = ns0.note_attachment_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="id", aname="_id", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="filename", aname="_filename", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="file", aname="_file", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._id = None
|
||||
self._filename = None
|
||||
self._file = None
|
||||
return
|
||||
Holder.__name__ = "note_attachment_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class return_note_attachment_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "return_note_attachment")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.return_note_attachment_Def.schema
|
||||
TClist = [GTD("http://www.sugarcrm.com/sugarcrm","note_attachment",lazy=False)(pname="note_attachment", aname="_note_attachment", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._note_attachment = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "return_note_attachment_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class user_auth_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "user_auth")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.user_auth_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="user_name", aname="_user_name", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="password", aname="_password", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="version", aname="_version", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._user_name = None
|
||||
self._password = None
|
||||
self._version = None
|
||||
return
|
||||
Holder.__name__ = "user_auth_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class field_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "field")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.field_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="name", aname="_name", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="type", aname="_type", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="label", aname="_label", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="required", aname="_required", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","name_value_list",lazy=False)(pname="options", aname="_options", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._name = None
|
||||
self._type = None
|
||||
self._label = None
|
||||
self._required = None
|
||||
self._options = None
|
||||
return
|
||||
Holder.__name__ = "field_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class field_list_Def(ZSI.TC.Array, TypeDefinition):
|
||||
#complexType/complexContent base="SOAP-ENC:Array"
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "field_list")
|
||||
def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):
|
||||
ofwhat = ns0.field_Def(None, typed=False)
|
||||
atype = (u'http://www.sugarcrm.com/sugarcrm', u'field[]')
|
||||
ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)
|
||||
|
||||
class name_value_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "name_value")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.name_value_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="name", aname="_name", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="value", aname="_value", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._name = None
|
||||
self._value = None
|
||||
return
|
||||
Holder.__name__ = "name_value_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class name_value_list_Def(ZSI.TC.Array, TypeDefinition):
|
||||
#complexType/complexContent base="SOAP-ENC:Array"
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "name_value_list")
|
||||
def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):
|
||||
ofwhat = ns0.name_value_Def(None, typed=False)
|
||||
atype = (u'http://www.sugarcrm.com/sugarcrm', u'name_value[]')
|
||||
ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)
|
||||
|
||||
class name_value_lists_Def(ZSI.TC.Array, TypeDefinition):
|
||||
#complexType/complexContent base="SOAP-ENC:Array"
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "name_value_lists")
|
||||
def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):
|
||||
ofwhat = ns0.name_value_list_Def(None, typed=False)
|
||||
atype = (u'http://www.sugarcrm.com/sugarcrm', u'name_value_list[]')
|
||||
ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)
|
||||
|
||||
class select_fields_Def(ZSI.TC.Array, TypeDefinition):
|
||||
#complexType/complexContent base="SOAP-ENC:Array"
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "select_fields")
|
||||
def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):
|
||||
ofwhat = ZSI.TC.String(None, typed=False)
|
||||
atype = (u'http://www.w3.org/2001/XMLSchema', u'string[]')
|
||||
ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)
|
||||
|
||||
class module_fields_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "module_fields")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
# ns = ns0.module_fields_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="module_name", aname="_module_name", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","field_list",lazy=False)(pname="module_fields", aname="_module_fields", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._module_name = None
|
||||
self._module_fields = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "module_fields_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class module_list_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "module_list")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.module_list_Def.schema
|
||||
TClist = [GTD("http://www.sugarcrm.com/sugarcrm","select_fields",lazy=False)(pname="modules", aname="_modules", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._modules = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "module_list_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class error_value_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "error_value")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.error_value_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="number", aname="_number", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="name", aname="_name", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="description", aname="_description", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._number = None
|
||||
self._name = None
|
||||
self._description = None
|
||||
return
|
||||
Holder.__name__ = "error_value_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class entry_value_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "entry_value")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.entry_value_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="id", aname="_id", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="module_name", aname="_module_name", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","name_value_list",lazy=False)(pname="name_value_list", aname="_name_value_list", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._id = None
|
||||
self._module_name = None
|
||||
self._name_value_list = None
|
||||
return
|
||||
Holder.__name__ = "entry_value_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class entry_list_Def(ZSI.TC.Array, TypeDefinition):
|
||||
#complexType/complexContent base="SOAP-ENC:Array"
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "entry_list")
|
||||
def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):
|
||||
ofwhat = ns0.entry_value_Def(None, typed=False)
|
||||
atype = (u'http://www.sugarcrm.com/sugarcrm', u'entry_value[]')
|
||||
ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)
|
||||
|
||||
class get_entry_list_result_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "get_entry_list_result")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.get_entry_list_result_Def.schema
|
||||
TClist = [ZSI.TCnumbers.Iint(pname="result_count", aname="_result_count", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="next_offset", aname="_next_offset", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","field_list",lazy=False)(pname="field_list", aname="_field_list", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","entry_list",lazy=False)(pname="entry_list", aname="_entry_list", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._result_count = None
|
||||
self._next_offset = None
|
||||
self._field_list = None
|
||||
self._entry_list = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "get_entry_list_result_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class get_entry_result_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "get_entry_result")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.get_entry_result_Def.schema
|
||||
TClist = [GTD("http://www.sugarcrm.com/sugarcrm","field_list",lazy=False)(pname="field_list", aname="_field_list", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","entry_list",lazy=False)(pname="entry_list", aname="_entry_list", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._field_list = None
|
||||
self._entry_list = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "get_entry_result_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class set_entry_result_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "set_entry_result")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.set_entry_result_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="id", aname="_id", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._id = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "set_entry_result_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class set_entries_result_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "set_entries_result")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.set_entries_result_Def.schema
|
||||
TClist = [GTD("http://www.sugarcrm.com/sugarcrm","select_fields",lazy=False)(pname="ids", aname="_ids", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._ids = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "set_entries_result_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class id_mod_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "id_mod")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.id_mod_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="id", aname="_id", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="date_modified", aname="_date_modified", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="deleted", aname="_deleted", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._id = None
|
||||
self._date_modified = None
|
||||
self._deleted = None
|
||||
return
|
||||
Holder.__name__ = "id_mod_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class ids_mods_Def(ZSI.TC.Array, TypeDefinition):
|
||||
#complexType/complexContent base="SOAP-ENC:Array"
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "ids_mods")
|
||||
def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):
|
||||
ofwhat = ns0.id_mod_Def(None, typed=False)
|
||||
atype = (u'http://www.sugarcrm.com/sugarcrm', u'id_mod[]')
|
||||
ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)
|
||||
|
||||
class get_relationships_result_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "get_relationships_result")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.get_relationships_result_Def.schema
|
||||
TClist = [GTD("http://www.sugarcrm.com/sugarcrm","ids_mods",lazy=False)(pname="ids", aname="_ids", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._ids = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "get_relationships_result_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class set_relationship_value_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "set_relationship_value")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.set_relationship_value_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="module1", aname="_module1", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="module1_id", aname="_module1_id", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="module2", aname="_module2", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="module2_id", aname="_module2_id", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._module1 = None
|
||||
self._module1_id = None
|
||||
self._module2 = None
|
||||
self._module2_id = None
|
||||
return
|
||||
Holder.__name__ = "set_relationship_value_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class set_relationship_list_Def(ZSI.TC.Array, TypeDefinition):
|
||||
#complexType/complexContent base="SOAP-ENC:Array"
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "set_relationship_list")
|
||||
def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw):
|
||||
ofwhat = ns0.set_relationship_value_Def(None, typed=False)
|
||||
atype = (u'http://www.sugarcrm.com/sugarcrm', u'set_relationship_value[]')
|
||||
ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw)
|
||||
|
||||
class set_relationship_list_result_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "set_relationship_list_result")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.set_relationship_list_result_Def.schema
|
||||
TClist = [ZSI.TCnumbers.Iint(pname="created", aname="_created", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="failed", aname="_failed", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._created = None
|
||||
self._failed = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "set_relationship_list_result_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class document_revision_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "document_revision")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.document_revision_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="id", aname="_id", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="document_name", aname="_document_name", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="revision", aname="_revision", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="filename", aname="_filename", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="file", aname="_file", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._id = None
|
||||
self._document_name = None
|
||||
self._revision = None
|
||||
self._filename = None
|
||||
self._file = None
|
||||
return
|
||||
Holder.__name__ = "document_revision_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class get_entry_list_result_encoded_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "get_entry_list_result_encoded")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
# ns = ns0.get_entry_list_result_encoded_Def.schema
|
||||
TClist = [ZSI.TCnumbers.Iint(pname="result_count", aname="_result_count", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="next_offset", aname="_next_offset", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="total_count", aname="_total_count", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","select_fields",lazy=False)(pname="field_list", aname="_field_list", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TC.String(pname="entry_list", aname="_entry_list", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._result_count = None
|
||||
self._next_offset = None
|
||||
self._total_count = None
|
||||
self._field_list = None
|
||||
self._entry_list = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "get_entry_list_result_encoded_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class get_sync_result_encoded_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "get_sync_result_encoded")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
# ns = ns0.get_sync_result_encoded_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="result", aname="_result", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._result = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "get_sync_result_encoded_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class get_quick_sync_result_encoded_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "get_quick_sync_result_encoded")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.get_quick_sync_result_encoded_Def.schema
|
||||
TClist = [ZSI.TC.String(pname="result", aname="_result", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="result_count", aname="_result_count", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="next_offset", aname="_next_offset", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), ZSI.TCnumbers.Iint(pname="total_count", aname="_total_count", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._result = None
|
||||
self._result_count = None
|
||||
self._next_offset = None
|
||||
self._total_count = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "get_quick_sync_result_encoded_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
class return_document_revision_Def(ZSI.TCcompound.ComplexType, TypeDefinition):
|
||||
schema = "http://www.sugarcrm.com/sugarcrm"
|
||||
type = (schema, "return_document_revision")
|
||||
def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw):
|
||||
#ns = ns0.return_document_revision_Def.schema
|
||||
TClist = [GTD("http://www.sugarcrm.com/sugarcrm","document_revision",lazy=False)(pname="document_revision", aname="_document_revision", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded")), GTD("http://www.sugarcrm.com/sugarcrm","error_value",lazy=False)(pname="error", aname="_error", minOccurs=1, maxOccurs=1, nillable=False, typed=False, encoded=kw.get("encoded"))]
|
||||
self.attribute_typecode_dict = attributes or {}
|
||||
if extend: TClist += ofwhat
|
||||
if restrict: TClist = ofwhat
|
||||
ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw)
|
||||
class Holder:
|
||||
__metaclass__ = pyclass_type
|
||||
typecode = self
|
||||
def __init__(self):
|
||||
# pyclass
|
||||
self._document_revision = None
|
||||
self._error = None
|
||||
return
|
||||
Holder.__name__ = "return_document_revision_Holder"
|
||||
self.pyclass = Holder
|
||||
|
||||
# end class ns0 (tns: http://www.sugarcrm.com/sugarcrm)
|
|
@ -0,0 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# 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 the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import import_message
|
|
@ -0,0 +1,29 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# 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 the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program 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 Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from osv import fields, osv
|
||||
|
||||
class import_message(osv.osv):
|
||||
"""Import Message"""
|
||||
|
||||
_name = "import.message"
|
||||
_description = __doc__
|
||||
|
||||
import_message()
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- Import Message Form View -->
|
||||
<record model="ir.ui.view" id="view_import_message_form">
|
||||
<field name="name">import.message.form</field>
|
||||
<field name="model">import.message</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Import Message">
|
||||
<label colspan="4" nolabel="1" string="Data are importing, the process is running in the background, an email will be sent to the given email address if it was defined."/>
|
||||
<separator string="" colspan="4" />
|
||||
<button icon="gtk-ok" special="cancel" string="_Ok"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue