| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<odoo> |
| 3 |
|
| 4 |
<record id="product_template_search_view_website" model="ir.ui.view"> |
| 5 |
<field name="name">product.template.search.published</field> |
| 6 |
<field name="model">product.template</field> |
| 7 |
<field name="inherit_id" ref="product.product_template_search_view"/> |
| 8 |
<field name="arch" type="xml"> |
| 9 |
<filter name="favorites" position="after"> |
| 10 |
<filter string="Published" name="published" domain="[('is_published', '=', True)]"/> |
| 11 |
</filter> |
| 12 |
<filter name="group_by_categ_id" position="after"> |
| 13 |
<filter |
| 14 |
string="eCommerce Category" |
| 15 |
name="groupby_public_category" |
| 16 |
context="{'group_by':'public_categ_ids'}" |
| 17 |
/> |
| 18 |
</filter> |
| 19 |
</field> |
| 20 |
</record> |
| 21 |
|
| 22 |
<record id="product_product_website_tree_view" model="ir.ui.view"> |
| 23 |
<field name="name">product.product.website.list</field> |
| 24 |
<field name="model">product.product</field> |
| 25 |
<field name="inherit_id" ref="product.product_product_tree_view"/> |
| 26 |
<field name="arch" type="xml"> |
| 27 |
<field name="name" position="after"> |
| 28 |
<field name="website_id" groups="website.group_multi_website" optional="show"/> |
| 29 |
<field name="is_published" string="Is Published" optional="hide"/> |
| 30 |
</field> |
| 31 |
<field name="additional_product_tag_ids" position="after"> |
| 32 |
<field |
| 33 |
name="website_ribbon_id" |
| 34 |
invisible="variant_ribbon_id" |
| 35 |
optional="hide" |
| 36 |
readonly="1" |
| 37 |
/> |
| 38 |
<field |
| 39 |
name="variant_ribbon_id" options="{'no_quick_create': True}" optional="hide" |
| 40 |
/> |
| 41 |
</field> |
| 42 |
</field> |
| 43 |
</record> |
| 44 |
|
| 45 |
<!-- We want website_id to be shown outside of website module like other models --> |
| 46 |
<record id="product_template_view_tree" model="ir.ui.view"> |
| 47 |
<field name="name">product.template.view.list.inherit.website_sale</field> |
| 48 |
<field name="model">product.template</field> |
| 49 |
<field name="inherit_id" ref="product.product_template_tree_view"/> |
| 50 |
<field name="arch" type="xml"> |
| 51 |
<field name="default_code" position="after"> |
| 52 |
<field name="website_id" groups="website.group_multi_website" optional="hide"/> |
| 53 |
</field> |
| 54 |
<field name="product_tag_ids" position="after"> |
| 55 |
<field name="website_ribbon_id" optional="hide"/> |
| 56 |
</field> |
| 57 |
</field> |
| 58 |
</record> |
| 59 |
|
| 60 |
<!-- only website module template view should use the website_sequence --> |
| 61 |
<record id="product_template_view_tree_website_sale" model="ir.ui.view"> |
| 62 |
<field name="name">product.template.view.list.website_sale</field> |
| 63 |
<field name="mode">primary</field> |
| 64 |
<field name="model">product.template</field> |
| 65 |
<field name="inherit_id" ref="website_sale.product_template_view_tree"/> |
| 66 |
<field name="arch" type="xml"> |
| 67 |
<list position="attributes"> |
| 68 |
<attribute name="default_order">website_sequence</attribute> |
| 69 |
</list> |
| 70 |
<field name="is_favorite" position="before"> |
| 71 |
<field name="website_sequence" widget="handle"/> |
| 72 |
</field> |
| 73 |
<field name="website_id" position="after"> |
| 74 |
<field name="public_categ_ids" widget="many2many_tags" string="Categories" optional="show"/> |
| 75 |
<field name="is_published" string="Is Published" optional="hide"/> |
| 76 |
</field> |
| 77 |
</field> |
| 78 |
</record> |
| 79 |
|
| 80 |
<record id="product_template_view_kanban_website_sale" model="ir.ui.view"> |
| 81 |
<field name="name">product.template.view.kanban.website_sale</field> |
| 82 |
<field name="mode">primary</field> |
| 83 |
<field name="model">product.template</field> |
| 84 |
<field name="inherit_id" ref="product.product_template_kanban_view"/> |
| 85 |
<field name="arch" type="xml"> |
| 86 |
<kanban position="attributes"> |
| 87 |
<attribute name="default_order">website_sequence</attribute> |
| 88 |
</kanban> |
| 89 |
</field> |
| 90 |
</record> |
| 91 |
|
| 92 |
<record id="product_template_action_website" model="ir.actions.act_window"> |
| 93 |
<field name="name">Products</field> |
| 94 |
<field name="res_model">product.template</field> |
| 95 |
<field name="path">ecommerce-products</field> |
| 96 |
<field name="view_mode">kanban,list,form,activity</field> |
| 97 |
<field name="view_id"/> |
| 98 |
<field name="search_view_id" ref="product_template_search_view_website"/> |
| 99 |
<field name="context">{ |
| 100 |
'search_default_published': 1, |
| 101 |
'list_view_ref': 'website_sale.product_template_view_tree_website_sale', |
| 102 |
'kanban_view_ref': 'website_sale.product_template_view_kanban_website_sale' |
| 103 |
}</field> |
| 104 |
<field name="help" type="html"> |
| 105 |
<p class="o_view_nocontent_smiling_face"> |
| 106 |
Create a new product |
| 107 |
</p><p> |
| 108 |
A product can be either a physical product or a service that you sell to your customers. |
| 109 |
</p> |
| 110 |
</field> |
| 111 |
</record> |
| 112 |
|
| 113 |
<record id="product_template_only_website_form_view" model="ir.ui.view"> |
| 114 |
<field name="name">product.template.product.only.website.form</field> |
| 115 |
<field name="model">product.template</field> |
| 116 |
<field name="inherit_id" ref="product.product_template_only_form_view"/> |
| 117 |
<field name="arch" type="xml"> |
| 118 |
<field name="categ_id" position="before"> |
| 119 |
<label for="compare_list_price" groups="website_sale.group_product_price_comparison"/> |
| 120 |
<div class="o_row" groups="website_sale.group_product_price_comparison"> |
| 121 |
<del class="oe_read_only"> |
| 122 |
<field name="compare_list_price" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"/> |
| 123 |
</del> |
| 124 |
<field name="compare_list_price" nolabel="1" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}" class="oe_edit_only"/> |
| 125 |
</div> |
| 126 |
<label for="base_unit_count" groups="website_sale.group_show_uom_price"/> |
| 127 |
<div name="base_unit_price" groups="website_sale.group_show_uom_price" class="d-flex flex-row"> |
| 128 |
<field name="base_unit_count" invisible="product_variant_count > 1" style="width: 4rem;"/> |
| 129 |
<field name="base_unit_id" options="{'no_open': True}" invisible="product_variant_count > 1" placeholder="Specify unit" style="width: 10rem;"/> |
| 130 |
<div class="d-flex flex-row" invisible="base_unit_price == 0 or product_variant_count > 1"> |
| 131 |
(<field name="base_unit_price" class="oe_inline"/> / <field name="base_unit_name" class="oe_inline"/>) |
| 132 |
</div> |
| 133 |
<span class="text-muted" invisible="product_variant_count <= 1">Based on variants</span> |
| 134 |
</div> |
| 135 |
</field> |
| 136 |
</field> |
| 137 |
</record> |
| 138 |
|
| 139 |
<record id="product_product_normal_website_form_view" model="ir.ui.view"> |
| 140 |
<field name="name">product.product.normal.view.website</field> |
| 141 |
<field name="model">product.product</field> |
| 142 |
<field name="inherit_id" ref="product.product_normal_form_view"/> |
| 143 |
<field name="arch" type="xml"> |
| 144 |
<field name="categ_id" position="before"> |
| 145 |
<label for="base_unit_count" groups="website_sale.group_show_uom_price"/> |
| 146 |
<div name="base_unit_price" groups="website_sale.group_show_uom_price" class="d-flex flex-row"> |
| 147 |
<field name="base_unit_count" style="width: 4rem;"/> |
| 148 |
<field name="base_unit_id" options="{'no_open': True}" placeholder="Specify unit" style="width: 10rem;"/> |
| 149 |
<div class="d-flex flex-row" invisible="base_unit_price == 0"> |
| 150 |
(<field name="base_unit_price" class="oe_inline"/> / <field name="base_unit_name" class="oe_inline"/>) |
| 151 |
</div> |
| 152 |
</div> |
| 153 |
</field> |
| 154 |
</field> |
| 155 |
</record> |
| 156 |
|
| 157 |
<record id="product_template_form_view" model="ir.ui.view"> |
| 158 |
<field name="name">product.template.product.website.form</field> |
| 159 |
<field name="model">product.template</field> |
| 160 |
<field name="inherit_id" ref="product.product_template_form_view"/> |
| 161 |
<field name="arch" type="xml"> |
| 162 |
<!-- add state field in header --> |
| 163 |
<span id="button_website" position="before"> |
| 164 |
<field name="is_published" widget="website_redirect_button" invisible="not sale_ok"/> |
| 165 |
</span> |
| 166 |
<group name="upsell" position="attributes"> |
| 167 |
<attribute name="invisible">0</attribute> |
| 168 |
</group> |
| 169 |
<group name="upsell" position="inside"> |
| 170 |
<field name="accessory_product_ids" widget="many2many_tags" |
| 171 |
domain="[('sale_ok', '=', True)]" |
| 172 |
invisible="not sale_ok" |
| 173 |
placeholder="Suggested accessories in the eCommerce cart"/> |
| 174 |
<field name="alternative_product_ids" widget="many2many_tags" |
| 175 |
domain="[('id', '!=', id), '|', ('company_id', '=', company_id), ('company_id', '=', False)]" |
| 176 |
context="{'search_product_product': True}" |
| 177 |
invisible="not sale_ok" |
| 178 |
placeholder="Displayed in bottom of product pages"/> |
| 179 |
<field name="description_ecommerce" invisible="1" /> <!-- Adding this field as we needed in product_barcodelookup module to store value in this field --> |
| 180 |
</group> |
| 181 |
<xpath expr="//page[@name='sales']/group[@name='sale']" position="inside"> |
| 182 |
<group colspan="2" name="product_template_images" string="eCommerce Media" invisible="not sale_ok"> |
| 183 |
<field |
| 184 |
colspan="2" |
| 185 |
name="product_template_image_ids" |
| 186 |
class="o_website_sale_image_list" |
| 187 |
context="{'default_name': name}" |
| 188 |
mode="kanban" |
| 189 |
add-label="Add Media" |
| 190 |
nolabel="1" |
| 191 |
widget="x2_many_media_viewer" |
| 192 |
options="{'convert_to_webp': True}" |
| 193 |
/> |
| 194 |
</group> |
| 195 |
</xpath> |
| 196 |
<xpath expr="//page[@name='sales']//group[@name='description']" position="before"> |
| 197 |
<group string="Ecommerce Description" name="ecom_description"> |
| 198 |
<field |
| 199 |
colspan="2" |
| 200 |
name="description_ecommerce" |
| 201 |
nolabel="1" |
| 202 |
placeholder="A detailed,formatted description to promote your product on |
| 203 |
this page. Use '/' to discover more features." |
| 204 |
/> |
| 205 |
</group> |
| 206 |
</xpath> |
| 207 |
<xpath expr="//group[@name='extra_info']//field[@name='product_tag_ids']" position="before"> |
| 208 |
<field |
| 209 |
name="website_id" |
| 210 |
options="{'no_create': True}" |
| 211 |
groups="website.group_multi_website" |
| 212 |
placeholder="All" |
| 213 |
/> |
| 214 |
</xpath> |
| 215 |
<group name="extra_info" position="inside"> |
| 216 |
<field name="is_published" widget="boolean_toggle"/> |
| 217 |
<field name="website_sequence" groups="base.group_no_one"/> |
| 218 |
<field name="public_categ_ids" widget="many2many_tags" string="Categories"/> |
| 219 |
<field |
| 220 |
name="website_ribbon_id" |
| 221 |
options="{'no_quick_create': True}" |
| 222 |
/> |
| 223 |
</group> |
| 224 |
<group name="extra_info" position="attributes"> |
| 225 |
<attribute name="string">Ecommerce Shop</attribute> |
| 226 |
</group> |
| 227 |
</field> |
| 228 |
</record> |
| 229 |
|
| 230 |
<record id="product_product_view_form_easy_inherit_website_sale" model="ir.ui.view"> |
| 231 |
<field name="name">product.product.view.form.easy.inherit.website_sale</field> |
| 232 |
<field name="model">product.product</field> |
| 233 |
<field name="inherit_id" ref="product.product_variant_easy_edit_view"/> |
| 234 |
<field name="arch" type="xml"> |
| 235 |
<group name="pricing" position="inside"> |
| 236 |
<label for="base_unit_count" groups="website_sale.group_show_uom_price"/> |
| 237 |
<div name="base_unit_price" groups="website_sale.group_show_uom_price" class="d-flex flex-row"> |
| 238 |
<field name="base_unit_count" style="width: 4rem;"/> |
| 239 |
<field name="base_unit_id" options="{'no_open': True}" placeholder="Specify unit" style="width: 10rem;"/> |
| 240 |
<div class="d-flex flex-row" invisible="base_unit_price == 0"> |
| 241 |
(<field name="base_unit_price" class="oe_inline"/> / <field name="base_unit_name" class="oe_inline"/>) |
| 242 |
</div> |
| 243 |
</div> |
| 244 |
</group> |
| 245 |
<group name="sales" position="inside"> |
| 246 |
<field name="website_ribbon_id" options="{'no_open': True}" readonly="True"/> |
| 247 |
<field name="variant_ribbon_id" options="{'no_quick_create': True}"/> |
| 248 |
</group> |
| 249 |
<group name="sales" position="after"> |
| 250 |
<group colspan="2" name="product_variant_images" string="Extra Variant Media"> |
| 251 |
<field name="product_variant_image_ids" class="o_website_sale_image_list" context="{'default_name': name}" mode="kanban" add-label="Add Media" nolabel="1" widget="x2_many_media_viewer" options="{'convert_to_webp': True}"/> |
| 252 |
</group> |
| 253 |
</group> |
| 254 |
</field> |
| 255 |
</record> |
| 256 |
|
| 257 |
</odoo> |