I placed an excel template edited in advance. When the excel template is downloaded, the user's name and time can be used as the name of Excel
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
Hi
Try the following code,
def action_print_product_move(self):
""" Here generate a dictionary of a list of data that return to
report action. And it will generate the xlsx report. """
data = {
'location': self.location_id.complete_name,
'date': self.date,
'user': self.env.user.name,
// This is for example in this way you can add your own datas
}
return {
'type': 'ir.actions.report',
'data': {'model': 'stock.move.location.report',
'options': json.dumps(data,
default=date_utils.json_default),
'output_format': 'xlsx',
'report_name': user+date ,
// You can add your won value in the report name
},
'report_type': 'xlsx',
}
Controller File:
def get_report_xlsx(self, model, options, output_format, report_name, **kw): |
Hope it helps