Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Social Media Base

Entity: social.post

Compute Method: _compute_hide_post

Inputs Method Outputs
"""Hide the post button when publishing is not a decision to take.

        A planned post keeps the button: the schedule says when the cron will
        send it, not that the user gave up on sending it right away. Once the
        post left for the social media the button only comes back to retry the
        publications that failed.
        """
for post in self:
            post.hide_post = (
                (
                    post.state
                    in (
                        "publishing",
                        "partially_published",
                        "published",
                        "cancelled",
                    )
                    and not post.any_failed_post
                )
                or not post.message
                or not post.account_ids
            )

Back to entity