hunk.code_window:             <field name="type">ir.actions.act_window</field>
               <field name="res_model">sale.order</field>
               <field name="view_type">form</field>
               <field name="view_id" ref="view_quotation_tree_with_onboarding"/>
               <field name="view_mode">tree,kanban,form,calendar,pivot,graph</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">
  
hunk.labels: keep keep keep keep replace keep keep keep
hunk.after_edit:             <field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
  
hunk.file_path: addons/sale/views/sale_views.xml
hunk.type: replace
file: <?xml version="1.0" encoding="utf-8"?>
  <odoo>
  
          <!-- Top menu item -->
          <menuitem id="sale_menu_root"
              name="Sales"
              web_icon="sale,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"
              action="sales_team.crm_team_salesteams_act"
              sequence="3"/>
  
          <menuitem id="res_partner_menu"
              parent="sale_order_menu"
              action="base.action_partner_form"
              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="3"
              name="Sales Orders"/>
  
          <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</field>
              <field name="view_type">form</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 purchase,
                      whether it's a physical product, a consumable or services.
                  </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>
                  <xpath expr="//group[@name='sale']" position="after">
                      <group name="options" groups="product.group_product_variant">
                          <group string="Options">
                              <field name="optional_product_ids" widget="many2many_tags" options="{'color_field': 'color'}" domain="[('id', '!=', active_id)]" />
                          </group>
                      </group>
                  </xpath>
              </field>
          </record>
  
          <menuitem id="product_menu_catalog" name="Products" action="product_template_action" 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_sale_pricelist" sequence="3" active="False"/>
  
          <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">
                      <field name="partner_id"/>
                      <field name="amount_total" widget="monetary"/>
                  </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">
                      <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">
                      <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">
                      <field name="name"/>
                      <field name="partner_id"/>
                      <field name="amount_total"/>
                      <field name="date_order"/>
                      <field name="state"/>
                      <field name="currency_id"/>
                      <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>
                                      </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" decoration-bf="message_needaction==True" decoration-muted="state=='cancel'">
                      <field name="message_needaction" invisible="1"/>
                      <field name="name" string="Order Number"/>
                      <field name="confirmation_date" string="Confirmation Date"/>
                      <field name="commitment_date" groups="sale.group_sale_order_dates"/>
                      <field name="expected_date" groups="sale.group_sale_order_dates"/>
                      <field name="partner_id"/>
                      <field name="user_id"/>
                      <field name="amount_total" sum="Total Tax Included" widget="monetary"/>
                      <field name="currency_id" invisible="1"/>
                      <field name="invoice_status" invisible="1"/>
                      <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" decoration-bf="message_needaction==True" decoration-muted="state=='cancel'">
                      <field name="message_needaction" invisible="1"/>
                      <field name="name" string="Quotation Number"/>
                      <field name="date_order" string="Quotation Date"/>
                      <field name="commitment_date" groups="sale.group_sale_order_dates"/>
                      <field name="expected_date" groups="sale.group_sale_order_dates"/>
                      <field name="partner_id"/>
                      <field name="user_id"/>
                      <field name="amount_total" sum="Total Tax Included" widget="monetary"/>
                      <field name="currency_id" invisible="1"/>
                      <field name="state"/>
                  </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">
                  <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="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="print_quotation" string="Print" type="object" states="draft" class="btn-primary o_sale_print"/>
                      <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="preview_sale_order" type="object" string="Preview"/>
                      <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="print_quotation" string="Print" type="object" states="sent,sale" class="o_sale_print"/>
                      <button name="action_quotation_send" string="Send by Email" type="object" states="sent,sale"/>
                      <button name="action_cancel" states="draft,sent,sale" type="object" string="Cancel"/>
                      <button name="action_draft" states="cancel" type="object" string="Set to Quotation"/>
                      <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."/>
                      <button name="action_unlock" type="object" string="Unlock" states="done" groups="sales_team.group_sale_manager"/>
                      <field name="state" widget="statusbar" statusbar_visible="draft,sent,sale"/>
                  </header>
                  <sheet>
                      <div class="oe_button_box" name="button_box">
                          <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>
                          <group>
                              <field name="partner_id" widget="res_partner_many2one" domain="[('customer','=',True)]" context="{'search_default_customer':1, '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>
                              <field name="validity_date" attrs="{'invisible': [('state', 'in', ['sale', 'done'])]}"/>
                              <field name="confirmation_date" attrs="{'invisible': [('state', 'in', ['draft', 'sent', 'cancel'])]}"/>
                              <field name="pricelist_id" groups="product.group_sale_pricelist"/>
                              <field name="currency_id" invisible="1"/>
                              <field name="payment_term_id" options="{'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"/>
                                      <group>
                                          <group attrs="{'invisible': [('display_type', '!=', False)]}">
                                              <field name="product_updatable" invisible="1"/>
                                              <field name="product_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"
                                                 />
                                              <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_subtotal" invisible="1"/>
                                              <label for="product_uom_qty" string="Ordered Quantity"/>
                                              <div>
                                                  <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" class="oe_inline"/>
                                                  <field
                                                      name="product_uom"
                                                      groups="uom.group_uom"
                                                      class="oe_inline oe_no_button"
                                                      attrs="{
                                                          'readonly': [('state', 'in', ('sale', 'done', 'cancel'))],
                                                          'required': [('display_type', '=', False)],
                                                      }"
                                                  />
                                              </div>
                                              <label for="qty_delivered" string="Delivered Quantity" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
                                              <div 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 Quantity" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
                                              <div 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"/>
                                              <label for="discount" groups="sale.group_discount_per_so_line"/>
                                              <div name="discount" groups="sale.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)]}">
                                              <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="customer_lead"/>
                                              <div>
                                                  <field name="customer_lead" class="oe_inline"/> days
                                              </div>
                                              <label for="analytic_tag_ids" groups="analytic.group_analytic_tags"/>
                                              <div>
                                                  <field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags" options="{'color_field': 'color'}"/>
                                              </div>
                                          </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 groups="base.group_no_one" attrs="{'invisible': [('display_type', '!=', False)]}">
                                          <label for="invoice_lines"/>
                                          <field name="invoice_lines"/>
                                      </div>
                                      <field name="state" invisible="1"/>
                                  </form>
                                  <!-- This is inherited below to make the order lines non-editable (inline)
                                      for the members of some usability groups (packaging, event):
                                      Indeed in those cases we need a dialog because there are additional fields to input.
                                  -->
                                  <tree
                                      string="Sales Order Lines"
                                      editable="bottom"
                                      decoration-info="(not display_type and invoice_status == 'to invoice')"
                                  >
                                      <control>
                                          <create string="Add a product"/>
                                          <create string="Configure a product" context="{'open_product_configurator': True}" groups="product.group_product_variant"/>
                                          <create string="Add a section" context="{'default_display_type': 'line_section'}"/>
                                          <create 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_updatable" invisible="1"/>
                                      <field
                                          name="product_id"
                                          attrs="{
                                              'readonly': [('product_updatable', '=', False)],
                                              'required': [('display_type', '=', False)],
                                          }"
                                          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
                                          }"
                                      />
                                      <field name="product_custom_attribute_value_ids" invisible="1" />
                                      <field name="product_no_variant_attribute_value_ids" invisible="1" />
                                      <field name="name" widget="section_and_note_text"/>
                                      <field
                                          name="product_uom_qty"
                                          string="Ordered Qty"
                                          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"
                                          attrs="{
                                              'column_invisible': [('parent.state', 'not in', ['sale', 'done'])],
                                              'readonly': [('qty_delivered_method', '!=', 'manual')]
                                          }"
                                      />
                                      <field name="qty_delivered_manual" invisible="1"/>
                                      <field name="qty_delivered_method" invisible="1"/>
                                      <field
                                          name="qty_invoiced"
                                          attrs="{'column_invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
                                      />
                                      <field name="qty_to_invoice" invisible="1"/>
                                      <field
                                          name="product_uom"
                                          attrs="{
                                              'readonly': [('state', 'in', ('sale','done', 'cancel'))],
                                              'required': [('display_type', '=', False)],
                                          }"
                                          context="{'company_id': parent.company_id}"
                                          groups="uom.group_uom"
                                          options='{"no_open": True}'
                                      />
                                      <field
                                          name="analytic_tag_ids"
                                          groups="analytic.group_analytic_tags"
                                          widget="many2many_tags"
                                      />
                                      <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)]}"
                                      />
                                      <field name="discount" groups="sale.group_discount_per_so_line"/>
                                      <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="customer_lead" invisible="1"/>
                                      <field name="currency_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_unit"/>
                                      <field name="display_type"/>
                                      <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-esc="record.price_subtotal.value"/>
                                                                  </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 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>
                              <field name="note" class="oe_inline" placeholder="Terms and conditions... (note: you can setup default ones in the Configuration menu)"/>
                              <div class="oe_clear"/>
                          </page>
                          <page string="Other Information" name="other_information">
                              <group>
                                  <group string="Shipping Information" name="sale_shipping" groups="sale.group_sale_order_dates">
                                      <field name="expected_date" groups="sale.group_sale_order_dates"/>
                                      <field name="commitment_date" groups="sale.group_sale_order_dates"/>
                                  </group>
                                  <group string="Sales Information" name="sales_person">
                                      <field name="user_id"/>
                                      <field name="team_id" options="{'no_create': True}"/>
                                      <field name="client_order_ref"/>
                                      <field name="require_signature"/>
                                      <field name="require_payment"/>
                                      <field name="reference" readonly="1" attrs="{'invisible': [('reference', '=', False)]}"/>
                                      <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
                                      <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"/>
                                  </group>
                                  <group name="sale_pay" string="Invoicing">
                                      <field name="date_order" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/>
                                      <field name="fiscal_position_id" options="{'no_create': True}"/>
                                      <field name="invoice_status" states="sale,done" invisible="1"/>
                                  </group>
                                  <group string="Reporting" name="technical" groups="base.group_no_one">
                                      <field groups="base.group_no_one" name="origin"/>
                                  </group>
                                  <group name="utm_link" groups="base.group_no_one"/>
                              </group>
                          </page>
                      </notebook>
                  </sheet>
                  <div class="oe_chatter">
                      <field name="message_follower_ids" widget="mail_followers"/>
                      <field name="activity_ids" widget="mail_activity"/>
                      <field name="message_ids" widget="mail_thread"/>
                  </div>
                  </form>
              </field>
          </record>
  
          <!-- inherited view to make the order lines list in the form non-editable
               for the members of some usability groups -->
          <record id="view_order_form_editable_list" model="ir.ui.view">
              <field name="name">sale.order.form.editable.list</field>
              <field name="model">sale.order</field>
              <field name="inherit_id" ref="sale.view_order_form"/>
              <field name="groups_id" eval="[(4, ref('product.group_stock_packaging'))]"/>
              <field name="arch" type="xml">
                  <xpath expr="//field[@name='order_line']/tree" position="attributes">
                      <attribute name="editable"/>
                  </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="arch" type="xml">
                  <search string="Search Sales Order">
                      <field name="name" string="Sales 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="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).
                      -->
                      <field name="order_line" string="Product" filter_domain="[('order_line.product_id.name', 'ilike', self)]"/>
                      <filter string="My Orders" domain="[('user_id','=',uid)]" name="my_sale_orders_filter"/>
                      <separator/>
                      <filter string="My Activities" name="activities_my"
                          domain="[('activity_ids.user_id', '=', uid)]"/>
                      <separator/>
                      <filter string="Late Activities" name="activities_overdue"
                          domain="[('activity_ids.date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
                          help="Show all records which has next action date is before today"/>
                      <filter string="Today Activities" name="activities_today"
                          domain="[('activity_ids.date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
                      <filter string="Future Activities" name="activities_upcoming_all"
                          domain="[('activity_ids.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">
                      <separator/>
                      <filter string="My Quotations" name="my_quotation" domain="[('state','=','draft'), ('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="Order Date" name="filter_order_date" date="date_order"/>
                  </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_type">form</field>
              <field name="view_mode">tree,kanban,form,calendar,pivot,graph</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_type">form</field>
              <field name="view_mode">tree,form,calendar,graph,pivot,kanban</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>
  
          <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_type">form</field>
              <field name="view_mode">tree,form,calendar,graph,pivot,kanban</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>
                  These are orders with products invoiced based on ordered quantities,
                  in the case you have delivered more than what was ordered.
                </p><p>
                  A typical example is the pre-paid hours of service,
                  where you want to sell extra hours to the customer
                  because the initial hours have already been used.
                </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_type">form</field>
              <field name="view_id" ref="view_quotation_tree_with_onboarding"/>
              <field name="view_mode">tree,kanban,form,calendar,pivot,graph</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="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"/>
                  </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"/>
                                  <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="sale.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 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">
                  <button name="toggle_active" position="before">
                      <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">
                          <div class="o_field_widget o_stat_info">
                              <span class="o_stat_value">
                                  <field name="sales_count" widget="statinfo" nolabel="1" class="mr4"/>
                                  <field name="uom_name"/>
                              </span>
                              <span class="o_stat_text">Sold</span>
                          </div>
                      </button>
                  </button>
                  <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">
                  <button name="toggle_active" position="before">
                      <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">
                          <div class="o_field_widget o_stat_info">
                              <span class="o_stat_value">
                                  <field name="sales_count" widget="statinfo" nolabel="1" class="mr4"/>
                                  <field name="uom_name"/>
                              </span>
                              <span class="o_stat_text">Sold</span>
                          </div>
                      </button>
                  </button>
                  <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="inherit_id" ref="product.product_template_form_view"/>
              <field name="arch" type="xml">
                  <xpath expr="//group[@name='email_template_and_project']" position="before">
                      <group string="Invoicing" name="invoicing" invisible="1">
                          <field name="invoice_policy" widget="radio"/>
                          <field name="service_type" widget="radio" invisible="True"/>
                          <field name="hide_expense_policy" invisible="1"/>
                          <field name="expense_policy" widget="radio" attrs="{'invisible': [('hide_expense_policy', '=', True)]}"/>
                      </group>
                  </xpath>
              </field>
          </record>
  
          <!-- Update account invoice search view!-->
          <record id="account_invoice_groupby_inherit" model="ir.ui.view">
              <field name="name">account.invoice.groupby</field>
              <field name="model">account.invoice</field>
              <field name="inherit_id" ref="account.view_account_invoice_filter"/>
              <field name="arch" type="xml">
                  <xpath expr="//field[@name='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>
  
          <!-- Update account invoice !-->
          <record model="ir.ui.view" id="account_invoice_form">
              <field name="name">Account Invoice</field>
              <field name="model">account.invoice</field>
              <field name="inherit_id" ref="account.invoice_form"/>
              <field name="arch" type="xml">
                  <data>
                      <xpath expr="//field[@name='user_id']" position="after">
                          <field name="team_id"/>
                      </xpath>
                      <xpath expr="//field[@name='partner_id']" position="after">
                         <field name="partner_shipping_id" groups="sale.group_delivery_invoice_address"/>
                     </xpath>
                      <xpath expr="//field[@name='discount']" position="attributes">
                          <attribute name="groups">sale.group_discount_per_so_line</attribute>
                      </xpath>
                  </data>
              </field>
          </record>
  
          <record model="ir.ui.view" id="account_invoice_line_tree">
              <field name="name">account.invoice.line.tree</field>
              <field name="model">account.invoice.line</field>
              <field name="inherit_id" ref="account.view_invoice_line_tree"/>
              <field name="arch" type="xml">
                  <data>
                      <xpath expr="//field[@name='discount']" position="attributes">
                          <attribute name="groups">sale.group_discount_per_so_line</attribute>
                      </xpath>
                  </data>
              </field>
          </record>
  
          <record model="ir.ui.view" id="account_invoice_line_form">
              <field name="name">account.invoice.line.form</field>
              <field name="model">account.invoice.line</field>
              <field name="inherit_id" ref="account.view_invoice_line_form"/>
              <field name="arch" type="xml">
                  <data>
                      <xpath expr="//field[@name='discount']" position="attributes">
                          <attribute name="groups">sale.group_discount_per_so_line</attribute>
                      </xpath>
                  </data>
              </field>
          </record>
  
          <record model="ir.ui.view" id="account_invoice_supplier_form">
              <field name="name">account.invoice.supplier.form</field>
              <field name="model">account.invoice</field>
              <field name="inherit_id" ref="account.invoice_supplier_form"/>
              <field name="arch" type="xml">
                  <data>
                      <xpath expr="//field[@name='discount']" position="attributes">
                          <attribute name="groups">sale.group_discount_per_so_line</attribute>
                      </xpath>
                  </data>
              </field>
          </record>
  
          <record id="product_pricelist_view_tree" model="ir.ui.view">
              <field name="name">product.pricelist.tree.inherit.product</field>
              <field name="model">product.pricelist</field>
              <field name="inherit_id" ref="product.product_pricelist_view_tree"/>
              <field name="arch" type="xml">
                  <field name="currency_id" position="before">
                      <field name="discount_policy" groups="sale.group_discount_per_so_line"/>
                  </field>
              </field>
          </record>
  
          <record id="product_pricelist_view_form" model="ir.ui.view">
              <field name="name">product.pricelist.form.inherit.product</field>
              <field name="model">product.pricelist</field>
              <field name="inherit_id" ref="product.product_pricelist_view"/>
              <field name="arch" type="xml">
                  <field name="currency_id" position="before">
                      <field name="discount_policy" groups="sale.group_discount_per_so_line" widget="radio"/>
                  </field>
                  <button name="toggle_active" position="attributes">
                      <attribute name="groups">sales_team.group_sale_manager</attribute>
                  </button>
              </field>
          </record>
  
          <record model="ir.ui.view" id="product_pricelist_view_kanban">
              <field name="name">product.pricelist.kanban.inherit.product</field>
              <field name="model">product.pricelist</field>
              <field name="inherit_id" ref="product.product_pricelist_view_kanban"/>
              <field name="arch" type="xml">
                  <data>
                      <xpath expr='//div[contains(@id, "product_pricelist")]' position="after">
                          <field name="discount_policy"/>
                      </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_type">form</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_type">form</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', '=', 'sale'),('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_type">form</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.invoice</field>
              <field name="view_type">form</field>
              <field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
              <field name="view_id" ref="account.invoice_tree"/>
              <field name="domain">[
                  ('state', 'not in', ['draft', 'cancel']),
                  ('type', 'in', ['out_invoice', 'out_refund'])]</field>
              <field name="context">{
                      'search_default_team_id': [active_id],
                      'default_team_id': active_id,
                      'default_type':'out_invoice',
                      '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.invoice_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')),('team_id', '=', active_id)]</field>
              <field name="context">{'search_default_order_month':1}</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">[('team_id', '=', active_id),('state', 'not in', ['draft', 'cancel'])]</field>
              <field name="context">{'search_default_month':1}</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>
  