You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.8 KiB

from odoo import models, fields, api
class SocialMixin(models.AbstractModel):
_name = "social.mixin"
_description = "Social Mixin"
social_facebook = fields.Char("Facebook Account")
social_instagram = fields.Char("Instagram Account")
social_twitter = fields.Char("Twitter Account")
social_linkedin = fields.Char("LinkedIn Account")
social_youtube = fields.Char("Youtube Account")
social_github = fields.Char("GitHub Account")
def open_twitter(self):
self.ensure_one()
return {
"type": "ir.actions.act_url",
"url": self.social_twitter or "https://www.twitter.com",
"target": "new",
}
def open_facebook(self):
self.ensure_one()
return {
"type": "ir.actions.act_url",
"url": self.social_facebook or "https://www.facebook.com",
"target": "new",
}
def open_github(self):
self.ensure_one()
return {
"type": "ir.actions.act_url",
"url": self.social_github or "https://www.github.com",
"target": "new",
}
def open_linkedin(self):
self.ensure_one()
return {
"type": "ir.actions.act_url",
"url": self.social_linkedin or "https://www.linkedin.com",
"target": "new",
}
def open_youtube(self):
self.ensure_one()
return {
"type": "ir.actions.act_url",
"url": self.social_youtube or "https://www.youtube.com",
"target": "new",
}
def open_instagram(self):
self.ensure_one()
return {
"type": "ir.actions.act_url",
"url": self.social_instagram or "https://www.instagram.com",
"target": "new",
}