| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<odoo> |
| 3 |
|
| 4 |
<record id="product_template_form_view" model="ir.ui.view"> |
| 5 |
<field name="name">product.template.form.view.inherit.sale</field> |
| 6 |
<field name="model">product.template</field> |
| 7 |
<field name="inherit_id" ref="product.product_template_form_view"/> |
| 8 |
<field name="arch" type="xml"> |
| 9 |
<page name="sales" position="attributes"> |
| 10 |
<attribute name="invisible" remove="1" separator="or"/> |
| 11 |
</page> |
| 12 |
<field name="product_variant_count" position="after"> |
| 13 |
<field name="service_type" widget="radio" invisible="True"/> |
| 14 |
<field name="visible_expense_policy" invisible="1"/> |
| 15 |
</field> |
| 16 |
<field name="type" position="after"> |
| 17 |
<field |
| 18 |
name="invoice_policy" |
| 19 |
required="1" |
| 20 |
invisible="not sale_ok or type == 'combo'" |
| 21 |
/> |
| 22 |
</field> |
| 23 |
<field name="service_tracking" position="attributes"> |
| 24 |
<attribute name="invisible" add="not sale_ok" separator="or"/> |
| 25 |
</field> |
| 26 |
<group name="description" position="after"> |
| 27 |
<t groups="sales_team.group_sale_salesman"> |
| 28 |
<group string="Warning on Sales Orders" groups="sale.group_warning_sale"> |
| 29 |
<field name="sale_line_warn_msg" |
| 30 |
placeholder="e.g. This product is defective." |
| 31 |
nolabel="1" colspan="2"/> |
| 32 |
</group> |
| 33 |
</t> |
| 34 |
<group name="expense_info" string="Expense" invisible="not visible_expense_policy"> |
| 35 |
<field name="expense_policy" widget="radio"/> |
| 36 |
</group> |
| 37 |
</group> |
| 38 |
</field> |
| 39 |
</record> |
| 40 |
|
| 41 |
<!-- TODO VFE inherit product_template_form_view and factorize both views --> |
| 42 |
<record id="product_form_view_sale_order_button" model="ir.ui.view"> |
| 43 |
<field name="name">product.product.sale.order</field> |
| 44 |
<field name="model">product.product</field> |
| 45 |
<field name="inherit_id" ref="product.product_normal_form_view"/> |
| 46 |
<field name="arch" type="xml"> |
| 47 |
<div name="button_box" position="inside"> |
| 48 |
<button class="oe_stat_button" |
| 49 |
name="action_view_sales" |
| 50 |
type="object" |
| 51 |
icon="fa-signal" |
| 52 |
help="Sold in the last 365 days" |
| 53 |
groups="sales_team.group_sale_salesman" |
| 54 |
invisible="not sale_ok"> |
| 55 |
<div class="o_field_widget o_stat_info"> |
| 56 |
<span class="o_stat_value d-flex gap-1"> |
| 57 |
<field name="sales_count" widget="statinfo" nolabel="1" class="oe_inline"/> |
| 58 |
<field name="uom_name" class="oe_inline" groups="uom.group_uom"/> |
| 59 |
</span> |
| 60 |
<span class="o_stat_text">Sold</span> |
| 61 |
</div> |
| 62 |
</button> |
| 63 |
</div> |
| 64 |
</field> |
| 65 |
</record> |
| 66 |
|
| 67 |
<record id="product_template_form_view_sale_order_button" model="ir.ui.view"> |
| 68 |
<field name="name">product.template.sale.order.button</field> |
| 69 |
<field name="model">product.template</field> |
| 70 |
<field name="inherit_id" ref="product.product_template_only_form_view"/> |
| 71 |
<field name="arch" type="xml"> |
| 72 |
<button name="action_open_documents" position="after"> |
| 73 |
<button class="oe_stat_button" |
| 74 |
name="action_view_sales" |
| 75 |
type="object" icon="fa-signal" |
| 76 |
help="Sold in the last 365 days" |
| 77 |
groups="sales_team.group_sale_salesman" |
| 78 |
invisible="not sale_ok"> |
| 79 |
<div class="o_field_widget o_stat_info"> |
| 80 |
<span class="o_stat_value d-flex gap-1"> |
| 81 |
<field name="sales_count" widget="statinfo" nolabel="1" class="oe_inline"/> |
| 82 |
<field name="uom_name" class="oe_inline" groups="uom.group_uom"/> |
| 83 |
</span> |
| 84 |
<span class="o_stat_text">Sold</span> |
| 85 |
</div> |
| 86 |
</button> |
| 87 |
</button> |
| 88 |
</field> |
| 89 |
</record> |
| 90 |
|
| 91 |
<record id="product_template_action" model="ir.actions.act_window"> |
| 92 |
<field name="name">Products</field> |
| 93 |
<field name="res_model">product.template</field> |
| 94 |
<field name="path">products</field> |
| 95 |
<field name="view_ids" eval="[Command.clear(), |
| 96 |
Command.create({'view_mode': 'kanban'}), |
| 97 |
Command.create({'view_mode': 'list', 'view_id': ref('account.product_template_list_view_sellable_inherit')}), |
| 98 |
Command.create({'view_mode': 'form'}), |
| 99 |
Command.create({'view_mode': 'activity'})]"/> |
| 100 |
<field name="search_view_id" ref="product.product_template_search_view"/> |
| 101 |
<field name="context">{"search_default_filter_to_sell":1, "sale_multi_pricelist_product_template": 1}</field> |
| 102 |
<field name="help" type="html"> |
| 103 |
<p class="o_view_nocontent_smiling_face"> |
| 104 |
Create a new product |
| 105 |
</p><p> |
| 106 |
You must define a product for everything you sell or purchase, |
| 107 |
whether it's a storable product, a consumable or a service. |
| 108 |
</p> |
| 109 |
</field> |
| 110 |
</record> |
| 111 |
|
| 112 |
<record id="product_view_kanban_catalog" model="ir.ui.view"> |
| 113 |
<field name="name">product.view.kanban.catalog.inherit.sale</field> |
| 114 |
<field name="inherit_id" ref="product.product_view_kanban_catalog"/> |
| 115 |
<field name="model">product.product</field> |
| 116 |
<field name="arch" type="xml"> |
| 117 |
<xpath expr="//t[@t-name='menu']" position="attributes"> |
| 118 |
<attribute name="groups">sales_team.group_sale_manager</attribute> |
| 119 |
</xpath> |
| 120 |
</field> |
| 121 |
</record> |
| 122 |
|
| 123 |
<record id="product_view_search_catalog" model="ir.ui.view"> |
| 124 |
<field name="name">product.view.search.catalog.inherit.sale</field> |
| 125 |
<field name="inherit_id" ref="product.product_view_search_catalog"/> |
| 126 |
<field name="model">product.product</field> |
| 127 |
<field name="arch" type="xml"> |
| 128 |
<filter name="goods" position="after"> |
| 129 |
<filter string="In the Order" |
| 130 |
invisible="context.get('active_model', '') != 'sale.order.line'" |
| 131 |
name="products_in_sale_order" |
| 132 |
domain="[('product_catalog_product_is_in_sale_order', '=', True)]"/> |
| 133 |
</filter> |
| 134 |
</field> |
| 135 |
</record> |
| 136 |
|
| 137 |
</odoo> |