Odoo Help


Add condition to RML report generation

on 6/25/14, 3:34 AM 2,176 views

Hi All,

I've prepared some custom RML report for CUSTOMERS. It's working fine for me. But I want it only for the CUSTOMERS and not for the SUPPLIERS. How can i remove or avoid the report name from being listed in the print button of SUPPLIERS.

And there's one more condition for CUSTOMERS, i.e., suppose there's a custom boolean flag i've added in the partner table for the CUSTOMERS. So i want the report to be generated only for those CUSTOMERS, where this flag is TRUE or 1.

Please help me with this. Any help would be appreciated :)

ASP :)

can u post your rml code ?..

on 6/25/14, 4:21 AM

Hi Prakash, Can we add something in the .py file of the report to achieve the above? My RML code is very long and I can't post it here. Please help me. I really need a way to do this. Can you please suggest something specific or give any example of code snippet where i need to change. Thanks for your reply :)

on 6/25/14, 7:04 AM

Just post your two lines rml main code for loop and object.name code.

on 6/25/14, 7:09 AM

To add a filter in rml code itself. otherwise write a function which passes the data and the function should return the filtered customer to RML parser.

on 6/25/14, 7:14 AM

Thanks for ur quick response Prakash :) But how can i restrict the report to be generated for SUPPLIERS or how to remove it from the print button list at the top of any supplier. As this report is only for CUSTOMERS.

on 6/25/14, 9:05 AM
On 6/30/14, 6:48 AM

Thanks Ray for the reply, so what u r suggesting is to print something informative as "THIS REPORT NOT VALID FOR SUPPLIERS" on the pdf report if we are printing for any supplier. I can go with this, but :) my requirement is to restrict the PDF generation in this case. So i was just wondering if we could use any "context" or "domain" to add filters in the report tag defined in the XML file or something like that. Once again thanks for ur reply. :) Cheers ASP


Ray Carnes

--Ray Carnes--
| 9 7 9
Keyport, United States
--Ray Carnes--

Senior ERP Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0 and 11.0.

Completed Odoo Functional and Technical Training.

Functional Areas:

  • CRM/Sales

  • Inventory

  • Manufacturing

  • Accounting

  • Purchasing

Major Skills:

  • Business Process Reengineering

  • Efficiency Consulting

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 6/25/14, 2:47 PM

Reports are tied to a model, so I don't think you can do this.  

You could have a condition in the RML that prints 'THIS REPORT NOT VALID FOR SUPPLIERS'.

Take a look at how the Quotation / Order report changes according to the state of the sale.order record.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 6/25/14, 3:34 AM
Seen: 2176 times
Last updated: 3/16/15, 8:10 AM