[MERGE] Perfect look feature branch

bzr revid: fme@openerp.com-20120514160601-wfc09rr6jd8h4m8r
This commit is contained in:
Fabien Meghazi
2012-05-14 18:06:01 +02:00
29 changed files with 672 additions and 434 deletions
+1 -1
View File
@@ -53,7 +53,7 @@
<form string="Invoice Line">
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
<field colspan="2" name="name"/>
<label string="Quantity :" align="1.0"/>
<label string="Quantity" for="quantity" align="1.0"/>
<group colspan="1" col="2">
<field name="quantity" nolabel="1"/>
<field name="uos_id" on_change="uos_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)" nolabel="1"/>
+2 -2
View File
@@ -10,8 +10,8 @@
<field name="property_account_payable" position="after">
<group colspan="2" col="6">
<field name="vat" on_change="vat_change(vat)"/>
<button name="button_check_vat" string="Check VAT" type="object" icon="gtk-execute"/>
<field name="vat_subjected" colspan="1" />
<button colspan="2" name="button_check_vat" string="Check VAT" type="object" icon="gtk-execute"/>
<field name="vat_subjected" colspan="1"/>
</group>
</field>
</field>
+2 -3
View File
@@ -53,11 +53,10 @@
</record>
<!-- bind adminitration dashboard to the root administration -->
<menuitem id="base.menu_administration" name="Settings" action="open_board_administration_form"/>
<menuitem id="base.menu_administration" name="Settings"/>
<!-- add a menu item in adminitration/reporting/dashboards -->
<menuitem id="base.menu_reporting_admin" name="Administration" parent="base.menu_reporting_dashboard" groups="base.group_system"/>
<menuitem id="base.menu_reporting_admin_dashboard" parent="base.menu_reporting_admin" action="open_board_administration_form"/>
<menuitem id="base.menu_reporting_admin_dashboard" parent="base.menu_reporting_dashboard" action="open_board_administration_form" groups="base.group_system"/>
</data>
</openerp>
-1
View File
@@ -108,7 +108,6 @@ Creates a dashboard for CRM that includes:
'process/crm_configuration_process.xml',
'res_partner_view.xml',
'board_crm_statistical_view.xml',
'board_crm_view.xml',
'res_config_view.xml',
-114
View File
@@ -1,114 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<!--
Board for statistical view of the sections
-->
<record model="ir.ui.view" id="view_crm_opportunity_categ_graph">
<field name="name">Opportunities By Categories - Graph</field>
<field name="model">crm.lead.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunity by Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_crm_opportunity_stage_graph">
<field name="name">Opportunities By Stage - Graph</field>
<field name="model">crm.lead.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunities By Stage" type="pie">
<field name="stage_id"/>
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_crm_opportunity_user_stage_graph">
<field name="name">Opportunities By Stage Per User - Graph</field>
<field name="model">crm.lead.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunities By Stage" type="bar">
<field name="stage_id"/>
<field name="planned_revenue" operator="+"/>
<field name="user_id" group="True"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="act_oppor_categ">
<field name="name">Opportunities By Categories</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_categ_graph"/>
<field name="domain">[('state', 'not in', ('done', 'cancel')), ('type', '=', 'opportunity')]</field>
<field name="context">{'search_default_Category':1}</field>
</record>
<record model="ir.actions.act_window" id="act_opportunity_stage">
<field name="name">Opportunities By Stage</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_stage_graph"/>
<field name="domain">[('state', 'not in', ('done', 'cancel')), ('type', '=', 'opportunity')]</field>
<field name="context">{'search_default_Stage':1}</field>
</record>
<record model="ir.actions.act_window" id="act_oppor_stage_user">
<field name="name">Planned Revenue By User and Stage</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_user_stage_graph"/>
<field name="domain">[('state','!=','cancel')]</field>
<field name="context">{'search_default_Stage':1}</field>
</record>
<record model="ir.ui.view" id="board_crm_statistical_form">
<field name="name">CRM - Statistical Dashboard Form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Statistics Dashboard" layout="manual">
<board style="1-1">
<column>
<action string="Opportunities by Categories" name="%(act_oppor_categ)d"/>
<action string="Opportunities by Stage" name="%(act_opportunity_stage)d"/>
</column>
<column>
<action string="Planned Revenue by Stage and User" name="%(act_oppor_stage_user)d"/>
</column>
</board>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_board_statistical_dash">
<field name="name">CRM Dashboard</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="usage">menu</field>
<field name="view_id" ref="board_crm_statistical_form"/>
</record>
<menuitem id="board.menu_sales_dashboard" name="Sales" sequence="1" parent="base.menu_reporting_dashboard"/>
<menuitem
id="menu_board_statistics_dash"
name="CRM Dashboard"
sequence="0"
parent="board.menu_sales_dashboard"
action="open_board_statistical_dash"
groups="base.group_sale_manager"/>
</data>
</openerp>
+148 -68
View File
@@ -1,31 +1,7 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_crm_opportunity_user_graph1">
<field name="name">crm.opportunity.user.graph1</field>
<field name="model">crm.lead.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunities by User and Team" type="bar">
<field name="stage_id"/>
<field name="nbr" operator="+"/>
<field name="user_id" group="True"/>
</graph>
</field>
</record>
<record id="view_report_crm_oppor_graph" model="ir.ui.view">
<field name="name">crm.lead.report.graph</field>
<field name="model">crm.lead.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="vertical" string="Opportunity Analysis" type="bar">
<field name="stage_id"/>
<field name="planned_revenue" operator="+"/>
</graph>
</field>
</record>
<!-- crm user dashboard -->
<record model="ir.ui.view" id="crm_case_my_open_oppor">
<field name="name">Opportunities</field>
<field name="model">crm.lead</field>
@@ -59,23 +35,20 @@
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="act_my_oppor">
<field name="name">My Open Opportunities</field>
<field name="res_model">crm.lead</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('user_id','=',uid),('state','=','open'), ('type', '=', 'opportunity')]</field>
<field name="context">{'default_user_id': uid, 'default_type': 'opportunity'}</field>
</record>
<record model="ir.actions.act_window" id="act_my_oppor">
<field name="name">My Open Opportunities</field>
<field name="res_model">crm.lead</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('user_id','=',uid),('state','=','open'), ('type', '=', 'opportunity')]</field>
<field name="context">{'default_user_id': uid, 'default_type': 'opportunity'}</field>
</record>
<record model="ir.actions.act_window.view" id="act_my_oppor_tree_view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_case_my_open_oppor"/>
<field name="act_window_id" ref="act_my_oppor"/>
</record>
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_case_my_open_oppor"/>
<field name="act_window_id" ref="act_my_oppor"/>
</record>
<record model="ir.actions.act_window.view" id="act_my_oppor_form_view">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
@@ -83,44 +56,151 @@
<field name="act_window_id" ref="act_my_oppor"/>
</record>
<record model="ir.actions.act_window" id="act_my_oppor_stage">
<field name="name">Planned Revenue By Stage</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_report_crm_oppor_graph"/>
<field name="domain">[('user_id','=',uid), ('type', '=', 'opportunity'), ('state','in',('draft','open','done','pending')), '!', '&amp;', ('state', '=', 'done'), ('date_closed','&gt;=',datetime.date.today().strftime('%Y-%m-01'))]</field>
<field name="context">{'search_default_Stage':1}</field>
</record>
<record id="view_report_crm_oppor_graph" model="ir.ui.view">
<field name="name">crm.lead.report.graph</field>
<field name="model">crm.lead.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph orientation="vertical" string="Opportunity Analysis" type="bar">
<field name="stage_id"/>
<field name="planned_revenue" operator="+"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="act_my_oppor_stage">
<field name="name">Planned Revenue By Stage</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_report_crm_oppor_graph"/>
<field name="domain">[('user_id','=',uid), ('type', '=', 'opportunity'), ('state','in',('draft','open','done','pending')), '!', '&amp;', ('state', '=', 'done'), ('date_closed','&gt;=',datetime.date.today().strftime('%Y-%m-01'))]</field>
<field name="context">{'search_default_Stage':1}</field>
</record>
<record model="ir.ui.view" id="board_crm_form">
<field name="name">Sales Dashboard Form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales Dashboard" layout="manual">
<board style="2-1">
<column>
<action string="My Opportunities"
name="%(act_my_oppor)d" creatable="true"/>
</column>
<column>
<action string="My Planned Revenues by Stage"
name="%(act_my_oppor_stage)d"/>
</column>
<record model="ir.ui.view" id="board_crm_form">
<field name="name">Sales Dashboard Form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales Dashboard" layout="manual">
<board style="2-1">
<column>
<action string="My Opportunities" name="%(act_my_oppor)d" creatable="true"/>
</column>
<column>
<action string="My Planned Revenues by Stage" name="%(act_my_oppor_stage)d"/>
</column>
</board>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_board_crm">
<field name="name">Sales</field>
<field name="name">CRM</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="usage">menu</field>
<field name="view_id" ref="board_crm_form"/>
</record>
<menuitem id="base.menu_base_partner"
action="open_board_crm"/>
<menuitem id="menu_board_crm" parent="base.menu_reporting_dashboard" action="open_board_crm" sequence="10" groups="base.group_sale_salesman"/>
<!-- crm mananger dashboard -->
<record model="ir.ui.view" id="view_crm_opportunity_categ_graph">
<field name="name">Opportunities By Categories - Graph</field>
<field name="model">crm.lead.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunity by Categories" type="bar" orientation="horizontal">
<field name="categ_id"/>
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="act_oppor_categ">
<field name="name">Opportunities By Categories</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_categ_graph"/>
<field name="domain">[('state', 'not in', ('done', 'cancel')), ('type', '=', 'opportunity')]</field>
<field name="context">{'search_default_Category':1}</field>
</record>
<record model="ir.ui.view" id="view_crm_opportunity_stage_graph">
<field name="name">Opportunities By Stage - Graph</field>
<field name="model">crm.lead.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunities By Stage" type="pie">
<field name="stage_id"/>
<field name="nbr" operator="+"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="act_opportunity_stage">
<field name="name">Opportunities By Stage</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_stage_graph"/>
<field name="domain">[('state', 'not in', ('done', 'cancel')), ('type', '=', 'opportunity')]</field>
<field name="context">{'search_default_Stage':1}</field>
</record>
<record model="ir.ui.view" id="view_crm_opportunity_user_stage_graph">
<field name="name">Opportunities By Stage Per User - Graph</field>
<field name="model">crm.lead.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Opportunities By Stage" type="bar">
<field name="stage_id"/>
<field name="planned_revenue" operator="+"/>
<field name="user_id" group="True"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="act_oppor_stage_user">
<field name="name">Planned Revenue By User and Stage</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_user_stage_graph"/>
<field name="domain">[('state','!=','cancel')]</field>
<field name="context">{'search_default_Stage':1}</field>
</record>
<record model="ir.ui.view" id="board_crm_statistical_form">
<field name="name">CRM - Statistical Dashboard Form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Statistics Dashboard" layout="manual">
<board style="1-1">
<column>
<action string="Opportunities by Categories" name="%(act_oppor_categ)d"/>
<action string="Opportunities by Stage" name="%(act_opportunity_stage)d"/>
</column>
<column>
<action string="Planned Revenue by Stage and User" name="%(act_oppor_stage_user)d"/>
</column>
</board>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_board_statistical_dash">
<field name="name">CRM Manager</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="usage">menu</field>
<field name="view_id" ref="board_crm_statistical_form"/>
</record>
<menuitem
id="menu_board_statistics_dash"
parent="base.menu_reporting_dashboard"
action="open_board_statistical_dash"
sequence="11"
groups="base.group_sale_manager"/>
</data>
</openerp>
+61 -58
View File
@@ -413,114 +413,117 @@
</div>
</div>
<sheet layout="auto">
<group colspan="4" col="7">
<field name="name" required="1" string="Opportunity"/>
<label string="Stage:" align="1.0"/>
<group colspan="1" col="4">
<field name="stage_id" nolabel="1"
on_change="onchange_stage_id(stage_id)"
domain="section_id and [('section_ids', '=', section_id)] or []"/>
<button name="stage_previous"
states="draft,open,pending" type="object"
icon="gtk-go-back" string="" context="{'stage_type': 'opportunity'}"/>
<button name="stage_next" states="draft,open,pending"
type="object" icon="gtk-go-forward" string="" context="{'stage_type': 'opportunity'}"/>
</group>
<field name="user_id"/>
<group colspan="4" col="3">
<field name="name" required="1" nolabel="1" class="oe_form_title" width="80%%"/>
<button string="Schedule/Log Call"
name="%(opportunity2phonecall_act)d" icon="terp-call-start"
type="action"/>
<button string="Schedule Meeting" icon="gtk-redo"
name="action_makeMeeting"
type="object"/>
</group>
<group colspan="4" col="4" class="oe_form_group_label_border" style="margin-top: 20px;">
<field name="user_id"/>
<field name="planned_revenue"/>
<field name="probability"/>
<field name="date_action"/>
<field name="date_deadline"/>
<button name="action_makeMeeting" type="object"
string="Schedule Meeting" icon="gtk-redo" />
<newline/>
<field name="date_action"/>
<field name="title_action"/>
<field name="priority" string="Priority"/>
<newline/>
<field name="probability"/>
<field name="type" invisible="1"/>
</group>
<notebook colspan="4">
<page string="Opportunity">
<group col="4" colspan="2">
<separator colspan="4" string="Contacts"/>
<group colspan="2">
<field name="partner_id" select="1"
on_change="onchange_partner_id(partner_id, email_from)" string="Customer"
colspan="2" />
<group colspan="2" col="3" class="oe_form_group_label_border">
<field width="80%%" name="partner_id" select="1"
on_change="onchange_partner_id(partner_id, email_from)" string="Customer"/>
<button name="%(action_crm_lead2partner)d"
icon="terp-partner" type="action"
string="Create"
attrs="{'invisible':[('partner_id','!=',False)]}"/>
</group>
<group col="3" colspan="2">
<field name="email_from" string="Email" />
<button string="Mail"
name="%(mail.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'crm.lead'}"
icon="terp-mail-message-new" type="action" />
</group>
<field name="phone"/>
<field name="phone" colspan="3"/>
<field width="80%%" name="email_from" string="Email"/>
<button string="Mail"
name="%(mail.action_email_compose_message_wizard)d"
context="{'mail':'new', 'model': 'crm.lead'}"
icon="terp-mail-message-new" type="action" />
</group>
</group>
<group col="2" colspan="2">
<group col="2" colspan="2" class="oe_form_group_label_border">
<separator colspan="2" string="Categorization"/>
<field name="section_id" colspan="1" widget="selection"/>
<field name="categ_id" select="1"
string="Category" widget="selection"
domain="[('object_id.model', '=', 'crm.lead')]" />
string="Category" widget="selection"
domain="[('object_id.model', '=', 'crm.lead')]" />
<label string="Stage" for="stage_id" align="1.0"/>
<group colspan="1" col="3">
<field name="stage_id" nolabel="1"
on_change="onchange_stage_id(stage_id)"
domain="section_id and [('section_ids', '=', section_id)] or []" width="60%%"/>
<button name="stage_previous"
states="draft,open,pending" type="object"
icon="gtk-go-back" string="" context="{'stage_type': 'opportunity'}"/>
<button name="stage_next" states="draft,open,pending"
type="object" icon="gtk-go-forward" string="" context="{'stage_type': 'opportunity'}"/>
</group>
<field name="priority" string="Priority"/>
</group>
<separator colspan="4" string="Details"/>
<field name="description" nolabel="1" colspan="4"/>
</page>
<page string="Lead">
<group colspan="2" col="4">
<separator string="Contact" colspan="4" col="4"/>
<separator string="Contact" colspan="4"/>
<group colspan="4" col="4" class="oe_form_group_label_border">
<field name="partner_name" string="Customer Name" colspan="4"/>
<newline/>
</group>
<group colspan="2" col="2" class="oe_form_group_label_border">
<field domain="[('domain', '=', 'contact')]" name="title" widget="selection"/>
<field name="function" />
<field name="street" colspan="4"/>
<field name="street2" colspan="4"/>
<field name="fax"/>
<field name="street"/>
<field name="zip"/>
<field name="city"/>
<field name="country_id"/>
</group>
<group colspan="2" col="2" class="oe_form_group_label_border">
<field name="function" />
<field name="mobile"/>
<field name="street2"/>
<field name="city"/>
<field name="state_id"/>
</group>
<group colspan="2" col="2">
<separator string="Communication" colspan="2"/>
<field name="fax"/>
<field name="mobile"/>
</group>
<group colspan="2" col="2">
<group colspan="2" col="2" class="oe_form_group_label_border">
<separator string="Categorization" colspan="2"/>
<field name="type_id" widget="selection"/>
<field name="channel_id" widget="selection"/>
</group>
<group colspan="2" col="2">
<group colspan="2" col="2" class="oe_form_group_label_border">
<separator string="Mailings" colspan="2"/>
<field name="opt_in" on_change="on_change_opt_in(opt_in)"/>
<field name="opt_out" on_change="on_change_opt_out(opt_out)"/>
</group>
</page>
<page string="Extra Info">
<group col="2" colspan="2">
<group col="2" colspan="2" class="oe_form_group_label_border">
<separator string="Misc" colspan="2"/>
<field name="active"/>
<field name="day_open" groups="base.group_no_one"/>
<field name="day_close" groups="base.group_no_one"/>
<field name="referred"/>
</group>
<separator colspan="4" string="References"/>
<field name="ref"/>
<field name="ref2"/>
<group col="2" colspan="2" class="oe_form_group_label_border">
<separator colspan="4" string="References"/>
<field name="ref"/>
<field name="ref2"/>
</group>
</page>
</notebook>
</sheet>
+10 -13
View File
@@ -10,11 +10,11 @@
<data>
<xpath expr="//notebook/page[@string='Lead']" position="after">
<page string="Assignation">
<group name="partner_assign_group" col="5" colspan="4">
<group name="partner_assign_group" col="5" colspan="4" class="oe_form_group_label_border">
<separator string="Partner Assignation" colspan="5"/>
<field name="partner_assigned_id" on_change="onchange_assign_id(partner_assigned_id)" domain="[('grade_id','&lt;&gt;',False)]"/>
<field name="date_assign"/>
<group colspan="1" col="1">
<field width="50%%" name="partner_assigned_id" on_change="onchange_assign_id(partner_assigned_id)" domain="[('grade_id','&lt;&gt;',False)]"/>
<field width="40%%" name="date_assign"/>
<group width="10%%" colspan="1" col="1">
<button string="Forward"
attrs="{'invisible':[('partner_assigned_id','=',False)]}"
name="%(crm_lead_forward_to_partner_act)d"
@@ -22,15 +22,12 @@
context="{'default_name': 'partner', 'default_partner_id': partner_assigned_id}"
/>
</group>
<group name="geo_assign_group" col="5" colspan="4">
<separator string="Geo Assignation" colspan="5"/>
<field name="partner_latitude"/>
<field name="partner_longitude"/>
<group colspan="1" col="1">
<button string="Geo Assign" name="action_assign_partner" type="object" colspan="1"
icon="gtk-apply"/>
</group>
</group>
<separator string="Geo Assignation" colspan="5"/>
<field width="50%%" name="partner_latitude"/>
<field width="40%%" name="partner_longitude"/>
<button width="10%%" string="Geo Assign" name="action_assign_partner" type="object" colspan="1"
icon="gtk-apply"/>
</group>
</page>
</xpath>
+8 -6
View File
@@ -9,9 +9,9 @@
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
<field name="arch" type="xml">
<data>
<xpath expr="/form/group/group[@name='preferences']/field[@name='menu_tips']" position="after">
<field name="menu_tips" position="after">
<field name="notification_email_pref" readonly="0"/>
</xpath>
</field>
</data>
</field>
</record>
@@ -23,11 +23,13 @@
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<data>
<xpath expr="/form/notebook/page[@string='User']/group/group/group[@name='preferences']/field[@name='menu_tips']" position="after">
<field name="menu_tips" position="after">
<field name="notification_email_pref"/>
</xpath>
<xpath expr="/form/notebook" position="after">
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</field>
<xpath expr="/form/sheet" position="after">
<div class="oe_form_sheet_width">
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</div>
</xpath>
</data>
</field>
-10
View File
@@ -274,16 +274,6 @@
margin: 0;
}
.openerp .oe_mail_oe_right {
float: right;
margin-right: 8px;
}
.openerp .oe_mail_oe_left {
float: left;
margin-right: 8px;
}
.openerp a.oe_mail_oe_intlink {
color: #8786b7;
}
+1 -1
View File
@@ -646,7 +646,7 @@ openerp.mail = function(session) {
load_search_view: function (view_id, defaults, hidden) {
var self = this;
this.searchview = new session.web.SearchView(this, this.ds_msg, view_id || false, defaults || {}, hidden || false);
var search_view_loaded = this.searchview.appendTo(this.$element.find('.oe_view_manager_row'));
var search_view_loaded = this.searchview.appendTo(this.$element.find('.oe_view_manager_view_search'));
return $.when(search_view_loaded).then(function () {
self.searchview.on_search.add(self.do_searchview_search);
});
+9 -8
View File
@@ -2,15 +2,16 @@
<template>
<div t-name="Wall" class="oe_mail_wall">
<div class="oe_view_manager_header">
<div class="oe_view_manager_row">
<h2 class="oe_view_title">All Feeds</h2>
</div>
</div>
<table class="oe_view_manager_header">
<tr class="oe_header_row">
<td><h2 class="oe_view_title">All Feeds</h2></td>
<td><div class="oe_view_manager_view_search" t-opentag="true"/></td>
</tr>
</table>
<div class="oe_mail_wall_left">
<div class="oe_mail_wall_act">
<textarea class="oe_mail oe_mail_wall_action_textarea" placeholder="Add a personnal message here..."/>
<button class="oe_mail_oe_right oe_mail_wall_button_comment" type="button">Post comment</button>
<button class="oe_right oe_mail_wall_button_comment" type="button">Post comment</button>
</div>
<div class="oe_clear"></div>
<div class="oe_mail_wall_threads">
@@ -45,7 +46,7 @@
<ul t-name="Thread" class="oe_mail oe_mail_thread">
<div class="oe_mail_thread_act">
<img class="oe_mail_msg_image oe_mail_oe_left" alt="User img"/>
<img class="oe_mail_msg_image oe_left" alt="User img"/>
<div class="oe_mail_msg_content">
<textarea class="oe_mail oe_mail_action_textarea" placeholder="Add your comment here..." onfocus="this.value = '';"/><br />
</div>
@@ -58,7 +59,7 @@
<li t-name="ThreadMsg" t-attf-class="oe_mail oe_mail_thread_msg">
<div t-attf-class="oe_mail_msg_#{record.type}">
<img class="oe_mail_msg_image oe_mail_oe_left" t-att-src="record.mini_url"/>
<img class="oe_mail_msg_image oe_left" t-att-src="record.mini_url"/>
<div class="oe_mail_msg_content">
<t t-if="record.type == 'email'"><t t-call="EmailDisplay" /></t>
<t t-if="record.type == 'notification' || record.type == 'comment'"><t t-call="NoteDisplay" /></t>
+1 -1
View File
@@ -276,7 +276,7 @@
<field name="act_window_id" ref="product_normal_action_sell"/>
</record>
<menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>
<menuitem id="base.menu_product" parent="base.menu_base_partner" name="Products" sequence="9"/>
<menuitem action="product.product_normal_action_sell" id="product.menu_products" parent="base.menu_product" sequence="1"/>
<record id="product_normal_action_puchased" model="ir.actions.act_window">
+86 -100
View File
@@ -1,6 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Sale user dashboard -->
<record id="action_quotation_for_sale" model="ir.actions.act_window">
<field name="name">My Quotations</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','draft'),('user_id','=',uid)]</field>
<field name="view_id" ref="sale.view_order_tree"/>
</record>
<record id="view_turnover_by_month_tree" model="ir.ui.view">
<field name="name">turnover.by.month.tree</field>
<field name="model">account.invoice.report</field>
<field name="type">tree</field>
<!-- Lower priority to avoid conflicting with default accounting views for reports -->
<field name="priority" eval="32"/>
<field name="arch" type="xml">
<tree string="Monthly Turnover">
<field name="month"/>
<field name="price_total"/>
</tree>
</field>
</record>
<record id="view_turnover_by_month_graph" model="ir.ui.view">
<field name="name">turnover.by.month.graph</field>
<field name="model">account.invoice.report</field>
<!-- Lower priority to avoid conflicting with default accounting views for reports -->
<field name="priority" eval="32"/>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Monthly Turnover" type="bar">
<field name="month"/>
<field name="price_total" operator="+"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="action_turnover_by_month">
<field name="name">Monthly Turnover</field>
<field name="res_model">account.invoice.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_turnover_by_month_graph"/>
<field name="domain">[('year','ilike',time.strftime('%Y')),('user_id','=',uid)]</field>
<field name="context">{'group_by_no_leaf':1,'group_by':['month']}</field>
<field name="search_view_id" ref="account.view_account_invoice_report_search"/>
</record>
<record model="ir.actions.act_window.view" id="action_turnover_by_month_graph_view">
<field name="act_window_id" ref="action_turnover_by_month"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_turnover_by_month_graph"/>
</record>
<record model="ir.actions.act_window.view" id="action_turnover_by_month_tree_view">
<field name="act_window_id" ref="action_turnover_by_month"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_turnover_by_month_tree"/>
</record>
<record id="board_sales_form" model="ir.ui.view">
<field name="name">board.sales.form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales Dashboard" layout="manual">
<board style="2-1">
<column>
<action name="%(action_quotation_for_sale)d" string="My Quotations" creatable="true"/>
</column>
<column>
<action name="%(action_turnover_by_month)d" string="Monthly Turnover"/>
</column>
</board>
</form>
</field>
</record>
<record id="open_board_sales" model="ir.actions.act_window">
<field name="name">Sales</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="board_sales_form"/>
</record>
<menuitem id="menu_board_sales" parent="base.menu_reporting_dashboard" action="open_board_sales" sequence="15" groups="base.group_sale_salesman"/>
<!-- Sale manager dashboard -->
<record id="board_sales_manager_form" model="ir.ui.view">
<field name="name">board.sales.manager.form</field>
<field name="model">board.board</field>
@@ -21,112 +105,14 @@
</form>
</field>
</record>
<record id="open_board_sales_manager" model="ir.actions.act_window">
<field name="name">Sales Manager Dashboard</field>
<field name="name">Sales Manager</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="board_sales_manager_form"/>
</record>
<menuitem id="board.menu_sales_dashboard" name="Sales" sequence="1" parent="base.menu_reporting_dashboard"/>
<menuitem action="open_board_sales_manager" icon="terp-graph" id="menu_board_sales_manager" parent="board.menu_sales_dashboard" sequence="0" groups="base.group_sale_manager"/>
<record id="action_quotation_for_sale" model="ir.actions.act_window">
<field name="name">My Quotations</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','draft'),('user_id','=',uid)]</field>
<field name="view_id" ref="sale.view_order_tree"/>
</record>
<record id="view_turnover_by_month_tree" model="ir.ui.view">
<field name="name">turnover.by.month.tree</field>
<field name="model">account.invoice.report</field>
<field name="type">tree</field>
<!-- Lower priority to avoid conflicting with default accounting views for reports -->
<field name="priority" eval="32"/>
<field name="arch" type="xml">
<tree string="Monthly Turnover">
<field name="month"/>
<field name="price_total"/>
</tree>
</field>
</record>
<record id="view_turnover_by_month_graph" model="ir.ui.view">
<field name="name">turnover.by.month.graph</field>
<field name="model">account.invoice.report</field>
<!-- Lower priority to avoid conflicting with default accounting views for reports -->
<field name="priority" eval="32"/>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Monthly Turnover" type="bar">
<field name="month"/>
<field name="price_total" operator="+"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="action_turnover_by_month">
<field name="name">Monthly Turnover</field>
<field name="res_model">account.invoice.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_turnover_by_month_graph"/>
<field name="domain">[('year','ilike',time.strftime('%Y')),('user_id','=',uid)]</field>
<field name="context">{'group_by_no_leaf':1,'group_by':['month']}</field>
<field name="search_view_id" ref="account.view_account_invoice_report_search"/>
</record>
<record model="ir.actions.act_window.view" id="action_turnover_by_month_graph_view">
<field name="act_window_id" ref="action_turnover_by_month"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_turnover_by_month_graph"/>
</record>
<record model="ir.actions.act_window.view" id="action_turnover_by_month_tree_view">
<field name="act_window_id" ref="action_turnover_by_month"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_turnover_by_month_tree"/>
</record>
<record id="board_sales_form" model="ir.ui.view">
<field name="name">board.sales.form</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales Dashboard" layout="manual">
<board style="2-1">
<column>
<action name="%(action_quotation_for_sale)d"
string="My Quotations" creatable="true"/>
<!--groups="base.group_sale_salesman,base.group_sale_manager,account.group_account_user,stock.group_stock_user"-->
</column>
<column>
<action name="%(action_turnover_by_month)d"
string="Monthly Turnover"/>
<!--groups="base.group_sale_salesman,account.group_account_manager"-->
</column>
</board>
</form>
</field>
</record>
<record id="open_board_sales" model="ir.actions.act_window">
<field name="name">Sales Dashboard</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="board_sales_form"/>
</record>
<menuitem
id="base.menu_base_partner" action="open_board_sales"
name="Sales"/>
<menuitem id="menu_board_sales_manager" parent="base.menu_reporting_dashboard" action="open_board_sales_manager" sequence="16" groups="base.group_sale_manager"/>
</data>
</openerp>
+1 -5
View File
@@ -1,10 +1,6 @@
<openerp>
<data>
<menuitem icon="terp-partner"
id="base.menu_base_partner" name="Sales"
sequence="1" groups="base.group_sale_salesman,base.group_sale_manager"/>
<menuitem id="base.menu_product" name="Products" parent="base.menu_base_partner" sequence="9"/>
<menuitem icon="terp-partner" id="base.menu_base_partner" name="Sales" sequence="1" groups="base.group_sale_salesman"/>
<record id="view_shop_form" model="ir.ui.view">
<field name="name">sale.shop</field>
-1
View File
@@ -43,7 +43,6 @@ crm modules.
'init_xml': [],
'update_xml': ['wizard/crm_make_sale_view.xml',
'sale_crm_view.xml',
'board_sale_crm_view.xml',
'process/sale_crm_process.xml',
'security/sale_crm_security.xml',
'security/ir.model.access.csv'
-35
View File
@@ -1,35 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="board_crm_form_inherit_replace1">
<field name="name">board.crm.form.inherit.replace1</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="inherit_id" ref="sale.board_sales_form"/>
<field name="arch" type="xml">
<xpath expr="/form/board/column/action[@string='My Quotations']" position="before">
<action name="%(crm.act_my_oppor)d"
string="My Opportunities"
creatable="true"
/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="board_crm_form_inherit_replace3">
<field name="name">board.crm.form.inherit.replace1</field>
<field name="model">board.board</field>
<field name="type">form</field>
<field name="inherit_id" ref="sale.board_sales_form"/>
<field name="arch" type="xml">
<xpath expr="/form/board/column/action[@string='Monthly Turnover']" position="before">
<action name="%(crm.act_my_oppor_stage)d"
string="My Planned Revenues by Stage"
/>
</xpath>
</field>
</record>
<menuitem name="Sales"
id="base.menu_base_partner" action="sale.open_board_sales"/>
</data>
</openerp>
+5 -3
View File
@@ -8,9 +8,11 @@
<field name="type">form</field>
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
<field name="arch" type="xml">
<field name="priority" position="after">
<button string="Convert to Quote" icon="gtk-go-forward" name="%(action_crm_make_sale)d" type="action"/>
</field>
<data>
<xpath expr="//div[contains(@class,'oe_form_topbar')]/div[contains(@class,'oe_right')]" position="before">
<button string="Convert to Quote" icon="gtk-go-forward" name="%(action_crm_make_sale)d" type="action"/>
</xpath>
</data>
</field>
</record>
+2 -3
View File
@@ -68,9 +68,8 @@
<field name="view_id" ref="board_warehouse_form"/>
</record>
<menuitem id="menu_dashboard_stock" name="Warehouse" sequence="10" parent="base.menu_reporting_dashboard"/>
<menuitem action="open_board_warehouse" icon="terp-graph" groups="group_stock_manager" id="menu_board_warehouse" parent="menu_dashboard_stock" sequence="1"/>
<menuitem icon="terp-stock" id="stock.menu_stock_root" name="Warehouse" sequence="5" groups="group_stock_manager" action="open_board_warehouse"/>
<menuitem id="menu_board_warehouse" parent="base.menu_reporting_dashboard" action="open_board_warehouse" sequence="20" groups="group_stock_manager"/>
<menuitem icon="terp-stock" id="stock.menu_stock_root" name="Warehouse" groups="group_stock_manager" sequence="5"/>
</data>
</openerp>
+1 -1
View File
@@ -61,7 +61,7 @@
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<field name="standard_price" position="replace">
<label string="Cost Price :" align="1.0"/>
<label string="Cost Price" for="standard_price" align="1.0"/>
<group col="2" colspan="1">
<field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}" nolabel="1"/>
<button name="%(action_view_change_standard_price)d" string="Update"
+15
View File
@@ -0,0 +1,15 @@
OpenERP, Open Source Management Solution
Copyright © 2010-2011 OpenERP SA (<http://openerp.com>).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public Lice
along with this program. If not, see <http://www.gnu.org/licenses/>.
+22
View File
@@ -0,0 +1,22 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import controllers
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+50
View File
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Web Shortcuts',
'version': '1.0',
'category': 'Tools',
'complexity': "easy",
'description': """
Enable shortcuts feature in the web client
==========================================
Add a Shortcut icon in the systray in order to access the user's shortcuts (if any).
Add a Shortcut icon besides the views title in order to add/remove a shortcut.
""",
'author': 'OpenERP SA',
'website': 'http://openerp.com',
'depends': ['base'],
'update_xml': [],
'js' : [
'static/src/js/web_shortcuts.js',
],
'css' : [
'static/src/css/web_shortcuts.css',
],
'qweb' : [
"static/src/xml/*.xml",
],
'installable': True,
'auto_install': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,3 @@
import main
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+18
View File
@@ -0,0 +1,18 @@
try:
# embedded
import openerp.addons.web.common.http as openerpweb
import openerp.addons.web.controllers.main as webmain
except ImportError:
# standalone
import web.common.http as openerpweb
import web.controllers.main as webmain
class Shortcuts(openerpweb.Controller):
_cp_path = "/web/shortcuts"
@openerpweb.jsonrequest
def list(self, req):
return req.session.model('ir.ui.view_sc').get_sc(
req.session._uid, "ir.ui.menu", req.session.eval_context(req.context))
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,57 @@
/* Shortcuts*/
.oe_systray_shortcuts {
margin: 3px;
}
.oe-shortcut-toggle {
height: 20px;
margin-top: 3px;
padding: 0;
width: 24px;
cursor: pointer;
display: block;
background: url(/web/static/src/img/add-shortcut.png) no-repeat center center;
float: left;
}
.oe-shortcut-remove{
background: url(/web/static/src/img/remove-shortcut.png) no-repeat center center;
}
.oe-shortcuts {
position: absolute;
margin: 0;
padding: 6px 15px;
top: 37px;
left: 197px;
right: 0;
height: 17px;
line-height: 1.2;
}
.oe-shortcuts ul {
display: block;
overflow: hidden;
list-style: none;
white-space: nowrap;
padding: 0;
margin: 0;
}
.oe-shortcuts li {
cursor: pointer;
display: -moz-inline-stack;
display: inline-block;
display: inline; /*IE7 */
color: #fff;
text-align: center;
border-left: 1px solid #909090;
padding: 0 4px;
font-size: 80%;
font-weight: normal;
vertical-align: top;
}
.oe-shortcuts li:hover {
background-color: #666;
}
.oe-shortcuts li:first-child {
border-left: none;
padding-left: 0;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

@@ -0,0 +1,145 @@
/*############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011-2012 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
############################################################################*/
openerp.web_shortcuts = function (instance) {
var QWeb = instance.web.qweb,
_t = instance.web._t;
instance.web_shortcuts.Shortcuts = instance.web.Widget.extend({
template: 'Systray.Shortcuts',
init: function() {
this._super();
this.on('load', this, this.load);
this.on('add', this, this.add);
this.on('display', this, this.display);
this.on('remove', this, this.remove);
this.on('click', this, this.click);
this.dataset = new instance.web.DataSet(this, 'ir.ui.view_sc');
},
start: function() {
var self = this;
this._super();
this.trigger('load');
this.$element.on('click', '.oe_systray_shortcuts_items a', function() {
self.trigger('click', $(this));
});
},
load: function() {
var self = this;
this.$element.find('.oe_systray_shortcuts_items').empty();
return this.rpc('/web/shortcuts/list', {}, function(shortcuts) {
_.each(shortcuts, function(sc) {
self.trigger('display', sc);
});
});
},
add: function (sc) {
var self = this;
this.dataset.create(sc, function (out) {
self.trigger('display', {
name : sc.name,
id : out.result,
res_id : sc.res_id
});
});
},
display: function(sc) {
var self = this;
this.$element.find('.oe_systray_shortcuts_items').append();
var $sc = $(QWeb.render('Systray.Shortcuts.Item', {'shortcut': sc}));
$sc.appendTo(self.$element.find('.oe_systray_shortcuts_items'));
},
remove: function (menu_id) {
var menu_id = this.session.active_id;
var $shortcut = this.$element.find('.oe_systray_shortcuts_items li a[data-id=' + menu_id + ']');
var shortcut_id = $shortcut.data('shortcut-id');
$shortcut.remove();
this.dataset.unlink([shortcut_id]);
},
click: function($link) {
var self = this,
id = $link.data('id');
self.session.active_id = id;
self.rpc('/web/menu/action', {'menu_id': id}, function(ir_menu_data) {
if (ir_menu_data.action.length){
instance.webclient.user_menu.on_action(ir_menu_data.action[0][2]);
}
});
this.$element.find('.oe_systray_shortcuts').trigger('mouseout');
},
has: function(menu_id) {
return !!this.$element.find('a[data-id=' + menu_id + ']').length;
}
});
instance.web.UserMenu.include({
do_update: function() {
var self = this;
this._super.apply(this, arguments);
this.update_promise.then(function() {
if (self.shortcuts) {
self.shortcuts.trigger('load');
} else {
self.shortcuts = new instance.web_shortcuts.Shortcuts(self);
self.shortcuts.appendTo(instance.webclient.$element.find('.oe_systray'));
}
});
},
});
instance.web.ViewManagerAction.include({
on_mode_switch: function (view_type, no_store) {
var self = this;
this._super.apply(this, arguments).then(function() {
self.shortcut_check(self.views[view_type]);
});
},
shortcut_check : function(view) {
var self = this;
var shortcuts_menu = instance.webclient.user_menu.shortcuts;
var grandparent = this.getParent() && this.getParent().getParent();
// display shortcuts if on the first view for the action
var $shortcut_toggle = this.$element.find('.oe-shortcut-toggle');
if (!this.action.name ||
!(view.view_type === this.views_src[0].view_type
&& view.view_id === this.views_src[0].view_id)) {
$shortcut_toggle.hide();
return;
}
$shortcut_toggle.toggleClass('oe-shortcut-remove', shortcuts_menu.has(self.session.active_id));
$shortcut_toggle.unbind("click").click(function() {
if ($shortcut_toggle.hasClass("oe-shortcut-remove")) {
shortcuts_menu.trigger('remove', self.session.active_id);
} else {
shortcuts_menu.trigger('add', {
'user_id': self.session.uid,
'res_id': self.session.active_id,
'resource': 'ir.ui.menu',
'name': self.action.name
});
}
$shortcut_toggle.toggleClass("oe-shortcut-remove");
});
}
});
};
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- vim:fdl=1:
-->
<templates id="template" xml:space="preserve">
<t t-name="Systray.Shortcuts">
<div class="oe_systray_shortcuts oe_systray_dropdown">
<a href="#"><img src="/web_shortcuts/static/src/img/icon.png" width="22" height="22" border="0"/></a>
<ul class="oe_systray_shortcuts_items oe_systray_dropdown_options"/>
</div>
</t>
<t t-name="Systray.Shortcuts.Item">
<li>
<a href="#" t-att-data-id="shortcut.res_id" t-att-data-shortcut-id="shortcut.id">
<t t-esc="shortcut.name"/>
</a>
</li>
</t>
<t t-extend="ViewManagerAction">
<t t-jquery="h2.oe_view_title" t-operation="prepend">
<a t-if="widget.flags.display_title !== false" class="oe-shortcut-toggle" title="Add / Remove Shortcut..."
href="javascript: void(0)"> </a>
</t>
</t>
</templates>