<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <!-- Tree View -->
    <record id="view_sos_customers_tree" model="ir.ui.view">
        <field name="name">sos.customers.tree</field>
        <field name="model">sos_customers</field>
        <field name="arch" type="xml">
            <tree>
          
                <field name="customer_name"/>
                  <field name="customer_city"/>
                   <field name="vertical_domain"/>
                <field name="interested_in"/>
                 <field name="responsible" widget="many2one_avatar_user"/>
                 <field name="write_uid" string="Last Edited By" optional="hide"/>
                <field name="write_date" string="Last Edited On" optional="hide"/>
                
            </tree>
        </field>
    </record>

    <!-- Form View -->
    <record id="view_sos_customers_form" model="ir.ui.view">
        <field name="name">sos.customers.form</field>
        <field name="model">sos_customers</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
<h2 style="text-align: center;text-transform: uppercase;text-shadow: 1px 1p 1px #140718;color: #65407c;padding:5px;">Customers</h2><hr></hr><br></br>  

                 <group>
                    <group>
                        <field name="customer_name"/>
                             <field name="interested_in"/>
                        <field name="project_name" invisible="interested_in == 'products'"/>
                        <field name="products" invisible="interested_in == 'projects'"/>
                        
                        
                        </group>
                        <group>
                        <field name="responsible" widget="many2one_avatar_user"/>
                        <field name="customer_city"/>
                        <field name="vertical_domain"/>
                        <field name="correspondence_address"/>
                    </group>
                    </group>
                   <h3 style="text-transform: uppercase;
    text-decoration: underline;">Contact Details</h3>
                    
                        <field name="line_ids_contacts">
                            <tree editable="bottom">
                            <field name="set_as_primary"/>
                            <field name="name"/>
                            <field name="dept"/>
                            <field name="email"/>
                            <field name="mobile_number"/>
                            
                            </tree>
                        </field>
                  
                </sheet>
            </form>
        </field>
    </record>

    <!-- Action -->
    <record id="action_sos_customers" model="ir.actions.act_window">
        <field name="name">Customers</field>
        <field name="res_model">sos_customers</field>
        <field name="view_mode">tree,form</field>
    </record>
<record id="sos_customers_view_panel" model="ir.ui.view">
    <field name="name">sos_customers.search</field>
    <field name="model">sos_customers</field>
    <field name="arch" type="xml">
        <search>
            <searchpanel>
                <field name="products" string="Products Interested In" icon="fa-list-ul" enable_counters="1"/>
                <field name="vertical_domain" string="Vertical/Domain" icon="fa-pie-chart" enable_counters="1"/>

            </searchpanel>

            <!-- Add fields to search on -->
            <field name="customer_name" string="Customer Name"/>
            <field name="vertical_domain" string="Domain/Vertical"/>
            
      
        </search>
    </field>
</record>
    <!-- Menu -->
    <menuitem id="menu_sos_customers" name="CUSTOMERS" parent="sos_sales_menu_root" action="action_sos_customers" sequence="2" groups="sos_inventory.sos_finance_user,sos_inventory.sos_sales_user,sos_inventory.sos_management_user,sos_inventory.sos_ce_head,sos_inventory.sos_ce_user"/>
</odoo>
