Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

res.partner loads very slow

Subscribe

Get notified when there's activity on this post

This question has been flagged
contactsslowslowness
3 Replies
8804 Views
Avatar
EquityandHelp

I have a heavily customized version of odoo. we had a developer who was building it but we ended our relationship over various disputes. We have someone employed who is knowledgeable about python both of us have taken to mostly developing it ourselves. while getting assistance where our knowledge lacks.

Our Res.parner module loads very slow and seems to be the catalyst for most of our speed issues as modules that reference and calculate it heavily are pretty slow as well. 


We've done a lot to optimize the postgre, workers, etc. and that helped a little. our server is also very fast with 8gb and plenty of computing power for our 20 users. Not everything is slow. just mainly res.partner and things that reference it heavily. 


We've isolated the issue to res partner. but the 3 types of logs we have used doesn't seem to tell us more specifically what the issue is. 

We have about 400 fields in res partner and over 40,000. records. but disk space-wise we are still under 1% and our bandwidth usage is also very low.


Would indexing all fo the fields help? Ie there a type of log that would tell us what specifically is loading slow or running into errors? Kw_call/re.partner/read but that seems to just be res.partner in general. how do I isolate and fix this issue?


Also for some reason, every field made in res.partner is duplicated into res.user. I can't figure out why this would be occurring or who to turn it off. 

2
Avatar
Discard
EquityandHelp
Author

Oh and it's odoo 11

Avatar
Sudhir Arya (ERP Harbor Consulting Services)
Best Answer

There could be lots of cases where you might need improvements in code:

1) If you have lots of auto compute fields, make sure they don't get calculated each time system loads the records. Better to use api.depends

2) If you have lots of data fetching in compute fields, try some SQLs.

It would be more helpful if you can share your code or contact someone who can look into your code and help you.

1
Avatar
Discard
Avatar
Andres Penagos
Best Answer

We have client with odoo10  with 257000 partners and  about 90 fields on res_partner table. We had same issue. We worked arround using tmux to start a test service and  see logs and analyze sql operations.

see tmux session:

 python /opt/odoo/odoo-bin --addons-path /opt/odoo/addons,/opt/odoo/extra-addons --database comfa_06oct20_12m  --db-filter comfa_06oct20_12m  --xmlrpc-port 8005 --db_host 192.168.1.126  --log-level='debug_sql'     --log-handler=odoo.sql_db:DEBUG

we could see which sql was delaying the load of  detailed information from  partner.....

When a partner information is called then some fields must be calculated.  So  When you have a large database ( example 3.000.000 rows in account_move_line) some  fields can take for ever for updating or checking  detailed information from selected partner. 

Fields   like "debit" and "credit" allocated on "accounting" page  or information of icons like number of sales, invoicing or others sumaries  from the res_partner form  can come up after  1minute or 2 minutes which is a big performance problem.

Some Odoo base methods to load data are good to have instant information but can be a pain in the ass when the database is growing so fast in large companies.

In order to resolve our performance issue we detected the calculated  fields and suspended them due the client do not use such data to move forward. We do not just set attrib "invisible" on  fields or buttons because even when it is invisible  the action  is executed/calculated.

We sacrifice good tools like summary  info on icons  for performance.  In case of Debit and Credit fields they could  be calculated with aditional click-button at user desire .
Take in mind several modules add  summary button at button box of res_partner example:



/usr/lib/python2.7/dist-packages/odoo/addons/account/views/partner_view.xml:94:            <field name="inherit_id" ref="base.view_partner_form" />
/usr/lib/python2.7/dist-packages/odoo/addons/account/views/partner_view.xml:139:            <field name="inherit_id" ref="base.view_partner_form" />
/usr/lib/python2.7/dist-packages/odoo/addons/account/views/partner_view.xml:172:            <field name="inherit_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/product/views/res_partner_views.xml:6:            <field name="inherit_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/stock/views/res_partner_views.xml:27:        <field name="inherit_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/sale_crm/views/partner_views.xml:7:        <field name="inherit_id" ref="base.view_partner_form" />
/usr/lib/python2.7/dist-packages/odoo/addons/digito_verificacion/digito_verificacion.xml:8:            <field name="inherit_id" ref="base.view_partner_form" />
/usr/lib/python2.7/dist-packages/odoo/addons/project_issue/views/res_partner_views.xml:7:        <field name="inherit_id" ref="base.view_partner_form" />
/usr/lib/python2.7/dist-packages/odoo/addons/mail/views/res_partner_views.xml:8:            <field name="inherit_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/project/views/res_partner_views.xml:8:            <field name="inherit_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/crm/views/res_partner_views.xml:106:            <field name="inherit_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/contacts/views/contact_views.xml:35:        <field name="view_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/sale/views/res_partner_views.xml:41:            <field name="inherit_id" ref="base.view_partner_form" />
/usr/lib/python2.7/dist-packages/odoo/addons/point_of_sale/views/res_partner_view.xml:6:            <field name="inherit_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/purchase/views/res_partner_views.xml:7:            <field name="inherit_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/purchase/views/res_partner_views.xml:72:            <field name="inherit_id" ref="base.view_partner_form" />
/usr/lib/python2.7/dist-packages/odoo/addons/purchase/views/res_partner_views.xml:96:            <field name="inherit_id" ref="base.view_partner_form" />
/usr/lib/python2.7/dist-packages/odoo/addons/tipo_documento/tipo_documento.xml:47:            <field name="inherit_id" ref="base.view_partner_form" />
/usr/lib/python2.7/dist-packages/odoo/addons/tipo_documento/tipo_documento.xml.save:47:            <field name="inherit_id" ref="base.view_partner_form" />
/usr/lib/python2.7/dist-packages/odoo/addons/membership/views/partner_views.xml:73:            <field name="view_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/membership/views/partner_views.xml:101:            <field name="inherit_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/website_partner/views/res_partner_views.xml:6:        <field name="inherit_id" ref="base.view_partner_form"/>
/usr/lib/python2.7/dist-packages/odoo/addons/base_geolocalize/views/res_partner_views.xml:6:            <field name="inherit_id" ref="base.view_partner_form"/>




