slider.py 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # -*- coding: utf-8 -*-
  2. # Part of BiztechCS. See LICENSE file for full copyright and licensing details.
  3. from openerp import api, fields, models
  4. class ProductCategorySlider(models.Model):
  5. _name = 'product.category.slider.config'
  6. name = fields.Char(string="Slider name", default='Trending', required=True, translate=True,
  7. help="Slider title to be displayed on website like Best products, Latest and etc...")
  8. active = fields.Boolean(string="Active", default=True)
  9. no_of_counts = fields.Selection([('3', '3'), ('4', '4'), ('5', '5'), ('6', '6')], string="Counts",
  10. default='4', required=True,
  11. help="No of products to be displayed in slider.")
  12. prod_cat_type = fields.Selection([('product', 'Product'), ('category', 'Category')],
  13. string="Type of slider", default='product', required=True,
  14. help="Select product or category for whom you want to show a slider.")
  15. auto_rotate = fields.Boolean(string='Auto Rotate Slider', default=True)
  16. sliding_speed = fields.Integer(string="Slider sliding speed", default='5000',
  17. help='Sliding speed of a slider can be set from here and it will be in milliseconds.')
  18. collections_product = fields.Many2many('product.template', 'king_pro_product_slider_rel', 'slider_id',
  19. 'prod_id', string="Collections of product")
  20. collections_category = fields.Many2many('product.public.category', 'king_pro_category_slider_rel',
  21. 'slider_id', 'cat_id', string="Collections of category")
  22. class BlogSlider(models.Model):
  23. _name = 'blog.slider.config'
  24. name = fields.Char(string="Slider name", default='Blogs', translate=True,
  25. help="Slider title to be displayed on website like Our Blogs, Latest Blog Post and etc...",
  26. required=True)
  27. active = fields.Boolean(string="Active", default=True)
  28. no_of_counts = fields.Selection([('1', '1'), ('2', '2'), ('3', '3')], string="Counts",
  29. default='3', help="No of blogs to be displayed in slider.", required=True)
  30. auto_rotate = fields.Boolean(string='Auto Rotate Slider', default=True)
  31. sliding_speed = fields.Integer(string="Slider sliding speed", default='5000',
  32. help='Sliding speed of a slider can be set from here and it will be in milliseconds.')
  33. collections_blog_post = fields.Many2many('blog.post', 'blogpost_slider_rel', 'slider_id',
  34. 'post_id', string="Collections of blog posts", required=True)
  35. class MultiSlider(models.Model):
  36. _name = 'multi.slider.config'
  37. name = fields.Char(string="Slider name", default='Trending',
  38. required=True, translate=True,
  39. help="Slider title to be displayed on website like Best products, Latest and etc...")
  40. active = fields.Boolean(string="Active", default=True)
  41. auto_rotate = fields.Boolean(string='Auto Rotate Slider', default=True)
  42. sliding_speed = fields.Integer(string="Slider sliding speed", default='5000',
  43. help='Sliding speed of a slider can be set from here and it will be in milliseconds.')
  44. no_of_collection = fields.Selection([('2', '2'), ('3', '3'), ('4', '4'), ('5', '5')],
  45. string="No. of collections to show", default='2',
  46. required=True,
  47. help="No of collections to be displayed on slider.")
  48. label_collection_1 = fields.Char(string="1st collection name", default='First collection',
  49. required=True, translate=True,
  50. help="Collection label to be displayed in website like Men, Women, Kids, etc...")
  51. collection_1_ids = fields.Many2many('product.template', 'product_slider_collection_1_rel', 'slider_id',
  52. 'prod_id',
  53. required=True,
  54. string="1st product collection")
  55. label_collection_2 = fields.Char(string="2nd collection name", default='Second collection',
  56. required=True, translate=True,
  57. help="Collection label to be displayed in website like Men, Women, Kids, etc...")
  58. collection_2_ids = fields.Many2many('product.template', 'product_slider_collection_2_rel', 'slider_id',
  59. 'prod_id',
  60. required=True,
  61. string="2nd product collection")
  62. label_collection_3 = fields.Char(string="3rd collection name", default='Third collection', translate=True,
  63. # required=True,
  64. help="Collection label to be displayed in website like Men, Women, Kids, etc...")
  65. collection_3_ids = fields.Many2many('product.template', 'product_slider_collection_3_rel', 'slider_id',
  66. 'prod_id',
  67. # required=True,
  68. string="3rd product collection")
  69. label_collection_4 = fields.Char(string="4th collection name", default='Fourth collection', translate=True,
  70. # required=True,
  71. help="Collection label to be displayed in website like Men, Women, Kids, etc...")
  72. collection_4_ids = fields.Many2many('product.template', 'product_slider_collection_4_rel', 'slider_id',
  73. 'prod_id',
  74. # required=True,
  75. string="4th product collection")
  76. label_collection_5 = fields.Char(string="5th collection name", default='Fifth collection', translate=True,
  77. # required=True,
  78. help="Collection label to be displayed in website like Men, Women, Kids, etc...")
  79. collection_5_ids = fields.Many2many('product.template', 'product_slider_collection_5_rel', 'slider_id',
  80. 'prod_id',
  81. # required=True,
  82. string="5th product collection")