slider_view.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <menuitem id="menu_slider_config" parent="sale.sale_menu_root" name="Slider Configuration" sequence="101"/>
  4. <!-- Product Category Slider -->
  5. <!-- Product Category Slider Form View-->
  6. <record id="prod_cat_slider_form_view" model="ir.ui.view">
  7. <field name="name">product.category.slider.form.view</field>
  8. <field name="model">product.category.slider.config</field>
  9. <field name="arch" type="xml">
  10. <form string="Product/Category Slider">
  11. <sheet>
  12. <group>
  13. <field name="name"/>
  14. <field name="active"/>
  15. <field name="no_of_counts"/>
  16. <field name="prod_cat_type"/>
  17. <field name="auto_rotate"/>
  18. <field name="sliding_speed"
  19. attrs="{'invisible': [('auto_rotate', '=', False)]}"/>
  20. <field name="collections_product"
  21. attrs="{'invisible': [('prod_cat_type', '=', 'category')],
  22. 'required': [('prod_cat_type', '=', 'product')]}"
  23. widget="many2many_tags"/>
  24. <field name="collections_category"
  25. attrs="{'invisible': [('prod_cat_type', '=', 'product')],
  26. 'required': [('prod_cat_type', '=', 'category')]}"
  27. widget="many2many_tags"/>
  28. </group>
  29. </sheet>
  30. </form>
  31. </field>
  32. </record>
  33. <!-- Product Category Slider List View-->
  34. <record id="prod_cat_slider_list_view" model="ir.ui.view">
  35. <field name="name">product.category.slider.list.view</field>
  36. <field name="model">product.category.slider.config</field>
  37. <field name="arch" type="xml">
  38. <tree string="Product/Category Slider">
  39. <field name="name"/>
  40. <field name="no_of_counts"/>
  41. <field name="prod_cat_type"/>
  42. <!-- <field name="auto_rotate"/>
  43. <field name="sliding_speed"/>
  44. <field name="collections"/> -->
  45. </tree>
  46. </field>
  47. </record>
  48. <!-- Product Category Slider Action -->
  49. <record id="prod_cat_slider_action" model="ir.actions.act_window">
  50. <field name="name">Product/Category Slider</field>
  51. <field name="type">ir.actions.act_window</field>
  52. <field name="res_model">product.category.slider.config</field>
  53. <field name="view_type">form</field>
  54. <field name="view_mode">tree,form</field>
  55. <field name="view_id" eval="False"/>
  56. <field name="help" type="html">
  57. <p class="oe_view_nocontent_create">
  58. Click to define a new slider.
  59. </p>
  60. </field>
  61. </record>
  62. <!-- Product Category menu in slider config -->
  63. <menuitem id="prod_cat_slider_menu"
  64. name="Product/Category Slider Configuration"
  65. action="prod_cat_slider_action"
  66. parent="kingfisher_pro.menu_slider_config"
  67. sequence="60"/>
  68. <!-- Brands slider -->
  69. <record id="product_brandz_search_view" model="ir.ui.view">
  70. <field name="name">product.brands.search.form</field>
  71. <field name="model">product.brands</field>
  72. <field name="arch" type="xml">
  73. <search string="Product Brands">
  74. <field name="name"/>
  75. </search>
  76. </field>
  77. </record>
  78. <!-- Brand Products -->
  79. <act_window id="action_open_brand_products"
  80. name="Brand Products"
  81. res_model="product.template"
  82. view_type="form"
  83. view_mode="kanban,form,tree"
  84. domain="[('product_brand_id', '=', active_id)]"/>
  85. <!-- Product Brand -->
  86. <act_window id="action_open_single_product_brand"
  87. name="Product Brand"
  88. res_model="product.brands"
  89. view_type="form"
  90. view_mode="kanban,form,tree"
  91. target="current"
  92. domain="[('product_ids', 'in', active_id)]"/>
  93. <!-- Product brand form view -->
  94. <record id="view_product_brands_form_view" model="ir.ui.view">
  95. <field name="name">product.brands.form</field>
  96. <field name="model">product.brands</field>
  97. <field name="arch" type="xml">
  98. <form string="Product Brands">
  99. <sheet>
  100. <field name="brand_logo" widget="image" class="oe_avatar oe_left"/>
  101. <div class="oe_title">
  102. <div class="oe_edit_only">
  103. <label for="name" string="Brand Name"/>
  104. </div>
  105. <h1>
  106. <field name="name"/>
  107. </h1>
  108. </div>
  109. <div class="oe_right oe_button_box">
  110. <button
  111. class="oe_inline oe_stat_button"
  112. type="action"
  113. name="%(action_open_brand_products)d"
  114. icon="fa-cubes">
  115. <field name="products_count" string="Products" widget="statinfo" />
  116. </button>
  117. </div>
  118. <group string="Brand Cover">
  119. <field name="brand_cover"
  120. height="74px"
  121. nolabel='1' widget="image"/>
  122. </group>
  123. <group string="Description">
  124. <field name="brand_description" nolabel="1" widget="html"/>
  125. </group>
  126. </sheet>
  127. </form>
  128. </field>
  129. </record>
  130. <!-- Product brand tree view -->
  131. <record id="view_product_brands_tree_view" model="ir.ui.view">
  132. <field name="name">product.brands.tree</field>
  133. <field name="model">product.brands</field>
  134. <field name="arch" type="xml">
  135. <tree string="product.brands">
  136. <field name="name"/>
  137. <field name="brand_description"/>
  138. </tree>
  139. </field>
  140. </record>
  141. <!-- Product brand kanban view -->
  142. <record id="view_product_brands_kanban_view" model="ir.ui.view">
  143. <field name="name">product.brands.kanban</field>
  144. <field name="model">product.brands</field>
  145. <field name="arch" type="xml">
  146. <kanban class="o_kanban_mobile">
  147. <field name="brand_logo"/>
  148. <field name="products_count"/>
  149. <field name="name"/>
  150. <field name="brand_description"/>
  151. <templates>
  152. <t t-name="kanban-box">
  153. <div class="oe_kanban_global_click">
  154. <div class="o_kanban_image">
  155. <img t-att-src="kanban_image('product.brand', 'brand_logo')" t-att-alt="brand_description"/>
  156. </div>
  157. <div class="oe_kanban_details">
  158. <strong class="o_kanban_record_title"><field name="name"/></strong>
  159. <div>
  160. <a name="%(kingfisher_pro.action_open_brand_products)d"
  161. type="action">
  162. <t t-esc="record.products_count.value"/> Products
  163. </a>
  164. </div>
  165. <div>
  166. <t t-raw="record.brand_description.value.slice(0,200)"/>
  167. <t t-if="record.brand_description.value.length > 200">
  168. <a type="open"><b>...</b></a>
  169. </t>
  170. </div>
  171. </div>
  172. </div>
  173. </t>
  174. </templates>
  175. </kanban>
  176. </field>
  177. </record>
  178. <!-- Product brand search view -->
  179. <record id="inherit_product_search_view" model="ir.ui.view">
  180. <field name="name">inherited.product.search.form</field>
  181. <field name="model">product.product</field>
  182. <field name="inherit_id" ref="product.product_search_form_view"/>
  183. <field name="arch" type="xml">
  184. <field name="name" position="after">
  185. <field name="product_brand_id"/>
  186. </field>
  187. <filter name="services" position='after'>
  188. <filter string="Brands" name="groupby_brand" domain="[]"
  189. context="{'group_by' : 'product_brand_id'}"/>
  190. </filter>
  191. </field>
  192. </record>
  193. <!-- Product template inherited search view -->
  194. <record id="inherited_view_product_template_search_brand" model="ir.ui.view">
  195. <field name="name">product.template.search.brand</field>
  196. <field name="model">product.template</field>
  197. <field name="inherit_id" ref="product.product_template_search_view"/>
  198. <field name="arch" type="xml">
  199. <field name="name" position="after">
  200. <field name="product_brand_id"/>
  201. </field>
  202. <filter name="services" position='after'>
  203. <filter string="Brand" name="groupby_brand" domain="[]"
  204. context="{'group_by' : 'product_brand_id'}"/>
  205. </filter>
  206. </field>
  207. </record>
  208. <!-- Product product inherited search view -->
  209. <record id="inherited_product_template_form_brand_add" model="ir.ui.view">
  210. <field name="name">product.template.product.form</field>
  211. <field name="model">product.template</field>
  212. <field name="inherit_id" ref="product.product_template_form_view" />
  213. <field name="arch" type="xml">
  214. <field name="name" position="after" >
  215. <field name="product_brand_id" placeholder="Brand"/>
  216. </field>
  217. </field>
  218. </record>
  219. <!-- Product template inherited kanban view -->
  220. <record id="inherited_view_product_template_kanban_brand" model="ir.ui.view">
  221. <field name="name">product kanban view: add brand</field>
  222. <field name="model">product.template</field>
  223. <field name="inherit_id" ref="product.product_template_kanban_view" />
  224. <field name="arch" type="xml">
  225. <xpath expr="//div[hasclass('oe_kanban_details')]/strong" position="after">
  226. <div>
  227. <a t-if="record.product_brand_id" type="action"
  228. name="%(action_open_single_product_brand)d">
  229. <field name="product_brand_id"/>
  230. </a>
  231. </div>
  232. </xpath>
  233. </field>
  234. </record>
  235. <!-- Product product inherited kanban view -->
  236. <record id="inherited_view_product_variant_kanban_brand" model="ir.ui.view">
  237. <field name="name">product variant kanban view: add brand</field>
  238. <field name="model">product.product</field>
  239. <field name="inherit_id" ref="product.product_kanban_view" />
  240. <field name="arch" type="xml">
  241. <xpath expr="//div[hasclass('oe_kanban_details')]/strong" position="after">
  242. <div>
  243. <a t-if="record.product_brand_id" type="open">
  244. <field name="product_brand_id"/>
  245. </a>
  246. </div>
  247. </xpath>
  248. </field>
  249. </record>
  250. <!-- Product template inherited tree view -->
  251. <record id="inherited_view_product_template_tree_brand" model="ir.ui.view">
  252. <field name="name">product tree view: add brand</field>
  253. <field name="model">product.template</field>
  254. <field name="inherit_id" ref="product.product_template_tree_view" />
  255. <field name="arch" type="xml">
  256. <field name="name" position="after">
  257. <field name="product_brand_id"/>
  258. </field>
  259. </field>
  260. </record>
  261. <!-- Product product inherited tree view -->
  262. <record id="inherited_view_product_variant_tree_brand" model="ir.ui.view">
  263. <field name="name">product variant tree view: add brand</field>
  264. <field name="model">product.product</field>
  265. <field name="inherit_id" ref="product.product_product_tree_view" />
  266. <field name="arch" type="xml">
  267. <field name="name" position="after">
  268. <field name="product_brand_id"/>
  269. </field>
  270. </field>
  271. </record>
  272. <!-- Product brand action -->
  273. <record model="ir.actions.act_window" id="action_product_brand">
  274. <field name="name">Brands</field>
  275. <field name="res_model">product.brands</field>
  276. <field name="view_type">form</field>
  277. <field name="view_mode">kanban,form,tree</field>
  278. </record>
  279. <!-- Brand Menu -->
  280. <menuitem id="menu_product_brand"
  281. name="Product Brands"
  282. action="action_product_brand"
  283. parent="kingfisher_pro.menu_slider_config"/>
  284. <!-- Blog Slider -->
  285. <!-- Blog Slider Form View-->
  286. <record id="dynamic_blog_slider_form_view" model="ir.ui.view">
  287. <field name="name">dynamic.blog.slider.form.view</field>
  288. <field name="model">blog.slider.config</field>
  289. <field name="arch" type="xml">
  290. <form string="Blog Post Slider">
  291. <sheet>
  292. <group>
  293. <field name="name"/>
  294. <field name="active"/>
  295. <field name="no_of_counts"/>
  296. <field name="auto_rotate"/>
  297. <field name="sliding_speed"
  298. attrs="{'invisible': [('auto_rotate', '=', False)]}"/>
  299. <field name="collections_blog_post"
  300. widget="many2many_tags"/>
  301. </group>
  302. </sheet>
  303. </form>
  304. </field>
  305. </record>
  306. <!-- Blog Slider List View-->
  307. <record id="dynamic_blog_slider_list_view" model="ir.ui.view">
  308. <field name="name">dynamic.blog.slider.list.view</field>
  309. <field name="model">blog.slider.config</field>
  310. <field name="arch" type="xml">
  311. <tree string="Blog Post Slider">
  312. <field name="name"/>
  313. <field name="no_of_counts"/>
  314. </tree>
  315. </field>
  316. </record>
  317. <!-- Blog Slider Action -->
  318. <record id="dynamic_blog_slider_action" model="ir.actions.act_window">
  319. <field name="name">Blog Post Slider</field>
  320. <field name="type">ir.actions.act_window</field>
  321. <field name="res_model">blog.slider.config</field>
  322. <field name="view_type">form</field>
  323. <field name="view_mode">tree,form</field>
  324. <field name="view_id" eval="False"/>
  325. <field name="help" type="html">
  326. <p class="oe_view_nocontent_create">
  327. Click to define a new slider.
  328. </p>
  329. </field>
  330. </record>
  331. <!-- Blog slider main menu in config -->
  332. <menuitem id="dynamic_blog_slider_menu"
  333. name="Blog Slider Configuration"
  334. action="dynamic_blog_slider_action"
  335. parent="website_blog.menu_website_blog_root"
  336. sequence="60"/>
  337. <!-- Multi Product Slider Form View-->
  338. <record id="multi_slider_form_view" model="ir.ui.view">
  339. <field name="name">multi.slider.form.view</field>
  340. <field name="model">multi.slider.config</field>
  341. <field name="arch" type="xml">
  342. <form string="Multi Slider">
  343. <sheet>
  344. <group>
  345. <field name="name"/>
  346. <field name="active"/>
  347. </group>
  348. <group string="Slider configuration">
  349. <field name="auto_rotate"/>
  350. <field name="sliding_speed"
  351. attrs="{'invisible': [('auto_rotate', '=', False)]}"/>
  352. </group>
  353. <group string="Collection configuration">
  354. <field name="no_of_collection"/>
  355. <field name="label_collection_1"
  356. attrs="{'invisible': [('no_of_collection', '=', False)]}"/>
  357. <field name="collection_1_ids"
  358. attrs="{'invisible': [('no_of_collection', '=', False)]}"
  359. widget='many2many_tags'/>
  360. <field name="label_collection_2"
  361. attrs="{'invisible': [('no_of_collection', '=', False)]}" />
  362. <field name="collection_2_ids"
  363. attrs="{'invisible': [('no_of_collection', '=', False)]}"
  364. widget='many2many_tags'/>
  365. <field name="label_collection_3"
  366. attrs="{'invisible': ['|', ('no_of_collection', '=', False),
  367. ('no_of_collection', 'not in', ('3', '4', '5'))],
  368. 'required': [('no_of_collection', 'in', ('3', '4', '5'))]}"/>
  369. <field name="collection_3_ids"
  370. attrs="{'invisible': ['|', ('no_of_collection', '=', False),
  371. ('no_of_collection', 'not in', ('3', '4', '5'))],
  372. 'required': ['|', ('no_of_collection', 'in', ('3', '4', '5'))]}"
  373. widget='many2many_tags'/>
  374. <field name="label_collection_4"
  375. attrs="{'invisible': ['|', ('no_of_collection', '=', False),
  376. ('no_of_collection', 'not in', ('4', '5'))],
  377. 'required': [('no_of_collection', 'in', ('4', '5'))]}"/>
  378. <field name="collection_4_ids"
  379. attrs="{'invisible': ['|', ('no_of_collection', '=', False),
  380. ('no_of_collection', 'not in', ('4', '5'))],
  381. 'required': [('no_of_collection', 'in', ('4', '5'))]}"
  382. widget='many2many_tags'/>
  383. <field name="label_collection_5"
  384. attrs="{'invisible': ['|', ('no_of_collection', '=', False),
  385. ('no_of_collection', '!=', '5')],
  386. 'required': [('no_of_collection', '=', '5')]}"/>
  387. <field name="collection_5_ids"
  388. attrs="{'invisible': ['|', ('no_of_collection', '=', False),
  389. ('no_of_collection', '!=', '5')],
  390. 'required': [('no_of_collection', '=', '5')]}"
  391. widget='many2many_tags'/>
  392. </group>
  393. </sheet>
  394. </form>
  395. </field>
  396. </record>
  397. <!-- Multi Product Slider List View-->
  398. <record id="multi_slider_list_view" model="ir.ui.view">
  399. <field name="name">multi.slider.list.view</field>
  400. <field name="model">multi.slider.config</field>
  401. <field name="arch" type="xml">
  402. <tree string="Dynamic Slider">
  403. <field name="name"/>
  404. <field name="active"/>
  405. <field name="no_of_collection"/>
  406. </tree>
  407. </field>
  408. </record>
  409. <!-- Multi Product Slider Action -->
  410. <record id="multi_slider_action" model="ir.actions.act_window">
  411. <field name="name">Multi Slider</field>
  412. <field name="type">ir.actions.act_window</field>
  413. <field name="res_model">multi.slider.config</field>
  414. <field name="view_type">form</field>
  415. <field name="view_mode">tree,form</field>
  416. <field name="view_id" eval="False"/>
  417. <field name="help" type="html">
  418. <p class="oe_view_nocontent_create">
  419. Click to define a new slider.
  420. </p>
  421. </field>
  422. </record>
  423. <!-- Main menu in config -->
  424. <menuitem id="multi_slider_menu"
  425. name="Multi Product Slider Configuration"
  426. action="multi_slider_action"
  427. parent="kingfisher_pro.menu_slider_config"
  428. sequence="70"/>
  429. </odoo>