[MERGE] Merge initial work of sugarcrm

bzr revid: sbh@tinyerp.com-20110217113543-n6466nro77nv72fu
This commit is contained in:
Sbh (OpenERP)
2011-02-17 17:05:43 +05:30
12 changed files with 2568 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# -*- 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
+39
View File
@@ -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", "Opportunity", "Accounts" and "contacts" Data into OpenERP Module.""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': [],
'init_xml': [],
'update_xml': ["wizard/sugarcrm_login_view.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:
+216
View File
@@ -0,0 +1,216 @@
# -*- 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 operator import itemgetter
from osv import fields, osv
import sugar
from tools.translate import _
class import_sugarcrm(osv.osv):
"""Import SugarCRM DATA"""
_name = "import.sugarcrm"
_description = __doc__
_columns = {
'mod_name':fields.selection([
('lead','Leads'),
('opportunity','Opportunities'),
('accounts','Accounts'),
('contact','Contacts'),
],'Module Name', help="Module Name is used to specify which Module data want to Import"),
'username': fields.char('User Name', size=64),
'password': fields.char('Password', size=24),
}
def _get_all(self, cr, uid, model, sugar_val, context=None):
models = self.pool.get(model)
all_model_ids = models.search(cr, uid, [('name', '=', sugar_val)])
output = [(False, '')]
output = sorted([(o.id, o.name)
for o in models.browse(cr, uid, all_model_ids,
context=context)],
key=itemgetter(1))
return output
def _get_all_states(self, cr, uid, sugar_val, context=None):
return self._get_all(
cr, uid, 'res.country.state', sugar_val, context=context)
def _get_all_countries(self, cr, uid, sugar_val, context=None):
return self._get_all(
cr, uid, 'res.country', sugar_val, context=context)
def _create_lead(self, cr, uid, sugar_val, country, state, context=None):
lead_pool = self.pool.get("crm.lead")
stage_id = ''
stage_pool = self.pool.get('crm.case.stage')
if sugar_val.get('status','') == 'New':
sugar_stage = 'New'
elif sugar_val.get('status','') == 'Assigned':
sugar_stage = 'Qualification'
elif sugar_val.get('status','') == 'In Progress':
sugar_stage = 'Proposition'
elif sugar_val.get('status','') == 'Recycled':
sugar_stage = 'Negotiation'
elif sugar_val.get('status','') == 'Dead':
sugar_stage = 'Lost'
else:
sugar_stage = ''
stage_ids = stage_pool.search(cr, uid, [("type", '=', 'lead'), ('name', '=', sugar_stage)])
for stage in stage_pool.browse(cr, uid, stage_ids):
stage_id = stage.id
vals = {'name': sugar_val.get('first_name','')+' '+ sugar_val.get('last_name',''),
'contact_name': sugar_val.get('first_name','')+' '+ sugar_val.get('last_name',''),
'user_id':sugar_val.get('created_by',''),
'description': sugar_val.get('description',''),
'partner_name': sugar_val.get('first_name','')+' '+ sugar_val.get('last_name',''),
'email_from': sugar_val.get('email1',''),
'stage_id': stage_id or '',
'phone': sugar_val.get('phone_work',''),
'mobile': sugar_val.get('phone_mobile',''),
'write_date':sugar_val.get('date_modified',''),
'function':sugar_val.get('title',''),
'street': sugar_val.get('primary_address_street',''),
'zip': sugar_val.get('primary_address_postalcode',''),
'city':sugar_val.get('primary_address_city',''),
'country_id': country and country[0][0] or False,
'state_id': state and state[0][0] or False
}
new_lead_id = lead_pool.create(cr, uid, vals)
return new_lead_id
def _create_opportunity(self, cr, uid, sugar_val, country, state, context=None):
lead_pool = self.pool.get("crm.lead")
stage_id = ''
stage_pool = self.pool.get('crm.case.stage')
if sugar_val.get('sales_stage','') == 'Need Analysis':
sugar_stage = 'New'
elif sugar_val.get('sales_stage','') == 'Closed Lost':
sugar_stage = 'Lost'
elif sugar_val.get('sales_stage','') == 'Closed Won':
sugar_stage = 'Won'
elif sugar_val.get('sales_stage','') == 'Value Proposition':
sugar_stage = 'Proposition'
elif sugar_val.get('sales_stage','') == 'Negotiation/Review':
sugar_stage = 'Negotiation'
else:
sugar_stage = ''
stage_ids = stage_pool.search(cr, uid, [("type", '=', 'opportunity'), ('name', '=', sugar_stage)])
for stage in stage_pool.browse(cr, uid, stage_ids):
stage_id = stage.id
vals = {'name': sugar_val.get('name',''),
'probability': sugar_val.get('probability',''),
'user_id': sugar_val.get('created_by', ''),
'stage_id': stage_id or '',
'type': 'opportunity',
'user_id': sugar_val.get('created_by',''),
'planned_revenue': sugar_val.get('amount_usdollar'),
'write_date':sugar_val.get('date_modified',''),
}
new_opportunity_id = lead_pool.create(cr, uid, vals)
return new_opportunity_id
def _create_contact(self, cr, uid, sugar_val, country, state, context=None):
addr_pool = self.pool.get("res.partner.address")
partner_pool = self.pool.get("res.partner")
vals = {'name': sugar_val.get('first_name','')+' '+ sugar_val.get('last_name',''),
'partner_id': sugar_val.get('account_id'),
}
new_partner_id = partner_pool.create(cr, uid, vals)
addr_vals = {'partner_id': new_partner_id,
'name': sugar_val.get('first_name','')+' '+ sugar_val.get('last_name',''),
'function':sugar_val.get('title',''),
'phone': sugar_val.get('phone_home'),
'mobile': sugar_val.get('phone_mobile'),
'fax': sugar_val.get('phone_fax'),
'street': sugar_val.get('primary_address_street',''),
'zip': sugar_val.get('primary_address_postalcode',''),
'city':sugar_val.get('primary_address_city',''),
'country_id': country and country[0][0] or False,
'state_id': state and state[0][0] or False,
'email': sugar_val.get('email1'),
}
addr_pool.create(cr, uid, addr_vals)
return new_partner_id
def import_data(self, cr, uid, ids,context=None):
if not context:
context={}
for current in self.browse(cr, uid, ids):
if current.mod_name == 'lead' or current.mod_name == 'opportunity':
module_name = 'crm'
elif current.mod_name == "accounts":
module_name = 'account'
else:
module_name = 'base'
ids = self.pool.get("ir.module.module").search(cr, uid, [("name", '=',
module_name), ('state', '=', 'installed')])
if not ids:
raise osv.except_osv(_('Error !'), _('Please Install %s Module') % (module_name))
if current.mod_name == 'lead':
sugar_name = "Leads"
elif current.mod_name == 'opportunity':
sugar_name="Opportunities"
elif current.mod_name == 'accounts':
sugar_name="Accounts"
elif current.mod_name == 'contact':
sugar_name="Contacts"
PortType,sessionid = sugar.login(context.get('username',''), context.get('password',''))
sugar_data = sugar.search(PortType,sessionid,sugar_name)
if sugar_data:
for sugar_val in sugar_data:
country = self._get_all_countries(cr, uid, sugar_val.get('primary_address_country'), context)
state = self._get_all_states(cr, uid, sugar_val.get('primary_address_state'), context)
if sugar_name == "Leads":
self._create_lead(cr, uid, sugar_val, country, state, context)
elif sugar_name == "Opportunities":
self._create_opportunity(cr, uid, sugar_val, country, state,context)
elif sugar_name == "Contacts":
self._create_contact(cr, uid, sugar_val, country, state, context)
obj_model = self.pool.get('ir.model.data')
model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','import.message.form')])
resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])
return {
'view_type': 'form',
'view_mode': 'form',
'res_model': 'import.message',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
}
import_sugarcrm()
@@ -0,0 +1,43 @@
<?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 Sugarcrm">
<group colspan="4" >
<separator string="Select SugarCRM Module Name" colspan="4"/>
<field name="mod_name" />
<field name="username" invisible="1"/>
<field name="password" invisible="1"/>
</group>
<separator string="" colspan="4" />
<group colspan="4" >
<label string="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button name="import_data" string="Import"
type="object" icon="gtk-ok"/>
</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>
</data>
</openerp>
+42
View File
@@ -0,0 +1,42 @@
import hashlib
from sugarsoap_services import *
from sugarsoap_services_types import *;
import sys;
class LoginError(Exception): pass
def login(username, password):
loc = sugarsoapLocator();
portType = loc.getsugarsoapPortType();
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';
response = portType.login(request);
if -1 == response._return._id:
raise LoginError(response._return._error._description);
return (portType, response._return._id);
def search(portType, sessionid, module_name=None):
se_req = get_entry_listRequest();
se_req._session = sessionid
se_req._module_name = module_name
se_resp = portType.get_entry_list(se_req);
list = se_resp._return._entry_list;
ans_list = []
for i in list:
ans_dir = {};
for j in i._name_value_list:
ans_dir[j._name.encode('utf-8')] = j._value.encode('utf-8')
#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)
+23
View File
@@ -0,0 +1,23 @@
# -*- 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 sugarcrm_login
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,21 @@
<?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 string="Import Data Successfully" colspan="4"/>
<separator string="" colspan="4" />
<label string="" colspan="2"/>
<button icon="gtk-ok" special="cancel" string="_Ok"/>
</form>
</field>
</record>
</data>
</openerp>
@@ -0,0 +1,56 @@
# -*- 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
from tools.translate import _
from import_sugarcrm import sugar
class sugarcrm_login(osv.osv):
"""SugarCRM Login"""
_name = "sugarcrm.login"
_description = __doc__
_columns = {
'username': fields.char('User Name', size=64, required=True),
'password': fields.char('Password', size=24,required=True),
}
def open_import(self, cr, uid, ids, context=None):
for current in self.browse(cr, uid, ids, context):
PortType,sessionid = sugar.login(current.username, current.password)
if sessionid == '-1':
raise osv.except_osv(_('Error !'), _('Wrong username and password'))
obj_model = self.pool.get('ir.model.data')
model_data_ids = obj_model.search(cr,uid,[('model','=','ir.ui.view'),('name','=','import.sugarcrm.form')])
resource_id = obj_model.read(cr, uid, model_data_ids, fields=['res_id'])
context.update({'rec_id': ids, 'username': current.username, 'password': current.password})
return {
'view_type': 'form',
'view_mode': 'form',
'res_model': 'import.sugarcrm',
'views': [(resource_id,'form')],
'type': 'ir.actions.act_window',
'target': 'new',
'context': context
}
sugarcrm_login()
@@ -0,0 +1,45 @@
<?xml version="1.0"?>
<openerp>
<data>
<!-- Sugarcrm Login Form View -->
<record model="ir.ui.view" id="view_sugarcrm_login_form">
<field name="name">sugarcrm.login.form</field>
<field name="model">sugarcrm.login</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sugarcrm Login">
<group colspan="4" >
<separator string="Please enter your user name and password." colspan="4"/>
<field name="username"/>
<newline/>
<field name="password" password="True" />
</group>
<separator string="" colspan="4" />
<group colspan="4" >
<label string="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="_Cancel"/>
<button name="open_import" string="Login"
type="object" icon="gtk-ok"/>
</group>
</form>
</field>
</record>
<!-- Sugarcrm Login Action -->
<record model="ir.actions.act_window" id="action_sugarcrm_login">
<field name="name">Sugarcrm Login</field>
<field name="res_model">sugarcrm.login</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_sugarcrm_login_form"/>
<field name="target">new</field>
</record>
<menuitem name="Sugarcrm" id="menu_sugarcrm" parent="base.menu_base_partner"/>
<menuitem name="Import Sugarcrm" id="menu_sugarcrm_login" parent="menu_sugarcrm" action="action_sugarcrm_login" icon="STOCK_EXECUTE"/>
</data>
</openerp>