data.xml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data noupdate="1">
  4. <record id="menu_shop" model="website.menu">
  5. <field name="name">Shop</field>
  6. <field name="url">/shop</field>
  7. <field name="parent_id" ref="website.main_menu"/>
  8. <field name="sequence" type="int">20</field>
  9. </record>
  10. <record id="action_open_website" model="ir.actions.act_url">
  11. <field name="name">Website Shop</field>
  12. <field name="target">self</field>
  13. <field name="url">/shop</field>
  14. </record>
  15. <record id="base.open_menu" model="ir.actions.todo">
  16. <field name="action_id" ref="action_open_website"/>
  17. <field name="state">open</field>
  18. </record>
  19. <record id="product_attribute_brand" model="product.attribute">
  20. <field name="name">Brand</field>
  21. <field name="sequence">0</field>
  22. </record>
  23. <record id="website_sale.sale_ribbon" model="product.ribbon">
  24. <field name="html">Sale</field>
  25. <field name="html_class">text-bg-success o_ribbon_left</field>
  26. </record>
  27. <record id="website_sale.sold_out_ribbon" model="product.ribbon">
  28. <field name="html">Sold out</field>
  29. <field name="html_class">text-bg-danger o_ribbon_left</field>
  30. </record>
  31. <record id="website_sale.out_of_stock_ribbon" model="product.ribbon">
  32. <field name="html">Out of stock</field>
  33. <field name="html_class">text-bg-warning o_ribbon_left</field>
  34. </record>
  35. <record id="website_sale.new_ribbon" model="product.ribbon">
  36. <field name="html">New!</field>
  37. <field name="html_class">text-bg-primary o_ribbon_left</field>
  38. </record>
  39. <record id="sales_team.salesteam_website_sales" model="crm.team">
  40. <field name="active" eval="True"/>
  41. </record>
  42. <record model="website" id="website.default_website">
  43. <field name="salesteam_id" ref="sales_team.salesteam_website_sales"/>
  44. </record>
  45. <record model="product.pricelist" id="product.list0">
  46. <field name="selectable" eval="True" />
  47. <field name="website_id" eval="False"/>
  48. </record>
  49. </data>
  50. <data>
  51. <!-- Filters for Dynamic Filter -->
  52. <record id="dynamic_snippet_newest_products_filter" model="ir.filters">
  53. <field name="name">Newest Products</field>
  54. <field name="model_id">product.product</field>
  55. <field name="user_id" eval="False" />
  56. <field name="domain">[('website_published', '=', True)]</field>
  57. <field name="context">{'display_default_code': False, 'add2cart_rerender': False}</field>
  58. <field name="sort">['create_date desc']</field>
  59. <field name="action_id" ref="website.action_website"/>
  60. </record>
  61. <!-- Action Server for Dynamic Filter -->
  62. <record id="dynamic_snippet_latest_sold_products_action" model="ir.actions.server">
  63. <field name="name">Recently Sold Products</field>
  64. <field name="model_id" ref="model_product_product"/>
  65. <field name="state">code</field>
  66. <field name="code">
  67. DynamicFilter = model.env['website.snippet.filter']
  68. response = DynamicFilter._get_products('latest_sold', model.env.context)
  69. </field>
  70. </record>
  71. <record id="dynamic_snippet_latest_viewed_products_action" model="ir.actions.server">
  72. <field name="name">Recently Viewed Products</field>
  73. <field name="model_id" ref="model_product_product"/>
  74. <field name="state">code</field>
  75. <field name="code">
  76. DynamicFilter = model.env['website.snippet.filter']
  77. res_products = DynamicFilter._get_products('latest_viewed', model.env.context)
  78. for data in res_products:
  79. data['_latest_viewed'] = True
  80. response = res_products
  81. </field>
  82. </record>
  83. <record id="dynamic_snippet_accessories_action" model="ir.actions.server">
  84. <field name="name">Product Accessories</field>
  85. <field name="model_id" ref="model_product_product"/>
  86. <field name="state">code</field>
  87. <field name="code">
  88. DynamicFilter = model.env['website.snippet.filter']
  89. model.env.context['product_template_id'] = request.params.get('productTemplateId')
  90. response = DynamicFilter._get_products('accessories', model.env.context)
  91. </field>
  92. </record>
  93. <record id="dynamic_snippet_recently_sold_with_action" model="ir.actions.server">
  94. <field name="name">Products Recently Sold With</field>
  95. <field name="model_id" ref="model_product_product"/>
  96. <field name="state">code</field>
  97. <field name="code">
  98. DynamicFilter = model.env['website.snippet.filter']
  99. model.env.context['product_template_id'] = request.params.get('productTemplateId')
  100. response = DynamicFilter._get_products('recently_sold_with', model.env.context)
  101. </field>
  102. </record>
  103. <record id="dynamic_snippet_alternative_products" model="ir.actions.server">
  104. <field name="name">Alternative Products</field>
  105. <field name="model_id" ref="model_product_product"/>
  106. <field name="state">code</field>
  107. <field name="code">
  108. DynamicFilter = model.env['website.snippet.filter']
  109. model.env.context['product_template_id'] = request.params.get('productTemplateId')
  110. response = DynamicFilter._get_products('alternative_products', model.env.context)
  111. </field>
  112. </record>
  113. <!-- Dynamic Filter -->
  114. <record id="dynamic_filter_newest_products" model="website.snippet.filter">
  115. <field name="filter_id" ref="website_sale.dynamic_snippet_newest_products_filter"/>
  116. <field name="field_names">display_name,description_sale,image_512</field>
  117. <field name="limit" eval="16"/>
  118. <field name="name">Newest Products</field>
  119. </record>
  120. <record id="dynamic_filter_latest_sold_products" model="website.snippet.filter">
  121. <field name="action_server_id" ref="website_sale.dynamic_snippet_latest_sold_products_action"/>
  122. <field name="field_names">display_name,description_sale,image_512</field>
  123. <field name="limit" eval="16"/>
  124. <field name="name">Recently Sold Products</field>
  125. </record>
  126. <record id="dynamic_filter_latest_viewed_products" model="website.snippet.filter">
  127. <field name="action_server_id" ref="website_sale.dynamic_snippet_latest_viewed_products_action"/>
  128. <field name="field_names">display_name,description_sale,image_512</field>
  129. <field name="limit" eval="16"/>
  130. <field name="name">Recently Viewed Products</field>
  131. </record>
  132. <record id="dynamic_filter_cross_selling_accessories" model="website.snippet.filter">
  133. <field name="action_server_id" ref="website_sale.dynamic_snippet_accessories_action"/>
  134. <field name="field_names">display_name,description_sale,image_512</field>
  135. <field name="limit" eval="16"/>
  136. <field name="name">Accessories for Product</field>
  137. <field name="product_cross_selling">True</field>
  138. </record>
  139. <record id="dynamic_filter_cross_selling_recently_sold_with" model="website.snippet.filter">
  140. <field name="action_server_id" ref="website_sale.dynamic_snippet_recently_sold_with_action"/>
  141. <field name="field_names">display_name,description_sale,image_512</field>
  142. <field name="limit" eval="16"/>
  143. <field name="name">Products Recently Sold With Product</field>
  144. <field name="product_cross_selling">True</field>
  145. </record>
  146. <record id="dynamic_filter_cross_selling_alternative_products" model="website.snippet.filter">
  147. <field name="action_server_id" ref="website_sale.dynamic_snippet_alternative_products"/>
  148. <field name="field_names">display_name,description_sale,image_512</field>
  149. <field name="limit" eval="16"/>
  150. <field name="name">Alternative Products</field>
  151. <field name="product_cross_selling">True</field>
  152. </record>
  153. <function model="ir.model.fields" name="formbuilder_whitelist">
  154. <value>sale.order</value>
  155. <value eval="[
  156. 'client_order_ref',
  157. ]"/>
  158. </function>
  159. <record id="base.model_res_partner" model="ir.model">
  160. <field name="website_form_key">create_customer</field>
  161. <field name="website_form_access">True</field>
  162. <field name="website_form_label">Create a Customer</field>
  163. </record>
  164. <function model="ir.model.fields" name="formbuilder_whitelist">
  165. <value>res.partner</value>
  166. <value eval="[
  167. 'name', 'phone', 'email',
  168. 'city', 'zip', 'street', 'street2', 'state_id', 'country_id',
  169. 'vat', 'company_name'
  170. ]"/>
  171. </function>
  172. </data>
  173. </odoo>