summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2022-08-29 10:41:07 +0700
committerIT Fixcomart <it@fixcomart.co.id>2022-08-29 10:41:07 +0700
commit349ddaed037e2a9eec7b96d31536924abd5601ed (patch)
tree354465bfa40f702652668f70894c3c944499b585
parentc3d42480e83f466f847bb0e8c051f45257de5cd2 (diff)
Menambahkan thumbnail blog dan mengubah group attr SEO Blog
-rwxr-xr-xindoteknik_custom/models/__init__.py1
-rw-r--r--indoteknik_custom/models/blog_post.py11
-rw-r--r--indoteknik_custom/views/blog_post.xml18
3 files changed, 30 insertions, 0 deletions
diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py
index 25341923..41c0b184 100755
--- a/indoteknik_custom/models/__init__.py
+++ b/indoteknik_custom/models/__init__.py
@@ -19,3 +19,4 @@ from . import sale_monitoring_detail
from . import sale_monitoring
from . import account_move
from . import account_asset
+from . import blog_post
diff --git a/indoteknik_custom/models/blog_post.py b/indoteknik_custom/models/blog_post.py
new file mode 100644
index 00000000..27f0c125
--- /dev/null
+++ b/indoteknik_custom/models/blog_post.py
@@ -0,0 +1,11 @@
+from odoo import models, fields
+
+
+class BlogPost(models.Model):
+ _inherit = 'blog.post'
+
+ thumbnail = fields.Binary(string="Thumbnail")
+ thumbnail_128 = fields.Image("Thumbnail 128", related="thumbnail", max_width=128, max_height=128, store=True)
+ thumbnail_256 = fields.Image("Thumbnail 256", related="thumbnail", max_width=256, max_height=256, store=True)
+ thumbnail_512 = fields.Image("Thumbnail 512", related="thumbnail", max_width=512, max_height=512, store=True)
+ thumbnail_1024 = fields.Image("Thumbnail 1024", related="thumbnail", max_width=1024, max_height=1024, store=True)
diff --git a/indoteknik_custom/views/blog_post.xml b/indoteknik_custom/views/blog_post.xml
new file mode 100644
index 00000000..0acf6aa5
--- /dev/null
+++ b/indoteknik_custom/views/blog_post.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<odoo>
+ <data>
+ <record id="blog_post_form_view_inherit" model="ir.ui.view">
+ <field name="name">Blog Posts</field>
+ <field name="model">blog.post</field>
+ <field name="inherit_id" ref="website_blog.view_blog_post_form" />
+ <field name="arch" type="xml">
+ <field name="blog_id" position="before">
+ <field name="thumbnail" widget="image" width="240" />
+ </field>
+ <xpath expr="//notebook/page[@name=seo]" position="attributes">
+ <attribute name="groups">website.group_website_designer</attribute>
+ </xpath>
+ </field>
+ </record>
+ </data>
+</odoo> \ No newline at end of file