From e62baea09db91741d84a2e62c5ab1db7d15cb8c2 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 3 Aug 2023 11:09:30 +0700 Subject: Add products field on categories homepage --- indoteknik_custom/models/website_categories_homepage.py | 2 ++ indoteknik_custom/views/website_categories_homepage.xml | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/indoteknik_custom/models/website_categories_homepage.py b/indoteknik_custom/models/website_categories_homepage.py index 612dd8a0..a0fc1011 100644 --- a/indoteknik_custom/models/website_categories_homepage.py +++ b/indoteknik_custom/models/website_categories_homepage.py @@ -3,6 +3,7 @@ from odoo import fields, models class WebsiteCategoriesHomepage(models.Model): _name = 'website.categories.homepage' + _rec_name = 'category_id' category_id = fields.Many2one('product.public.category', string='Category', help='table ecommerce category') image = fields.Binary(string='Image') @@ -12,3 +13,4 @@ class WebsiteCategoriesHomepage(models.Model): ('tayang', 'Tayang'), ('tidak_tayang', 'Tidak Tayang') ], string='Status') + product_ids = fields.Many2many('product.template', string='Product Template') diff --git a/indoteknik_custom/views/website_categories_homepage.xml b/indoteknik_custom/views/website_categories_homepage.xml index 22424280..0a7ef2c2 100644 --- a/indoteknik_custom/views/website_categories_homepage.xml +++ b/indoteknik_custom/views/website_categories_homepage.xml @@ -11,8 +11,7 @@ Website Categories Homepage website.categories.homepage - - + @@ -31,11 +30,20 @@ - + + + + + + + + + + -- cgit v1.2.3