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
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
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
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
Registrati