1
0
forked from Mapan/odoo17e
odoo17e-kedaikipas58/addons/social_youtube/models/social_post_template.py
2024-12-10 09:04:09 +07:00

21 lines
726 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.osv import expression
class SocialPostTemplateYoutube(models.Model):
_inherit = 'social.post.template'
def _get_default_accounts_domain(self):
""" As YouTube requires 'extra work' (video upload, ...), we don't want it selected by default.
It will also not be available for the social post template.
"""
youtube_media = self.env.ref('social_youtube.social_media_youtube')
return expression.AND([
super(SocialPostTemplateYoutube, self)._get_default_accounts_domain(),
[('media_id', '!=', youtube_media.id)]
])