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
- Financeiro
- Inventário
- PoS
- Project
- MRP
Esta pergunta foi sinalizada
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
Está gostando da discussão? Não fique apenas lendo, participe!
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscreva-se