next you will find some fields we replaced or suspended in order to recover performance when a Partner is load  to check its information.  We eliminated the action in button and set invisible the now not-function button. A better methods for sure can be applied or even having  tables-view to return summaries could be a way.

        <record model="ir.ui.view" id="partner_view_button_contracts_count_ext">
            <field name="name">partner.view.button.contracts_count_suspended</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="account.partner_view_button_contracts_count" />
            <field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/>
            <field name="arch" type="xml">
                 
                <button  name="%(account.action_open_partner_analytic_accounts)d" position="replace">
                    <button class="oe_stat_button"  attrs="{'invisible': [('name', '!=', False)]}"
                        icon="fa-book" groups="analytic.group_analytic_accounting">
                    </button>
                </button>
   
            </field>
        </record>

        <record id="view_partner_property_form_suspended" model="ir.ui.view">
            <field name="name">res.partner.pos.form.inherit.suspended</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="point_of_sale.view_partner_property_form"/>
            <field name="arch" type="xml">
    
                <button  name="%(point_of_sale.action_pos_pos_form)d"  position="replace">
                    <button class="oe_stat_button"  attrs="{'invisible': [('name', '!=', False)]}"
                         icon="fa-shopping-bag">
                    </button>
                </button>


            </field>
        </record>

    
       
        <record id="res_partner_view_buttons_suspended" model="ir.ui.view">
            <field name="name">res.partner.view.buttons.suspended</field>
            <field name="model">res.partner</field>
            <field name="inherit_id" ref="sale.res_partner_view_buttons" />
            <field name="priority" eval="20"/>
            <field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
            <field name="arch" type="xml">
                <!-- <div name="button_box" position="replace"> -->
                 <button name="%(sale.act_res_partner_2_sale_order)d"   position="replace">
                    <button class="oe_stat_button"  attrs="{'invisible': [('name', '!=', False)]}"
                        icon="fa-usd">
                    </button>     
                 </button>
            </field>
        </record>
       
       
         <record id="view_partner_property_form_suspend" model="ir.ui.view">
            <field name="name">res.partner.property.form.inherit.suspend</field>
            <field name="model">res.partner</field>
            <!-- <field name="priority">2</field> -->
            <field name="inherit_id" ref="account.view_partner_property_form"/>
            <field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/>
            <field name="arch" type="xml">
                <xpath expr="//page[@name='accounting']/group//group[@name='acc_sale']" position="replace">
                            <group string="Sale" name="acc_sale">
                                <field name="property_payment_term_id" widget="selection"/>
                                <!-- <field name="credit" groups="base.group_no_one"/> -->
                                <field name="trust"/>
                            </group>
               
                 </xpath>
                 <xpath expr="//page[@name='accounting']/group//group[@name='acc_purchase']" position="replace">
                         <group string="Purchase" name="acc_purchase">
                            <field name="property_supplier_payment_term_id" widget="selection"/>
                            <!-- <field name="debit" groups="base.group_no_one"/> -->
                            <field name="currency_id" invisible="1"/>
                        </group>
               
                 </xpath>
       
            </field>
        </record>
       

hope it hekp

regards






3
Avatar
Discard
Avatar
Dhaval Ashiyani (dhh)
Best Answer
  • One possibility for slowness is due to related fields in res.partner

       Try to check unnecessary related fields in res.partner

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
importing contacts. Getting blocking error: Contacts require a name at multiple rows
contacts
Avatar
Avatar
Avatar
2
Oct 25
905
Blocking Errors
contacts
Avatar
Avatar
1
Oct 25
732
O18 EE: Completely unknown email addresses in the contacts?
contacts
Avatar
Avatar
Avatar
2
Nov 25
899
Add contacts to the seller field and not users
contacts
Avatar
Avatar
1
May 25
2408
Individual address on company contact form
contacts
Avatar
Avatar
1
Mar 25
2353
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now