From 2bc877dcbe21138451a65aa00f75f2ca240b0e4a Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 4 Jan 2023 11:04:01 +0700 Subject: add window website channel and website content --- indoteknik_custom/__manifest__.py | 2 + indoteknik_custom/models/__init__.py | 1 + indoteknik_custom/models/website_content.py | 34 +++++++++++ indoteknik_custom/security/ir.model.access.csv | 4 +- indoteknik_custom/views/website_content.xml | 65 ++++++++++++++++++++++ .../views/website_content_channel.xml | 58 +++++++++++++++++++ 6 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 indoteknik_custom/models/website_content.py create mode 100644 indoteknik_custom/views/website_content.xml create mode 100644 indoteknik_custom/views/website_content_channel.xml diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py index cf034f91..137cfb1f 100755 --- a/indoteknik_custom/__manifest__.py +++ b/indoteknik_custom/__manifest__.py @@ -52,6 +52,8 @@ 'views/purchase_outstanding.xml', 'views/sales_outstanding.xml', 'views/customer_review.xml', + 'views/website_content_channel.xml', + 'views/website_content.xml', 'report/report.xml', 'report/report_banner_banner.xml', 'report/report_banner_banner2.xml', diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index 1190e7d0..d7d3e03c 100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py @@ -40,3 +40,4 @@ from . import product_spec from . import purchase_outstanding from . import sales_outstanding from . import customer_review +from . import website_content diff --git a/indoteknik_custom/models/website_content.py b/indoteknik_custom/models/website_content.py new file mode 100644 index 00000000..e94076f8 --- /dev/null +++ b/indoteknik_custom/models/website_content.py @@ -0,0 +1,34 @@ +from odoo import fields, models, api +import logging + +_logger = logging.getLogger(__name__) + + +class WebsiteContent(models.Model): + _name = 'website.content' + + sequence = fields.Integer(string='Sequence') + slide_type = fields.Selection([ + ('document', 'Document'), + ('infographic', 'Infographic'), + ('presentation', 'Presentation'), + ('video', 'Video') + ]) + name = fields.Char(string='Name') + url = fields.Char(string='URL') + channel_id = fields.Many2one('website.content.channel', string='Channel') + status = fields.Selection([ + ('tayang', 'Tayang'), + ('tidak_tayang', 'Tidak Tayang') + ], string='Status') + + +class WebsiteContentChannel(models.Model): + _name = 'website.content.channel' + + name = fields.Char(string='Name') + description_html = fields.Html('Description', sanitize_attributes=False, sanitize_form=False) + visibility = fields.Selection([ + ('public', 'Public'), + ('internal', 'Internal') + ]) diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index c6d6cb4e..2f70d737 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -21,4 +21,6 @@ access_website_categories_homepage,access.website.categories.homepage,model_webs access_sales_target,access.sales.target,model_sales_target,,1,1,1,1 access_purchase_outstanding,access.purchase.outstanding,model_purchase_outstanding,,1,1,1,1 access_sales_outstanding,access.sales.outstanding,model_sales_outstanding,,1,1,1,1 -access_customer_review,access.customer.review,model_customer_review,,1,1,1,1 \ No newline at end of file +access_customer_review,access.customer.review,model_customer_review,,1,1,1,1 +access_website_content_channel,access.website.content.channel,model_website_content_channel,,1,1,1,1 +access_website_content,access.website.content,model_website_content,,1,1,1,1 \ No newline at end of file diff --git a/indoteknik_custom/views/website_content.xml b/indoteknik_custom/views/website_content.xml new file mode 100644 index 00000000..e071134d --- /dev/null +++ b/indoteknik_custom/views/website_content.xml @@ -0,0 +1,65 @@ + + + + website.content.tree + website.content + + + + + + + + + + + + + + website.content.form + website.content + +
+ + + + + + + + + + + + +
+
+
+ + + website.content.list.select + website.content + + + + + + + + + + Website Content + ir.actions.act_window + website.content + + tree,form + + + +
\ No newline at end of file diff --git a/indoteknik_custom/views/website_content_channel.xml b/indoteknik_custom/views/website_content_channel.xml new file mode 100644 index 00000000..d1bc23fc --- /dev/null +++ b/indoteknik_custom/views/website_content_channel.xml @@ -0,0 +1,58 @@ + + + + website.content.channel.tree + website.content.channel + + + + + + + + + + website.content.channel.form + website.content.channel + +
+ + + + + + + + + +
+
+
+ + + website.content.channel.list.select + website.content.channel + + + + + + + + + + Website Content Channel + ir.actions.act_window + website.content.channel + + tree,form + + + +
\ No newline at end of file -- cgit v1.2.3