From ad917be44207e98a4bc7e9d9e2d357eeaf267fb7 Mon Sep 17 00:00:00 2001 From: rch-openerp Date: Thu, 18 Nov 2010 17:54:59 +0530 Subject: [PATCH 1/4] [IMP]: Replace currency code with currency symbol. bzr revid: rch@tinyerp.com-20101118122459-8wxos4t4lsifc840 --- addons/account/account.py | 2 +- addons/account/account_unit_test.xml | 20 +++++++++---------- addons/account/invoice.py | 2 +- .../account_general_ledger_landscape.rml | 2 +- addons/account/report/common_report_header.py | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 0f8c9575931..0c1f9f0f73c 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -312,7 +312,7 @@ class account_account(osv.osv): def _get_company_currency(self, cr, uid, ids, field_name, arg, context={}): result = {} for rec in self.browse(cr, uid, ids, context): - result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.code) + result[rec.id] = (rec.company_id.currency_id.id,rec.company_id.currency_id.symbol) return result def _get_child_ids(self, cr, uid, ids, field_name, arg, context={}): diff --git a/addons/account/account_unit_test.xml b/addons/account/account_unit_test.xml index e4178517361..c810e6a1080 100644 --- a/addons/account/account_unit_test.xml +++ b/addons/account/account_unit_test.xml @@ -1,7 +1,7 @@ - + @@ -19,8 +19,8 @@ 5.00 100.00 - - + + Basic computer with Dvorak keyboard and left-handed mouse @@ -34,19 +34,19 @@ 800 2 - - + + - EUR + € - + - + - + open @@ -62,7 +62,7 @@ - + paid diff --git a/addons/account/invoice.py b/addons/account/invoice.py index e03e0035022..559b259057d 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1232,7 +1232,7 @@ class account_invoice(osv.osv): if (not round(total,self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))) or writeoff_acc_id: self.pool.get('account.move.line').reconcile(cr, uid, line_ids, 'manual', writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context) else: - code = invoice.currency_id.code + code = invoice.currency_id.symbol # TODO: use currency's formatting function msg = _("Invoice '%s' is paid partially: %s%s of %s%s (%s%s remaining)") % \ (name, pay_amount, code, invoice.amount_total, code, total, code) diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml index a10f23f439a..a8404f5b2b3 100644 --- a/addons/account/report/account_general_ledger_landscape.rml +++ b/addons/account/report/account_general_ledger_landscape.rml @@ -301,7 +301,7 @@ [[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]] [[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]] [[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] - [[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]] + [[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.symbol or '' ]] diff --git a/addons/account/report/common_report_header.py b/addons/account/report/common_report_header.py index 35d0c1356ef..68c976cb4fe 100644 --- a/addons/account/report/common_report_header.py +++ b/addons/account/report/common_report_header.py @@ -136,7 +136,7 @@ class common_report_header(object): def _get_currency(self, data): if data.get('form', False) and data['form'].get('chart_account_id', False): - return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr, self.uid, data['form']['chart_account_id']).company_id.currency_id.code - return '' + return pooler.get_pool(self.cr.dbname).get('account.account').browse(self.cr, self.uid, data['form']['chart_account_id']).company_id.currency_id.symbol + return '' #vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file From 314aba57579fe08a96744ab4a6afe65eb5e976ba Mon Sep 17 00:00:00 2001 From: rch-openerp Date: Fri, 19 Nov 2010 17:47:39 +0530 Subject: [PATCH 2/4] [IMP]: Group by works correctly when zoom on graph view of Sale Manager Dashboard. bzr revid: rch@tinyerp.com-20101119121739-uz7pyth9i8dj23mf --- addons/sale/board_sale_view.xml | 6 +- addons/sale/report/sale_report_view.xml | 91 +++---------------------- 2 files changed, 13 insertions(+), 84 deletions(-) diff --git a/addons/sale/board_sale_view.xml b/addons/sale/board_sale_view.xml index 1473bf42f31..82fdc3d1d3b 100644 --- a/addons/sale/board_sale_view.xml +++ b/addons/sale/board_sale_view.xml @@ -14,11 +14,11 @@ - + - - + + diff --git a/addons/sale/report/sale_report_view.xml b/addons/sale/report/sale_report_view.xml index 4f81fb4cb5d..a47ab2e73a9 100644 --- a/addons/sale/report/sale_report_view.xml +++ b/addons/sale/report/sale_report_view.xml @@ -97,11 +97,11 @@ - + - + @@ -133,24 +133,12 @@ - - sales.by.partner.tree - sale.report - tree - - - - - - - - sales.by.partner.graph sale.report graph - + @@ -158,37 +146,13 @@ - Sales By Partner + Sales by Partner sale.report form graph,tree [('state','in',('manual','progress')),('date','<=', time.strftime('%Y-%m-%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=90)).strftime('%Y-%m-%d'))] - {'group_by_no_leaf':1,'group_by':['partner_id']} - - - - graph - - - - - - tree - - - - - - sales.by.salesman.tree - sale.report - tree - - - - - - + {'search_default_Customer':1} @@ -196,7 +160,7 @@ sale.report graph - + @@ -204,36 +168,13 @@ - Sales By Salesman + Sales by Salesman sale.report form graph,tree [('state','in',('manual','progress','done')),('date','<=', time.strftime('%Y-%m-%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=90)).strftime('%Y-%m-%d'))] - {'group_by_no_leaf':1,'group_by':['user_id']} - - - - graph - - - - - - tree - - - - - sold.product.total.price.tree - sale.report - tree - - - - - - + {'search_default_User':1} @@ -255,20 +196,8 @@ graph,tree [('state','in',('manual','progress','done')),('date','>',(datetime.date.today()-datetime.timedelta(days=90)).strftime('%Y-%m-%d'))] - {'group_by_no_leaf':1,'group_by':['categ_id']} + {'search_default_Category':1} - - - graph - - - - - - tree - - - view.sales.by.month.tree @@ -283,7 +212,7 @@ - Sales By Month + Sales by Month sale.report form tree,graph From 229eb3120fc18e4bfac16cb911f14f15566b2c1e Mon Sep 17 00:00:00 2001 From: rch-openerp Date: Fri, 19 Nov 2010 18:28:39 +0530 Subject: [PATCH 3/4] [IMP]: Group by works correctly when zoom on graph view of Sale Dashboard and select field's button in group by when zoom on graph view. bzr revid: rch@tinyerp.com-20101119125839-yzspdbfxek7yt15b --- addons/crm/board_crm_statistical_view.xml | 11 +++++---- addons/crm/board_crm_view.xml | 27 ++-------------------- addons/crm/report/crm_lead_report_view.xml | 4 ++-- 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/addons/crm/board_crm_statistical_view.xml b/addons/crm/board_crm_statistical_view.xml index ae76031ecc0..333a8684764 100644 --- a/addons/crm/board_crm_statistical_view.xml +++ b/addons/crm/board_crm_statistical_view.xml @@ -28,7 +28,7 @@ - + Opportunities By Stage Per User - Graph crm.lead.report @@ -43,12 +43,13 @@ - Opportunities By Categories + Opportunities by Categories crm.lead.report form graph,tree,form [('state', 'not in', ('done', 'cancel')), ('type', '=', 'opportunity')] + {'search_default_Category':1} @@ -57,6 +58,7 @@ graph,tree,form [('state', 'not in', ('done', 'cancel')), ('type', '=', 'opportunity')] + {'search_default_Stage':1} @@ -66,6 +68,7 @@ graph,tree,form [('state','!=','cancel')] + {'search_default_Stage':1} @@ -77,14 +80,14 @@ diff --git a/addons/crm/board_crm_view.xml b/addons/crm/board_crm_view.xml index f316ed4e26a..80e7fbfed0c 100644 --- a/addons/crm/board_crm_view.xml +++ b/addons/crm/board_crm_view.xml @@ -18,17 +18,6 @@ - - crm.lead.report.tree - crm.lead.report - tree - - - - - - - crm.lead.report.graph crm.lead.report @@ -110,21 +99,9 @@ form graph,tree,form - ['&', '&', ('user_id','=',uid), ('type', '=', 'opportunity'), '!' , '&', ('state', '=', 'done'), ('date_closed','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%Y-%m-%d'))] - {'group_by_no_leaf':1,'group_by':['stage_id']} + ['&', '&', ('user_id','=',uid), ('type', '=', 'opportunity'), '!' , '&', ('state', '=', 'done'), ('date_closed','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%Y-%m-%d'))] + {'search_default_Stage':1} - - - graph - - - - - - tree - - - crm.lead.report diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml index f099ceede8b..fd27e55fc2e 100644 --- a/addons/crm/report/crm_lead_report_view.xml +++ b/addons/crm/report/crm_lead_report_view.xml @@ -136,9 +136,9 @@ domain="[]" context="{'group_by':'company_id'}" /> - + - From 4c8a58015ae2edfc87e5e65dce1b651a21e26f1d Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Mon, 22 Nov 2010 17:23:48 +0100 Subject: [PATCH 4/4] [FIX] account, general ledger report: fixed the strip_name function bzr revid: qdp-launchpad@tinyerp.com-20101122162348-paxq56r4wj6mtjqn --- addons/account/report/account_general_ledger.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py index 6ccfb9343a2..4656987cbeb 100644 --- a/addons/account/report/account_general_ledger.py +++ b/addons/account/report/account_general_ledger.py @@ -90,15 +90,13 @@ class general_ledger(report_sxw.rml_parse, common_report_header): }) self.context = context - def _ellipsis(self, orig_str, maxlen=100, ellipsis='...'): - maxlen = maxlen - len(ellipsis) - if maxlen <= 0: - maxlen = 1 - new_str = orig_str[:maxlen] - return new_str + def _ellipsis(self, char, size=100, truncation_str='...'): + if len(char) <= size: + return char + return char[:size-len(truncation_str)] + truncation_str def _strip_name(self, name, maxlen=50): - return self._ellipsis(name, maxlen, ' ...') + return self._ellipsis(name, maxlen) def _sum_currency_amount_account(self, account): self.cr.execute('SELECT sum(l.amount_currency) AS tot_currency \ @@ -317,4 +315,4 @@ class general_ledger(report_sxw.rml_parse, common_report_header): report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/account_general_ledger.rml', parser=general_ledger, header='internal') report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/account_general_ledger_landscape.rml', parser=general_ledger, header='internal landscape') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: