Debian Codegraph @

addons/marketing_card/models/card_template.py

raw
1 from odoo import fields, models
2
3 # Good ratio to have a large image still small enough to stay under 5MB (common limit)
4 # Close to the 2:1 ratio recommended by twitter and these dimensions are recommended by meta
5 # https://developers.facebook.com/docs/sharing/webmasters/images/
6 # https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image
7 TEMPLATE_DIMENSIONS = (600, 315)
8 TEMPLATE_RATIO = 40 / 21
9
10
11 class CardTemplate(models.Model):
12 _name = 'card.template'
13 _description = 'Marketing Card Template'
14
15 name = fields.Char(required=True, translate=True)
16 default_background = fields.Image()
17 body = fields.Html(sanitize_tags=False, sanitize_attributes=False)
18
19 primary_color = fields.Char(default='#f9f9f9', required=True)
20 secondary_color = fields.Char(default='#000000', required=True)
21 primary_text_color = fields.Char(default='#000000', required=True)
22 secondary_text_color = fields.Char(default='#ffffff', required=True)