I'm trying to filter objects in the database that belong to the current year. I'm getting the above error, please help
<t t-foreach="o.search([(o.date_from.year, '=', datetime.datetime.now().year)])" t-as="year"> <t t-foreach="request.env['hr.payslip.line'].search([('slip_id', '=', year.id)])" t-as="lines"> <tr t-foreach="lines" t-as="line">
<td>#value from line#</td> </tr> </t> </t>
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
Hello Kelly,
Try this:
<t t-if="o.search([(o.date_from.year, '=', datetime.datetime.now().year)])">
<t t-foreach="request.env['hr.payslip.line'].search([('slip_id', '=', year.id)])" t-as="lines">
<tr t-foreach="lines" t-as="line">
<td>#value from line#</td>
</tr>
</t>
</t>
Accept and upvote answer if helpful
Thanks and Regards
Haresh Kansara
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