跳至內容
選單
此問題已被標幟
3933 瀏覽次數

hello everyone this is my first post here 
i really can't find help anywhere 

so i'm having a form to insert login, password and an URL to an Alfresco server and a "Test Connection" button to call a python method which try to login the user using the given data. everything works fine right now

what I want is to disable the default behavior of the button click, which is saving the record to the database 

is there anyone knows how to achieve this ? 


This is the model 

class AlfrescoConfig(models.Model):

        _name = 'alfresco.config'

         _description = 'Alfresco Configuration'

         name = fields.Char('Instance name',required=True)

         baseUrl = fields.Char('Base Url', required=True)

         username = fields.Char('Login', required=True)

         password = fields.Char('Password',required=True)

    

     @api.one

     def checkConnection(self):

            client = ShareClient(url=self.baseUrl, debug=1)

            client.login(self.username,self.password)

            client.logout()



<record model="ir.ui.view" id="alfrescoConfigFormView">

     <field name="name">alfresco.add.config</field>

     <field name="model">alfresco.config</field>

     <field name="arch" type="xml">

         <form string="AlfrescoAddInstance">  

         <field name="name" class="oe_inline" /> <newline />

         <field name="username" /> <newline />

         <field name="password" password="True" /> <newline />

         <field name="baseUrl" placeholder="e.g. http://localhost:8080" colspan="4" /> <newline />

         <button name="checkConnection" colspan="2" type="object" class="oe_highlight" string="Test Connection"/>

 </record>

頭像
捨棄
作者

anyone ?!

相關帖文 回覆 瀏覽次數 活動
2
3月 15
4900
0
10月 19
3104
0
3月 15
3569
0
3月 15
3423
0
3月 15
3458