[IMP] Fixed issue of traceback when we enter non integer number,improved css and help.

bzr revid: tpa@tinyerp.com-20130726071834-hd9qyyotf41ja57w
This commit is contained in:
Turkesh Patel (Open ERP) 2013-07-26 12:48:34 +05:30
parent a892e25901
commit edff1d9575
4 changed files with 49 additions and 14 deletions

View File

@ -29,6 +29,7 @@
margin: 0 !important;
position: relative;
display: inline-block;
float: left;
}
.openerp .oe_kanban_view .oe_kanban_crm_salesteams .oe_items_list a:hover {
text-decoration: underline !important;

View File

@ -47,8 +47,8 @@
<search string="Sales Analysis">
<field name="date"/>
<field name="date_confirm"/>
<filter icon="terp-document-new" string="Quotations" domain="[('state','=','draft')]"/>
<filter icon="terp-check" string="Sales" domain="[('state','not in',('draft','done','cancel'))]"/>
<filter icon="terp-document-new" name="Quotations" domain="[('state','=','draft')]"/>
<filter icon="terp-check" name="Sales" domain="[('state','not in',('draft','done','cancel'))]"/>
<separator/>
<filter icon="terp-accessories-archiver" string="Picked" domain="[('shipped','=',True)]"/>
<separator/>

View File

@ -211,6 +211,33 @@
<field name="act_window_id" ref="sale_crm.action_invoice_salesteams"/>
</record>
<record id="action_order_report_quotation_salesteam" model="ir.actions.act_window">
<field name="name">Sales Analysis</field>
<field name="res_model">sale.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_year':1,'search_default_month':1,'search_default_User':1,'search_default_Quotations':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="help">This report performs analysis on your quotations and sales orders. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application.</field>
</record>
<record id="action_order_report_so_salesteam" model="ir.actions.act_window">
<field name="name">Sales Analysis</field>
<field name="res_model">sale.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_year':1,'search_default_month':1,'search_default_User':1,'search_default_Sales':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="help">This report performs analysis on your quotations and sales orders. Analysis check your sales revenues and sort it by different group criteria (salesman, partner, product, etc.) Use this report to perform analysis on sales not having invoiced yet. If you want to analyse your turnover, you should use the Invoice Analysis report in the Accounting application.</field>
</record>
<record id="action_account_invoice_report_salesteam" model="ir.actions.act_window">
<field name="name">Invoices Analysis</field>
<field name="res_model">account.invoice.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_period':1, 'search_default_current':1, 'search_default_user':1, 'search_default_year': 1, 'search_default_category_product':1, 'search_default_customer':1, 'group_by':[], 'group_by_no_leaf':1,}</field>
<field name="help">From this report, you can have an overview of the amount invoiced to your customer. The tool search can also be used to personalise your Invoices reports and so, match this analysis to your needs.</field>
</record>
<record id="crm_case_section_salesteams_view_form" model="ir.ui.view">
<field name="name">crm.case.section.form</field>
<field name="model">crm.case.section</field>
@ -241,9 +268,9 @@
<xpath expr="//div[@class='oe_salesteams_leads']" position="after">
<div class="oe_salesteams_orders">
<a name="%(action_orders_salesteams)d" type="action">Sales Orders</a>
<a name="%(sale.action_order_report_all)d" type="action" class="oe_sparkline_bar_link">
<a name="%(action_order_report_so_salesteam)d" type="action" class="oe_sparkline_bar_link">
<field name="monthly_confirmed" widget="sparkline_bar">
Revenue of confirmed sales orders per month.<br/>Click the acces to Sales Analysis
Revenue of confirmed sales orders per month.<br/>Click to acces the Sales Analysis
</field>
</a>
</div>
@ -251,7 +278,7 @@
<xpath expr="//div[@class='oe_salesteams_opportunities']" position="after">
<div class="oe_salesteams_invoices">
<a name="%(action_invoice_salesteams)d" type="action" groups="account.group_account_invoice">Invoices</a>
<a name="%(account.action_account_invoice_report_all)d" type="action" class="oe_sparkline_bar_link">
<a name="%(action_account_invoice_report_salesteam)d" type="action" class="oe_sparkline_bar_link">
<field name="monthly_invoiced" widget="sparkline_bar">
Revenue of sent invoices per month.<br/>Click to see a detailed analysis of invoices.
</field>
@ -259,9 +286,9 @@
</div>
<div class="oe_salesteams_quotations">
<a name="%(action_quotations_salesteams)d" type="action" class="oe_sparkline_bar_link">Quotations</a>
<a name="%(sale.action_order_report_all)d" type="action" class="oe_sparkline_bar_link">
<a name="%(action_order_report_quotation_salesteam)d" type="action" class="oe_sparkline_bar_link">
<field name="monthly_quoted" widget="sparkline_bar">
Revenue of created quotation per month.<br/>Click to see a detailed analysis of sales.
Revenue of created quotations per month.<br/>Click to see a detailed analysis of sales.
</field>
</a>
</div>

View File

@ -67,13 +67,17 @@ openerp.sale_crm.GaugeWidget = openerp.web_kanban.AbstractField.extend({
$input.focus()
.keydown(function (event) {
event.stopPropagation();
if (event.keyCode == 13 || event.keyCode == 9) {
if ($input.val() != value) {
parent.view.dataset.call(self.options.action_change, [parent.id, $input.val()]).then(function () {
parent.do_reload();
});
} else {
$div.remove();
if(isNaN($input.val())){
self.do_warn(_t("Wrong value entered!"), _t("Only Integer Value should be valid."));
$div.remove();
} else {
if (event.keyCode == 13 || event.keyCode == 9) {
var val = self.parse_client($input.val());
if (val != value) {
parent.view.dataset.call(self.options.action_change, [parent.id, $input.val()]).then(function () {
parent.do_reload();
});
} else { $div.remove();}
}
}
})
@ -102,6 +106,9 @@ openerp.sale_crm.GaugeWidget = openerp.web_kanban.AbstractField.extend({
}
}
},
parse_client: function(value) {
return openerp.web.parse_value(value, { type:"integer" });
},
});
openerp.web_kanban.fields_registry.add("gage", "openerp.sale_crm.GaugeWidget");