summaryrefslogtreecommitdiff
path: root/addons/sale/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/views
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/sale/views')
-rw-r--r--addons/sale/views/assets.xml40
-rw-r--r--addons/sale/views/mail_activity_views.xml15
-rw-r--r--addons/sale/views/payment_views.xml30
-rw-r--r--addons/sale/views/product_views.xml17
-rw-r--r--addons/sale/views/res_config_settings_views.xml468
-rw-r--r--addons/sale/views/res_partner_views.xml87
-rw-r--r--addons/sale/views/sale_onboarding_views.xml71
-rw-r--r--addons/sale/views/sale_portal_templates.xml592
-rw-r--r--addons/sale/views/sale_views.xml1355
-rw-r--r--addons/sale/views/sales_team_views.xml136
-rw-r--r--addons/sale/views/utm_campaign_views.xml42
-rw-r--r--addons/sale/views/variant_templates.xml117
12 files changed, 2970 insertions, 0 deletions
diff --git a/addons/sale/views/assets.xml b/addons/sale/views/assets.xml
new file mode 100644
index 00000000..2b78d5cc
--- /dev/null
+++ b/addons/sale/views/assets.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <template id="assets_backend_inherit_sale" inherit_id="web.assets_backend" name="Sale backend assets">
+ <xpath expr="link[last()]" position="after">
+ <link rel="stylesheet" type="text/scss" href="/sale/static/src/scss/sale_onboarding.scss"/>
+ <link rel="stylesheet" type="text/scss" href="/sale/static/src/scss/product_configurator.scss"/>
+ </xpath>
+ <xpath expr="script[last()]" position="after">
+ <script type="text/javascript" src="/sale/static/src/js/sale.js"></script>
+ <script type="text/javascript" src="/sale/static/src/js/tours/sale.js"></script>
+ <script type="text/javascript" src="/sale/static/src/js/product_configurator_widget.js"/>
+ <script type="text/javascript" src="/sale/static/src/js/sale_order_view.js"/>
+ <script type="text/javascript" src="/sale/static/src/js/product_discount_widget.js"/>
+ </xpath>
+ </template>
+ <template id="report_assets_common_inherit_sale" inherit_id="web.report_assets_common" name="Sale report common assets">
+ <xpath expr="link[last()]" position="after">
+ <link rel="stylesheet" type="text/scss" href="/sale/static/src/scss/sale_report.scss"/>
+ </xpath>
+ </template>
+ <template id="assets_frontend_inherit_sale" inherit_id="web.assets_frontend" name="Sale frontend assets">
+ <xpath expr="link[last()]" position="after">
+ <link rel="stylesheet" type="text/scss" href="/sale/static/src/scss/sale_portal.scss"/>
+ </xpath>
+ <xpath expr="script[last()]" position="after">
+ <script type="text/javascript" src="/sale/static/src/js/sale_portal_sidebar.js"></script>
+ </xpath>
+ </template>
+ <template id="assets_tests" name="Sale Assets Tests" inherit_id="web.assets_tests">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/sale/static/tests/tours/sale_signature.js"></script>
+ </xpath>
+ </template>
+ <template id="qunit_suite" name="sale_tests" inherit_id="web.qunit_suite_tests">
+ <xpath expr="." position="inside">
+ <script type="text/javascript" src="/sale/static/tests/product_configurator_tests.js"></script>
+ <script type="text/javascript" src="/sale/static/tests/sales_team_dashboard_tests.js"></script>
+ </xpath>
+ </template>
+</odoo>
diff --git a/addons/sale/views/mail_activity_views.xml b/addons/sale/views/mail_activity_views.xml
new file mode 100644
index 00000000..67608158
--- /dev/null
+++ b/addons/sale/views/mail_activity_views.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<odoo>
+ <!-- Activity types config -->
+ <record id="mail_activity_type_action_config_sale" model="ir.actions.act_window">
+ <field name="name">Activity Types</field>
+ <field name="res_model">mail.activity.type</field>
+ <field name="view_mode">tree,form</field>
+ <field name="domain">['|', ('res_model_id', '=', False), ('res_model_id.model', '=', 'sale.order')]</field>
+ <field name="context">{'default_res_model': 'sale.order'}</field>
+ </record>
+ <menuitem id="sale_menu_config_activity_type"
+ action="mail_activity_type_action_config_sale"
+ parent="menu_sale_config"
+ groups="base.group_no_one"/>
+</odoo> \ No newline at end of file
diff --git a/addons/sale/views/payment_views.xml b/addons/sale/views/payment_views.xml
new file mode 100644
index 00000000..bf26daf6
--- /dev/null
+++ b/addons/sale/views/payment_views.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <data>
+ <record id="acquirer_form_inherit_sale" model="ir.ui.view">
+ <field name="name">payment.acquirer.form.inherit.sale.payment</field>
+ <field name="model">payment.acquirer</field>
+ <field name="inherit_id" ref="payment.acquirer_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='qr_code']" position="after">
+ <field name="so_reference_type" attrs="{'invisible': [('provider', '!=', 'transfer')]}"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="transaction_form_inherit_sale" model="ir.ui.view">
+ <field name="name">payment.transaction.form.inherit.sale.payment</field>
+ <field name="model">payment.transaction</field>
+ <field name="inherit_id" ref="payment.transaction_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//div[hasclass('oe_button_box')]" position="inside">
+ <button name="action_view_sales_orders" type="object"
+ class="oe_stat_button" icon="fa-money"
+ attrs="{'invisible': [('sale_order_ids_nbr', '=', 0)]}">
+ <field name="sale_order_ids_nbr" widget="statinfo" string="Sales Order(s)"/>
+ </button>
+ </xpath>
+ </field>
+ </record>
+ </data>
+</odoo>
diff --git a/addons/sale/views/product_views.xml b/addons/sale/views/product_views.xml
new file mode 100644
index 00000000..1142887a
--- /dev/null
+++ b/addons/sale/views/product_views.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<odoo>
+
+ <record model="ir.ui.view" id="product_template_sale_form_view">
+ <field name="name">product.template.sales</field>
+ <field name="model">product.template</field>
+ <field name="inherit_id" ref="product.product_template_form_view"/>
+ <field name="arch" type="xml">
+ <xpath expr="//group[@name='sale']" position="attributes">
+ <attribute name="invisible">0</attribute>
+ </xpath>
+ <xpath expr="//group[@name='invoicing']" position="attributes">
+ <attribute name="invisible">0</attribute>
+ </xpath>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/sale/views/res_config_settings_views.xml b/addons/sale/views/res_config_settings_views.xml
new file mode 100644
index 00000000..882e2f6e
--- /dev/null
+++ b/addons/sale/views/res_config_settings_views.xml
@@ -0,0 +1,468 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <record id="res_config_settings_view_form" model="ir.ui.view">
+ <field name="name">res.config.settings.view.form.inherit.sale</field>
+ <field name="model">res.config.settings</field>
+ <field name="priority" eval="10"/>
+ <field name="inherit_id" ref="base.res_config_settings_view_form" />
+ <field name="arch" type="xml">
+ <xpath expr="//div[hasclass('settings')]" position="inside">
+ <div class="app_settings_block o_not_app" data-string="Sales" string="Sales" data-key="sale_management" groups="sales_team.group_sale_manager">
+ <h2>Product Catalog</h2>
+ <div class="row mt16 o_settings_container" name="catalog_setting_container">
+ <div class="col-12 col-lg-6 o_setting_box" id="variant_options">
+ <div class="o_setting_left_pane">
+ <field name="group_product_variant"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_product_variant"/>
+ <a href="https://www.odoo.com/documentation/14.0/applications/sales/sales/products_prices/products/variants.html" title="Documentation" class="o_doc_link" target="_blank"></a>
+ <div class="text-muted">
+ Sell variants of a product using attributes (size, color, etc.)
+ </div>
+ <div class="content-group" attrs="{'invisible': [('group_product_variant','=',False)]}">
+ <div class="mt8">
+ <button name="%(product.attribute_action)d" icon="fa-arrow-right" type="action" string="Attributes" class="btn-link"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="product_configurator">
+ <div class="o_setting_left_pane">
+ <field name="module_sale_product_configurator"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_sale_product_configurator"/>
+ <div class="text-muted">
+ Select product attributes and optional products from the sales order
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="product_matrix">
+ <div class="o_setting_left_pane">
+ <field name="module_sale_product_matrix"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_sale_product_matrix" string="Variant Grid Entry"/>
+ <div class="text-muted">
+ Add several variants to an order from a grid
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="uom_settings">
+ <div class="o_setting_left_pane">
+ <field name="group_uom"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_uom"/>
+ <div class="text-muted">
+ Sell and purchase products in different units of measure
+ </div>
+ <div class="content-group" attrs="{'invisible': [('group_uom','=',False)]}">
+ <div class="mt8">
+ <button name="%(uom.product_uom_form_action)d" icon="fa-arrow-right" type="action" string="Units of Measure" class="btn-link"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box"
+ id="email_template"
+ title="Sending an email is useful if you need to share specific information or content about a product (instructions, rules, links, media, etc.). Create and set the email template from the product detail form (in Sales tab).">
+ <div class="o_setting_left_pane">
+ <field name="module_product_email_template"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_product_email_template" string="Deliver Content by Email"/>
+ <div class="text-muted">
+ Send a product-specific email once the invoice is validated
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box"
+ id="stock_packaging"
+ title="Ability to select a package type in sales orders and to force a quantity that is a multiple of the number of units per package.">
+ <div class="o_setting_left_pane">
+ <field name="group_stock_packaging"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_stock_packaging"/>
+ <div class="text-muted">
+ Sell products by multiple of unit # per package
+ </div>
+ </div>
+ </div>
+ </div>
+ <h2>Pricing</h2>
+ <div class="row mt16 o_settings_container" id="pricing_setting_container">
+ <div class="col-12 col-lg-6 o_setting_box"
+ id="discount_sale_order_lines"
+ title="Apply manual discounts on sales order lines or display discounts computed from pricelists (option to activate in the pricelist configuration).">
+ <div class="o_setting_left_pane">
+ <field name="group_discount_per_so_line"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_discount_per_so_line"/>
+ <div class="text-muted">
+ Grant discounts on sales order lines
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box"
+ id="coupon_settings"
+ title="Boost your sales with two kinds of discount programs: promotions and coupon codes. Specific conditions can be set (products, customers, minimum purchase amount, period). Rewards can be discounts (% or amount) or free products.">
+ <div class="o_setting_left_pane">
+ <field name="module_sale_coupon"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_sale_coupon"/>
+ <div class="text-muted" id="sale_coupon">
+ Manage promotion &amp; coupon programs
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="pricelist_configuration">
+ <div class="o_setting_left_pane">
+ <field name="group_product_pricelist"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_product_pricelist"/>
+ <a href="https://www.odoo.com/documentation/14.0/applications/sales/sales/products_prices/prices/pricing.html" title="Documentation" class="o_doc_link" target="_blank"></a>
+ <div class="text-muted">
+ Set multiple prices per product, automated discounts, etc.
+ </div>
+ <div class="content-group" attrs="{'invisible': [('group_product_pricelist' ,'=', False)]}">
+ <div class="mt16">
+ <field name="group_sale_pricelist" invisible="1"/>
+ <field name="product_pricelist_setting" widget="radio" class="o_light_label"/>
+ </div>
+ <div class="mt8">
+ <button name="%(product.product_pricelist_action2)d" icon="fa-arrow-right" type="action" string="Pricelists" groups="product.group_product_pricelist" class="btn-link"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box"
+ id="auth_signup_documents"
+ title=" To send invitations in B2B mode, open a contact or select several ones in list view and click on 'Portal Access Management' option in the dropdown menu *Action*.">
+ <div class="o_setting_left_pane">
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="auth_signup_uninvited"/>
+ <div class="text-muted">
+ Let your customers log in to see their documents
+ </div>
+ <div class="mt8">
+ <field name="auth_signup_uninvited" class="o_light_label" widget="radio" required="True"/>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box"
+ id="show_margins"
+ title="The margin is computed as the sum of product sales prices minus the cost set in their detail form.">
+ <div class="o_setting_left_pane">
+ <field name="module_sale_margin"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_sale_margin"/>
+ <div class="text-muted">
+ Show margins on orders
+ </div>
+ </div>
+ </div>
+ </div>
+ <h2>Quotations &amp; Orders</h2>
+ <div class="row mt16 o_settings_container" name="quotation_order_setting_container">
+ <div class="col-12 col-lg-6 o_setting_box" id="sale_config_online_confirmation_sign">
+ <div class="o_setting_left_pane">
+ <field name="portal_confirmation_sign"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="portal_confirmation_sign"/>
+ <a href="https://www.odoo.com/documentation/14.0/applications/sales/sales/send_quotations/get_signature_to_validate.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." groups="base.group_multi_company"/>
+ <div class="text-muted">
+ Request an online signature to confirm orders
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="sale_config_online_confirmation_pay">
+ <div class="o_setting_left_pane">
+ <field name="portal_confirmation_pay"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="portal_confirmation_pay"/>
+ <a href="https://www.odoo.com/documentation/14.0/applications/sales/sales/send_quotations/get_paid_to_validate.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." groups="base.group_multi_company"/>
+ <div class="text-muted">
+ Request an online payment to confirm orders
+ </div>
+ <div class="mt8" attrs="{'invisible': [('portal_confirmation_pay', '=', False)]}">
+ <button name='%(payment.action_payment_acquirer)d' icon="fa-arrow-right" type="action" string="Payment Acquirers" class="btn-link"/>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="confirmation_email_setting" attrs="{'invisible': [('portal_confirmation_pay', '=', False) , ('portal_confirmation_sign', '=', False)]}" groups="base.group_no_one">
+ <div class="o_setting_right_pane">
+ <span class="o_form_label">Confirmation Email</span>
+ <div class="text-muted">
+ Automatic email sent after the customer has signed or paid online
+ </div>
+ <div class="row mt16">
+ <label for="confirmation_template_id" string="Email Template" class="col-lg-4 o_light_label"/>
+ <field name="confirmation_template_id" class="oe_inline"/>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="invoice_delivery_addresses">
+ <div class="o_setting_left_pane">
+ <field name="group_sale_delivery_address"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_sale_delivery_address"/>
+ <a href="https://www.odoo.com/documentation/14.0/applications/sales/sales/send_quotations/different_addresses.html" title="Documentation" class="o_doc_link" target="_blank"></a>
+ <div class="text-muted">
+ Select specific invoice and delivery addresses
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="quotation_validity_days">
+ <div class="o_setting_left_pane">
+ <field name="use_quotation_validity_days"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="use_quotation_validity_days"/>
+ <span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
+ <div class="text-muted">
+ Set a default validity on your quotations
+ </div>
+ <div class="content-group" attrs="{'invisible': [('use_quotation_validity_days','=',False)]}">
+ <div class="mt16">
+ <span class="col-lg-3">Default Limit: <field name="quotation_validity_days" attrs="{'required': [('use_quotation_validity_days', '=', True)]}"/> days</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="order_warnings">
+ <div class="o_setting_left_pane">
+ <field name="group_warning_sale"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_warning_sale" string="Sale Warnings"/>
+ <div class="text-muted">
+ Get warnings in orders for products or customers
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="no_edit_order">
+ <div class="o_setting_left_pane">
+ <field name="group_auto_done_setting"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_auto_done_setting"/>
+ <div class="text-muted">
+ No longer edit orders once confirmed
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="proforma_configuration">
+ <div class="o_setting_left_pane">
+ <field name="group_proforma_sales"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="group_proforma_sales"/>
+ <div class="text-muted">
+ Allows you to send Pro-Forma Invoice to your customers
+ </div>
+ </div>
+ </div>
+ </div>
+ <h2 class="mt32">Shipping</h2>
+ <div class="row mt16 o_settings_container" name="shipping_setting_container">
+ <div class="col-12 col-lg-6 o_setting_box" id="delivery">
+ <div class="o_setting_left_pane">
+ <field name="module_delivery"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_delivery"/>
+ <div class="text-muted" id="delivery_carrier">
+ Compute shipping costs on orders
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="ups">
+ <div class="o_setting_left_pane">
+ <field name="module_delivery_ups" widget="upgrade_boolean"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_delivery_ups"/>
+ <div class="text-muted">
+ Compute shipping costs and ship with UPS
+ </div>
+ <div class="content-group">
+ <div id="sale_delivery_ups"/>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_dhl">
+ <div class="o_setting_left_pane">
+ <field name="module_delivery_dhl" widget="upgrade_boolean"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_delivery_dhl"/>
+ <div class="text-muted">
+ Compute shipping costs and ship with DHL
+ </div>
+ <div class="content-group">
+ <div id="sale_delivery_dhl"></div>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_fedex">
+ <div class="o_setting_left_pane">
+ <field name="module_delivery_fedex" widget="upgrade_boolean"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_delivery_fedex"/>
+ <div class="text-muted">
+ Compute shipping costs and ship with FedEx
+ </div>
+ <div class="content-group">
+ <div id="sale_delivery_fedex"/>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_usps">
+ <div class="o_setting_left_pane">
+ <field name="module_delivery_usps" widget="upgrade_boolean"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_delivery_usps"/>
+ <div class="text-muted">
+ Compute shipping costs and ship with USPS
+ </div>
+ <div class="content-group">
+ <div id="sale_delivery_usps"/>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_bpost">
+ <div class="o_setting_left_pane">
+ <field name="module_delivery_bpost" widget="upgrade_boolean"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_delivery_bpost"/>
+ <div class="text-muted">
+ Compute shipping costs and ship with bpost
+ </div>
+ <div class="content-group">
+ <div id="sale_delivery_bpost"/>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_easypost">
+ <div class="o_setting_left_pane">
+ <field name="module_delivery_easypost" widget="upgrade_boolean"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_delivery_easypost"/>
+ <div class="text-muted">
+ Compute shipping costs and ship with Easypost
+ </div>
+ <div class="content-group">
+ <div id="sale_delivery_easypost"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <h2>Invoicing</h2>
+ <div class="row mt16 o_settings_container" name="invoicing_setting_container">
+ <div id="sales_settings_invoicing_policy"
+ class="col-12 col-lg-6 o_setting_box"
+ title="This default value is applied to any new product created. This can be changed in the product detail form.">
+ <div class="o_setting_right_pane">
+ <label for="default_invoice_policy"/>
+ <a href="https://www.odoo.com/documentation/14.0/applications/sales/sales/invoicing/invoicing_policy.html" title="Documentation" class="o_doc_link" target="_blank"></a>
+ <div class="text-muted">
+ Quantities to invoice from sales orders
+ </div>
+ <div class="content-group">
+ <div class="mt16">
+ <field name="default_invoice_policy" class="o_light_label" widget="radio"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="col-xs-12 col-md-6 o_setting_box"
+ id="automatic_invoicing"
+ attrs="{'invisible': ['|', ('default_invoice_policy', '!=', 'order'), ('portal_confirmation_pay', '=', False)]}">
+ <div class="o_setting_left_pane">
+ <field name="automatic_invoice"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="automatic_invoice"/>
+ <div class="text-muted">
+ Generate the invoice automatically when the online payment is confirmed
+ </div>
+ <div attrs="{'invisible': [('automatic_invoice','=',False)]}" groups="base.group_no_one">
+ <label for="template_id" class="o_light_label"/>
+ <field name="template_id" class="oe_inline" options="{'no_create': True}"/>
+ </div>
+ </div>
+ </div>
+ <div class="col-12 col-lg-6 o_setting_box" id="down_payments">
+ <div class="o_setting_left_pane"/>
+ <div class="o_setting_right_pane">
+ <span class="o_form_label">Down Payments</span>
+ <a href="https://www.odoo.com/documentation/14.0/applications/sales/sales/invoicing/down_payment.html" title="Documentation" class="o_doc_link" target="_blank"></a>
+ <div class="text-muted">
+ Product used for down payments
+ </div>
+ <div class="text-muted">
+ <field name="deposit_default_product_id" context="{'default_type': 'service'}"/>
+ </div>
+ </div>
+ </div>
+ </div>
+ <h2 class="mt32">Connectors</h2>
+ <div class="row mt16 o_settings_container" id="connectors_setting_container">
+ <div class="col-12 col-lg-6 o_setting_box" id="amazon_connector">
+ <div class="o_setting_left_pane">
+ <field name="module_sale_amazon" widget="upgrade_boolean"/>
+ </div>
+ <div class="o_setting_right_pane">
+ <label for="module_sale_amazon"/>
+ <a href="https://www.odoo.com/documentation/14.0/applications/sales/sales/amazon_connector/setup.html" title="Documentation" class="o_doc_link" target="_blank"></a>
+ <div class="text-muted">
+ Import Amazon orders and sync deliveries
+ </div>
+ <div class="content-group"
+ name="amazon_connector"
+ attrs="{'invisible': [('module_sale_amazon', '=', False)]}"/>
+ </div>
+ </div>
+ </div>
+ <div id="sale_ebay"/>
+ </div>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="action_sale_config_settings" model="ir.actions.act_window">
+ <field name="name">Settings</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">res.config.settings</field>
+ <field name="view_id" ref="res_config_settings_view_form"/>
+ <field name="view_mode">form</field>
+ <field name="target">inline</field>
+ <field name="context">{'module' : 'sale_management', 'bin_size': False}</field>
+ </record>
+
+ <menuitem id="menu_sale_general_settings"
+ name="Settings"
+ parent="menu_sale_config"
+ sequence="0"
+ action="action_sale_config_settings"
+ groups="base.group_system"/>
+
+</odoo>
diff --git a/addons/sale/views/res_partner_views.xml b/addons/sale/views/res_partner_views.xml
new file mode 100644
index 00000000..cbfa2b17
--- /dev/null
+++ b/addons/sale/views/res_partner_views.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<odoo>
+ <record id="act_res_partner_2_sale_order" model="ir.actions.act_window">
+ <field name="name">Quotations and Sales</field>
+ <field name="res_model">sale.order</field>
+ <field name="view_mode">tree,form,graph</field>
+ <field name="context">{'search_default_partner_id': active_id, 'default_partner_id': active_id}</field>
+ <field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Create a new quotation, the first step of a new sale!
+ </p><p>
+ Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
+ </p>
+ </field>
+ </record>
+
+ <!-- Partner kanban view inherte -->
+ <record model="ir.ui.view" id="crm_lead_partner_kanban_view">
+ <field name="name">res.partner.kanban.saleorder.inherit</field>
+ <field name="model">res.partner</field>
+ <field name="inherit_id" ref="base.res_partner_kanban_view"/>
+ <field name="priority" eval="20"/>
+ <field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
+ <field name="arch" type="xml">
+ <field name="mobile" position="after">
+ <field name="sale_order_count"/>
+ </field>
+ <xpath expr="//span[hasclass('oe_kanban_partner_links')]" position="inside">
+ <span t-if="record.sale_order_count.value>0" class="badge badge-pill"><i class="fa fa-fw fa-usd" role="img" aria-label="Sale orders" title="Sales orders"/><t t-esc="record.sale_order_count.value"/></span>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="res_partner_view_buttons" model="ir.ui.view">
+ <field name="name">res.partner.view.buttons</field>
+ <field name="model">res.partner</field>
+ <field name="inherit_id" ref="base.view_partner_form" />
+ <field name="priority" eval="3"/>
+ <field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
+ <field name="arch" type="xml">
+ <div name="button_box" position="inside">
+ <button class="oe_stat_button" type="action" name="%(sale.act_res_partner_2_sale_order)d"
+ groups="sales_team.group_sale_salesman"
+ icon="fa-usd">
+ <field string="Sales" name="sale_order_count" widget="statinfo"/>
+ </button>
+ </div>
+ <page name="internal_notes" position="inside">
+ <group colspan="2" col="2" groups="sale.group_warning_sale">
+ <separator string="Warning on the Sales Order" colspan="4" />
+ <field name="sale_warn" nolabel="1" />
+ <field name="sale_warn_msg" colspan="3" nolabel="1"
+ attrs="{'required':[('sale_warn', '!=', False), ('sale_warn','!=','no-message')],'readonly':[('sale_warn','=','no-message')]}"/>
+ </group>
+ </page>
+ </field>
+ </record>
+
+ <record id="res_partner_view_form_payment_defaultcreditcard" model="ir.ui.view">
+ <field name="name">res.partner.view.form.payment.defaultcreditcard</field>
+ <field name="model">res.partner</field>
+ <field name="inherit_id" ref="payment.view_partners_form_payment_defaultcreditcard"/>
+ <field name="arch" type="xml">
+ <button name="%(payment.payment_token_action)d" position="attributes">
+ <attribute name="groups">sales_team.group_sale_salesman</attribute>
+ </button>
+ </field>
+ </record>
+
+ <record id="res_partner_view_form_property_inherit" model="ir.ui.view">
+ <field name="name">res.partner.view.form.property.inherit</field>
+ <field name="model">res.partner</field>
+ <field name="inherit_id" ref="account.view_partner_property_form"/>
+ <field name="arch" type="xml">
+ <group name="fiscal_information" position="attributes">
+ <attribute name="groups">account.group_account_invoice, sales_team.group_sale_salesman</attribute>
+ </group>
+ <field name="property_payment_term_id" position="attributes">
+ <attribute name="groups">account.group_account_invoice, sales_team.group_sale_salesman</attribute>
+ </field>
+ <field name="property_supplier_payment_term_id" position="attributes">
+ <attribute name="groups">account.group_account_invoice, sales_team.group_sale_salesman</attribute>
+ </field>
+ </field>
+ </record>
+</odoo>
diff --git a/addons/sale/views/sale_onboarding_views.xml b/addons/sale/views/sale_onboarding_views.xml
new file mode 100644
index 00000000..b913649b
--- /dev/null
+++ b/addons/sale/views/sale_onboarding_views.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <!-- ONBOARDING STEPS -->
+ <template id="onboarding_quotation_layout_step">
+ <t t-call="base.onboarding_step">
+ <t t-set="title">Quotation Layout</t>
+ <t t-set="description">Customize the look of your quotations.</t>
+ <t t-set="done_icon" t-value="'fa-star'" />
+ <t t-set="done_text">Looks great!</t>
+ <t t-set="btn_text">Customize</t>
+ <t t-set="model" t-value="'base.document.layout'" />
+ <t t-set="method" t-value="'action_open_base_document_layout'" />
+ <t t-set="state" t-value="state.get('account_onboarding_invoice_layout_state')" />
+ </t>
+ </template>
+ <template id="sale_onboarding_order_confirmation_step">
+ <t t-call="base.onboarding_step">
+ <t t-set="title">Order Confirmation</t>
+ <t t-set="description">Choose between electronic signatures or online payments.</t>
+ <t t-set="btn_text">Set payments</t>
+ <t t-set="method" t-value="'action_open_sale_onboarding_payment_acquirer'" />
+ <t t-set="model" t-value="'res.company'" />
+ <t t-set="state" t-value="state.get('sale_onboarding_order_confirmation_state')" />
+ </t>
+ </template>
+ <template id="sale_onboarding_sample_quotation_step">
+ <t t-call="base.onboarding_step">
+ <t t-set="title">Sample Quotation</t>
+ <t t-set="description">Send a quotation to test the customer portal.</t>
+ <t t-set="btn_text">Send sample</t>
+ <t t-set="method" t-value="'action_open_sale_onboarding_sample_quotation'" />
+ <t t-set="model" t-value="'res.company'" />
+ <t t-set="state" t-value="state.get('sale_onboarding_sample_quotation_state')" />
+ </t>
+ </template>
+
+ <!-- ONBOARDING PANEL-->
+ <template id="sale_quotation_onboarding_panel" name="sale.quotation.onboarding.panel">
+ <t t-call="base.onboarding_container">
+ <t t-set="classes" t-value="'o_onboarding_violet'" />
+ <t t-set="bg_image" t-value="'/sale/static/src/img/sale_quotation_onboarding_bg.jpg'"/>
+ <t t-set="close_method" t-value="'action_close_sale_quotation_onboarding'" />
+ <t t-set="close_model" t-value="'res.company'" />
+ <t t-call="base.onboarding_company_step" name="company_step" />
+ <t t-call="sale.onboarding_quotation_layout_step" name="quotation_layout_step" />
+ <t t-call="sale.sale_onboarding_order_confirmation_step" name="payment_acquirer_step" />
+ <t t-call="sale.sale_onboarding_sample_quotation_step" name="sample_quotation_step" />
+ </t>
+ </template>
+ <!-- ORDER CONFIRMATION -->
+ <record id="sale_onboarding_order_confirmation_form" model="ir.ui.view">
+ <field name="name">sale.order.confirmation.onboarding.form</field>
+ <field name="model">sale.payment.acquirer.onboarding.wizard</field>
+ <field name="inherit_id" ref="payment.payment_acquirer_onboarding_wizard_form" />
+ <field name="mode">primary</field>
+ <field name="priority">1000</field>
+ <field name="arch" type="xml">
+ <xpath expr="//div[@name='left-column']" position="attributes">
+ <attribute name="class">col col-4</attribute>
+ </xpath>
+ </field>
+ </record>
+ <record id="action_open_sale_onboarding_payment_acquirer_wizard" model="ir.actions.act_window">
+ <field name="name">Choose how to confirm quotations</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">sale.payment.acquirer.onboarding.wizard</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="sale_onboarding_order_confirmation_form" />
+ <field name="target">new</field>
+ </record>
+</odoo>
diff --git a/addons/sale/views/sale_portal_templates.xml b/addons/sale/views/sale_portal_templates.xml
new file mode 100644
index 00000000..77720253
--- /dev/null
+++ b/addons/sale/views/sale_portal_templates.xml
@@ -0,0 +1,592 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <template id="portal_my_home_menu_sale" name="Portal layout : sales menu entries" inherit_id="portal.portal_breadcrumbs" priority="20">
+ <xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
+ <li t-if="page_name == 'quote' or sale_order and sale_order.state in ('sent', 'cancel')" t-attf-class="breadcrumb-item #{'active ' if not sale_order else ''}">
+ <a t-if="sale_order" t-attf-href="/my/quotes?{{ keep_query() }}">Quotations</a>
+ <t t-else="">Quotations</t>
+ </li>
+ <li t-if="page_name == 'order' or sale_order and sale_order.state not in ('sent', 'cancel')" t-attf-class="breadcrumb-item #{'active ' if not sale_order else ''}">
+ <a t-if="sale_order" t-attf-href="/my/orders?{{ keep_query() }}">Sales Orders</a>
+ <t t-else="">Sales Orders</t>
+ </li>
+ <li t-if="sale_order" class="breadcrumb-item active">
+ <span t-field="sale_order.type_name"/>
+ <t t-esc="sale_order.name"/>
+ </li>
+ </xpath>
+ </template>
+
+ <template id="portal_my_home_sale" name="Show Quotations / Sales Orders" customize_show="True" inherit_id="portal.portal_my_home" priority="20">
+ <xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
+ <t t-call="portal.portal_docs_entry">
+ <t t-set="title">Quotations</t>
+ <t t-set="url" t-value="'/my/quotes'"/>
+ <t t-set="placeholder_count" t-value="'quotation_count'"/>
+ </t>
+ <t t-call="portal.portal_docs_entry">
+ <t t-set="title">Sales Orders</t>
+ <t t-set="url" t-value="'/my/orders'"/>
+ <t t-set="placeholder_count" t-value="'order_count'"/>
+ </t>
+ </xpath>
+ </template>
+
+ <template id="portal_my_quotations" name="My Quotations">
+ <t t-call="portal.portal_layout">
+ <t t-set="breadcrumbs_searchbar" t-value="True"/>
+
+ <t t-call="portal.portal_searchbar">
+ <t t-set="title">Quotations</t>
+ </t>
+ <t t-if="not quotations">
+ <p>There are currently no quotations for your account.</p>
+ </t>
+ <t t-if="quotations" t-call="portal.portal_table">
+ <thead>
+ <tr class="active">
+ <th>Quotation #</th>
+ <th class="text-right">Quotation Date</th>
+ <th class="text-right">Valid Until</th>
+ <th class="text-center"/>
+ <th class="text-right">Total</th>
+ </tr>
+ </thead>
+ <t t-foreach="quotations" t-as="quotation">
+ <tr>
+ <td><a t-att-href="quotation.get_portal_url()"><t t-esc="quotation.name"/></a></td>
+ <td class="text-right"><span t-field="quotation.date_order"/></td>
+ <td class="text-right"><span t-field="quotation.validity_date"/></td>
+ <td class="text-center">
+ <span t-if="quotation.state == 'cancel'" class="badge badge-pill badge-secondary"><i class="fa fa-fw fa-remove"/> Cancelled</span>
+ <span t-if="quotation.is_expired" class="badge badge-pill badge-secondary"><i class="fa fa-fw fa-clock-o"/> Expired</span>
+ </td>
+ <td class="text-right">
+ <span t-field="quotation.amount_total"/>
+ </td>
+ </tr>
+ </t>
+ </t>
+ </t>
+ </template>
+
+ <template id="portal_my_orders" name="My Sales Orders">
+ <t t-call="portal.portal_layout">
+ <t t-set="breadcrumbs_searchbar" t-value="True"/>
+
+ <t t-call="portal.portal_searchbar">
+ <t t-set="title">Sales Orders</t>
+ </t>
+ <t t-if="not orders">
+ <p>There are currently no orders for your account.</p>
+ </t>
+ <t t-if="orders" t-call="portal.portal_table">
+ <thead>
+ <tr class="active">
+ <th>
+ <span class='d-none d-md-inline'>Sales Order #</span>
+ <span class='d-block d-md-none'>Ref.</span>
+ </th>
+ <th class="text-right">Order Date</th>
+ <th class="text-center"/>
+ <th class="text-right">Total</th>
+ </tr>
+ </thead>
+ <t t-foreach="orders" t-as="order">
+ <tr>
+ <td><a t-att-href="order.get_portal_url()"><t t-esc="order.name"/></a></td>
+ <td class="text-right">
+ <span t-field="order.date_order" t-options="{'widget': 'date'}"/>&amp;nbsp;
+ <span class='d-none d-md-inline' t-field="order.date_order" t-options="{'time_only': True}"/>
+ </td>
+ <td class="text-center">
+ <span t-if="order.state == 'done'" class="badge badge-pill badge-success">
+ <i class="fa fa-fw fa-check" role="img" aria-label="Done" title="Done"/>Done
+ </span>
+ </td>
+ <td class="text-right"><span t-field="order.amount_total"/></td>
+ </tr>
+ </t>
+ </t>
+ </t>
+ </template>
+
+ <!-- Complete page of the sale_order -->
+ <template id="sale_order_portal_template" name="Sales Order Portal Template" inherit_id="portal.portal_sidebar" primary="True">
+ <xpath expr="//div[hasclass('o_portal_sidebar')]" position="inside">
+ <t t-set="o_portal_fullwidth_alert" groups="sales_team.group_sale_salesman">
+ <t t-call="portal.portal_back_in_edit_mode">
+ <t t-set="backend_url" t-value="'/web#model=%s&amp;id=%s&amp;action=%s&amp;view_type=form' % (sale_order._name, sale_order.id, action.id)"/>
+ </t>
+ </t>
+
+ <div class="row mt16 o_portal_sale_sidebar">
+ <!-- Sidebar -->
+ <t t-call="portal.portal_record_sidebar">
+ <t t-set="classes" t-value="'col-lg-auto d-print-none'"/>
+
+ <t t-set="title">
+ <h2 class="mb-0"><b t-field="sale_order.amount_total" data-id="total_amount"/> </h2>
+ </t>
+ <t t-set="entries">
+ <ul class="list-group list-group-flush flex-wrap flex-row flex-lg-column">
+ <li class="list-group-item flex-grow-1">
+ <a t-if="sale_order.has_to_be_signed(True)" role="button" class="btn btn-primary btn-block mb8" data-toggle="modal" data-target="#modalaccept" href="#">
+ <i class="fa fa-check"/><t t-if="sale_order.has_to_be_paid(True)"> Sign &amp; Pay</t><t t-else=""> Accept &amp; Sign</t>
+ </a>
+ <a t-elif="sale_order.has_to_be_paid(True)" role="button" id="o_sale_portal_paynow" data-toggle="modal" data-target="#modalaccept" href="#" t-att-class="'btn-block mb8 %s' % ('btn btn-light' if sale_order.transaction_ids else 'btn btn-primary')" >
+ <i class="fa fa-check"/> <t t-if="not sale_order.signature">Accept &amp; Pay</t><t t-else="">Pay Now</t>
+ </a>
+ <div class="o_download_pdf btn-toolbar flex-sm-nowrap">
+ <div class="btn-group flex-grow-1 mr-1 mb-1">
+ <a class="btn btn-secondary btn-block o_download_btn" t-att-href="sale_order.get_portal_url(report_type='pdf', download=True)" title="Download"><i class="fa fa-download"/> Download</a>
+ </div>
+ <div class="btn-group flex-grow-1 mb-1">
+ <a class="btn btn-secondary btn-block o_print_btn o_portal_invoice_print" t-att-href="sale_order.get_portal_url(report_type='pdf')" id="print_invoice_report" title="Print" target="_blank"><i class="fa fa-print"/> Print</a>
+ </div>
+ </div>
+ </li>
+
+ <li class="navspy list-group-item pl-0 flex-grow-1" t-ignore="true" role="complementary">
+ <ul class="nav flex-column bs-sidenav"></ul>
+ </li>
+
+ <t t-if="not sale_order.is_expired and sale_order.state in ['draft', 'sent']">
+ <li t-if="sale_order.validity_date" class="list-group-item">
+ <small><b class="text-muted">This offer expires on</b></small>
+ <div t-field="sale_order.validity_date"></div>
+ </li>
+ <li t-if="sale_order.amount_undiscounted - sale_order.amount_untaxed &gt; 0.01" class="list-group-item flex-grow-1">
+ <small><b class="text-muted">Your advantage</b></small>
+ <small>
+ <b t-field="sale_order.amount_undiscounted"
+ t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'
+ style="text-decoration: line-through"
+ class="d-block mt-1"
+ data-id="amount_undiscounted" />
+ </small>
+ <t t-if="sale_order.amount_untaxed == sale_order.amount_total">
+ <h4 t-field="sale_order.amount_total" class="text-success" data-id="total_amount"/>
+ </t>
+ <t t-else="">
+ <h4 t-field="sale_order.amount_untaxed" class="text-success mb-0" data-id="total_untaxed"/>
+ <small>(<span t-field="sale_order.amount_total" data-id="total_amount"/> Incl. tax)</small>
+ </t>
+ </li>
+ </t>
+
+ <li t-if="sale_order.user_id" class="list-group-item flex-grow-1">
+ <div class="small mb-1"><strong class="text-muted">Salesperson</strong></div>
+ <div class="row flex-nowrap">
+ <div class="col flex-grow-0 pr-2">
+ <img class="rounded-circle mr4 float-left o_portal_contact_img" t-if="sale_order.user_id.image_1024" t-att-src="image_data_uri(sale_order.user_id.image_1024)" alt="Contact"/>
+ <img class="rounded-circle mr4 float-left o_portal_contact_img" t-if="not sale_order.user_id.image_1024" src="/web/static/src/img/placeholder.png" alt="Contact"/>
+ </div>
+ <div class="col pl-0" style="min-width: 150px">
+ <span t-field="sale_order.user_id" t-options='{"widget": "contact", "fields": ["name", "phone"], "no_marker": True}'/>
+ <a href="#discussion" class="small"><i class="fa fa-comment"></i> Send message</a>
+ </div>
+ </div>
+ </li>
+ </ul>
+ </t>
+ </t>
+
+ <!-- Page content -->
+ <div id="quote_content" class="col-12 col-lg justify-content-end">
+
+ <!-- modal relative to the actions sign and pay -->
+ <div role="dialog" class="modal fade" id="modalaccept">
+ <div class="modal-dialog" t-if="sale_order.has_to_be_signed(True)">
+ <form id="accept" method="POST" t-att-data-order-id="sale_order.id" t-att-data-token="sale_order.access_token" class="js_accept_json modal-content js_website_submit_form">
+ <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
+ <header class="modal-header">
+ <h4 class="modal-title">Validate Order</h4>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
+ </header>
+ <main class="modal-body" id="sign-dialog">
+ <p>
+ <span>By signing this proposal, I agree to the following terms:</span>
+ <ul>
+ <li><span>Accepted on the behalf of:</span> <b t-field="sale_order.partner_id.commercial_partner_id"/></li>
+ <li><span>For an amount of:</span> <b data-id="total_amount" t-field="sale_order.amount_total"/></li>
+ <li t-if="sale_order.payment_term_id"><span>With payment terms:</span> <b t-field="sale_order.payment_term_id.note"/></li>
+ </ul>
+ </p>
+ <t t-call="portal.signature_form">
+ <t t-set="call_url" t-value="sale_order.get_portal_url(suffix='/accept')"/>
+ <t t-set="default_name" t-value="sale_order.partner_id.name"/>
+ </t>
+ </main>
+ </form>
+ </div>
+
+ <div class="modal-dialog" t-if="not sale_order.has_to_be_signed(True) and sale_order.has_to_be_paid(True)">
+ <div class="modal-content">
+ <header class="modal-header">
+ <h4 class="modal-title">Validate Order</h4>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
+ </header>
+ <main class="modal-body" id="sign-dialog">
+ <p>
+ <span>By paying this proposal, I agree to the following terms:</span>
+ <ul>
+ <li><span>Accepted on the behalf of:</span> <b t-field="sale_order.partner_id.commercial_partner_id"/></li>
+ <li><span>For an amount of:</span> <b data-id="total_amount" t-field="sale_order.amount_total"/></li>
+ <li t-if="sale_order.payment_term_id"><span>With payment terms:</span> <b t-field="sale_order.payment_term_id.note"/></li>
+ </ul>
+ </p>
+ <div t-if="pms or acquirers" id="payment_method" class="text-left">
+ <h3 class="mb24">Pay with</h3>
+ <t t-call="payment.payment_tokens_list">
+ <t t-set="mode" t-value="'payment'"/>
+ <t t-set="submit_txt">Pay &amp; Confirm</t>
+ <t t-set="icon_class" t-value="'fa-lock'"/>
+ <t t-set="form_action" t-value="sale_order.get_portal_url(suffix='/transaction/token')"/>
+ <t t-set="prepare_tx_url" t-value="sale_order.get_portal_url(suffix='/transaction/')"/>
+ <t t-set="access_token" t-value="sale_order.access_token"/>
+ </t>
+ </div>
+ </main>
+ </div>
+ </div>
+ </div>
+
+ <!-- modal relative to the action reject -->
+ <div role="dialog" class="modal fade" id="modaldecline">
+ <div class="modal-dialog">
+ <form id="decline" method="POST" t-attf-action="/my/orders/#{sale_order.id}/decline?access_token=#{sale_order.access_token}" class="modal-content">
+ <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
+ <header class="modal-header">
+ <h4 class="modal-title">Reject This Quotation</h4>
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
+ </header>
+ <main class="modal-body">
+ <p>
+ Tell us why you are refusing this quotation, this will help us improve our services.
+ </p>
+ <textarea rows="4" name="decline_message" required="" placeholder="Your feedback..." class="form-control" />
+ </main>
+ <footer class="modal-footer">
+ <button type="submit" t-att-id="sale_order.id" class="btn btn-danger"><i class="fa fa-times"></i> Reject</button>
+ <button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
+ </footer>
+ </form>
+ </div>
+ </div>
+
+ <!-- status messages -->
+ <div t-if="message == 'sign_ok'" class="alert alert-success alert-dismissable d-print-none" role="status">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
+ <strong>Thank You!</strong><br/>
+ <t t-if="message == 'sign_ok' and sale_order.state in ['sale', 'done']">Your order has been confirmed.</t>
+ <t t-elif="message == 'sign_ok' and sale_order.has_to_be_paid()">Your order has been signed but still needs to be paid to be confirmed.</t>
+ <t t-else="">Your order has been signed.</t>
+ </div>
+
+ <div t-if="message == 'cant_reject' and sale_order.has_to_be_signed()" class="alert alert-danger alert-dismissable d-print-none" role="alert">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
+ Your order is not in a state to be rejected.
+ </div>
+
+ <t t-if="sale_order.transaction_ids">
+ <t t-call="payment.payment_confirmation_status">
+ <t t-set="payment_tx_id" t-value="sale_order.get_portal_last_transaction()"/>
+ <t t-set="reference" t-value="sale_order.reference"/>
+ </t>
+ </t>
+
+ <div t-if="sale_order.state == 'cancel'" class="alert alert-danger alert-dismissable d-print-none" role="alert">
+ <button type="button" class="close" data-dismiss="alert" aria-label="close">×</button>
+ <strong>This quotation has been canceled.</strong> <a role="button" href="#discussion"><i class="fa fa-comment"/> Contact us to get a new quotation.</a>
+ </div>
+
+ <div t-if="sale_order.is_expired" class="alert alert-warning alert-dismissable d-print-none" role="alert">
+ <button type="button" class="close" data-dismiss="alert" aria-label="close">×</button>
+ <strong>This offer expired!</strong> <a role="button" href="#discussion"><i class="fa fa-comment"/> Contact us to get a new quotation.</a>
+ </div>
+
+ <!-- main content -->
+ <div t-attf-class="card #{'pb-5' if report_type == 'html' else ''}" id="portal_sale_content">
+ <div t-call="sale.sale_order_portal_content"/>
+ </div>
+
+ <!-- bottom actions -->
+ <div t-if="sale_order.has_to_be_signed(True) or sale_order.has_to_be_paid(True)" class="row justify-content-center text-center d-print-none pt-1 pb-4">
+
+ <t t-if="sale_order.has_to_be_signed(True)">
+ <div class="col-sm-auto mt8">
+ <a role="button" class="btn btn-primary" data-toggle="modal" data-target="#modalaccept" href="#"><i class="fa fa-check"/><t t-if="sale_order.has_to_be_paid(True)"> Sign &amp; Pay</t><t t-else=""> Accept &amp; Sign</t></a>
+ </div>
+ <div class="col-sm-auto mt8">
+ <a role="button" class="btn btn-secondary" href="#discussion"><i class="fa fa-comment"/> Feedback</a>
+ </div>
+ <div class="col-sm-auto mt8">
+ <a role="button" class="btn btn-danger" data-toggle="modal" data-target="#modaldecline" href="#"> <i class="fa fa-times"/> Reject</a>
+ </div>
+ </t>
+ <div t-elif="sale_order.has_to_be_paid(True)" class="col-sm-auto mt8">
+ <a role="button" data-toggle="modal" data-target="#modalaccept" href="#" t-att-class="'%s' % ('btn btn-light' if sale_order.transaction_ids else 'btn btn-primary')">
+ <i class="fa fa-check"/> <t t-if="not sale_order.signature">Accept &amp; Pay</t><t t-else="">Pay Now</t>
+ </a>
+ </div>
+ </div>
+
+ <!-- chatter -->
+ <div id="sale_order_communication" class="mt-4">
+ <h2>History</h2>
+ <t t-call="portal.message_thread">
+ <t t-set="object" t-value="sale_order"/>
+ </t>
+ </div>
+ </div><!-- // #quote_content -->
+ </div>
+ </xpath>
+ </template>
+
+ <!--
+ Sales Order content : intro, informations, order lines, remarks, descriptions ....
+ This template should contains all the printable element of the SO. This is the
+ template rendered in PDF with the report engine.
+ -->
+ <template id="sale_order_portal_content" name="Sales Order Portal Content">
+ <!-- Intro -->
+ <div id="introduction" t-attf-class="pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}">
+ <h2 class="my-0">
+ <t t-esc="sale_order.type_name"/>
+ <em t-esc="sale_order.name"/>
+ </h2>
+ </div>
+
+ <div t-attf-class="#{'card-body' if report_type == 'html' else ''}">
+ <!-- Informations -->
+ <div id="informations">
+ <div t-if="sale_order.transaction_ids and not invoices and sale_order.state in ('sent', 'sale') and portal_confirmation == 'pay' and not success and not error" t-att-data-order-id="sale_order.id">
+ <t t-if="sale_order.transaction_ids">
+ <t t-call="payment.payment_confirmation_status">
+ <t t-set="payment_tx_id" t-value="sale_order.get_portal_last_transaction()"/>
+ <t t-set="reference" t-value="sale_order.reference"/>
+ </t>
+ </t>
+ </div>
+ <div class="row" id="so_date">
+ <div class="mb-3 col-6">
+ <t t-if="sale_order.state in ['sale', 'done', 'cancel']">
+ <strong>Order Date:</strong>
+ </t>
+ <t t-else="">
+ <strong>Quotation Date:</strong>
+ </t>
+ <span t-field="sale_order.date_order" t-options='{"widget": "date"}'/>
+ </div>
+ <div class="mb-3 col-6" t-if="sale_order.validity_date">
+ <strong>Expiration Date:</strong> <span t-field="sale_order.validity_date" t-options='{"widget": "date"}'/>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-lg-6">
+ <strong t-if="sale_order.partner_shipping_id == sale_order.partner_invoice_id" class="d-block mb-1">Invoicing and Shipping Address:</strong>
+ <strong t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id" class="d-block mb-1">Invoicing Address:</strong>
+ <address t-field="sale_order.partner_invoice_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
+ </div>
+ <t t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id">
+ <div id="shipping_address" class="col-lg-6">
+ <strong class="d-block mb-1">Shipping Address:</strong>
+ <address t-field="sale_order.partner_shipping_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
+ </div>
+ </t>
+ </div>
+
+ <t t-set="invoices" t-value="[i for i in sale_order.invoice_ids if i.state not in ['draft', 'cancel']]"/>
+ <div t-if="invoices" class="row">
+ <div class="col">
+ <strong class="d-block mb-1">Invoices</strong>
+ <ul class="list-group mb-4">
+ <t t-foreach="invoices" t-as="i">
+ <t t-set="report_url" t-value="i.get_portal_url(report_type='pdf', download=True)"/>
+ <div class="d-flex flex-wrap align-items-center justify-content-between">
+ <div>
+ <a t-att-href="report_url">
+ <span t-esc="i.name"/>
+ </a>
+ <div class="small d-lg-inline-block">Date: <span class="text-muted" t-field="i.invoice_date"/></div>
+ </div>
+ <span t-if="i.payment_state in ('paid', 'in_payment')" class="small badge badge-success orders_label_text_align"><i class="fa fa-fw fa-check"/> <b>Paid</b></span>
+ <span t-else="" class="small badge badge-info orders_label_text_align"><i class="fa fa-fw fa-clock-o"/> <b>Waiting Payment</b></span>
+ </div>
+ </t>
+ </ul>
+ </div>
+ </div>
+ </div>
+
+ <section id="details" style="page-break-inside: auto;" class="mt32">
+ <h3 id="details">Pricing</h3>
+
+ <t t-set="display_discount" t-value="True in [line.discount > 0 for line in sale_order.order_line]"/>
+
+ <table t-att-data-order-id="sale_order.id" t-att-data-token="sale_order.access_token" class="table table-sm" id="sales_order_table">
+ <thead class="bg-100">
+ <tr>
+ <th class="text-left">Products</th>
+ <th class="text-right">Quantity</th>
+ <th t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">Unit Price</th>
+ <th t-if="display_discount" t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
+ <span>Disc.%</span>
+ </th>
+ <th t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
+ <span>Taxes</span>
+ </th>
+ <th class="text-right" >
+ <span groups="account.group_show_line_subtotals_tax_excluded">Amount</span>
+ <span groups="account.group_show_line_subtotals_tax_included">Total Price</span>
+ </th>
+ </tr>
+ </thead>
+ <tbody class="sale_tbody">
+
+ <t t-set="current_subtotal" t-value="0"/>
+
+ <t t-foreach="sale_order.order_line" t-as="line">
+
+ <t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
+ <t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
+
+ <tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
+ <t t-if="not line.display_type">
+ <td id="product_name"><span t-field="line.name"/></td>
+ <td class="text-right">
+ <div id="quote_qty">
+ <span t-field="line.product_uom_qty"/>
+ <span t-field="line.product_uom"/>
+ </div>
+ </td>
+ <td t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
+ <div
+ t-if="line.discount &gt;= 0"
+ t-field="line.price_unit"
+ t-att-style="line.discount and 'text-decoration: line-through' or None"
+ t-att-class="(line.discount and 'text-danger' or '') + ' text-right'"
+ />
+ <div t-if="line.discount">
+ <t t-esc="(1-line.discount / 100.0) * line.price_unit" t-options='{"widget": "float", "decimal_precision": "Product Price"}'/>
+ </div>
+ </td>
+ <td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
+ <strong t-if="line.discount &gt; 0" class="text-info">
+ <t t-esc="((line.discount % 1) and '%s' or '%d') % line.discount"/>%
+ </strong>
+ </td>
+ <td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
+ <span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/>
+ </td>
+ <td class="text-right">
+ <span class="oe_order_line_price_subtotal" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
+ <span class="oe_order_line_price_total" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
+ </td>
+ </t>
+ <t t-if="line.display_type == 'line_section'">
+ <td colspan="99">
+ <span t-field="line.name"/>
+ </td>
+ <t t-set="current_section" t-value="line"/>
+ <t t-set="current_subtotal" t-value="0"/>
+ </t>
+ <t t-if="line.display_type == 'line_note'">
+ <td colspan="99">
+ <span t-field="line.name"/>
+ </td>
+ </t>
+ </tr>
+
+ <t t-if="current_section and (line_last or sale_order.order_line[line_index+1].display_type == 'line_section')">
+ <tr class="is-subtotal text-right">
+ <td colspan="99">
+ <strong class="mr16">Subtotal</strong>
+ <span
+ t-esc="current_subtotal"
+ t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'
+ />
+ </td>
+ </tr>
+ </t>
+ </t>
+ </tbody>
+ </table>
+
+ <div id="total" class="row" name="total" style="page-break-inside: avoid;">
+ <div t-attf-class="#{'col-4' if report_type != 'html' else 'col-sm-7 col-md-5'} ml-auto">
+ <t t-call="sale.sale_order_portal_content_totals_table"/>
+ </div>
+ </div>
+ </section>
+
+ <section t-if="sale_order.signature" id="signature" name="Signature">
+ <div class="row mt-4" name="signature">
+ <div t-attf-class="#{'col-3' if report_type != 'html' else 'col-sm-7 col-md-4'} ml-auto text-center">
+ <h5>Signature</h5>
+ <img t-att-src="image_data_uri(sale_order.signature)" style="max-height: 6rem; max-width: 100%;"/>
+ <p t-field="sale_order.signed_by"/>
+ </div>
+ </div>
+ </section>
+
+ <section id="terms" class="mt-5" t-if="sale_order.note">
+ <h3 class="">Terms &amp; Conditions</h3>
+ <hr class="mt-0 mb-1"/>
+ <em t-field="sale_order.note"/>
+ </section>
+
+ <section class="mt-5" t-if="sale_order.payment_term_id">
+ <h3 class="">Payment terms</h3>
+ <hr class="mt-0 mb-1"/>
+ <span t-field="sale_order.payment_term_id"/>
+ </section>
+ </div>
+ </template>
+
+ <template id="sale_order_portal_content_totals_table">
+ <table class="table table-sm">
+ <tr class="border-black">
+ <td><strong>Subtotal</strong></td>
+ <td class="text-right">
+ <span
+ data-id="total_untaxed"
+ t-field="sale_order.amount_untaxed"
+ t-options='{"widget": "monetary","display_currency": sale_order.pricelist_id.currency_id}'
+ />
+ </td>
+ </tr>
+ <t t-foreach="sale_order.amount_by_group" t-as="amount_by_group">
+ <tr>
+ <t t-if="amount_by_group[3] == 1 and sale_order.amount_untaxed == amount_by_group[2]">
+ <td>
+ <span t-esc="amount_by_group[0]"/>
+ <span>&amp;nbsp;<span>on</span>&amp;nbsp;<t t-esc="amount_by_group[2]" t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'/></span>
+ </td>
+ <td class="text-right">
+ <span t-esc="amount_by_group[1]"
+ t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'/>
+ </td>
+ </t>
+ <t t-else ="">
+ <td>
+ <span t-esc="amount_by_group[0]"/>
+ </td>
+ <td class="text-right">
+ <span t-esc="amount_by_group[1]"
+ t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'/>
+ </td>
+ </t>
+ </tr>
+ </t>
+ <tr class="border-black">
+ <td><strong>Total</strong></td>
+ <td class="text-right">
+ <span data-id="total_amount" t-field="sale_order.amount_total" t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'/>
+ </td>
+ </tr>
+ </table>
+ </template>
+</odoo>
diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml
new file mode 100644
index 00000000..2edd9eda
--- /dev/null
+++ b/addons/sale/views/sale_views.xml
@@ -0,0 +1,1355 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+
+ <!-- Top menu item -->
+ <menuitem id="sale_menu_root"
+ name="Sales"
+ web_icon="sale_management,static/description/icon.png"
+ active="False"
+ sequence="7"/>
+
+ <menuitem id="sale_order_menu"
+ name="Orders"
+ parent="sale_menu_root"
+ sequence="2"/>
+
+ <menuitem id="report_sales_team"
+ name="Sales Teams"
+ parent="sale_order_menu"
+ groups="sales_team.group_sale_manager"
+ action="sales_team.crm_team_salesteams_act"
+ sequence="3"/>
+
+ <menuitem id="res_partner_menu"
+ parent="sale_order_menu"
+ action="account.res_partner_action_customer"
+ sequence="4" groups="sales_team.group_sale_salesman"/>
+
+ <menuitem id="menu_sale_report"
+ name="Reporting"
+ parent="sale_menu_root"
+ sequence="5"
+ groups="sales_team.group_sale_manager"/>
+
+ <menuitem id="menu_report_product_all"
+ name="Sales"
+ action="action_order_report_all"
+ parent="menu_sale_report"
+ sequence="1"/>
+
+ <menuitem id="menu_sale_config"
+ name="Configuration"
+ parent="sale_menu_root"
+ sequence="6"
+ groups="sales_team.group_sale_manager"/>
+
+ <menuitem id="sales_team_config"
+ name="Sales Teams"
+ parent="sale.menu_sale_config"
+ action="sales_team.sales_team_config_action"
+ sequence="2"/>
+
+ <menuitem id="menu_sales_config"
+ parent="menu_sale_config"
+ sequence="4"
+ name="Sales Orders"/>
+
+ <menuitem
+ id="menu_tag_config"
+ name="Tags"
+ parent="sale.menu_sales_config"
+ action="sales_team.sales_team_crm_tag_action"
+ sequence="2"/>
+
+ <record id="product_template_action" model="ir.actions.act_window">
+ <field name="name">Products</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">product.template</field>
+ <field name="view_mode">kanban,tree,form,activity</field>
+ <field name="view_id" ref="product.product_template_kanban_view"/>
+ <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_template_form_view" model="ir.ui.view">
+ <field name="name">product.template.product.website.form</field>
+ <field name="model">product.template</field>
+ <field name="inherit_id" ref="product.product_template_form_view"/>
+ <field name="arch" type="xml">
+ <xpath expr="//page[@name='sales']" position="attributes">
+ <attribute name="invisible">0</attribute>
+ </xpath>
+ </field>
+ </record>
+
+ <menuitem id="product_menu_catalog" name="Products" parent="sale_menu_root" sequence="4" groups="sales_team.group_sale_salesman"/>
+ <menuitem id="menu_product" name="Product Variants" parent="product_menu_catalog" sequence="2" groups="base.group_no_one" active="False"/>
+ <menuitem action="product_template_action" id="menu_product_template_action" parent="product_menu_catalog" sequence="1" active="False"/>
+ <menuitem id="prod_config_main" name="Products" parent="menu_sale_config" sequence="5"/>
+ <menuitem id="menu_products" action="product.product_normal_action_sell" parent="product_menu_catalog" groups="product.group_product_variant" sequence="2" active="False"/>
+ <menuitem id="next_id_16" name="Units of Measure" parent="sale.prod_config_main" sequence="6" groups="uom.group_uom" active="False"/>
+ <menuitem action="uom.product_uom_form_action" id="menu_product_uom_form_action" parent="sale.prod_config_main" sequence="7" groups="uom.group_uom" active="False"/>
+ <menuitem action="uom.product_uom_categ_form_action" id="menu_product_uom_categ_form_action" parent="sale.prod_config_main" sequence="8" groups="uom.group_uom" active="False"/>
+ <menuitem id="menu_product_pricelist_main" name="Pricelists" parent="product_menu_catalog" action="product.product_pricelist_action2" groups="product.group_product_pricelist" sequence="3" active="False"/>
+
+ <record id="sale_order_view_activity" model="ir.ui.view">
+ <field name="name">sale.order.activity</field>
+ <field name="model">sale.order</field>
+ <field name="arch" type="xml">
+ <activity string="Sales Orders">
+ <templates>
+ <div t-name="activity-box">
+ <div>
+ <field name="name" display="full"/>
+ <field name="partner_id" muted="1" display="full"/>
+ </div>
+ </div>
+ </templates>
+ </activity>
+ </field>
+ </record>
+
+ <record id="view_sale_order_calendar" model="ir.ui.view">
+ <field name="name">sale.order.calendar</field>
+ <field name="model">sale.order</field>
+ <field name="arch" type="xml">
+ <calendar string="Sales Orders" date_start="date_order" color="state" hide_time="true" event_limit="5">
+ <field name="currency_id" invisible="1"/>
+ <field name="partner_id" avatar_field="image_128"/>
+ <field name="amount_total" widget="monetary"/>
+ <field name="payment_term_id"/>
+ <field name="state" filters="1" invisible="1"/>
+ </calendar>
+ </field>
+ </record>
+ <record model="ir.ui.view" id="view_sale_order_graph">
+ <field name="name">sale.order.graph</field>
+ <field name="model">sale.order</field>
+ <field name="arch" type="xml">
+ <graph string="Sales Orders" sample="1">
+ <field name="partner_id"/>
+ <field name="amount_total" type="measure"/>
+ </graph>
+ </field>
+ </record>
+ <record model="ir.ui.view" id="view_sale_order_pivot">
+ <field name="name">sale.order.pivot</field>
+ <field name="model">sale.order</field>
+ <field name="arch" type="xml">
+ <pivot string="Sales Orders" sample="1">
+ <field name="date_order" type="row"/>
+ <field name="amount_total" type="measure"/>
+ </pivot>
+ </field>
+ </record>
+
+ <!-- Sales Orders Kanban View -->
+ <record model="ir.ui.view" id="view_sale_order_kanban">
+ <field name="name">sale.order.kanban</field>
+ <field name="model">sale.order</field>
+ <field name="arch" type="xml">
+ <kanban class="o_kanban_mobile" sample="1">
+ <field name="name"/>
+ <field name="partner_id"/>
+ <field name="amount_total"/>
+ <field name="date_order"/>
+ <field name="state"/>
+ <field name="currency_id"/>
+ <field name="activity_state"/>
+ <progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
+ <templates>
+ <t t-name="kanban-box">
+ <div t-attf-class="oe_kanban_card oe_kanban_global_click">
+ <div class="o_kanban_record_top mb16">
+ <div class="o_kanban_record_headings mt4">
+ <strong class="o_kanban_record_title"><span><t t-esc="record.partner_id.value"/></span></strong>
+ </div>
+ <strong><field name="amount_total" widget="monetary"/></strong>
+ </div>
+ <div class="o_kanban_record_bottom">
+ <div class="oe_kanban_bottom_left text-muted">
+ <span><t t-esc="record.name.value"/> <t t-esc="record.date_order.value"/></span>
+ <field name="activity_ids" widget="kanban_activity"/>
+ </div>
+ <div class="oe_kanban_bottom_right">
+ <field name="state" widget="label_selection" options="{'classes': {'draft': 'default', 'cancel': 'default', 'done': 'success'}}"/>
+ </div>
+ </div>
+ </div>
+ </t>
+ </templates>
+ </kanban>
+ </field>
+ </record>
+
+ <record id="view_order_tree" model="ir.ui.view">
+ <field name="name">sale.order.tree</field>
+ <field name="model">sale.order</field>
+ <field name="priority">2</field>
+ <field name="arch" type="xml">
+ <tree string="Sales Orders" multi_edit="1" sample="1">
+ <field name="message_needaction" invisible="1"/>
+ <field name="name" string="Number" readonly="1" decoration-bf="1"/>
+ <field name="date_order" string="Order Date" widget="date" optional="show"/>
+ <field name="commitment_date" optional="hide"/>
+ <field name="expected_date" optional="hide"/>
+ <field name="partner_id" readonly="1"/>
+ <field name="user_id" optional="show" widget="many2one_avatar_user"/>
+ <field name="activity_ids" widget="list_activity" optional="show"/>
+ <field name="team_id" optional="hide"/>
+ <field name="company_id" groups="base.group_multi_company" optional="show" readonly="1"/>
+ <field name="amount_untaxed" sum="Total Tax Excluded" widget="monetary" optional="hide"/>
+ <field name="amount_tax" sum="Tax Total" widget="monetary" optional="hide"/>
+ <field name="amount_total" sum="Total Tax Included" widget="monetary" decoration-bf="1" optional="show"/>
+ <field name="currency_id" invisible="1"/>
+ <field name="invoice_status" decoration-success="invoice_status == 'invoiced'" decoration-info="invoice_status == 'to invoice'" decoration-warning="invoice_status == 'upselling'" widget="badge" optional="show"/>
+ <field name="tag_ids" optional="hide" widget="many2many_tags" options="{'color_field': 'color'}"/>
+ <field name="state" invisible="1"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="view_quotation_tree" model="ir.ui.view">
+ <field name="name">sale.order.tree</field>
+ <field name="model">sale.order</field>
+ <field name="priority">4</field>
+ <field name="arch" type="xml">
+ <tree string="Quotation" class="o_sale_order" multi_edit="1" sample="1">
+ <field name="name" string="Number" readonly="1" decoration-bf="1"/>
+ <field name="create_date" string="Creation Date" widget="date" optional="show"/>
+ <field name="commitment_date" widget="date" optional="hide"/>
+ <field name="expected_date" widget="date" optional="hide"/>
+ <field name="partner_id" readonly="1"/>
+ <field name="user_id" widget="many2one_avatar_user" optional="show"/>
+ <field name="activity_ids" widget="list_activity" optional="show"/>
+ <field name="team_id" optional="hide"/>
+ <field name="tag_ids" optional="hide" widget="many2many_tags" options="{'color_field': 'color'}"/>
+ <field name="company_id" groups="base.group_multi_company" optional="show" readonly="1"/>
+ <field name="amount_untaxed" sum="Total Tax Excluded" widget="monetary" optional="hide"/>
+ <field name="amount_tax" sum="Tax Total" widget="monetary" optional="hide"/>
+ <field name="amount_total" sum="Total Tax Included" widget="monetary" decoration-bf="1" optional="show"/>
+ <field name="state" decoration-success="state == 'sale' or state == 'done'" decoration-info="state == 'draft' or state == 'sent'" widget="badge" optional="show"/>
+ <field name="invoice_status" optional="hide"/>
+ <field name="message_needaction" invisible="1"/>
+ <field name="currency_id" invisible="1"/>
+ </tree>
+ </field>
+ </record>
+ <record id="view_quotation_tree_with_onboarding" model="ir.ui.view">
+ <field name="name">sale.order.tree</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="view_quotation_tree"/>
+ <field name="mode">primary</field>
+ <field name="arch" type="xml">
+ <xpath expr="//tree" position="attributes">
+ <attribute name="banner_route">/sales/sale_quotation_onboarding_panel</attribute>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_order_form" model="ir.ui.view">
+ <field name="name">sale.order.form</field>
+ <field name="model">sale.order</field>
+ <field name="arch" type="xml">
+ <form string="Sales Order" class="o_sale_order" js_class="sale_discount_form">
+ <header>
+ <field name="authorized_transaction_ids" invisible="1"/>
+ <button name="payment_action_capture" type="object"
+ string="Capture Transaction" class="oe_highlight"
+ attrs="{'invisible': [('authorized_transaction_ids', '=', [])]}"/>
+ <button name="payment_action_void" type="object"
+ string="Void Transaction"
+ confirm="Are you sure you want to void the authorized transaction? This action can't be undone."
+ attrs="{'invisible': [('authorized_transaction_ids', '=', [])]}"/>
+ <button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
+ type="action" class="btn-primary"
+ attrs="{'invisible': [('invoice_status', '!=', 'to invoice')]}"/>
+ <button name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
+ type="action" context="{'default_advance_payment_method': 'percentage'}"
+ attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
+ <button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="btn-primary"/>
+ <button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice"
+ groups="sale.group_proforma_sales" class="btn-primary"
+ attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('invoice_count','&gt;=',1)]}" context="{'proforma': True}"/>
+ <button name="action_confirm" id="action_confirm"
+ string="Confirm" class="btn-primary" type="object"
+ attrs="{'invisible': [('state', 'not in', ['sent'])]}"/>
+ <button name="action_confirm"
+ string="Confirm" type="object"
+ attrs="{'invisible': [('state', 'not in', ['draft'])]}"/>
+ <button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice" groups="sale.group_proforma_sales" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('invoice_count','&gt;=',1)]}" context="{'proforma': True}"/>
+ <button name="action_quotation_send" string="Send by Email" type="object" states="sent,sale"/>
+ <button name="action_cancel" type="object" string="Cancel" attrs="{'invisible': ['|', ('state', 'not in', ['draft', 'sent','sale']), ('id', '=', False)]}"/>
+ <button name="action_draft" states="cancel" type="object" string="Set to Quotation"/>
+ <field name="state" widget="statusbar" statusbar_visible="draft,sent,sale"/>
+ </header>
+ <sheet>
+ <div class="oe_button_box" name="button_box">
+ <button name="preview_sale_order"
+ type="object"
+ class="oe_stat_button"
+ icon="fa-globe icon">
+ <div class="o_field_widget o_stat_info">
+ <span class="o_stat_text">Customer</span>
+ <span class="o_stat_text">Preview</span>
+ </div>
+ </button>
+ <button name="action_view_invoice"
+ type="object"
+ class="oe_stat_button"
+ icon="fa-pencil-square-o"
+ attrs="{'invisible': [('invoice_count', '=', 0)]}">
+ <field name="invoice_count" widget="statinfo" string="Invoices"/>
+ </button>
+ </div>
+ <div class="oe_title">
+ <h1>
+ <field name="name" readonly="1"/>
+ </h1>
+ </div>
+ <group name="sale_header">
+ <group name="partner_details">
+ <field name="partner_id" widget="res_partner_many2one" context="{'res_partner_search_mode': 'customer', 'show_address': 1, 'show_vat': True}" options='{"always_reload": True}'/>
+ <field name="partner_invoice_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'invoice'}" options='{"always_reload": True}'/>
+ <field name="partner_shipping_id" groups="sale.group_delivery_invoice_address" context="{'default_type':'delivery'}" options='{"always_reload": True}'/>
+ </group>
+ <group name="order_details">
+ <field name="validity_date" attrs="{'invisible': [('state', 'in', ['sale', 'done'])]}"/>
+ <div class="o_td_label" groups="base.group_no_one" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}">
+ <label for="date_order" string="Quotation Date"/>
+ </div>
+ <field name="date_order" nolabel="1" groups="base.group_no_one" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/>
+ <div class="o_td_label" attrs="{'invisible': [('state', 'in', ['draft', 'sent'])]}">
+ <label for="date_order" string="Order Date"/>
+ </div>
+ <field name="date_order" attrs="{'required': [('state', 'in', ['sale', 'done'])], 'invisible': [('state', 'in', ['draft', 'sent'])]}" nolabel="1"/>
+ <field name="show_update_pricelist" invisible="1"/>
+ <label for="pricelist_id" groups="product.group_product_pricelist"/>
+ <div groups="product.group_product_pricelist" class="o_row">
+ <field name="pricelist_id" options="{'no_open':True,'no_create': True}"/>
+ <button name="update_prices" type="object"
+ string=" Update Prices"
+ help="Recompute all prices based on this pricelist"
+ class="btn-link mb-1 px-0" icon="fa-refresh"
+ confirm="This will update all unit prices based on the currently set pricelist."
+ attrs="{'invisible': ['|', ('show_update_pricelist', '=', False), ('state', 'in', ['sale', 'done','cancel'])]}"/>
+ </div>
+ <field name="currency_id" invisible="1"/>
+ <field name="payment_term_id" options="{'no_open':True,'no_create': True}"/>
+ </group>
+ </group>
+ <notebook>
+ <page string="Order Lines" name="order_lines">
+ <field
+ name="order_line"
+ widget="section_and_note_one2many"
+ mode="tree,kanban"
+ attrs="{'readonly': [('state', 'in', ('done','cancel'))]}"
+ >
+ <form>
+ <field name="display_type" invisible="1"/>
+ <!--
+ We need the sequence field to be here for new lines to be added at the correct position.
+ TODO: at some point we want to fix this in the framework so that an invisible field is not required.
+ -->
+ <field name="sequence" invisible="1"/>
+ <field name="product_uom_category_id" invisible="1"/>
+ <group>
+ <group attrs="{'invisible': [('display_type', '!=', False)]}">
+ <field name="product_updatable" invisible="1"/>
+ <field name="product_id"
+ domain="[('sale_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
+ context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'company_id': parent.company_id}"
+ attrs="{
+ 'readonly': [('product_updatable', '=', False)],
+ 'required': [('display_type', '=', False)],
+ }"
+ force_save="1"
+ widget="many2one_barcode"
+ />
+ <field name="invoice_status" invisible="1"/>
+ <field name="qty_to_invoice" invisible="1"/>
+ <field name="qty_delivered_manual" invisible="1"/>
+ <field name="qty_delivered_method" invisible="1"/>
+ <field name="price_total" invisible="1"/>
+ <field name="price_tax" invisible="1"/>
+ <field name="price_subtotal" invisible="1"/>
+ <field name="product_uom_readonly" invisible="1"/>
+ <label for="product_uom_qty"/>
+ <div class="o_row" name="ordered_qty">
+ <field
+ context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'uom_qty_change':True, 'company_id': parent.company_id}"
+ name="product_uom_qty"/>
+ <field
+ name="product_uom"
+ force_save="1"
+ groups="uom.group_uom"
+ class="oe_no_button"
+ attrs="{
+ 'readonly': [('product_uom_readonly', '=', True)],
+ 'required': [('display_type', '=', False)],
+ }"
+ />
+ </div>
+ <label for="qty_delivered" string="Delivered" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
+ <div name="delivered_qty" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}">
+ <field name="qty_delivered" attrs="{'readonly': [('qty_delivered_method', '!=', 'manual')]}"/>
+ </div>
+ <label for="qty_invoiced" string="Invoiced" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
+ <div name="invoiced_qty" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}">
+ <field name="qty_invoiced" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
+ </div>
+ <field name="price_unit"/>
+ <field name="tax_id" widget="many2many_tags" options="{'no_create': True}" context="{'search_view_ref': 'account.account_tax_view_search'}" domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
+ attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"/>
+ <label for="discount" groups="product.group_discount_per_so_line"/>
+ <div name="discount" groups="product.group_discount_per_so_line">
+ <field name="discount" class="oe_inline"/> %%
+ </div>
+ <!--
+ We need the sequence field to be here
+ because we want to be able to overwrite the default sequence value in the JS
+ in order for new lines to be added at the correct position.
+ NOTE: at some point we want to fix this in the framework so that an invisible field is not required.
+ -->
+ <field name="sequence" invisible="1"/>
+ </group>
+ <group attrs="{'invisible': [('display_type', '!=', False)]}">
+ <label for="customer_lead"/>
+ <div name="lead">
+ <field name="customer_lead" class="oe_inline"/> days
+ </div>
+ <field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags" options="{'color_field': 'color'}" domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"/>
+ </group>
+ </group>
+ <label for="name" string="Description" attrs="{'invisible': [('display_type', '!=', False)]}"/>
+ <label for="name" string="Section Name (eg. Products, Services)" attrs="{'invisible': [('display_type', '!=', 'line_section')]}"/>
+ <label for="name" string="Note" attrs="{'invisible': [('display_type', '!=', 'line_note')]}"/>
+ <field name="name"/>
+ <div name="invoice_lines" groups="base.group_no_one" attrs="{'invisible': [('display_type', '!=', False)]}">
+ <label for="invoice_lines"/>
+ <field name="invoice_lines"/>
+ </div>
+ <field name="state" invisible="1"/>
+ <field name="company_id" invisible="1"/>
+ </form>
+ <tree
+ string="Sales Order Lines"
+ editable="bottom"
+ >
+ <control>
+ <create name="add_product_control" string="Add a product"/>
+ <create name="add_section_control" string="Add a section" context="{'default_display_type': 'line_section'}"/>
+ <create name="add_note_control" string="Add a note" context="{'default_display_type': 'line_note'}"/>
+ </control>
+
+ <field name="sequence" widget="handle" />
+ <!-- We do not display the type because we don't want the user to be bothered with that information if he has no section or note. -->
+ <field name="display_type" invisible="1"/>
+ <field name="product_uom_category_id" invisible="1"/>
+
+ <field name="product_updatable" invisible="1"/>
+ <field
+ name="product_id"
+ attrs="{
+ 'readonly': [('product_updatable', '=', False)],
+ 'required': [('display_type', '=', False)],
+ }"
+ options="{'no_open': True}"
+ force_save="1"
+ context="{
+ 'partner_id': parent.partner_id,
+ 'quantity': product_uom_qty,
+ 'pricelist': parent.pricelist_id,
+ 'uom':product_uom,
+ 'company_id': parent.company_id,
+ 'default_lst_price': price_unit,
+ 'default_description_sale': name
+ }"
+ domain="[('sale_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
+ widget="product_configurator"
+ />
+ <field name="product_template_id"
+ string="Product"
+ invisible="1"
+ attrs="{
+ 'readonly': [('product_updatable', '=', False)],
+ 'required': [('display_type', '=', False)],
+ }"
+ options="{'no_open': True}"
+ context="{
+ 'partner_id': parent.partner_id,
+ 'quantity': product_uom_qty,
+ 'pricelist': parent.pricelist_id,
+ 'uom':product_uom,
+ 'company_id': parent.company_id,
+ 'default_list_price': price_unit,
+ 'default_description_sale': name
+ }"
+ domain="[('sale_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
+ widget="product_configurator"/>
+ <field name="name" widget="section_and_note_text" optional="show"/>
+ <field
+ name="analytic_tag_ids"
+ optional="hide"
+ groups="analytic.group_analytic_tags"
+ widget="many2many_tags"
+ options="{'color_field': 'color'}"
+ domain="['|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
+ />
+ <field
+ name="product_uom_qty"
+ decoration-info="(not display_type and invoice_status == 'to invoice')" decoration-bf="(not display_type and invoice_status == 'to invoice')"
+ context="{
+ 'partner_id': parent.partner_id,
+ 'quantity': product_uom_qty,
+ 'pricelist': parent.pricelist_id,
+ 'uom': product_uom,
+ 'company_id': parent.company_id
+ }"
+ />
+ <field
+ name="qty_delivered"
+ decoration-info="(not display_type and invoice_status == 'to invoice')" decoration-bf="(not display_type and invoice_status == 'to invoice')"
+ string="Delivered"
+ attrs="{
+ 'column_invisible': [('parent.state', 'not in', ['sale', 'done'])],
+ 'readonly': [('qty_delivered_method', '!=', 'manual')]
+ }"
+ optional="show"
+ />
+ <field name="qty_delivered_manual" invisible="1"/>
+ <field name="qty_delivered_method" invisible="1"/>
+ <field
+ name="qty_invoiced"
+ decoration-info="(not display_type and invoice_status == 'to invoice')" decoration-bf="(not display_type and invoice_status == 'to invoice')"
+ string="Invoiced"
+ attrs="{'column_invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
+ optional="show"
+ />
+ <field name="qty_to_invoice" invisible="1"/>
+ <field name="product_uom_readonly" invisible="1"/>
+ <field
+ name="product_uom"
+ force_save="1"
+ string="UoM"
+ attrs="{
+ 'readonly': [('product_uom_readonly', '=', True)],
+ 'required': [('display_type', '=', False)],
+ }"
+ context="{'company_id': parent.company_id}"
+ groups="uom.group_uom"
+ options='{"no_open": True}'
+ optional="show"
+ />
+ <field
+ name="customer_lead"
+ optional="hide"
+ attrs="{'readonly': [('parent.state', 'not in', ['draft', 'sent', 'sale'])]}"
+ />
+ <field
+ name="price_unit"
+ attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"
+ />
+ <field
+ name="tax_id"
+ widget="many2many_tags"
+ options="{'no_create': True}"
+ domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id)]"
+ attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"
+ optional="show"
+ />
+ <field name="discount" string="Disc.%" groups="product.group_discount_per_so_line" optional="show" widget="product_discount"/>
+ <field name="price_subtotal" widget="monetary" groups="account.group_show_line_subtotals_tax_excluded"/>
+ <field name="price_total" widget="monetary" groups="account.group_show_line_subtotals_tax_included"/>
+ <field name="state" invisible="1"/>
+ <field name="invoice_status" invisible="1"/>
+ <field name="currency_id" invisible="1"/>
+ <field name="price_tax" invisible="1"/>
+ <field name="company_id" invisible="1"/>
+ </tree>
+ <kanban class="o_kanban_mobile">
+ <field name="name"/>
+ <field name="product_id"/>
+ <field name="product_uom_qty"/>
+ <field name="product_uom" groups="uom.group_uom"/>
+ <field name="price_subtotal"/>
+ <field name="price_total"/>
+ <field name="price_tax" invisible="1"/>
+ <field name="price_total" invisible="1"/>
+ <field name="price_unit"/>
+ <field name="display_type"/>
+ <field name="tax_id" invisible="1"/>
+ <field name="company_id" invisible="1"/>
+ <templates>
+ <t t-name="kanban-box">
+ <div t-attf-class="oe_kanban_card oe_kanban_global_click {{ record.display_type.raw_value ? 'o_is_' + record.display_type.raw_value : '' }}">
+ <t t-if="!record.display_type.raw_value">
+ <div class="row">
+ <div class="col-8">
+ <strong>
+ <span>
+ <t t-esc="record.product_id.value"/>
+ </span>
+ </strong>
+ </div>
+ <div class="col-4">
+ <strong>
+ <span class="float-right text-right">
+ <t t-set="line_price" t-value="record.price_subtotal.value" groups="account.group_show_line_subtotals_tax_excluded"/>
+ <t t-set="line_price" t-value="record.price_total.value" groups="account.group_show_line_subtotals_tax_included"/>
+ <t t-esc="line_price"/>
+ </span>
+ </strong>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-12 text-muted">
+ <span>
+ Quantity:
+ <t t-esc="record.product_uom_qty.value"/>
+ <t t-esc="record.product_uom.value"/>
+ </span>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-12 text-muted">
+ <span>
+ Unit Price:
+ <t t-esc="record.price_unit.value"/>
+ </span>
+ </div>
+ </div>
+ </t>
+ <t t-if="record.display_type.raw_value === 'line_section' || record.display_type.raw_value === 'line_note'">
+ <div class="row">
+ <div class="col-12">
+ <span>
+ <t t-esc="record.name.value"/>
+ </span>
+ </div>
+ </div>
+ </t>
+ </div>
+ </t>
+ </templates>
+ </kanban>
+ </field>
+ <group name="note_group" col="6" class="mt-2 mt-md-0">
+ <group colspan="4">
+ <field name="note" nolabel="1" placeholder="Terms and conditions..."/>
+ </group>
+ <group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total">
+ <field name="amount_untaxed" widget='monetary' options="{'currency_field': 'currency_id'}"/>
+ <field name="amount_tax" widget='monetary' options="{'currency_field': 'currency_id'}"/>
+ <div class="oe_subtotal_footer_separator oe_inline o_td_label">
+ <label for="amount_total" />
+ </div>
+ <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"/>
+ </group>
+ <div class="oe_clear"/>
+ </group>
+ </page>
+ <page string="Other Info" name="other_information">
+ <group>
+ <group name="sales_person" string="Sales">
+ <field name="user_id" domain="[('share', '=', False)]" widget="many2one_avatar_user"/>
+ <field name="team_id" kanban_view_ref="%(sales_team.crm_team_view_kanban)s" options="{'no_create': True}"/>
+ <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
+ <field name="require_signature"/>
+ <field name="require_payment"/>
+ <field name="reference" readonly="1" attrs="{'invisible': [('reference', '=', False)]}"/>
+ <field name="client_order_ref"/>
+ <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
+ </group>
+ <group name="sale_info" string="Invoicing">
+ <field name="fiscal_position_id" options="{'no_create': True}"/>
+ <field name="analytic_account_id" context="{'default_partner_id':partner_invoice_id, 'default_name':name}" attrs="{'readonly': [('invoice_count','!=',0),('state','=','sale')]}" groups="analytic.group_analytic_accounting" force_save="1"/>
+ <field name="invoice_status" states="sale,done" groups="base.group_no_one"/>
+ </group>
+ </group>
+ <group>
+ <group name="sale_shipping">
+ <label for="commitment_date" string="Delivery Date"/>
+ <div name="commitment_date_div" class="o_row">
+ <field name="commitment_date"/>
+ <span name="expected_date_span" class="text-muted">Expected: <field name="expected_date" widget="date"/></span>
+ </div>
+ </group>
+ <group string="Reporting" name="sale_reporting" groups="base.group_no_one">
+ <group name="technical" colspan="2" class="mb-0">
+ <field name="origin"/>
+ </group>
+ <group name="utm_link" colspan="2" class="mt-0">
+ <field name="campaign_id"/>
+ <field name="medium_id"/>
+ <field name="source_id"/>
+ </group>
+ </group>
+ </group>
+ </page>
+ <page groups="base.group_no_one" string="Customer Signature" name="customer_signature" attrs="{'invisible': [('require_signature', '=', False), ('signed_by', '=', False), ('signature', '=', False), ('signed_on', '=', False)]}">
+ <group>
+ <field name="signed_by"/>
+ <field name="signed_on"/>
+ <field name="signature" widget="image"/>
+ </group>
+ </page>
+ </notebook>
+ </sheet>
+ <div class="oe_chatter">
+ <field name="message_follower_ids"/>
+ <field name="activity_ids"/>
+ <field name="message_ids"/>
+ </div>
+ </form>
+ </field>
+ </record>
+
+ <record id="view_sales_order_auto_done_setting" model="ir.ui.view">
+ <field name="name">sale.order.form</field>
+ <field name="model">sale.order</field>
+ <field name="inherit_id" ref="sale.view_order_form"/>
+ <field name="groups_id" eval="[(4, ref('sale.group_auto_done_setting'))]"/>
+ <field name="arch" type="xml">
+ <xpath expr="//form//header//button[@name='action_draft']" position="after">
+ <button name="action_done" type="object" string="Lock" states="sale"
+ help="If the sale is locked, you can not modify it anymore. However, you will still be able to invoice or deliver." groups="sales_team.group_sale_manager"/>
+ <button name="action_unlock" type="object" string="Unlock" states="done" groups="sales_team.group_sale_manager"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_sales_order_filter" model="ir.ui.view">
+ <field name="name">sale.order.list.select</field>
+ <field name="model">sale.order</field>
+ <field name="priority" eval="15"/>
+ <field name="arch" type="xml">
+ <search string="Search Sales Order">
+ <field name="name" string="Order" filter_domain="['|', '|', ('name', 'ilike', self), ('client_order_ref', 'ilike', self), ('partner_id', 'child_of', self)]"/>
+ <field name="partner_id" operator="child_of"/>
+ <field name="user_id"/>
+ <field name="team_id" string="Sales Team"/>
+ <field name="order_line" string="Product" filter_domain="[('order_line.product_id', 'ilike', self)]"/>
+ <field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
+ <!-- We only allow to search on the following sale order line fields (product, name) because the other fields, such as price, quantity, ...
+ will not be searched as often, and if they need to be searched it's usually in the context of products
+ and then they can be searched from the page listing the sale order lines related to a product (from the product itself).
+ -->
+ <filter string="My Orders" domain="[('user_id', '=', uid)]" name="my_sale_orders_filter"/>
+ <filter invisible="1" string="Late Activities" name="activities_overdue"
+ domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
+ help="Show all records which has next action date is before today"/>
+ <filter invisible="1" string="Today Activities" name="activities_today"
+ domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
+ <filter invisible="1" string="Future Activities" name="activities_upcoming_all"
+ domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
+ <group expand="0" string="Group By">
+ <filter string="Salesperson" name="salesperson" domain="[]" context="{'group_by': 'user_id'}"/>
+ <filter name="customer" string="Customer" domain="[]" context="{'group_by': 'partner_id'}"/>
+ <filter string="Order Date" name="order_month" domain="[]" context="{'group_by': 'date_order'}"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id="sale_order_view_search_inherit_quotation" model="ir.ui.view">
+ <field name="name">sale.order.search.inherit.quotation</field>
+ <field name="model">sale.order</field>
+ <field name="mode">primary</field>
+ <field name="inherit_id" ref="sale.view_sales_order_filter"/>
+ <field name="arch" type="xml">
+ <xpath expr="//filter[@name='my_sale_orders_filter']" position="replace">
+ <field name="campaign_id"/>
+ <separator/>
+ <filter string="My Quotations" name="my_quotation" domain="[('user_id', '=', uid)]"/>
+ <separator/>
+ <filter string="Quotations" name="draft" domain="[('state','in',('draft', 'sent'))]"/>
+ <filter string="Sales Orders" name="sales" domain="[('state','in',('sale','done'))]"/>
+ <separator/>
+ <filter string="Create Date" name="filter_create_date" date="create_date"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="sale_order_view_search_inherit_sale" model="ir.ui.view">
+ <field name="name">sale.order.search.inherit.sale</field>
+ <field name="model">sale.order</field>
+ <field name="mode">primary</field>
+ <field name="inherit_id" ref="sale.view_sales_order_filter"/>
+ <field name="arch" type="xml">
+ <xpath expr="//filter[@name='my_sale_orders_filter']" position="after">
+ <separator/>
+ <filter string="To Invoice" name="to_invoice" domain="[('invoice_status','=','to invoice')]" />
+ <filter string="To Upsell" name="upselling" domain="[('invoice_status','=','upselling')]" />
+ <separator/>
+ <filter string="Order Date" name="order_date" date="date_order"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="action_orders" model="ir.actions.act_window">
+ <field name="name">Sales Orders</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">sale.order</field>
+ <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
+ <field name="search_view_id" ref="sale_order_view_search_inherit_sale"/>
+ <field name="context">{}</field>
+ <field name="domain">[('state', 'not in', ('draft', 'sent', 'cancel'))]</field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Create a new quotation, the first step of a new sale!
+ </p><p>
+ Once the quotation is confirmed, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
+ </p>
+ </field>
+ </record>
+
+ <record id="sale_order_action_view_order_tree" model="ir.actions.act_window.view">
+ <field name="sequence" eval="1"/>
+ <field name="view_mode">tree</field>
+ <field name="view_id" ref="sale.view_order_tree"/>
+ <field name="act_window_id" ref="action_orders"/>
+ </record>
+
+ <record id="sale_order_action_view_order_kanban" model="ir.actions.act_window.view">
+ <field name="sequence" eval="2"/>
+ <field name="view_mode">kanban</field>
+ <field name="view_id" ref="sale.view_sale_order_kanban"/>
+ <field name="act_window_id" ref="action_orders"/>
+ </record>
+
+ <record id="sale_order_action_view_order_form" model="ir.actions.act_window.view">
+ <field name="sequence" eval="3"/>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="sale.view_order_form"/>
+ <field name="act_window_id" ref="action_orders"/>
+ </record>
+
+ <record id="sale_order_action_view_order_calendar" model="ir.actions.act_window.view">
+ <field name="sequence" eval="4"/>
+ <field name="view_mode">calendar</field>
+ <field name="view_id" ref="sale.view_sale_order_calendar"/>
+ <field name="act_window_id" ref="action_orders"/>
+ </record>
+
+ <record id="sale_order_action_view_order_pivot" model="ir.actions.act_window.view">
+ <field name="sequence" eval="5"/>
+ <field name="view_mode">pivot</field>
+ <field name="view_id" ref="sale.view_sale_order_pivot"/>
+ <field name="act_window_id" ref="action_orders"/>
+ </record>
+
+ <record id="sale_order_action_view_order_graph" model="ir.actions.act_window.view">
+ <field name="sequence" eval="6"/>
+ <field name="view_mode">graph</field>
+ <field name="view_id" ref="sale.view_sale_order_graph"/>
+ <field name="act_window_id" ref="action_orders"/>
+ </record>
+
+ <menuitem id="menu_sale_order"
+ name="Orders"
+ action="action_orders"
+ parent="sale_order_menu"
+ sequence="2" groups="sales_team.group_sale_salesman"/>
+
+ <record id="action_orders_to_invoice" model="ir.actions.act_window">
+ <field name="name">Orders to Invoice</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">sale.order</field>
+ <field name="view_mode">tree,form,calendar,graph,pivot,kanban,activity</field>
+ <field name="context">{'create': False}</field>
+ <field name="domain">[('invoice_status','=','to invoice')]</field>
+ <field name="search_view_id" ref="view_sales_order_filter"/>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ No orders to invoice found
+ </p><p>
+ You can select all orders and invoice them in batch,<br/>
+ or check every order and invoice them one by one.
+ </p>
+ </field>
+ </record>
+
+ <record id="model_sale_order_action_quotation_sent" model="ir.actions.server">
+ <field name="name">Mark Quotation as Sent</field>
+ <field name="model_id" ref="sale.model_sale_order"/>
+ <field name="binding_model_id" ref="sale.model_sale_order"/>
+ <field name="binding_view_types">form,list</field>
+ <field name="state">code</field>
+ <field name="code">action = records.action_quotation_sent()</field>
+ </record>
+
+ <menuitem id="menu_sale_invoicing"
+ name="To Invoice"
+ parent="sale_menu_root"
+ sequence="3" groups="sales_team.group_sale_salesman"/>
+
+ <menuitem id="menu_sale_order_invoice"
+ action="action_orders_to_invoice"
+ parent="sale.menu_sale_invoicing"
+ sequence="2" active="False"/>
+
+ <record id="action_orders_upselling" model="ir.actions.act_window">
+ <field name="name">Orders to Upsell</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">sale.order</field>
+ <field name="view_mode">tree,form,calendar,graph,pivot,kanban,activity</field>
+ <field name="domain">[('invoice_status','=','upselling')]</field>
+ <field name="context">{'create': False}</field>
+ <field name="search_view_id" ref="view_sales_order_filter"/>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ No orders to upsell found.
+ </p><p>
+ An order is to upsell when delivered quantities are above initially
+ ordered quantities, and the invoicing policy is based on ordered quantities.
+ </p><p>
+ As an example, if you sell pre-paid hours of services, Odoo recommends you
+ to sell extra hours when all ordered hours have been consumed.
+ </p>
+ </field>
+ </record>
+ <menuitem action="action_orders_upselling"
+ id="menu_sale_order_upselling" parent="sale.menu_sale_invoicing"
+ sequence="5" active="False"/>
+
+
+ <record id="action_quotations_with_onboarding" model="ir.actions.act_window">
+ <field name="name">Quotations</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">sale.order</field>
+ <field name="view_id" ref="view_quotation_tree_with_onboarding"/>
+ <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
+ <field name="search_view_id" ref="sale_order_view_search_inherit_quotation"/>
+ <field name="context">{'search_default_my_quotation': 1}</field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Create a new quotation, the first step of a new sale!
+ </p><p>
+ Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
+ </p>
+ </field>
+ </record>
+
+ <record id="action_quotations" model="ir.actions.act_window">
+ <field name="name">Quotations</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">sale.order</field>
+ <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
+ <field name="search_view_id" ref="sale_order_view_search_inherit_quotation"/>
+ <field name="context">{'search_default_my_quotation': 1}</field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Create a new quotation, the first step of a new sale!
+ </p><p>
+ Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
+ </p>
+ </field>
+ </record>
+
+ <record id="sale_order_action_view_quotation_tree" model="ir.actions.act_window.view">
+ <field name="sequence" eval="1"/>
+ <field name="view_mode">tree</field>
+ <field name="view_id" ref="sale.view_quotation_tree"/>
+ <field name="act_window_id" ref="action_quotations"/>
+ </record>
+
+ <record id="sale_order_action_view_quotation_kanban" model="ir.actions.act_window.view">
+ <field name="sequence" eval="2"/>
+ <field name="view_mode">kanban</field>
+ <field name="view_id" ref="sale.view_sale_order_kanban"/>
+ <field name="act_window_id" ref="action_quotations"/>
+ </record>
+
+ <record id="sale_order_action_view_quotation_form" model="ir.actions.act_window.view">
+ <field name="sequence" eval="3"/>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="sale.view_order_form"/>
+ <field name="act_window_id" ref="action_quotations"/>
+ </record>
+
+ <record id="sale_order_action_view_quotation_calendar" model="ir.actions.act_window.view">
+ <field name="sequence" eval="4"/>
+ <field name="view_mode">calendar</field>
+ <field name="view_id" ref="sale.view_sale_order_calendar"/>
+ <field name="act_window_id" ref="action_quotations"/>
+ </record>
+
+ <record id="sale_order_action_view_quotation_pivot" model="ir.actions.act_window.view">
+ <field name="sequence" eval="5"/>
+ <field name="view_mode">pivot</field>
+ <field name="view_id" ref="sale.view_sale_order_pivot"/>
+ <field name="act_window_id" ref="action_quotations"/>
+ </record>
+
+ <record id="sale_order_action_view_quotation_graph" model="ir.actions.act_window.view">
+ <field name="sequence" eval="6"/>
+ <field name="view_mode">graph</field>
+ <field name="view_id" ref="sale.view_sale_order_graph"/>
+ <field name="act_window_id" ref="action_quotations"/>
+ </record>
+
+ <menuitem id="menu_sale_quotations"
+ action="action_quotations_with_onboarding"
+ parent="sale_order_menu"
+ sequence="1" groups="sales_team.group_sale_salesman"/>
+
+ <record id="view_order_line_tree" model="ir.ui.view">
+ <field name="name">sale.order.line.tree</field>
+ <field name="model">sale.order.line</field>
+ <field name="arch" type="xml">
+ <tree string="Sales Order Lines" create="false">
+ <field name="order_id"/>
+ <field name="order_partner_id"/>
+ <field name="name"/>
+ <field name="salesman_id"/>
+ <field name="product_uom_qty" string="Qty"/>
+ <field name="qty_delivered"/>
+ <field name="qty_invoiced"/>
+ <field name="qty_to_invoice"/>
+ <field name="product_uom" string="Unit of Measure" groups="uom.group_uom"/>
+ <field name="price_subtotal" sum="Total" widget="monetary"/>
+ <field name="currency_id" invisible="1"/>
+ </tree>
+ </field>
+ </record>
+
+ <record id="sale_order_line_view_form_readonly" model="ir.ui.view">
+ <field name="name">sale.order.line.form.readonly</field>
+ <field name="model">sale.order.line</field>
+ <field name="arch" type="xml">
+ <form string="Sales Order Item">
+ <sheet>
+ <div class="oe_title">
+ <h1>
+ <field name="display_name" readonly="1"/>
+ </h1>
+ </div>
+ <group>
+ <group>
+ <field name="order_id" readonly="1"/>
+ <field name="product_id" readonly="1"/>
+ <field name="name" readonly="1"/>
+ <field name="product_uom_qty" readonly="1"/>
+ <field name="qty_delivered" readonly="1"/>
+ <field name="qty_invoiced"/>
+ <field name="product_uom" readonly="1"/>
+ <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
+ <field name="order_partner_id" invisible="1"/>
+ <field name="display_type" invisible="1"/>
+ <field name="product_updatable" invisible="1"/>
+ </group>
+ <group>
+ <field name="price_unit" readonly="1"/>
+ <field name="discount" groups="product.group_discount_per_so_line" readonly="1"/>
+ <field name="price_subtotal" widget="monetary"/>
+ <field name="tax_id" widget="many2many_tags" readonly="1"/>
+ <field name="price_tax" widget="monetary"/>
+ <field name="price_total" widget="monetary"/>
+ <field name="currency_id" invisible="1"/>
+ </group>
+ </group>
+ </sheet>
+ </form>
+ </field>
+ </record>
+
+ <record id="view_sales_order_line_filter" model="ir.ui.view">
+ <field name="name">sale.order.line.select</field>
+ <field name="model">sale.order.line</field>
+ <field name="arch" type="xml">
+ <search string="Search Sales Order">
+ <filter string="To Invoice" name="to_invoice" domain="[('qty_to_invoice','!=', 0)]" help="Sales Order Lines ready to be invoiced"/>
+ <separator/>
+ <filter string="My Sales Order Lines" name="my_sales_order_lines" domain="[('salesman_id','=',uid)]" help="Sales Order Lines related to a Sales Order of mine"/>
+ <field name="order_id"/>
+ <field name="order_partner_id" operator="child_of"/>
+ <field name="product_id"/>
+ <field name="salesman_id"/>
+ <group expand="0" string="Group By">
+ <filter string="Product" name="product" domain="[]" context="{'group_by':'product_id'}"/>
+ <filter string="Order" name="order" domain="[]" context="{'group_by':'order_id'}"/>
+ <filter string="Salesperson" name="salesperson" domain="[]" context="{'group_by':'salesman_id'}"/>
+ </group>
+ </search>
+ </field>
+ </record>
+
+ <record id="sale_order_line_view_kanban" model="ir.ui.view">
+ <field name="name">sale.order.line.kanban</field>
+ <field name="model">sale.order.line</field>
+ <field name="arch" type="xml">
+ <kanban class="o_kanban_mobile">
+ <templates>
+ <t t-name="kanban-box">
+ <div class="oe_kanban_content oe_kanban_global_click">
+ <div class="row">
+ <div class="col-12">
+ <field name="display_name"/>
+ </div>
+ </div>
+ </div>
+ </t>
+ </templates>
+ </kanban>
+ </field>
+ </record>
+
+ <record model="ir.ui.view" id="product_form_view_sale_order_button">
+ <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="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
+ <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" groups="sales_team.group_sale_salesman" help="Sold in the last 365 days" attrs="{'invisible': [('sale_ok', '=', False)]}">
+ <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>
+ </div>
+ <group name="description" position="after">
+ <group string="Warning when Selling this Product" groups="sale.group_warning_sale">
+ <field name="sale_line_warn" nolabel="1"/>
+ <field name="sale_line_warn_msg" colspan="3" nolabel="1"
+ attrs="{'required':[('sale_line_warn','!=','no-message')],'readonly':[('sale_line_warn','=','no-message')]}"/>
+ </group>
+ </group>
+ </field>
+ </record>
+
+ <record model="ir.ui.view" id="product_template_form_view_sale_order_button">
+ <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="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
+ <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" groups="sales_team.group_sale_salesman" help="Sold in the last 365 days" attrs="{'invisible': [('sale_ok', '=', False)]}">
+ <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>
+ </div>
+ <group name="description" position="after">
+ <group string="Warning when Selling this Product" groups="sale.group_warning_sale">
+ <field name="sale_line_warn" nolabel="1"/>
+ <field name="sale_line_warn_msg" colspan="3" nolabel="1"
+ attrs="{'required':[('sale_line_warn','!=','no-message')],'readonly':[('sale_line_warn','=','no-message')], 'invisible':[('sale_line_warn','=','no-message')]}"/>
+ </group>
+ </group>
+ </field>
+ </record>
+
+ <record model="ir.ui.view" id="product_template_form_view_invoice_policy">
+ <field name="name">product.template.invoice.policy</field>
+ <field name="model">product.template</field>
+ <field name="priority">15</field>
+ <field name="inherit_id" ref="product.product_template_form_view"/>
+ <field name="arch" type="xml">
+ <xpath expr="//page[@name='sales']//group[@name='sale']" position="inside">
+ <group string="Invoicing" name="invoicing" invisible="1">
+ <field name="invoice_policy" widget="radio"/>
+ <field name="service_type" widget="radio" invisible="True"/>
+ <field name="visible_expense_policy" invisible="1"/>
+ <field name="expense_policy" widget="radio" attrs="{'invisible': [('visible_expense_policy', '=', False)]}"/>
+ </group>
+ </xpath>
+ </field>
+ </record>
+
+ <!-- Update account invoice search view!-->
+ <record id="account_invoice_groupby_inherit" model="ir.ui.view">
+ <field name="name">account.move.groupby</field>
+ <field name="model">account.move</field>
+ <field name="inherit_id" ref="account.view_account_invoice_filter"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='invoice_user_id']" position="after">
+ <field name="team_id"/>
+ </xpath>
+ <xpath expr="//group/filter[@name='status']" position="after">
+ <filter string="Sales Team" name="sales_channel" domain="[]" context="{'group_by':'team_id'}"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="account_invoice_view_tree" model="ir.ui.view">
+ <field name="name">account.move.tree.inherit.sale</field>
+ <field name="model">account.move</field>
+ <field name="inherit_id" ref="account.view_invoice_tree"/>
+ <field name="arch" type="xml">
+ <field name="invoice_user_id" position="after">
+ <field name="team_id" invisible="context.get('default_move_type') not in ('out_invoice', 'out_refund','out_receipt')" optional="hide"/>
+ </field>
+ </field>
+ </record>
+
+ <!-- Update account invoice !-->
+ <record model="ir.ui.view" id="account_invoice_form">
+ <field name="name">Account Invoice</field>
+ <field name="model">account.move</field>
+ <field name="inherit_id" ref="account.view_move_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//field[@name='partner_id']" position="after">
+ <field name="partner_shipping_id"
+ groups="sale.group_delivery_invoice_address"
+ attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund'))]}"/>
+ </xpath>
+ <xpath expr="//field[@name='invoice_line_ids']//field[@name='discount']" position="attributes">
+ <attribute name="groups">product.group_discount_per_so_line</attribute>
+ </xpath>
+ <xpath expr="//group[@name='sale_info_group']/field[@name='invoice_user_id']" position="after">
+ <field name="team_id" kanban_view_ref="%(sales_team.crm_team_view_kanban)s"/>
+ </xpath>
+ <xpath expr="//group[@id='other_tab_group']" position="inside">
+ <group string="Marketing"
+ name="utm_link"
+ groups="base.group_no_one"
+ attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}">
+ <field name="campaign_id"/>
+ <field name="medium_id"/>
+ <field name="source_id"/>
+ </group>
+ </xpath>
+ </data>
+ </field>
+ </record>
+
+ <!-- search by Salesteams -->
+ <record id="action_orders_salesteams" model="ir.actions.act_window">
+ <field name="name">Sales Orders</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">sale.order</field>
+ <field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
+ <field name="search_view_id" ref="sale.sale_order_view_search_inherit_sale"/>
+ <field name="domain">[('state','not in',('draft','sent','cancel'))]</field>
+ <field name="context">{
+ 'search_default_team_id': [active_id],
+ 'default_team_id': active_id,
+ }
+ </field>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Create a new quotation, the first step of a new sale!
+ </p><p>
+ Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
+ </p>
+ </field>
+ </record>
+ <record id="action_orders_to_invoice_salesteams" model="ir.actions.act_window">
+ <field name="name">Sales Orders</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">sale.order</field>
+ <field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
+ <field name="search_view_id" ref="sale.sale_order_view_search_inherit_sale"/>
+ <field name="domain">[('invoice_status','=','to invoice')]</field>
+ <field name="context">{
+ 'search_default_team_id': [active_id],
+ 'default_team_id': active_id,
+ }
+ </field>
+ </record>
+ <record id="action_quotations_salesteams" model="ir.actions.act_window">
+ <field name="name">Quotations</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">sale.order</field>
+ <field name="view_id" ref="sale.view_quotation_tree"/>
+ <field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
+ <field name="context">{
+ 'search_default_team_id': [active_id],
+ 'default_team_id': active_id,
+ 'show_address': 1,
+ }
+ </field>
+ <field name="domain">[]</field>
+ <field name="search_view_id" ref="sale.sale_order_view_search_inherit_quotation"/>
+ <field name="help" type="html">
+ <p class="o_view_nocontent_smiling_face">
+ Create a new quotation, the first step of a new sale!
+ </p><p>
+ Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
+ </p>
+ </field>
+ </record>
+ <record id="action_invoice_salesteams" model="ir.actions.act_window">
+ <field name="name">Invoices</field>
+ <field name="res_model">account.move</field>
+ <field name="view_mode">tree,form,kanban</field>
+ <field name="view_id" ref="account.view_move_tree"/>
+ <field name="domain">[
+ ('state', '=', 'posted'),
+ ('move_type', 'in', ['out_invoice', 'out_refund'])]</field>
+ <field name="context">{
+ 'search_default_team_id': [active_id],
+ 'default_team_id': active_id,
+ 'default_move_type':'out_invoice',
+ 'move_type':'out_invoice',
+ 'journal_type': 'sale',
+ }
+ </field>
+ <field name="search_view_id" ref="account.view_account_invoice_filter"/>
+ </record>
+
+ <record id="action_invoice_salesteams_view_tree" model="ir.actions.act_window.view">
+ <field name="sequence">1</field>
+ <field name="view_mode">tree</field>
+ <field name="act_window_id" ref="sale.action_invoice_salesteams"/>
+ </record>
+
+ <record id="action_invoice_salesteams_view_form" model="ir.actions.act_window.view">
+ <field name="sequence">2</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="account.view_move_form"/>
+ <field name="act_window_id" ref="sale.action_invoice_salesteams"/>
+ </record>
+
+ <record id="action_order_report_quotation_salesteam" model="ir.actions.act_window">
+ <field name="name">Quotations Analysis</field>
+ <field name="res_model">sale.report</field>
+ <field name="view_mode">graph</field>
+ <field name="domain">[('state','=','draft'),('team_id', '=', active_id)]</field>
+ <field name="context">{'search_default_order_month':1}</field>
+ <field name="help">This report performs analysis on your quotations. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application.</field>
+ </record>
+
+ <record id="action_order_report_so_salesteam" model="ir.actions.act_window">
+ <field name="name">Sales Analysis</field>
+ <field name="res_model">sale.report</field>
+ <field name="view_mode">graph</field>
+ <field name="domain">[('state','not in',('draft','cancel'))]</field>
+ <field name="context">{
+ 'search_default_Sales': 1,
+ 'search_default_filter_date': 1,
+ 'search_default_team_id': [active_id]}</field>
+ <field name="help">This report performs analysis on your sales orders. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application.</field>
+ </record>
+
+ <record id="action_account_invoice_report_salesteam" model="ir.actions.act_window">
+ <field name="name">Invoices Analysis</field>
+ <field name="res_model">account.invoice.report</field>
+ <field name="view_mode">graph</field>
+ <field name="domain">[('state', 'not in', ['draft', 'cancel'])]</field>
+ <field name="context">{'search_default_month':1, 'search_default_team_id': [active_id]}</field>
+ <field name="help">From this report, you can have an overview of the amount invoiced to your customer. The search tool can also be used to personalise your Invoices reports and so, match this analysis to your needs.</field>
+ </record>
+</odoo>
diff --git a/addons/sale/views/sales_team_views.xml b/addons/sale/views/sales_team_views.xml
new file mode 100644
index 00000000..0941082b
--- /dev/null
+++ b/addons/sale/views/sales_team_views.xml
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <record id="crm_team_salesteams_view_form" model="ir.ui.view">
+ <field name="name">crm.team.form</field>
+ <field name="model">crm.team</field>
+ <field name="priority">9</field>
+ <field name="inherit_id" ref="sales_team.crm_team_view_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//div[@name='options_active']" position="inside">
+ <div class="o_row" style="display:inherit">
+ <field name="use_quotations"/><label for="use_quotations"/>
+ </div>
+ </xpath>
+ <xpath expr="//group[@name='right']" position="inside">
+ <field name="invoiced_target" widget="monetary"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_account_invoice_report_search_inherit" model="ir.ui.view">
+ <field name="name">account.invoice.report.search.inherit</field>
+ <field name="model">account.invoice.report</field>
+ <field name="inherit_id" ref="account.view_account_invoice_report_search"/>
+ <field name="arch" type="xml">
+ <xpath expr="//group/filter[@name='user']" position="after">
+ <filter string="Sales Team" name="sales_channel" domain="[]" context="{'group_by':'team_id'}"/>
+ </xpath>
+ <xpath expr="//field[@name='invoice_user_id']" position="after">
+ <field name="team_id"/>
+ </xpath>
+ </field>
+ </record>
+
+ <!-- Sales Team Dashboard Views -->
+ <record id="action_quotation_form" model="ir.actions.act_window">
+ <field name="name">New Quotation</field>
+ <field name="res_model">sale.order</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="view_mode">form</field>
+ <field name="context">{
+ 'search_default_team_id': [active_id],
+ 'default_team_id': active_id,
+ 'default_user_id': uid,
+ }
+ </field>
+ <field name="search_view_id" ref="sale_order_view_search_inherit_quotation"/>
+ </record>
+
+ <record id="crm_team_salesteams_view_kanban" model="ir.ui.view">
+ <field name="name">crm.team.kanban</field>
+ <field name="model">crm.team</field>
+ <field name="inherit_id" ref="sales_team.crm_team_salesteams_view_kanban"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="//templates" position="before">
+ <field name="use_quotations"/>
+ <field name="invoiced_target"/>
+ </xpath>
+
+ <xpath expr="//t[@name='second_options']" position="after">
+ <div class="row" t-if="record.quotations_count.raw_value">
+ <div class="col-8">
+ <a name="%(action_quotations_salesteams)d" type="action" context="{'search_default_draft': True, 'search_default_sent': True}">
+ <field name="quotations_count"/>
+ <t t-if="record.quotations_count.raw_value == 1">Quotation</t>
+ <t t-else="">Quotations</t>
+ </a>
+ </div>
+ <div class="col-4 text-right text-truncate">
+ <field name="quotations_amount" widget="monetary"/>
+ </div>
+ </div>
+ <div class="row" name="orders_to_invoice" t-if="record.sales_to_invoice_count.raw_value">
+ <div class="col-8">
+ <a name="%(action_orders_to_invoice_salesteams)d" type="action">
+ <field name="sales_to_invoice_count"/>
+ <t t-if="record.sales_to_invoice_count.raw_value == 1">Order to Invoice</t>
+ <t t-else="">Orders to Invoice</t>
+ </a>
+ </div>
+ </div>
+ </xpath>
+
+ <xpath expr="//div[hasclass('bottom_block')]" position="inside">
+ <t groups="sales_team.group_sale_manager">
+ <t t-if="record.invoiced_target.raw_value" class="col-12 o_kanban_primary_bottom">
+ <field name="invoiced" widget="progressbar" title="Invoicing" options="{'current_value': 'invoiced', 'max_value': 'invoiced_target', 'editable': true, 'edit_max_value': true, 'on_change': 'update_invoiced_target'}"/>
+ </t>
+ <t t-if="!record.invoiced_target.raw_value" class="col-12 o_kanban_primary_bottom text-center">
+ <a href="#" class="sales_team_target_definition o_inline_link">Click to define an invoicing target</a>
+ </t>
+ </t>
+ </xpath>
+
+ <xpath expr="//div[hasclass('o_kanban_manage_view')]" position="inside">
+ <div t-if="record.use_quotations.raw_value">
+ <a name="%(action_quotations_salesteams)d" type="action" class="o_quotation_view_button">Quotations</a>
+ </div>
+ <div>
+ <a name="%(action_orders_salesteams)d" type="action">Sales Orders</a>
+ </div>
+ <div groups="account.group_account_invoice">
+ <a name="%(action_invoice_salesteams)d" type="action">Invoices</a>
+ </div>
+ </xpath>
+
+ <xpath expr="//div[hasclass('o_kanban_manage_new')]" position="inside">
+ <div t-if="record.use_quotations.raw_value">
+ <a name="%(action_quotation_form)d" type="action">
+ Quotation
+ </a>
+ </div>
+ </xpath>
+
+ <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside">
+ <div name="sales_report">
+ <a name="%(action_order_report_so_salesteam)d" type="action">
+ Sales
+ </a>
+ </div>
+ <div groups="account.group_account_invoice" name="invoices_report">
+ <a name="%(action_account_invoice_report_salesteam)d" type="action">
+ Invoices
+ </a>
+ </div>
+ </xpath>
+
+ </data>
+ </field>
+ </record>
+
+ <record id="sales_team.mail_activity_type_action_config_sales" model="ir.actions.act_window">
+ <field name="domain">['|', ('res_model_id', '=', False), ('res_model_id.model', 'in', ['sale.order', 'res.partner', 'product.template', 'product.product'])]</field>
+ </record>
+
+</odoo>
diff --git a/addons/sale/views/utm_campaign_views.xml b/addons/sale/views/utm_campaign_views.xml
new file mode 100644
index 00000000..62eace8d
--- /dev/null
+++ b/addons/sale/views/utm_campaign_views.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+<record model="ir.ui.view" id="utm_campaign_view_kanban">
+ <field name="name">utm.campaign.view.kanban</field>
+ <field name="model">utm.campaign</field>
+ <field name="inherit_id" ref="utm.utm_campaign_view_kanban"/>
+ <field name="arch" type="xml">
+ <xpath expr="//div[@id='utm_statistics']" position="inside">
+ <div class="mr-3" title="Revenues">
+ <field name="currency_id" invisible="True"/>
+ <small class="font-weight-bold">
+ <field name="invoiced_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
+ </small>
+ </div>
+ <div class="mr-3" title="Quotations">
+ <i class="fa fa-money text-muted"></i>
+ <small class="font-weight-bold">
+ <field name="quotation_count"/>
+ </small>
+ </div>
+ </xpath>
+ </field>
+</record>
+
+<record model="ir.ui.view" id="utm_campaign_view_form">
+ <field name="name">utm.campaign.view.form</field>
+ <field name="model">utm.campaign</field>
+ <field name="inherit_id" ref="utm.utm_campaign_view_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//div[hasclass('oe_button_box')]" position="inside">
+ <button name="action_redirect_to_invoiced"
+ type="object" class="oe_stat_button order-1" icon="fa-usd">
+ <field name="invoiced_amount" widget="statinfo" string="Revenues"/>
+ </button>
+ <button name="action_redirect_to_quotations"
+ type="object" class="oe_stat_button order-2" icon="fa-money">
+ <field name="quotation_count" widget="statinfo" string="Quotations"/>
+ </button>
+ </xpath>
+ </field>
+</record>
+</odoo>
diff --git a/addons/sale/views/variant_templates.xml b/addons/sale/views/variant_templates.xml
new file mode 100644
index 00000000..53f46c58
--- /dev/null
+++ b/addons/sale/views/variant_templates.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <template id="variants">
+ <t t-set="attribute_exclusions" t-value="product._get_attribute_exclusions(parent_combination, parent_name)"/>
+ <ul t-attf-class="list-unstyled js_add_cart_variants #{ul_class}" t-att-data-attribute_exclusions="json.dumps(attribute_exclusions)">
+ <t t-foreach="product.valid_product_template_attribute_line_ids" t-as="ptal">
+ <!-- Attributes selection is hidden if there is only one value available and it's not a custom value -->
+ <li t-att-data-attribute_id="ptal.attribute_id.id"
+ t-att-data-attribute_name="ptal.attribute_id.name"
+ t-attf-class="variant_attribute #{'d-none' if len(ptal.product_template_value_ids._only_active()) == 1 and not ptal.product_template_value_ids._only_active()[0].is_custom else ''}">
+
+ <!-- Used to customize layout if the only available attribute value is custom -->
+ <t t-set="single" t-value="len(ptal.product_template_value_ids._only_active()) == 1"/>
+ <t t-set="single_and_custom" t-value="single and ptal.product_template_value_ids._only_active()[0].is_custom" />
+ <strong t-field="ptal.attribute_id.name" class="attribute_name"/>
+
+ <t t-if="ptal.attribute_id.display_type == 'select'">
+ <select
+ t-att-data-attribute_id="ptal.attribute_id.id"
+ t-attf-class="form-control js_variant_change #{ptal.attribute_id.create_variant} #{'d-none' if single_and_custom else ''}"
+ t-att-name="'ptal-%s' % ptal.id">
+ <t t-foreach="ptal.product_template_value_ids._only_active()" t-as="ptav">
+ <option t-att-value="ptav.id"
+ t-att-data-value_id="ptav.id"
+ t-att-data-value_name="ptav.name"
+ t-att-data-attribute_name="ptav.attribute_id.name"
+ t-att-data-is_custom="ptav.is_custom"
+ t-att-selected="ptav in combination"
+ t-att-data-is_single="single"
+ t-att-data-is_single_and_custom="single_and_custom">
+ <span t-field="ptav.name"/>
+ <span t-if="ptav.price_extra" class="badge badge-pill badge-secondary">
+ <!--
+ price_extra is displayed as catalog price instead of
+ price after pricelist because it is impossible to
+ compute. Indeed, the pricelist rule might depend on the
+ selected variant, so the price_extra will be different
+ depending on the selected combination. The price of an
+ attribute is therefore variable and it's not very
+ accurate to display it.
+ -->
+ <t t-esc="ptav.price_extra > 0 and '+' or '-'"/>
+ <span t-esc="abs(ptav.price_extra)" class="variant_price_extra" style="white-space: nowrap;"
+ t-options='{
+ "widget": "monetary",
+ "from_currency": product.currency_id,
+ "display_currency": (pricelist or product).currency_id
+ }'/>
+ </span>
+ </option>
+ </t>
+ </select>
+ </t>
+
+ <t t-if="ptal.attribute_id.display_type == 'radio'">
+ <ul t-att-data-attribute_id="ptal.attribute_id.id" t-attf-class="list-unstyled #{'d-none' if single_and_custom else ''}">
+ <t t-foreach="ptal.product_template_value_ids._only_active()" t-as="ptav">
+ <li class="form-group js_attribute_value" style="margin: 0;">
+ <label class="col-form-label">
+ <div>
+ <input type="radio"
+ t-attf-class="js_variant_change radio_input #{ptal.attribute_id.create_variant}"
+ t-att-checked="ptav in combination"
+ t-att-name="'ptal-%s' % ptal.id"
+ t-att-value="ptav.id"
+ t-att-data-value_id="ptav.id"
+ t-att-data-value_name="ptav.name"
+ t-att-data-attribute_name="ptav.attribute_id.name"
+ t-att-data-is_custom="ptav.is_custom"
+ t-att-data-is_single="single"
+ t-att-data-is_single_and_custom="single_and_custom" />
+ <div class="radio_input_value">
+ <span t-field="ptav.name"/>
+ <span class="badge badge-pill badge-secondary" t-if="ptav.price_extra">
+ <!-- see note above about price_extra -->
+ <t t-esc="ptav.price_extra > 0 and '+' or '-'"/>
+ <span t-esc="abs(ptav.price_extra)" class="variant_price_extra" style="white-space: nowrap;"
+ t-options='{
+ "widget": "monetary",
+ "from_currency": product.currency_id,
+ "display_currency": (pricelist or product).currency_id
+ }'/>
+ </span>
+ </div>
+ </div>
+ </label>
+ </li>
+ </t>
+ </ul>
+ </t>
+
+ <t t-if="ptal.attribute_id.display_type == 'color'">
+ <ul t-att-data-attribute_id="ptal.attribute_id.id" t-attf-class="list-inline #{'d-none' if single_and_custom else ''}">
+ <li t-foreach="ptal.product_template_value_ids._only_active()" t-as="ptav" class="list-inline-item">
+ <label t-attf-style="background-color:#{ptav.html_color or ptav.product_attribute_value_id.name if not ptav.is_custom else ''}"
+ t-attf-class="css_attribute_color #{'active' if ptav in combination else ''} #{'custom_value' if ptav.is_custom else ''}">
+ <input type="radio"
+ t-attf-class="js_variant_change #{ptal.attribute_id.create_variant}"
+ t-att-checked="ptav in combination"
+ t-att-name="'ptal-%s' % ptal.id"
+ t-att-value="ptav.id"
+ t-att-title="ptav.name"
+ t-att-data-value_id="ptav.id"
+ t-att-data-value_name="ptav.name"
+ t-att-data-attribute_name="ptav.attribute_id.name"
+ t-att-data-is_custom="ptav.is_custom"
+ t-att-data-is_single="single"
+ t-att-data-is_single_and_custom="single_and_custom"/>
+ </label>
+ </li>
+ </ul>
+ </t>
+ </li>
+ </t>
+ </ul>
+ </template>
+</odoo>