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

Is there a way to filter lines in RML reports containing specific words or characters?

Subscribe

Get notified when there's activity on this post

This question has been flagged
rmlv7lines
3 Replies
6301 Views
Avatar
Santi

How can I use the python function "filter" to filter out lines in an RML report containing specific words or characters?

In my case, I would like to filter out from Invoice and Picking reports, lines containing the character ">" (this character is applied by the product_pack module to the "Children" product lines of a "Product Pack" )

This is an example of the function that appears in OpenERP's manual:

repeatIn(filter( lambda l: l.product_id.type=='service' ,o.invoice_line), 'line')

0
Avatar
Discard
JC

care to past the code here?

Santi
Author

sorry, I didn't see your comment till now, I already received the answer below, but thanks anyway!

Avatar
Prakash
Best Answer

Try the below code in RML File,

[[repeatIn(filter(lambda l: l.name.find('>')==-1, o.invoice_line), 'line')]]

The above code filter the record which name column contain a character '>'.

 

1
Avatar
Discard
Avatar
Serpent Consulting Services Pvt. Ltd.
Best Answer

Preferably, you should write a function which passes the lines and the function should return the filtered line to RML parser.

Thanks.

1
Avatar
Discard
Avatar
Santi
Author Best Answer

Perfect, thanks Prakash, that's exactly what I was looking for! ..for some reason I didn't get notified, so I hadn't seen your answer till now.

I made a slight correction to your code ('l' instead of 'line' at the end): 

[[repeatIn(filter(lambda l: l.name.find('>')==-1, o.invoice_line), 'l')]]

 

Another quick question...how can I merge two filters? 

This one: [[repeatIn(filter(lambda l: l.x_printable_choice==0 ,o.invoice_line), 'l')]]

and the one above: [[repeatIn(filter(lambda l: l.name.find('>')==-1, o.invoice_line), 'l')]]

 

I'm not sure if I should start a new thread with the question...let me know if so

 

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
Account_check_writing Module RML
rml v7 check_writing
Avatar
Avatar
1
Mar 15
5068
How to display the company header only on the first page?
rml v7 header report
Avatar
Avatar
6
Jan 17
16420
How to solve encoding problems when using base_rml_edit? Solved
rml v7 encoding base_rml_edit
Avatar
Avatar
1
Sep 15
10748
Using an old rml report
v8 rml v7 reports
Avatar
Avatar
1
Apr 15
3814
Translation of custom reports
rml v7 translation report
Avatar
Avatar
1
Jan 25
9274
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