Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
8763 Переглядів

Hi folks,

So, in my system, I have a couple of entities. One is called an "account" which can represent a company, contact or whatever else you want. The other is called the activity log, which is an SQL view that collates all activities within the system (such as calendar events, opportunities, leads etc).

The activity log is linked to accounts by a many2one field called account_id.

What I want to do is to display a graph within the accounts form view that shows relevant activities per month, grouped by type of activity. So, the graph would show months along the x-axis, whilst the bars themselves would show a count of each activity type for that month.

The bit I am mainly struggling with is how to display a graph within a form view. I can't find any examples elsewhere so it may not be possible but the documentation states that since OpenERP 4.1, it has been possible to do this.

Does anyone know how?

Many thanks

Аватар
Відмінити

Hello,

Can you give me Odoo version you use ? and is it community or enterprise ?

thanks

Найкраща відповідь

You can try alternate way to open the Graph view from the click of a button and return the action of the graph with some default filter you want to show the data in the graph view.

@api.multi
def action_graph(self):
return {
'name': _('Sale Order Graph'),
'view_type': 'form',
'view_mode': 'graph',
'res_model': 'sale.order',
'type': 'ir.actions.act_window',
'context': {
'search_default_partner_id': self.partner_id.id,
}
}
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
вер. 23
11357
2
трав. 18
8228
1
серп. 25
88
4
лип. 25
1412
1
лип. 25
722