[REF] refactoring moodle code
bzr revid: mva@openerp.com-20120220152101-l6rfzgdkb6mb0cxk
This commit is contained in:
parent
a91557d4c1
commit
3584ea8093
|
@ -26,13 +26,14 @@ import time
|
|||
import random
|
||||
from random import sample
|
||||
|
||||
|
||||
class event_moodle(osv.osv):
|
||||
_name = 'event.moodle'
|
||||
_columns = {
|
||||
'moodle_username' : fields.char('Moodle username', 128,help="You can also connect with your username that you define when you create a tokken"),
|
||||
'moodle_password' : fields.char('Moodle password', 128),
|
||||
'moodle_token' : fields.char('Moodle token', 128,help="Put your token that you created in your moodle serveur"),
|
||||
'serveur_moodle': fields.char('Moodle server', 128, required=True,help="URL where you have your moodle server ")
|
||||
'serveur_moodle': fields.char('Moodle server', 128, required=True,help="URL where you have your moodle server "),
|
||||
}
|
||||
|
||||
url=''
|
||||
|
@ -50,6 +51,7 @@ class event_moodle(osv.osv):
|
|||
create the good url with the information of the configuration
|
||||
@return url for moodle connexion
|
||||
"""
|
||||
url=""
|
||||
config_moodle = self.browse(cr, uid, ids, context=context)
|
||||
if config_moodle[0].moodle_username and config_moodle[0].moodle_password:
|
||||
url='http://'+config_moodle[0].serveur_moodle+'/moodle/webservice/xmlrpc/simpleserver.php?wsusername='+config_moodle[0].moodle_username+'&wspassword='+config_moodle[0].moodle_password
|
||||
|
@ -60,7 +62,7 @@ class event_moodle(osv.osv):
|
|||
#connexion with token
|
||||
self.url = url
|
||||
return url
|
||||
#create a good url for xmlrpc connect
|
||||
#create a good url for xmlrpc connect
|
||||
|
||||
def create_moodle_user(self,cr,uid,ids,dic_user):
|
||||
"""
|
||||
|
|
|
@ -18,13 +18,13 @@
|
|||
<field name="email" required="1" />
|
||||
</field>
|
||||
|
||||
<field name="partner_id" position="after" >
|
||||
<field name="name" position="after" >
|
||||
<field name="moodle_check_user" on_change="onchange_moodle_name(moodle_check_user)"/>
|
||||
<field name="moodle_users_id" invisible="1"/>
|
||||
</field>
|
||||
|
||||
<field name="name" position="replace"/>
|
||||
<field name="origin" position="after" >
|
||||
<field name="phone" position="before" >
|
||||
<field name="name" required="1" />
|
||||
</field>
|
||||
</field>
|
||||
|
|
|
@ -43,10 +43,11 @@
|
|||
<record id="config_wizard_config_moodle" model="ir.actions.todo">
|
||||
<field name="action_id" ref="configure_moodle"/>
|
||||
<field name="category_id" ref="marketing_cat" />
|
||||
<field name="type">once</field>
|
||||
<field name="type">automatic</field>
|
||||
<field name="name">Configuration of moodle</field>
|
||||
</record>
|
||||
|
||||
<menuitem name="Configure Moodle" parent="base.menu_marketing_config_root" id="wizard_moodle" action="configure_moodle"/>
|
||||
<menuitem name="Moodle Configuration" parent="base.menu_marketing_config_root" id="wizard_moodle" action="configure_moodle"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue