summaryrefslogtreecommitdiff
path: root/addons/sale_stock/views
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/sale_stock/views
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/sale_stock/views')
-rw-r--r--addons/sale_stock/views/report_invoice.xml32
-rw-r--r--addons/sale_stock/views/res_config_settings_views.xml102
-rw-r--r--addons/sale_stock/views/res_users_views.xml44
-rw-r--r--addons/sale_stock/views/sale_order_views.xml134
-rw-r--r--addons/sale_stock/views/sale_stock_portal_template.xml39
-rw-r--r--addons/sale_stock/views/stock_production_lot_views.xml35
-rw-r--r--addons/sale_stock/views/stock_views.xml103
7 files changed, 489 insertions, 0 deletions
diff --git a/addons/sale_stock/views/report_invoice.xml b/addons/sale_stock/views/report_invoice.xml
new file mode 100644
index 00000000..0e12889a
--- /dev/null
+++ b/addons/sale_stock/views/report_invoice.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <template id="sale_stock_report_invoice_document" inherit_id="account.report_invoice_document">
+ <xpath expr="//div[@id='total']" position="after">
+ <t t-set="lot_values" t-value="o._get_invoiced_lot_values()"/>
+ <t t-if="lot_values">
+ <br/>
+ <table groups="sale_stock.group_lot_on_invoice" class="table table-sm" style="width: 50%;" name="invoice_snln_table">
+ <thead>
+ <tr>
+ <th><span>Product</span></th>
+ <th class="text-right"><span>Quantity</span></th>
+ <th class="text-right"><span>SN/LN</span></th>
+ </tr>
+ </thead>
+ <tbody>
+ <t t-foreach="lot_values" t-as="snln_line">
+ <tr>
+ <td><t t-esc="snln_line['product_name']"/></td>
+ <td class="text-right">
+ <t t-esc="snln_line['quantity']"/>
+ <t t-esc="snln_line['uom_name']" groups="uom.group_uom"/>
+ </td>
+ <td class="text-right"><t t-esc="snln_line['lot_name']"/></td>
+ </tr>
+ </t>
+ </tbody>
+ </table>
+ </t>
+ </xpath>
+ </template>
+</odoo>
diff --git a/addons/sale_stock/views/res_config_settings_views.xml b/addons/sale_stock/views/res_config_settings_views.xml
new file mode 100644
index 00000000..4f932c93
--- /dev/null
+++ b/addons/sale_stock/views/res_config_settings_views.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <record id="res_config_settings_view_form_sale" model="ir.ui.view">
+ <field name="name">res.config.settings.view.form.inherit.sale.stock.sale</field>
+ <field name="model">res.config.settings</field>
+ <field name="inherit_id" ref="sale.res_config_settings_view_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//div[@id='ups']" position="after">
+ <div class="col-12 col-lg-6 o_setting_box" id="display_incoterms_setting">
+ <div class="o_setting_left_pane">
+ <field name="group_display_incoterm"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_display_incoterm"/>
+ <div class="text-muted">
+ Display incoterms on orders &amp; invoices
+ </div>
+ <div class="content-group" attrs="{'invisible': [('group_display_incoterm','=',False)]}">
+ <div class="mt8">
+ <button name="%(account.action_incoterms_tree)d" icon="fa-arrow-right" type="action" string="Incoterms" class="btn-link"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="res_config_settings_view_form_stock" model="ir.ui.view">
+ <field name="name">res.config.settings.view.form.inherit.sale.stock.stock</field>
+ <field name="model">res.config.settings</field>
+ <field name="inherit_id" ref="stock.res_config_settings_view_form"/>
+ <field name="arch" type="xml">
+ <div id="production_lot_info" position="inside">
+ <div class="col-12 col-lg-6 o_setting_box" attrs="{'invisible': [('group_stock_production_lot', '=', False)]}" id="group_lot_on_invoice">
+ <div class="o_setting_left_pane">
+ <field name="group_lot_on_invoice"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_lot_on_invoice"/>
+ <div class="text-muted">
+ Lots &amp; Serial numbers will appear on the invoice
+ </div>
+ </div>
+ </div>
+ </div>
+ <div id="warning_info" position="after">
+ <div class="col-12 col-lg-6 o_setting_box">
+ <div class="o_setting_right_pane">
+ <label for="default_picking_policy"/>
+ <div class="text-muted">
+ When to start shipping
+ </div>
+ <div class="content-group">
+ <div class="mt16">
+ <field name="default_picking_policy" class="o_light_label" widget="selection"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" title="Reserving products manually in delivery orders or by running the scheduler is advised to better manage priorities in case of long customer lead times or/and frequent stock-outs. By default, the scheduler runs automatically every 24 hours.">
+ <div class="o_setting_right_pane">
+ <label for="module_procurement_jit"/>
+ <div class="text-muted">
+ When to reserve sold products
+ </div>
+ <div class="content-group">
+ <div class="mt16">
+ <field name="module_procurement_jit" class="o_light_label" widget="radio"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <xpath expr="//h2[@id='schedule_info']" position="attributes">
+ <attribute name="invisible">0</attribute>
+ </xpath>
+ <div id="sale_security_lead" position="replace">
+ <div class="col-12 col-lg-6 o_setting_box" title="Margin of error for dates promised to customers. Products will be scheduled for procurement and delivery that many days earlier than the actual promised date, to cope with unexpected delays in the supply chain.">
+ <div class="o_setting_left_pane">
+ <field name="use_security_lead"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="use_security_lead"/>
+ <a href="https://www.odoo.com/documentation/14.0/applications/inventory_and_mrp/inventory/management/planning/scheduled_dates.html" title="Documentation" class="mr-2 o_doc_link" target="_blank"></a>
+ <span class="fa fa-lg fa-building-o" title="Values set here are company-specific." role="img" aria-label="Values set here are company-specific." groups="base.group_multi_company"/>
+ <div class="text-muted">
+ Schedule deliveries earlier to avoid delays
+ </div>
+ <div class="content-group">
+ <div class="mt16" attrs="{'invisible': [('use_security_lead','=',False)]}">
+ <span>Move forward expected delivery dates by <field name="security_lead" class="oe_inline"/> days</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </field>
+ </record>
+
+</odoo>
diff --git a/addons/sale_stock/views/res_users_views.xml b/addons/sale_stock/views/res_users_views.xml
new file mode 100644
index 00000000..d141c4ea
--- /dev/null
+++ b/addons/sale_stock/views/res_users_views.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <data>
+ <record id="res_users_view_form_preferences" model="ir.ui.view">
+ <field name="name">res.users.preferences.form.inherit</field>
+ <field name="model">res.users</field>
+ <field name="inherit_id" ref="base.view_users_form_simple_modif"/>
+ <field name="arch" type="xml">
+ <group name="signature" position="after">
+ <group name="Warehouses">
+ <field name="property_warehouse_id" groups="stock.group_stock_multi_warehouses"/>
+ </group>
+ </group>
+ </field>
+ </record>
+
+ <record id="res_users_view_simple_form" model="ir.ui.view">
+ <field name="name">res.users.simple.form.inherit</field>
+ <field name="model">res.users</field>
+ <field name="inherit_id" ref="base.view_users_simple_form"/>
+ <field name="arch" type="xml">
+ <group name="phone_numbers" position="after">
+ <group name="Warehouses">
+ <field name="property_warehouse_id" groups="stock.group_stock_multi_warehouses"/>
+ </group>
+ </group>
+ </field>
+ </record>
+
+ <record id="res_users_view_form" model="ir.ui.view">
+ <field name="name">res.users.form.inherit</field>
+ <field name="model">res.users</field>
+ <field name="inherit_id" ref="base.view_users_form"/>
+ <field name="arch" type="xml">
+ <group name="messaging" position="after">
+ <group name="Warehouses" string="Inventory" groups="stock.group_stock_multi_warehouses">
+ <field name="property_warehouse_id" groups="stock.group_stock_multi_warehouses"/>
+ </group>
+ </group>
+ </field>
+ </record>
+
+ </data>
+</odoo> \ No newline at end of file
diff --git a/addons/sale_stock/views/sale_order_views.xml b/addons/sale_stock/views/sale_order_views.xml
new file mode 100644
index 00000000..7a9a9e37
--- /dev/null
+++ b/addons/sale_stock/views/sale_order_views.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0"?>
+<odoo>
+ <data>
+ <record id="view_order_form_inherit_sale_stock" model="ir.ui.view">
+ <field name="name">sale.order.form.sale.stock</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale.view_order_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//button[@name='action_view_invoice']" position="before">
+ <field name="picking_ids" invisible="1"/>
+ <button type="object"
+ name="action_view_delivery"
+ class="oe_stat_button"
+ icon="fa-truck"
+ attrs="{'invisible': [('delivery_count', '=', 0)]}" groups="base.group_user">
+ <field name="delivery_count" widget="statinfo" string="Delivery"/>
+ </button>
+ </xpath>
+ <xpath expr="//group[@name='sale_shipping']" position="attributes">
+ <attribute name="groups"></attribute><!-- Remove the res.group on the group and set it on the field directly-->
+ <attribute name="string">Delivery</attribute>
+ </xpath>
+ <xpath expr="//label[@for='commitment_date']" position="before">
+ <field name="warehouse_id" options="{'no_create': True}" groups="stock.group_stock_multi_warehouses" force_save="1"/>
+ <field name="incoterm" widget="selection" groups="sale_stock.group_display_incoterm"/>
+ <field name="picking_policy" required="True"/>
+ </xpath>
+ <xpath expr="//span[@name='expected_date_span']" position="attributes">
+ <attribute name="attrs">
+ {'invisible': [('effective_date', '!=', False), ('commitment_date', '!=', False)]}
+ </attribute>
+ </xpath>
+ <xpath expr="//div[@name='commitment_date_div']" position="replace">
+ <div class="o_row">
+ <field name="commitment_date"/>
+ <span class="text-muted" attrs="{'invisible': [('effective_date', '!=', False), ('commitment_date', '!=', False)]}">Expected: <field name="expected_date" widget="date"/></span>
+ </div>
+ <field name="effective_date" attrs="{'invisible': [('effective_date', '=', False)]}"/>
+ </xpath>
+ <xpath expr="//page[@name='other_information']//field[@name='expected_date']" position="after">
+ <field name="show_json_popover" invisible="1"/>
+ <field string=" " name="json_popover" widget="stock_rescheduling_popover" attrs="{'invisible': [('show_json_popover', '=', False)]}"/>
+ </xpath>
+ <xpath expr="//page/field[@name='order_line']/form/group/group/field[@name='price_unit']" position="before">
+ <field name="product_packaging" attrs="{'invisible': [('product_id', '=', False)]}" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" domain="[('product_id','=',product_id)]" groups="product.group_stock_packaging" />
+ </xpath>
+ <xpath expr="//page/field[@name='order_line']/tree/field[@name='price_unit']" position="before">
+ <field name="product_packaging" attrs="{'invisible': [('product_id', '=', False)]}" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" domain="[('product_id','=',product_id)]" groups="product.group_stock_packaging" optional="show"/>
+ </xpath>
+ <xpath expr="//field[@name='order_line']/form/group/group/field[@name='analytic_tag_ids']" position="before">
+ <field name="route_id" groups="stock.group_adv_location" options="{'no_create': True}"/>
+ </xpath>
+ <xpath expr="//field[@name='order_line']/tree/field[@name='analytic_tag_ids']" position="after">
+ <field name="route_id" groups="stock.group_adv_location" options="{'no_create': True}" optional="hide"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_quotation_tree" model="ir.ui.view">
+ <field name="name">sale.order.tree.inherit.sale.stock</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale.view_quotation_tree"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='tag_ids']" position="after">
+ <field name="warehouse_id" options="{'no_create': True}" groups="stock.group_stock_multi_warehouses" optional="hide" />
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_order_tree" model="ir.ui.view">
+ <field name="name">sale.order.tree.inherit.sale.stock</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale.view_order_tree"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='team_id']" position="after">
+ <field name="warehouse_id" options="{'no_create': True}" groups="stock.group_stock_multi_warehouses" optional="hide"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_order_line_tree_inherit_sale_stock" model="ir.ui.view">
+ <field name="name">sale.order.line.tree.sale.stock.location</field>
+ <field name="inherit_id" ref="sale.view_order_line_tree"/>
+ <field name="model">sale.order.line</field>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='price_subtotal']" position="before">
+ <field name="route_id" groups="stock.group_adv_location" options="{'no_create': True}"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_order_form_inherit_sale_stock_qty" model="ir.ui.view">
+ <field name="name">sale.order.line.tree.sale.stock.qty</field>
+ <field name="inherit_id" ref="sale.view_order_form"/>
+ <field name="model">sale.order</field>
+ <field name="arch" type="xml">
+ <xpath expr="//page/field[@name='order_line']/form/group/group/div[@name='ordered_qty']/field[@name='product_uom']" position="after">
+ <!-- below fields are used in the widget qty_at_date_widget -->
+ <field name="product_type" invisible="1"/>
+ <field name="virtual_available_at_date" invisible="1"/>
+ <field name="qty_available_today" invisible="1"/>
+ <field name="free_qty_today" invisible="1"/>
+ <field name="scheduled_date" invisible="1"/>
+ <field name="forecast_expected_date" invisible="1"/>
+ <field name="warehouse_id" invisible="1"/>
+ <field name="qty_to_deliver" invisible="1"/>
+ <field name="is_mto" invisible="1"/>
+ <field name="display_qty_widget" invisible="1"/>
+ <widget name="qty_at_date_widget" width="0.1"/>
+ </xpath>
+ <xpath expr="//page/field[@name='order_line']/tree/field[@name='qty_delivered']" position="after">
+ <!-- below fields are used in the widget qty_at_date_widget -->
+ <field name="product_type" invisible="1"/>
+ <field name="virtual_available_at_date" invisible="1"/>
+ <field name="qty_available_today" invisible="1"/>
+ <field name="free_qty_today" invisible="1"/>
+ <field name="scheduled_date" invisible="1"/>
+ <field name="forecast_expected_date" invisible="1"/>
+ <field name="warehouse_id" invisible="1"/>
+ <field name="qty_to_deliver" invisible="1"/>
+ <field name="is_mto" invisible="1"/>
+ <field name="display_qty_widget" invisible="1"/>
+ <widget name="qty_at_date_widget" width="20px"/>
+ </xpath>
+ </field>
+ </record>
+
+ <template id="sale_order_line_view_list" name="sale.order.line.view.list" inherit_id="web.assets_backend">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/sale_stock/static/src/js/qty_at_date_widget.js"></script>
+ </xpath>
+ </template>
+ </data>
+</odoo>
diff --git a/addons/sale_stock/views/sale_stock_portal_template.xml b/addons/sale_stock/views/sale_stock_portal_template.xml
new file mode 100644
index 00000000..775de492
--- /dev/null
+++ b/addons/sale_stock/views/sale_stock_portal_template.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <template id="sale_order_portal_content_inherit_sale_stock" name="Orders Shipping Followup" inherit_id="sale.sale_order_portal_content">
+ <xpath expr="//div[@id='so_date']" position="after">
+ <div class="row" t-if="sale_order.incoterm">
+ <div class="mb-3 col-6 ml-auto">
+ <strong>Incoterm: </strong> <span t-field="sale_order.incoterm"/>
+ </div>
+ </div>
+ </xpath>
+ <xpath expr="//div[@id='informations']" position="inside">
+ <t t-if="sale_order.picking_ids">
+ <div>
+ <strong>Delivery Orders</strong>
+ </div>
+ <div>
+ <t t-foreach="sale_order.picking_ids.filtered(lambda picking: picking.picking_type_id.code != 'internal')" t-as="i">
+ <t t-set="delivery_report_url" t-value="'/my/picking/pdf/%s?%s' % (i.id, keep_query())"/>
+ <div class="d-flex flex-wrap align-items-center justify-content-between o_sale_stock_picking">
+ <div>
+ <a t-att-href="delivery_report_url">
+ <span t-esc="i.name"/>
+ </a>
+ <div class="small d-lg-inline-block ml-3">Date:
+ <span class="text-muted" t-field="i.date_done" t-options="{'date_only': True}"/>
+ <span t-if="i.state in ['draft', 'waiting', 'confirmed', 'assigned']" class="text-muted" t-field="i.scheduled_date" t-options="{'date_only': True}"/>
+ </div>
+ </div>
+ <span t-if="i.state == 'done'" class="small badge badge-success orders_label_text_align"><i class="fa fa-fw fa-truck"/> <b>Shipped</b></span>
+ <span t-if="i.state == 'cancel'" class="small badge badge-danger orders_label_text_align"><i class="fa fa-fw fa-times"/> <b>Cancelled</b></span>
+ <span t-if="i.state in ['draft', 'waiting', 'confirmed', 'assigned']" class="small badge badge-info orders_label_text_align"><i class="fa fa-fw fa-clock-o"/> <b>Preparation</b></span>
+ </div>
+ </t>
+ </div>
+ </t>
+ </xpath>
+ </template>
+
+</odoo>
diff --git a/addons/sale_stock/views/stock_production_lot_views.xml b/addons/sale_stock/views/stock_production_lot_views.xml
new file mode 100644
index 00000000..817285d2
--- /dev/null
+++ b/addons/sale_stock/views/stock_production_lot_views.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="stock_production_lot_view_form" model="ir.ui.view">
+ <field name="name">stock.production.lot.view.form</field>
+ <field name="model">stock.production.lot</field>
+ <field name="inherit_id" ref="stock.view_production_lot_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//div[hasclass('oe_button_box')]/button" position="before">
+ <button class="oe_stat_button" name="action_view_so"
+ type="object" icon="fa-pencil-square-o" help="Sale Orders"
+ attrs="{'invisible': ['|', ('sale_order_count', '=', 0), ('display_complete', '=', False)]}">
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_value">
+ <field name="sale_order_count" widget="statinfo" nolabel="1" class="mr4"/>
+ </span>
+ <span class="o_stat_text">Sales</span>
+ </div>
+ </button>
+ </xpath>
+ <xpath expr="//group[@name='main_group']" position="after">
+ <group>
+ <field name="sale_order_ids" widget="many2many" readonly="True"
+ attrs="{'invisible': ['|', ('sale_order_ids', '=', []), ('display_complete', '=', True)]}">
+ <tree>
+ <field name="name"/>
+ <field name="partner_id"/>
+ <field name="date_order"/>
+ <field name="state" invisible="1"/>
+ </tree>
+ </field>
+ </group>
+ </xpath>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/sale_stock/views/stock_views.xml b/addons/sale_stock/views/stock_views.xml
new file mode 100644
index 00000000..c95aca3f
--- /dev/null
+++ b/addons/sale_stock/views/stock_views.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <data>
+ <template id="exception_on_so">
+ <div>
+ Exception(s) occurred on the sale order(s):
+ <t t-foreach="sale_order_ids" t-as="sale_order">
+ <a href="#" data-oe-model="sale.order" t-att-data-oe-id="sale_order.id"><t t-esc="sale_order.name"/></a>.
+ </t>
+ Manual actions may be needed.
+ <div class="mt16">
+ <p>Exception(s):</p>
+ <ul t-foreach="order_exceptions" t-as="exception">
+ <li>
+ <t t-set="order_line" t-value="exception[0]"/>
+ <t t-set="new_qty" t-value="exception[1][0]"/>
+ <t t-set="old_qty" t-value="exception[1][1]"/>
+ <a href="#" data-oe-model="sale.order" t-att-data-oe-id="order_line.order_id.id"><t t-esc="order_line.order_id.name"/></a>:
+ <t t-esc="new_qty"/> <t t-esc="order_line.product_uom.name"/> of <t t-esc="order_line.product_id.name"/>
+ <t t-if="cancel">
+ cancelled
+ </t>
+ <t t-if="not cancel">
+ ordered instead of <t t-esc="old_qty"/> <t t-esc="order_line.product_uom.name"/>
+ </t>
+ </li>
+ </ul>
+ </div>
+ <div class="mt16" t-if="not cancel and impacted_pickings">
+ <p>Impacted Transfer(s):</p>
+ <ul t-foreach="impacted_pickings" t-as="picking">
+ <li><a href="#" data-oe-model="stock.picking" t-att-data-oe-id="picking.id"><t t-esc="picking.name"/></a></li>
+ </ul>
+ </div>
+ </div>
+ </template>
+
+ <template id="exception_on_picking">
+ <div>
+ Exception(s) occurred on the picking:
+ <a href="#" data-oe-model="stock.picking" t-att-data-oe-id="origin_picking.id"><t t-esc="origin_picking.name"/></a>.
+ Manual actions may be needed.
+ <div class="mt16">
+ <p>Exception(s):</p>
+ <ul t-foreach="moves_information" t-as="exception">
+ <t t-set="move" t-value="exception[0]"/>
+ <t t-set="new_qty" t-value="exception[1][0]"/>
+ <t t-set="old_qty" t-value="exception[1][1]"/>
+ <li>
+ <t t-esc="new_qty"/> <t t-esc="move.product_uom.name"/>
+ of <t t-esc="move.product_id.display_name"/> processed instead of <t t-esc="old_qty"/> <t t-esc="move.product_uom.name"/></li>
+ </ul>
+ </div>
+ </div>
+ </template>
+
+ <menuitem id="menu_aftersale" name="After-Sale"
+ groups="sales_team.group_sale_salesman"
+ parent="sale.sale_menu_root" sequence="5" />
+ <menuitem id="menu_invoiced" name="Invoicing" parent="menu_aftersale" sequence="1"/>
+
+ <record id="stock_location_route_view_form_inherit_sale_stock" model="ir.ui.view">
+ <field name="name">stock.location.route.form</field>
+ <field name="inherit_id" ref="stock.stock_location_route_form_view"/>
+ <field name="model">stock.location.route</field>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='warehouse_ids']" position="after">
+ <br/><field name="sale_selectable" string="Sales Order Lines"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="product_template_view_form_inherit_sale" model="ir.ui.view">
+ <field name="name">product.template.inherit.form</field>
+ <field name="inherit_id" ref="sale.product_template_form_view_sale_order_button"/>
+ <field name="model">product.template</field>
+ <field name="arch" type="xml">
+ <xpath expr="//button[@name='action_view_sales']" position="replace" />
+ </field>
+ </record>
+
+ <record id="product_template_view_form_inherit_stock" model="ir.ui.view">
+ <field name="name">product.template.inherit.form</field>
+ <field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
+ <field name="model">product.template</field>
+ <field name="arch" type="xml">
+ <button name="action_view_orderpoints" position="after">
+ <button class="oe_stat_button" name="action_view_sales"
+ type="object" icon="fa-signal" attrs="{'invisible': [('sale_ok', '=', False)]}"
+ groups="sales_team.group_sale_salesman" help="Sold in the last 365 days">
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_value">
+ <field name="sales_count" widget="statinfo" nolabel="1" class="mr4"/>
+ <field name="uom_name"/>
+ </span>
+ <span class="o_stat_text">Sold</span>
+ </div>
+ </button>
+ </button>
+ </field>
+ </record>
+ </data>
+</odoo>