Can any one tell me from where to get variable which is used in foreach? For example:- t t-foreach="grouped_tasks" t-as="tasks"
In this example, "grouped_tasks" variable is used. From where I get this example?
Please help me!
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Reports can be developed 2 ways:
1) Directly print the report using current record (From Print button option in the form / tree view: Mostly without parser): Report is generated mostly we use "docs" variable to access the records to print the report.
2) From the wizard by passing some parameters to the parser (Custom Report): In the parser we can define the method and pass it to the qweb report by overriding render_html method..
Hi,
t-foreach is iteration directive in qweb which take an expression returning the collection to iterate on, if you set of records in your model you can find data inside that record set using t-foreach please refer this link to understand more on t-foreach.
for example if have one2many_id in your model you can access that data inside one2many field using
this statement t-foreach = one2many_id t-as = field
refer this link for example
Thanks!
Take a Look at this example which is already in account module.
In XML file here report engine calls py function declared in class. Github Link
In PY Then the call redirect to py function. Github Link
Thanks for your help!
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