product_brand_view.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. product_brand for Odoo
  4. Copyright (C) 2009 NetAndCo <http://www.netandco.net>.
  5. Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com>
  6. Copyright (C) 2014 prisnet.ch Seraphine Lantible <s.lantible@gmail.com>
  7. Copyright (C) 2015 Leonardo Donelli <http://www.wearemonk.com>
  8. Contributors:
  9. Mathieu Lemercier <mathieu@netandco.net>
  10. Franck Bret <franck@netandco.net>
  11. Seraphine Lantible <s.lantible@gmail.com>
  12. Leonardo Donelli <donelli@webmonks.it>
  13. -->
  14. <openerp>
  15. <data>
  16. <record id="product_brand_search_form_view" model="ir.ui.view">
  17. <field name="name">product.brand.search.form</field>
  18. <field name="model">product.brand</field>
  19. <field name="arch" type="xml">
  20. <search string="Product Brand">
  21. <field name="name"/>
  22. <field name="partner_id"/>
  23. </search>
  24. </field>
  25. </record>
  26. <act_window
  27. id="action_open_brand_products"
  28. name="Brand Products"
  29. res_model="product.template"
  30. view_type="form"
  31. view_mode="kanban,form,tree"
  32. domain="[('product_brand_id', '=', active_id)]"/>
  33. <act_window
  34. id="action_open_single_product_brand"
  35. name="Product Brand"
  36. res_model="product.brand"
  37. view_type="form"
  38. view_mode="kanban,form,tree"
  39. target="current"
  40. domain="[('product_ids', 'in', active_id)]"/>
  41. <record id="view_product_brand_form" model="ir.ui.view">
  42. <field name="name">product.brand.form</field>
  43. <field name="model">product.brand</field>
  44. <field name="arch" type="xml">
  45. <form string="Product Brand" version="7.0">
  46. <sheet>
  47. <field name="logo" widget="image" class="oe_avatar oe_left"/>
  48. <div class="oe_title">
  49. <div class="oe_edit_only">
  50. <label for="name" string="Brand Name"/>
  51. </div>
  52. <h1>
  53. <field name="name"/>
  54. </h1>
  55. </div>
  56. <div class="oe_right oe_button_box">
  57. <button
  58. class="oe_inline oe_stat_button"
  59. type="action"
  60. name="%(action_open_brand_products)d"
  61. icon="fa-cubes">
  62. <field name="products_count" string="Products" widget="statinfo" />
  63. </button>
  64. </div>
  65. <group>
  66. <field name="partner_id"/>
  67. </group>
  68. <group string="Description">
  69. <field name="description" nolabel="1"/>
  70. </group>
  71. </sheet>
  72. </form>
  73. </field>
  74. </record>
  75. <record id="view_product_brand_tree" model="ir.ui.view">
  76. <field name="name">product.brand.tree</field>
  77. <field name="model">product.brand</field>
  78. <field name="arch" type="xml">
  79. <tree string="product.brand">
  80. <field name="name"/>
  81. <field name="description"/>
  82. <field name="partner_id"/>
  83. </tree>
  84. </field>
  85. </record>
  86. <record id="view_product_brand_kanban" model="ir.ui.view">
  87. <field name="name">product.brand.kanban</field>
  88. <field name="model">product.brand</field>
  89. <field name="arch" type="xml">
  90. <kanban>
  91. <field name="logo"/>
  92. <field name="products_count"/>
  93. <field name="description"/>
  94. <templates>
  95. <t t-name="kanban-box">
  96. <div class="oe_kanban_vignette oe_semantic_html_override">
  97. <a type="open">
  98. <img t-att-src="kanban_image('product.product', 'logo', record.id.value)"
  99. class="oe_kanban_image"/>
  100. </a>
  101. <div class="oe_kanban_details">
  102. <h4>
  103. <a type="open">
  104. <field name="name"/>
  105. </a>
  106. </h4>
  107. <div>
  108. <a name="%(product_brand.action_open_brand_products)d"
  109. type="action">
  110. <t t-esc="record.products_count.value"/> Products
  111. </a>
  112. </div>
  113. <span>
  114. <t t-esc="record.description.value.substr(0,200)"/>
  115. <t t-if="record.description.value.length > 200">
  116. <a type="open"><b>...</b></a>
  117. </t>
  118. </span>
  119. </div>
  120. </div>
  121. </t>
  122. </templates>
  123. </kanban>
  124. </field>
  125. </record>
  126. <record id="product_search_form_view" model="ir.ui.view">
  127. <field name="name">product.search.form</field>
  128. <field name="model">product.product</field>
  129. <field name="inherit_id" ref="product.product_search_form_view"/>
  130. <field name="arch" type="xml">
  131. <field name="categ_id" position="after">
  132. <field name="product_brand_id"/>
  133. </field>
  134. <group string='Group by...' position="inside">
  135. <filter string="Brand" name="groupby_brand" domain="[]"
  136. context="{'group_by' : 'product_brand_id'}"/>
  137. </group>
  138. </field>
  139. </record>
  140. <record id="view_product_template_search_brand" model="ir.ui.view">
  141. <field name="name">product.template.search.brand</field>
  142. <field name="model">product.template</field>
  143. <field name="inherit_id" ref="product.product_template_search_view"/>
  144. <field name="arch" type="xml">
  145. <field name="name" position="after">
  146. <field name="product_brand_id"/>
  147. </field>
  148. <group string='Group by...' position="inside">
  149. <filter string="Brand" name="groupby_brand" domain="[]"
  150. context="{'group_by' : 'product_brand_id'}"/>
  151. </group>
  152. </field>
  153. </record>
  154. <record id="product_template_form_brand_add" model="ir.ui.view">
  155. <field name="name">product.template.product.form</field>
  156. <field name="model">product.template</field>
  157. <field name="inherit_id" ref="product.product_template_form_view" />
  158. <field name="arch" type="xml">
  159. <field name="name" position="after" >
  160. <field name="product_brand_id" placeholder="Brand"/>
  161. </field>
  162. </field>
  163. </record>
  164. <record id="view_product_template_kanban_brand" model="ir.ui.view">
  165. <field name="name">product kanban view: add brand</field>
  166. <field name="model">product.template</field>
  167. <field name="inherit_id" ref="product.product_template_kanban_view" />
  168. <field name="arch" type="xml">
  169. <xpath expr="//h4" position="after">
  170. <div>
  171. <a t-if="record.product_brand_id" type="action"
  172. name="%(action_open_single_product_brand)d">
  173. <field name="product_brand_id"/>
  174. </a>
  175. </div>
  176. </xpath>
  177. </field>
  178. </record>
  179. <record id="view_product_variant_kanban_brand" model="ir.ui.view">
  180. <field name="name">product variant kanban view: add brand</field>
  181. <field name="model">product.product</field>
  182. <field name="inherit_id" ref="product.product_kanban_view" />
  183. <field name="arch" type="xml">
  184. <xpath expr="//h4" position="after">
  185. <div>
  186. <a t-if="record.product_brand_id" type="open">
  187. <field name="product_brand_id"/>
  188. </a>
  189. </div>
  190. </xpath>
  191. </field>
  192. </record>
  193. <record id="view_product_template_tree_brand" model="ir.ui.view">
  194. <field name="name">product tree view: add brand</field>
  195. <field name="model">product.template</field>
  196. <field name="inherit_id" ref="product.product_template_tree_view" />
  197. <field name="arch" type="xml">
  198. <field name="name" position="after">
  199. <field name="product_brand_id"/>
  200. </field>
  201. </field>
  202. </record>
  203. <record id="view_product_variant_tree_brand" model="ir.ui.view">
  204. <field name="name">product variant tree view: add brand</field>
  205. <field name="model">product.product</field>
  206. <field name="inherit_id" ref="product.product_product_tree_view" />
  207. <field name="arch" type="xml">
  208. <field name="name" position="after">
  209. <field name="product_brand_id"/>
  210. </field>
  211. </field>
  212. </record>
  213. <record model="ir.actions.act_window" id="action_product_brand">
  214. <field name="name">Brand</field>
  215. <field name="res_model">product.brand</field>
  216. <field name="view_type">form</field>
  217. <field name="view_mode">kanban,form,tree</field>
  218. </record>
  219. <menuitem
  220. name="Product Brands"
  221. id="menu_product_brand"
  222. action="action_product_brand"
  223. parent="base.menu_product"/>
  224. </data>
  225. </openerp>