Skip to content
Snippets Groups Projects
Commit f400baef1bb6 authored by Anael Lorimier's avatar Anael Lorimier
Browse files

Fixes #1 Add functions to process URL most click graphs

Adding a button in the Campaign Form to access graphs view
Update js injection to auto-update graphs field
parent b417f317c2dc
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
'marketing_campaign_tracker_view.xml', 'marketing_campaign_tracker_view.xml',
'wizard/wizard.xml', 'wizard/wizard.xml',
'report/analytic.xml', 'report/analytic.xml',
'report/marketing_campaign_view.xml',
], ],
'js': ['static/src/js/report_analytic.js'], 'js': ['static/src/js/report_analytic.js'],
'demo_xml': [ 'demo_xml': [
......
...@@ -31,14 +31,9 @@ ...@@ -31,14 +31,9 @@
_name = 'board.board' _name = 'board.board'
_inherit = 'board.board' _inherit = 'board.board'
def update_graph(self, cr, uid, ids, context=None): def board_update(self, cr, uid, id_, context=None):
self.pool.get('marketing_campaign_tracker.analytic').update_graphs(cr, uid, ids, context=context) campaign_id = context.get('campaign_id', None)
def board_update(self, cr, uid, ids, context=None): if campaign_id:
print "**********************" self.pool.get('marketing_campaign_tracker.analytic').update_graphs(cr, uid, campaign_id, context=context)
print cr
print uid
print ids
print context
print "**********************"
return 0 return 0
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_marketing_campaign_analytic_form" model="ir.ui.view">
<field name="name">marketing.campaign.analytic.form</field>
<field name="model">marketing.campaign</field>
<field name="type">form</field>
<field name="inherit_id" ref="marketing_campaign.view_marketing_campaign_form"/>
<field name="arch" type="xml">
<xpath expr="//button[@string='Segments']" position="after">
<button type="action"
name="%(open_board_marketing_campaign_tracker_analytic)d"
string="Campaign Analytic"/>
</xpath>
</field>
</record>
</data>
</openerp>
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
}, },
start: function() start: function()
{ {
var context = new instance.web.CompoundContext(this.build_context(), {});
this._super.apply(this, arguments); this._super.apply(this, arguments);
if (this.view.dataset.context['live_update'] == 1) if (this.view.dataset.context['live_update'] == 1)
{ {
...@@ -16,7 +15,7 @@ ...@@ -16,7 +15,7 @@
this._super.apply(this, arguments); this._super.apply(this, arguments);
if (this.view.dataset.context['live_update'] == 1) if (this.view.dataset.context['live_update'] == 1)
{ {
this.ds_model.call('board_update', [this.session.uid, context]); this.ds_model.call('board_update', [this.session.uid, this.view.dataset.context]);
} }
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment