How can we pass context value to qweb report so that i can control the visibility of tables. I have a qweb report with lot of tables. Depending on the selection list, i want to control the view of these tables in qweb report. So my option was to control using context. But didn't find any way to pass the context. If there is any other opinion, please share.
Passing context to qweb report for managing table visibility - odoo
3.6k Views Asked by OmaL At
2
There are 2 best solutions below
0
Cyrusville
On
Your question is not very clear on what exactly you want. For instance, I dont know what you mean by "Depending on the selection list", so I assume you have a wizard that prompts the user to select some options. If that is the case, you can pass the selection variable inside the data dictionary in the return statement of your print function.
def print_report(self, cr, uid, ids, context=None):
if context is None:
context = {}
datas = {'ids': context.get('active_ids', [])}
res = self.read(cr, uid, ids, ['date_start', 'date_end', 'user_ids'], context=context)
res = res and res[0] or {}
datas['form'] = res
if res.get('id',False):
datas['ids']=[res['id']]
return self.pool['report'].get_action(cr, uid, [], 'point_of_sale.report_detailsofsales', data=datas, context=context)
This passes the user selection under data['form']. You can then access the selections in qweb as data['form']['date_start']
Related Questions in ODOO
- odoo : look for method I click on button "add line" in tree view
- Odoo live chat not working when using apache reverse proxy
- Odoo: How to set import template default for model
- record doesn't exist error when creating a new record
- Odoo Window action apply multiple filters
- Comparing value from a foreign key in Odoo
- How can i print my invoice report from a server action
- Changing journal_id in account.move default_get Method Not Reflecting in UI
- Odoo synchronization with Google agenda
- Call JS function from XML
- Migrate javascript V12 in V17
- Odoo 16 ir.actions.report qweb-pdf pass data via POST method
- How to migrate from Odoo 15 to Odoo 16 using odoo.upgrade?
- i cannot enter the http://localhost:8069/web/ odoo 16
- Odoo Custom Module - First Steps failed by model_id
Related Questions in ODOO-8
- odoo show product in many2one from the same id
- How to display value of another fields of related field in Odoo form views
- how to automatically add ir.cron schedule jobs in calendar view in odoo?
- I got error can't adapt type NewId when I cave a new document in odoo
- I have error can't adapt type 'NewId' error in odoo
- Translate Odoo website content using Gettext PO file
- odoo 8 update field other table
- Odoo amount_to_text not working correctly with 4 decimal places
- Compatibility of Alternative Biometric Devices (e.g., ZKteco uFace800 plus) with Odoo 15 Module for Attendance Integration
- odoo 8 upgrade module from command line
- odoo 8 inherit from inherit view
- how inherited with odoo I want to modify the type of consultation as on this code but I don't want to touch the source file
- odoo8 Field year selection with today year as default
- odoo 8 make button invisible from compute result
- how to print several products on the same page with odoo
Related Questions in OPENERP-8
- How do I call a method in ir.rule domain in Odoo?
- How can I get static account, partner and other values in odoo 10?
- How to update external_id for partners/companies and Where is default external_id is generating in odoo?
- How do I use res.partner ORM to create a Partner Registration functionality
- Filter out previously selected assets from employee view in Odoo 11
- Odoo 8: Many2One from computed value
- How to upgrade wkhtmltopdf 0.12.2.4 in odoo using ubuntu?
- Odoo v.8 I like seeing sale orders of which i am follower
- Record Rules for many2one field in odoo
- Writing values to datetime field in odoo
- Creating block objects by assigning values to many2many field
- Odoo Email is 'Outbox' state. But mail is not received by the receiver
- addition of months to date in Odoo 8
- how to check if a specefic attribut does exist in odoo DB?
- Overriding Many2many add an item button. Odoo
Related Questions in QWEBPAGE
- Different margin top from the second page with first page odoo report
- qt webengine request camera and mic access on mac
- QWebEngine - how to catch execution of any javascripts from C++?
- Hide Reload action in Qt context menu
- all webcontent to string
- Showing content of QCH-File with QWebEngineView
- Cannot find reference self.loadFinished.connect when trying to execute scripts in HTML pages
- get HTML from QWebEnginePage in QWebEngineView using Lamda
- QT 5.5 Disable Web Security
- QWebEngineView modify web content before render
- QWebView not loading after opening pop up window
- pyqt5.6 interceptRequest doesn't work
- QApplication Within A Shared Library Event Loop Issues
- Qt QWebView/QWebPage Windows Authentication
- Qwebkit links with .org do not work
Related Questions in QWEB
- In an Odoo 16 QWeb template, the content of <link> tag is added after the tag, not within
- Loop through a group list with Qweb in Odoo17
- xpath reference in Odoo 15 and 16, how to resolve it
- Odoo 17 Qweb Report - How to get a field from another model
- How can I create another Invoice Template in Odoo Community(Saas)
- How to extend a templates xml:space="preserve" in Odoo 14
- How can I show modal on page load?
- Does OCA module report_qweb_element_page_visibility leave blank spaces in Odoo 15?
- Odoo 14 QWEB report page border
- How to use regular expression for a mini markup mechanism in PDF reports?
- Odoo 17 QWeb Question: Whats behind the concept of <t t-out="0"/>
- Odoo V16 - Show/hide dynamically input on website register form
- How to avoid ODOO 15 render error for missing values
- How to convert float to int in odoo qweb?
- How to open the attachment in the same screen as an image preview in template (Odoo16)
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Create parser class first
Then define another class
Then you can call the localcontext method in that way
Refer our blog on Qweb report