Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] excel_import_export: index on record loop #3101

Open
imbarbudiman opened this issue Oct 30, 2024 · 1 comment
Open

[16.0] excel_import_export: index on record loop #3101

imbarbudiman opened this issue Oct 30, 2024 · 1 comment

Comments

@imbarbudiman
Copy link

Is your feature request related to a problem?
I want to create an automatic sequence number for each record, but it seems there is no 'index' for the current record.

eie-row index

Describe the solution you'd like
It would be great if there were a feature similar to $as_index in qweb.
I thought I could override get_eval_context(), but it looks like that won't work for the current pattern/algorithm in excel_import_export

Additional context

{
    '__EXPORT__': {
        'a_42152223': {
            'results': {
                'A3': '${index + 1}', # if 'results' len is 3, 'index' will be 0, 1, 2 on each record
                'B3': 'date${value.strftime("%d/%m/%Y") or ""}#{style=text}',
                'C3': '${"NPWP"}#{style=text}',
                'D3': 'partner_id.vat${value or ""}#{style=text}',
            },
        },
    },
}
@imbarbudiman
Copy link
Author

@kittiu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant