تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
لقد تم إغلاق هذا السؤال والسبب: Question / Code not indented
بواسطة Jugert Mucoimaj في 05 فبراير, 2024 02:53:23
1072 أدوات العرض

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
فبراير 22
1618
6
أغسطس 19
9713
0
ديسمبر 19
3
1
فبراير 24
2297
1
أغسطس 22
13752