Ok these what I did @csangrador
- I set the URL to: relatorio://for each=“item in o.records” → opening loop tag
- I set the text: for each=“item in o.records”
- And put simple string “Hello world”, expecting this string will be repeated x times
- Then for closing tag I set the URL to: relatorio://for
- I set the text: for
But this attempt again produce assert not opened_tags error, I aligned all to left too.
So I tried: maybe if I put the tag in URL can solved. So I did:
- I set the URL to: relatorio://<for each=“item in o.records”>
- I set the text: <for each=“item in o.records”>
- And put simple string “Hello world”, expecting this string will be repeated x times
- Then for closing tag I set the URL to: relatorio://</for>
- I set the text: </for>
But then it seems that relatorio engine spits a new error:
raise TemplateSyntaxError(err, template.filepath, lineno,
genshi.template.base.TemplateSyntaxError: invalid syntax in expression "__relatorio_guess_type(__relatorio_store_cache(139770805891392, <for each="item in o.records">))" of "attrs" directive (, line 1) (<string>, line 139)
Please I really need to understand whats goin on?
FYI this is my model which I want to render
class UserTimesheet(ModelSQL, ModelView):
"User Timesheet"
__name__ = 'afx.user.timesheet'
# Hardcoded
MAIN_COMPANY = 1
year = fields.Selection([], "Year", help='Format: YYYY', required=True, states={
'readonly': Eval('id', -1) > 0
}, depends=['id'])
month = fields.Selection([], "Month", sort=False, required=True, states={
'readonly': Eval('id', -1) > 0
}, depends=['id'])
user = fields.Many2One('company.employee', "User", required=True, domain=[
('company', '=', MAIN_COMPANY)])
unique_id = fields.Char("Uuid", required=True)
total_works = fields.Float(
'Hours In Month',
digits=(16, 2), states={
'readonly': True
}, depends=['id'])
records = fields.One2Many('afx.user.timesheet.record', 'timesheet', "Records", required=False)
Regards
Bromo