跳至內容
選單
此問題已被標幟
問題已關閉 原因: Question / Code not indented
Jugert Mucoimaj2024年02月05日 14時53分23秒
1354 瀏覽次數

I made a simple model getting data from an API but to retrieve data need to activate it with a button. I made and function and button's tag "" and it is not showing up on the view.


class ToggleSync(models.Model):
_name = "hotel.sync"
_description = "ToogleSync"

sync = fields.Boolean("Sync or Not")
api_token = fields.Char("API Token")

# Define the method to be called when the button is clicked
# @api.multi
def _compute_get_data(self):
for record in self:
print("wassup")


Sorry I have some time not working on Odoo and I have no idea what is wrong.


Edit: Editor not working with xml code. xml code always disappears.


Edit 2: button name="_compute_get_data" string="Get Data" class="btn-primary"                 type="object"


Edit 3: Reinstalled the module and it showed up

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
2月 22
1847
6
8月 19
10040
0
12月 19
3
1
2月 24
2656
1
8月 22
14085