| 1 |
<?xml version="1.0"?> |
| 2 |
<odoo> |
| 3 |
|
| 4 |
<record id="product_pages_tree_view" model="ir.ui.view"> |
| 5 |
<field name="name">Product Pages List</field> |
| 6 |
<field name="model">product.template</field> |
| 7 |
<field name="priority">99</field> |
| 8 |
<field name="mode">primary</field> |
| 9 |
<field name="inherit_id" ref="product_template_view_tree_website_sale"/> |
| 10 |
<field name="arch" type="xml"> |
| 11 |
<xpath expr="//list" position="attributes"> |
| 12 |
<attribute name="js_class">website_pages_list</attribute> |
| 13 |
<attribute name="type">object</attribute> |
| 14 |
<attribute name="action">open_website_url</attribute> |
| 15 |
</xpath> |
| 16 |
|
| 17 |
<field name="is_published" position="replace"/> |
| 18 |
|
| 19 |
<field name="default_code" position="attributes"> |
| 20 |
<attribute name="optional">hide</attribute> |
| 21 |
</field> |
| 22 |
<field name="product_tag_ids" position="attributes"> |
| 23 |
<attribute name="optional">hide</attribute> |
| 24 |
</field> |
| 25 |
<field name="standard_price" position="attributes"> |
| 26 |
<attribute name="optional">hide</attribute> |
| 27 |
</field> |
| 28 |
|
| 29 |
<field name="name" position="after"> |
| 30 |
<field name="website_url"/> |
| 31 |
</field> |
| 32 |
<xpath expr="//list"> |
| 33 |
<field name="is_seo_optimized"/> |
| 34 |
<field name="is_published"/> |
| 35 |
|
| 36 |
<field name="website_id" position="move"/> |
| 37 |
</xpath> |
| 38 |
</field> |
| 39 |
</record> |
| 40 |
|
| 41 |
<record id="product_pages_kanban_view" model="ir.ui.view"> |
| 42 |
<field name="name">Product Pages Kanban</field> |
| 43 |
<field name="model">product.template</field> |
| 44 |
<field name="priority">99</field> |
| 45 |
<field name="mode">primary</field> |
| 46 |
<field name="inherit_id" ref="product_template_view_kanban_website_sale"/> |
| 47 |
<field name="arch" type="xml"> |
| 48 |
<kanban position="attributes"> |
| 49 |
<attribute name="js_class">website_pages_kanban</attribute> |
| 50 |
<attribute name="class" add="o_wsale_products_kanban" separator=" "/> |
| 51 |
<attribute name="type">object</attribute> |
| 52 |
<attribute name="action">open_website_url</attribute> |
| 53 |
</kanban> |
| 54 |
<xpath expr="//main/div/div" position="after"> |
| 55 |
<div class="d-flex flex-column mb-1"> |
| 56 |
<div class="text-muted" t-if="record.website_id.value" groups="website.group_multi_website"> |
| 57 |
<i class="fa fa-globe me-1" title="Website"/> |
| 58 |
<field name="website_id"/> |
| 59 |
</div> |
| 60 |
<field class="text-primary" name="website_url"/> |
| 61 |
</div> |
| 62 |
</xpath> |
| 63 |
<xpath expr="//aside" position="after"> |
| 64 |
<footer class="justify-content-end flex-grow-1"> |
| 65 |
<field name="is_published" widget="boolean_toggle"/> |
| 66 |
<span t-if="record.is_published.raw_value">Published</span> |
| 67 |
<span t-else="">Not Published</span> |
| 68 |
</footer> |
| 69 |
</xpath> |
| 70 |
</field> |
| 71 |
</record> |
| 72 |
|
| 73 |
<record id="action_product_pages_list" model="ir.actions.act_window"> |
| 74 |
<field name="name">Product Pages</field> |
| 75 |
<field name="res_model">product.template</field> |
| 76 |
<field name="path">product-pages</field> |
| 77 |
<field name="view_mode">list,kanban</field> |
| 78 |
<field name="view_id" ref="product_pages_tree_view"/> |
| 79 |
<field name="view_ids" eval="[Command.clear(), |
| 80 |
Command.create({'view_mode': 'list', 'sequence': 1, 'view_id': ref('product_pages_tree_view')}), |
| 81 |
Command.create({'view_mode': 'kanban', 'sequence': 2, 'view_id': ref('product_pages_kanban_view')}), |
| 82 |
]"/> |
| 83 |
<field name="context">{'create_action': 'website_sale.product_product_action_add'}</field> |
| 84 |
</record> |
| 85 |
|
| 86 |
</odoo> |