India

ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171

   .

ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254

  UAE

Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466

  Germany​

ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

OpenERP 7 integration with Moodle

Contact Form


Jasad Moozhiyan's picture

OpenERP 7 integration with Moodle

OpenERP 7.0, The full featured ERP making the switch from an ERP to a suite of integrated business applications. So far, the world was split between ERPs and best of breed applications. With 7.0, OpenERP combines the key benefits of stand-alone apps (ease of use, quick to deploy, highly customizable, ...) with the integrations and feature coverage only ERPs used to provide to their customers.

Moodle (Modular Object-Oriented Dynamic Learning Environment) is a free source e-learning software platform, also known as a Learning Management System, or Virtual Learning Environment (VLE).It was originally developed by Martin Dougiamas to help educators create online courses with a focus on interaction and collaborative construction of content, and is in continual evolution. The first version of Moodle was released on 20 August 2002.

Moodle has several features considered typical of an e-learning platform, plus some original innovations (like its filtering system). Moodle is very similar to a learning management system. Moodle can be used in many types of environments such as in education, training and development, and business settings.

Some typical features of Moodle are:

  • Assignment submission
  • Discussion forum
  • Files download
  • Grading
  • Moodle instant messages
  • Online calendar
  • Online news and announcement (College and course level)
  • Online quiz

To integrate openERP with moodle, first you need to install a moodle server(I used moodle 2.4.3 version).Then create an Admin user and activate the web service in moodle.

For activate web service in moodle.

  1. In moodle, site administration ->plugins ->web services ->manage protocols -> activate the xmlrpc web service.
  2. In moodle, site administration ->plugins ->web services ->manage tokens -> create a token: When creating token, you need to select a web service.So you can select the existing web service or can create new service for this particular   integration.If you want to create seprate web services for this integration, Goto site administration ->plugins ->web services -> External services -> add external service and add the functions.Ex:
  3. In moodle, site administration ->plugins ->web services ->overview -> activate webservice.

In openERP 7.0, there is a module named 'event_moodle' which help us to interact with a Moodle platform.So first install 'event_moodle' module, when you installing, it will shows a pop up window to set up the configuration such as server name, token, user and password.Provide the server name, created token and the username, password of the admin user(admin user have all the privileges).

Configuration window

Fig: Configuration window when installing module in OpenERP

In this integration, the openERP event is mapped to moodle courses and the registrations of event is mapped to moodle users.So when you create and confirming an event, correspondig course will be created in your moodle server.Similarly when you create and confirming a registration for a particular event, corresponding user will be created in moodle server and a role such as student, teacher etc is assigned to this created user.Here the default role is student.

Fig: Event created in OpenERP

The username and password of this user is randomly generated and it is stored in registration form of OpenERP('Moodle username' and 'Password for Moodle User' fields).This user can login to the moodle server and he can add his own course,blogs,messages etc.

Fig: Registration form in OpenERP with moodle user and password after confirmation

The corresponding course created in moodle server is as shown below:

Fig: Course created in Moodle

The User created corresponding to the confirmed registration of a selected event is shown below. And if we modify the 'Event Confirmation' mail by including the url of moodle, username and password of the registration, help the registrant to get the login details of moodle account.

Fig: User created in Moodle

The role assigned to this created user is as shown below:

Fig: Role of user in Moodle

As OpenERP is a concrete ERP solution and moodle is a good e-learning platform, so developers can extend the functionality by adding new plugins in moodle and corresponding changes in OpenERP.

Josué Rodríguez's picture

Thanks for your answer! At

Thanks for your answer! At create an external service, add functions and create a new token, the integration works! Thanks for your support.

Now i have a new inconvenient. When i register an member in the event appear this message:

OpenERP Server Error
Client Traceback (most recent call last):
File "/opt/openerp/server/openerp/addons/web/http.py", line 204, in dispatch
response["result"] = method(self, **self.params)
File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1134, in call_button
action = self._call_kw(req, model, method, args, {})
File "/opt/openerp/server/openerp/addons/web/controllers/main.py", line 1122, in _call_kw
return getattr(req.session.model(model), method)(*args, **kwargs)
File "/opt/openerp/server/openerp/addons/web/session.py", line 42, in proxy
result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
File "/opt/openerp/server/openerp/addons/web/session.py", line 30, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/opt/openerp/server/openerp/addons/web/session.py", line 103, in send
raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last):
File "/opt/openerp/server/openerp/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/opt/openerp/server/openerp/netsvc.py", line 292, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/openerp/server/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, *params)
File "/opt/openerp/server/openerp/osv/osv.py", line 188, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/opt/openerp/server/openerp/osv/osv.py", line 131, in wrapper
return f(self, dbname, *args, **kwargs)
File "/opt/openerp/server/openerp/osv/osv.py", line 197, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/opt/openerp/server/openerp/osv/osv.py", line 185, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/opt/openerp/server/openerp/addons/event/event.py", line 340, in registration_open
res = self.confirm_registration(cr, uid, ids, context=context)
File "/opt/openerp/server/openerp/addons/event_moodle/event_moodle.py", line 253, in confirm_registration
'city': register.city,
File "/opt/openerp/server/openerp/osv/orm.py", line 486, in __getattr__
raise AttributeError(e)
AttributeError: "Field 'city' does not exist in object 'browse_record(event.registration, 2)'"

Thanks for your valious help!

Jasad Moozhiyan's picture

Hi Josue, The data you are

Hi Josue,

The data you are fetching to create the registration/user is not correct.So please fetch the correct data and try.

Josue Rodriguez's picture

Thanks for you suggest, but

Thanks for you suggest, but no luck. If is possible can you send a copy of you event_moodle.py?
I work with moodle 2.5 and i can see that field name to password is newpasswird, but in openerp module is password. And for example to register a new user in moodle the field country is required but in py file not appear.
Thanks for your answer!

Cira Brilla's picture

Hi to every body, it's my

Hi to every body, it's my first pay a quick visit of this weblog; this weblog includes awesome and in fact excellent data for visitors.

Jasad Moozhiyan's picture

Thanks Cira Brilla.

Thanks Cira Brilla.