mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-26 18:52:02 +02:00
137 lines
6.5 KiB
XML
137 lines
6.5 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<odoo>
|
|
|
|
<record id="product_template_form_view" model="ir.ui.view">
|
|
<field name="name">product.template.form.view.inherit.sale</field>
|
|
<field name="model">product.template</field>
|
|
<field name="inherit_id" ref="product.product_template_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<page name="sales" position="attributes">
|
|
<attribute name="invisible" remove="1" separator="or"/>
|
|
</page>
|
|
<field name="product_variant_count" position="after">
|
|
<field name="service_type" widget="radio" invisible="True"/>
|
|
<field name="visible_expense_policy" invisible="1"/>
|
|
</field>
|
|
<field name="type" position="after">
|
|
<field
|
|
name="invoice_policy"
|
|
required="1"
|
|
invisible="not sale_ok or type == 'combo'"
|
|
/>
|
|
</field>
|
|
<field name="service_tracking" position="attributes">
|
|
<attribute name="invisible" add="not sale_ok" separator="or"/>
|
|
</field>
|
|
<group name="description" position="after">
|
|
<t groups="sales_team.group_sale_salesman">
|
|
<group string="Warning on Sales Orders" groups="sale.group_warning_sale">
|
|
<field name="sale_line_warn_msg"
|
|
placeholder="e.g. This product is defective."
|
|
nolabel="1" colspan="2"/>
|
|
</group>
|
|
</t>
|
|
<group name="expense_info" string="Expense" invisible="not visible_expense_policy">
|
|
<field name="expense_policy" widget="radio"/>
|
|
</group>
|
|
</group>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- TODO VFE inherit product_template_form_view and factorize both views -->
|
|
<record id="product_form_view_sale_order_button" model="ir.ui.view">
|
|
<field name="name">product.product.sale.order</field>
|
|
<field name="model">product.product</field>
|
|
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<div name="button_box" position="inside">
|
|
<button class="oe_stat_button"
|
|
name="action_view_sales"
|
|
type="object"
|
|
icon="fa-signal"
|
|
help="Sold in the last 365 days"
|
|
groups="sales_team.group_sale_salesman"
|
|
invisible="not sale_ok">
|
|
<div class="o_field_widget o_stat_info">
|
|
<span class="o_stat_value d-flex gap-1">
|
|
<field name="sales_count" widget="statinfo" nolabel="1" class="oe_inline"/>
|
|
<field name="uom_name" class="oe_inline" groups="uom.group_uom"/>
|
|
</span>
|
|
<span class="o_stat_text">Sold</span>
|
|
</div>
|
|
</button>
|
|
</div>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="product_template_form_view_sale_order_button" model="ir.ui.view">
|
|
<field name="name">product.template.sale.order.button</field>
|
|
<field name="model">product.template</field>
|
|
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<button name="action_open_documents" position="after">
|
|
<button class="oe_stat_button"
|
|
name="action_view_sales"
|
|
type="object" icon="fa-signal"
|
|
help="Sold in the last 365 days"
|
|
groups="sales_team.group_sale_salesman"
|
|
invisible="not sale_ok">
|
|
<div class="o_field_widget o_stat_info">
|
|
<span class="o_stat_value d-flex gap-1">
|
|
<field name="sales_count" widget="statinfo" nolabel="1" class="oe_inline"/>
|
|
<field name="uom_name" class="oe_inline" groups="uom.group_uom"/>
|
|
</span>
|
|
<span class="o_stat_text">Sold</span>
|
|
</div>
|
|
</button>
|
|
</button>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="product_template_action" model="ir.actions.act_window">
|
|
<field name="name">Products</field>
|
|
<field name="res_model">product.template</field>
|
|
<field name="path">products</field>
|
|
<field name="view_ids" eval="[Command.clear(),
|
|
Command.create({'view_mode': 'kanban'}),
|
|
Command.create({'view_mode': 'list', 'view_id': ref('account.product_template_list_view_sellable_inherit')}),
|
|
Command.create({'view_mode': 'form'}),
|
|
Command.create({'view_mode': 'activity'})]"/>
|
|
<field name="search_view_id" ref="product.product_template_search_view"/>
|
|
<field name="context">{"search_default_filter_to_sell":1, "sale_multi_pricelist_product_template": 1}</field>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create a new product
|
|
</p><p>
|
|
You must define a product for everything you sell or purchase,
|
|
whether it's a storable product, a consumable or a service.
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="product_view_kanban_catalog" model="ir.ui.view">
|
|
<field name="name">product.view.kanban.catalog.inherit.sale</field>
|
|
<field name="inherit_id" ref="product.product_view_kanban_catalog"/>
|
|
<field name="model">product.product</field>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//t[@t-name='menu']" position="attributes">
|
|
<attribute name="groups">sales_team.group_sale_manager</attribute>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="product_view_search_catalog" model="ir.ui.view">
|
|
<field name="name">product.view.search.catalog.inherit.sale</field>
|
|
<field name="inherit_id" ref="product.product_view_search_catalog"/>
|
|
<field name="model">product.product</field>
|
|
<field name="arch" type="xml">
|
|
<filter name="goods" position="after">
|
|
<filter string="In the Order"
|
|
invisible="context.get('active_model', '') != 'sale.order.line'"
|
|
name="products_in_sale_order"
|
|
domain="[('product_catalog_product_is_in_sale_order', '=', True)]"/>
|
|
</filter>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|