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
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Other
  3. Row Number in tree/list view v 13.0
  4. Sales Conditions FAQ

Row Number in tree/list view

by Synodica Solutions Pvt. Ltd. https://synodica.com
Odoo 23
v 13.0 Third Party 12643
Download for v 13.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 94
Technical Name rowno_in_tree
LicenseLGPL-3
Websitehttps://synodica.com
Versions 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 94
Technical Name rowno_in_tree
LicenseLGPL-3
Websitehttps://synodica.com
Versions 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0

Show Number in List/Tree View

You can see the row number in tree/list view in Odoo backend list views.

You would love to have our other Apps!



Contact us for support, customization

Write us
Suggestions & Feedback to: info@sheliyainfotech.com , sheliyanilesh@gmail.com, nikunj.antala@gmail.com

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
  • Ratings
  • Discuss
Nice module
by
Lima Saudara
on 4/23/20, 3:58 AM

This helps me enough :)


by
suraj james
on 3/31/20, 1:55 AM

Hi Nilesh, When using section and notes, the you are applying the wrong class and the row doesn't look consistent with the default odoo. Otherwise, your code is perfect.


Issue with this module in Odoo v16 Community
by
Akhil P Sivan
on 1/29/24, 5:50 AM

After installing the module, we cannot choose products in sale order lines. Please check & solve this issue.


list_view.js
by
suraj james
on 3/27/20, 10:42 AM

///////PLEASE UPDATE YOUR CODE for list_view.js////// //// FIXED THE BUGGY LOOK FOR THE ROW WHERE THE # COL IS DISPLAYED ALSO///// //variable to determine number of sections/notes var numSectionsNotes = 0; odoo.define('rowno_in_tree.ListNumber', function (require) { "use strict"; var core = require('web.core'); var ListRenderer = require('web.ListRenderer'); var _t = core._t; ListRenderer.include({ _getNumberOfCols: function () { var columns = this._super(); columns +=1; return columns; }, _renderFooter: function (isGrouped) { var $footer = this._super(isGrouped); $footer.find("tr").prepend($('

')); return $footer; }, _renderGroupRow: function (group, groupLevel) { var $row = this._super(group, groupLevel); if (this.mode !== 'edit' || this.hasSelectors){ $row.find("th.o_group_name").after($('')); } return $row; }, _renderGroups: function (data, groupLevel) { var self = this; var _self = this; groupLevel = groupLevel || 0; var result = []; var $tbody = $(''); _.each(data, function (group) { if (!$tbody) { $tbody = $(''); } $tbody.append(self._renderGroupRow(group, groupLevel)); if (group.data.length) { result.push($tbody); // render an opened group if (group.groupedBy.length) { // the opened group contains subgroups result = result.concat(self._renderGroups(group.data, groupLevel + 1)); } else { // the opened group contains records var $records = _.map(group.data, function (record,index) { //Nilesh if (_self.mode !== 'edit' || _self.hasSelectors){ return self._renderRow(record).prepend($("").html(index+1)); //.prepend($('')); } else{ return self._renderRow(record); } }); result.push($('').append($records)); } $tbody = null; } }); if ($tbody) { result.push($tbody); } return result; }, _renderHeader: function (isGrouped) { //reset the number of Sections/Notes count when rendering the header numSectionsNotes = 0; var $header = this._super(isGrouped); if (this.hasSelectors) { $header.find("th.o_list_record_selector").before($('').html('#')); var advance_search = $header.find("tr.advance_search_row") if(advance_search.length && advance_search.find('td.o_list_row_number_header').length==0){ advance_search.prepend($('').html(' ')); } } else{ if (this.mode !== 'edit'){ $header.find("tr").prepend($("").html('#')); } } //$header.find("tr").prepend($('').html('#')); return $header; }, _renderRow: function (record) { var $row = this._super(record); var isSection = record.data.display_type === 'line_section'; var isNote = record.data.display_type === 'line_note'; if (this.mode !== 'edit' && this.state.groupedBy.length==0){ var index = this.state.data.findIndex(function(e){return record.id===e.id}) if (index!==-1){ //do not show row numbers for sections or notes if (isSection || isNote){ numSectionsNotes +=1; $row.prepend($("").html("")); } else{ $row.prepend($("").html(index-numSectionsNotes+1)); } } } return $row; }, }); });
Re: list_view.js
by
Synodica Solutions Pvt. Ltd.
on 3/31/20, 12:13 AM Author

Hello Dear, there is no bug in my code, your requirements is different, so its not showing as per your requirements. If you want to see row number in list view, its showing well without any error.


by
suraj james
on 3/23/20, 5:20 AM

Hi Nilesh, how can we skip the row numbers for Sections/Notes in Sale order lines


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

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