Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
คำถามนี้ถูกปิดแล้ว เนื่องจาก: Question / Code not indented โดย Jugert Mucoimaj เมื่อ 05/02/2024 14:53:23
1481 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.พ. 22
2004
6
ส.ค. 19
10174
0
ธ.ค. 19
3
1
ก.พ. 24
2760
1
ส.ค. 22
14196