summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorapa-tiny <apa@tinyerp.com>2010-11-23 15:38:29 +0530
committerapa-tiny <apa@tinyerp.com>2010-11-23 15:38:29 +0530
commitc103fbc02b4d9c1cbf3dfffb4e515f26bed5085e (patch)
tree2774b5da74cc8bb14bf7fe04acf784c0591a9bf4
parent0bd20f1ede3fd9978a05e407603ebfd95b7d410d (diff)
parent6abb5ce3d2b60671f7366a082a371b3be60158e8 (diff)
[MERGE]:lp:~openerp-dev/openobject-addons/report_dev
bzr revid: apa@tinyerp.com-20101123100829-aw03hf8llt3kypi5
-rw-r--r--addons/account/account.py2
-rw-r--r--addons/account/account_unit_test.xml20
-rw-r--r--addons/account/invoice.py2
-rw-r--r--addons/account/report/account_general_ledger.py14
-rw-r--r--addons/account/report/account_general_ledger_landscape.rml1
-rw-r--r--addons/account/report/common_report_header.py4
-rw-r--r--addons/crm/board_crm_statistical_view.xml11
-rw-r--r--addons/crm/board_crm_view.xml27
-rw-r--r--addons/crm/report/crm_lead_report_view.xml4
-rw-r--r--addons/sale/board_sale_view.xml6
-rw-r--r--addons/sale/report/sale_report_view.xml91
11 files changed, 45 insertions, 137 deletions
diff --git a/addons/account/account.py b/addons/account/account.py
index 6cead2cddd3..485b085fbbe 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 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
- <!-- This file must be loaded _after_ account_demo.xml ! -->
+ <!-- This file must be loaded _after_ account_demo.xml ! -->
<record id="test_invoice_1" model="account.invoice">
<field name="currency_id" ref="base.EUR"/>
<field name="company_id" ref="base.main_company"/>
@@ -19,8 +19,8 @@
<field name="base">5.00</field>
<field name="amount">100.00</field>
<field name="account_id" ref="account.ova"/>
- <field name="invoice_id" ref="test_invoice_1"/>
- </record>
+ <field name="invoice_id" ref="test_invoice_1"/>
+ </record>
<record id="test_invoice_1_line_1" model="account.invoice.line">
<field name="name">Basic computer with Dvorak keyboard and left-handed mouse</field>
<field name="invoice_id" ref="test_invoice_1"/>
@@ -34,19 +34,19 @@
<field name="price_unit">800</field>
<field name="quantity">2</field>
<field name="account_id" ref="account.a_sale"/>
- </record>
-
+ </record>
+
<assert id="test_invoice_1" model="account.invoice" string="The currency unit of Test invoice 1 is EUR">
- <test expr="currency_id.code">EUR</test>
+ <test expr="currency_id.symbol">€</test>
</assert>
-
+
<assert id="test_invoice_1" model="account.invoice" severity="error" string="The amount of Test invoice 1 is correct">
<test expr="sum([l.price_subtotal for l in invoice_line]) == 1850"/>
<test expr="sum([l.price_subtotal for l in invoice_line]) == amount_untaxed"/>
</assert>
-
+
<workflow action="invoice_open" model="account.invoice" ref="test_invoice_1"/>
-
+
<assert id="test_invoice_1" model="account.invoice" string="Test invoice 1 is now open">
<test expr="state">open</test>
</assert>
@@ -62,7 +62,7 @@
<!-- context = --> <value eval="{}"/>
<!-- name = --> <value eval="str('Payment from ASUStek')"/>
</function>
-
+
<assert id="test_invoice_1" model="account.invoice" string="Test invoice 1 is now paid">
<test expr="state">paid</test>
</assert>
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 4eae61d90d7..0512b160a51 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -1235,7 +1235,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.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:
diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml
index 5e2d445f772..fcf635e3a5c 100644
--- a/addons/account/report/account_general_ledger_landscape.rml
+++ b/addons/account/report/account_general_ledger_landscape.rml
@@ -271,6 +271,7 @@
<pto>
<pto_header>
<blockTable colWidths="40.0,50.0,105.0,67.0,65.0,130.0,50.0,70.0,65.0,75.0,70.0" style="Table7">[[data['form']['amount_currency'] == True or removeParentNode('blockTable')]]
+
<tr>
<td>
<para style="terp_tblheader_Details">Date</para>
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
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 @@
</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>
@@ -43,12 +43,13 @@
</record>
<record model="ir.actions.act_window" id="act_oppor_categ">
- <field name="res_model">Opportunities By Categories</field>
+ <field name="res_model">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">
@@ -57,6 +58,7 @@
<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">
@@ -66,6 +68,7 @@
<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">
@@ -77,14 +80,14 @@
<hpaned>
<child1>
<action
- string="Opportunities By Categories"
+ string="Opportunities by Categories"
name="%(act_oppor_categ)d"
colspan="4"
height="200"
width="250"/>
<action
- string="Opportunities By Stage"
+ string="Opportunities by Stage"
name="%(act_opportunity_stage)d"
height="200"
colspan="4"/>
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 @@
</field>
</record>
- <record id="view_report_crm_oppor_tree" model="ir.ui.view">
- <field name="name">crm.lead.report.tree</field>
- <field name="model">crm.lead.report</field>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <tree string="Opportunity Analysis">
- <field name="stage_id"/>
- <field name="planned_revenue"/>
- </tree>
- </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>
@@ -110,21 +99,9 @@
<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">['&amp;', '&amp;', ('user_id','=',uid), ('type', '=', 'opportunity'), '!' , '&amp;', ('state', '=', 'done'), ('date_closed','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%Y-%m-%d'))]</field>
- <field name="context">{'group_by_no_leaf':1,'group_by':['stage_id']}</field>
+ <field name="domain">['&amp;', '&amp;', ('user_id','=',uid), ('type', '=', 'opportunity'), '!' , '&amp;', ('state', '=', 'done'), ('date_closed','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%Y-%m-%d'))]</field>
+ <field name="context">{'search_default_Stage':1}</field>
</record>
- <record id="open_view_report_crm_oppor_graph" model="ir.actions.act_window.view">
- <field eval="1" name="sequence"/>
- <field name="view_mode">graph</field>
- <field name="view_id" ref="view_report_crm_oppor_graph"/>
- <field name="act_window_id" ref="act_my_oppor_stage"/>
- </record>
- <record id="open_view_report_crm_oppor_tree" model="ir.actions.act_window.view">
- <field eval="2" name="sequence"/>
- <field name="view_mode">tree</field>
- <field name="view_id" ref="view_report_crm_oppor_tree"/>
- <field name="act_window_id" ref="act_my_oppor_stage"/>
- </record>
<record model="ir.actions.act_window" id="act_sales_pipeline">
<field name="res_model">crm.lead.report</field>
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'}" />
<separator orientation="vertical" />
- <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
+ <filter string="Stage" name="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
- <filter string="Category" icon="terp-stock_symbol-selection"
+ <filter string="Category" name="Category" icon="terp-stock_symbol-selection"
domain="[]" context="{'group_by':'categ_id'}" />
<filter string="Campaign" icon="terp-gtk-jump-to-rtl"
domain="[]" context="{'group_by':'type_id'}" />
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 @@
<hpaned position="100">
<child1>
<action name="%(sale.action_quotation_for_sale)d" string="Quotations"/>
- <action width="510" name="%(sale.action_view_sales_by_month)d" string="Sales By Month"/>
+ <action width="510" name="%(sale.action_view_sales_by_month)d" string="Sales by Month"/>
</child1>
<child2>
- <action name="%(sale.action_sales_by_salesman)d" string="Sales By Salesman"/>
- <action name="%(sale.action_sales_by_partner)d" string="Sales By Customer"/>
+ <action name="%(sale.action_sales_by_salesman)d" string="Sales by Salesman"/>
+ <action name="%(sale.action_sales_by_partner)d" string="Sales by Customer"/>
<action name="%(sale.action_sales_product_total_price)d" string="Sales by Product's Category"/>
</child2>
</hpaned>
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 @@
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="Salesman" icon="terp-personal" name="User" context="{'group_by':'user_id'}"/>
- <filter string="Partner" icon="terp-partner" context="{'group_by':'partner_id'}"/>
+ <filter string="Partner" icon="terp-partner" name="Customer" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical"/>
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id','set_visible':True}"/>
<filter string="Default UoM" icon="terp-mrp" context="{'group_by':'uom_name'}"/>
- <filter string="Category of Product" icon="terp-stock_symbol-selection" context="{'group_by':'categ_id'}"/>
+ <filter string="Category of Product" icon="terp-stock_symbol-selection" name="Category" context="{'group_by':'categ_id'}"/>
<separator orientation="vertical" groups="analytic.group_analytic_accounting"/>
<filter string="Analytic Account" icon="terp-folder-green" context="{'group_by':'analytic_account_id'}" groups="analytic.group_analytic_accounting"/>
<separator orientation="vertical" groups="analytic.group_analytic_accounting"/>
@@ -133,24 +133,12 @@
<menuitem action="action_order_report_all" id="menu_report_product_all" parent="base.next_id_64" sequence="1" groups="base.group_sale_manager"/>
<!--This views used in board_sale module -->
- <record id="view_sales_by_partner_tree" model="ir.ui.view">
- <field name="name">sales.by.partner.tree</field>
- <field name="model">sale.report</field>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <tree string="Sales By Partner">
- <field name="partner_id"/>
- <field name="price_total"/>
- </tree>
- </field>
- </record>
-
<record id="view_sales_by_partner_graph" model="ir.ui.view">
<field name="name">sales.by.partner.graph</field>
<field name="model">sale.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
- <graph string="Sales By Partner" type="bar">
+ <graph string="Sales by Partner" type="bar">
<field name="partner_id" />
<field name="price_total" operator="+"/>
</graph>
@@ -158,37 +146,13 @@
</record>
<record id="action_sales_by_partner" model="ir.actions.act_window">
- <field name="name">Sales By Partner</field>
+ <field name="name">Sales by Partner</field>
<field name="res_model">sale.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('state','in',('manual','progress')),('date','&lt;=', time.strftime('%Y-%m-%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=90)).strftime('%Y-%m-%d'))]</field>
<field name="view_id" ref="view_sales_by_partner_graph"/>
- <field name="context">{'group_by_no_leaf':1,'group_by':['partner_id']}</field>
- </record>
- <record id="open_view_sales_by_partner_graph" model="ir.actions.act_window.view">
- <field eval="1" name="sequence"/>
- <field name="view_mode">graph</field>
- <field name="view_id" ref="view_sales_by_partner_graph"/>
- <field name="act_window_id" ref="action_sales_by_partner"/>
- </record>
- <record id="open_view_sales_by_partner_tree" model="ir.actions.act_window.view">
- <field eval="2" name="sequence"/>
- <field name="view_mode">tree</field>
- <field name="view_id" ref="view_sales_by_partner_tree"/>
- <field name="act_window_id" ref="action_sales_by_partner"/>
- </record>
-
- <record id="view_sales_by_salesman_tree" model="ir.ui.view">
- <field name="name">sales.by.salesman.tree</field>
- <field name="model">sale.report</field>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <tree string="Sales By Salesman">
- <field name="user_id"/>
- <field name="price_total"/>
- </tree>
- </field>
+ <field name="context">{'search_default_Customer':1}</field>
</record>
<record id="view_sales_by_salesman_graph" model="ir.ui.view">
@@ -196,7 +160,7 @@
<field name="model">sale.report</field>
<field name="type">graph</field>
<field name="arch" type="xml">
- <graph string="Sales By Salesman" type="bar">
+ <graph string="Sales by Salesman" type="bar">
<field name="user_id" />
<field name="price_total" operator="+"/>
</graph>
@@ -204,36 +168,13 @@
</record>
<record id="action_sales_by_salesman" model="ir.actions.act_window">
- <field name="name">Sales By Salesman</field>
+ <field name="name">Sales by Salesman</field>
<field name="res_model">sale.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree</field>
<field name="domain">[('state','in',('manual','progress','done')),('date','&lt;=', time.strftime('%Y-%m-%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=90)).strftime('%Y-%m-%d'))]</field>
<field name="view_id" ref="view_sales_by_salesman_graph"/>
- <field name="context">{'group_by_no_leaf':1,'group_by':['user_id']}</field>
- </record>
- <record id="open_view_sales_by_salesman_graph" model="ir.actions.act_window.view">
- <field eval="7" name="sequence"/>
- <field name="view_mode">graph</field>
- <field name="view_id" ref="view_sales_by_salesman_graph"/>
- <field name="act_window_id" ref="action_sales_by_salesman"/>
- </record>
- <record id="open_view_sales_by_salesman_tree" model="ir.actions.act_window.view">
- <field eval="9" name="sequence"/>
- <field name="view_mode">tree</field>
- <field name="view_id" ref="view_sales_by_salesman_tree"/>
- <field name="act_window_id" ref="action_sales_by_salesman"/>
- </record>
- <record id="view_sales_product_total_price_tree" model="ir.ui.view">
- <field name="name">sold.product.total.price.tree</field>
- <field name="model">sale.report</field>
- <field name="type">tree</field>
- <field name="arch" type="xml">
- <tree string="Sales by Product Category">
- <field name="categ_id"/>
- <field name="price_total"/>
- </tree>
- </field>
+ <field name="context">{'search_default_User':1}</field>
</record>
<record id="view_sales_product_total_price_graph" model="ir.ui.view">
@@ -255,20 +196,8 @@
<field name="view_mode">graph,tree</field>
<field name="domain">[('state','in',('manual','progress','done')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=90)).strftime('%Y-%m-%d'))]</field>
<field name="view_id" ref="view_sales_product_total_price_graph"/>
- <field name="context">{'group_by_no_leaf':1,'group_by':['categ_id']}</field>
- </record>
- <record id="open_view_sales_product_total_price_graph" model="ir.actions.act_window.view">
- <field eval="3" name="sequence"/>
- <field name="view_mode">graph</field>
- <field name="view_id" ref="view_sales_product_total_price_graph"/>
- <field name="act_window_id" ref="action_sales_product_total_price"/>
+ <field name="context">{'search_default_Category':1}</field>
</record>
- <record id="open_view_sales_product_total_price_tree" model="ir.actions.act_window.view">
- <field eval="4" name="sequence"/>
- <field name="view_mode">tree</field>
- <field name="view_id" ref="view_sales_product_total_price_tree"/>
- <field name="act_window_id" ref="action_sales_product_total_price"/>
- </record>
<record id="view_sales_by_month_tree" model="ir.ui.view">
<field name="name">view.sales.by.month.tree</field>
@@ -283,7 +212,7 @@
</field>
</record>
<record id="action_view_sales_by_month" model="ir.actions.act_window">
- <field name="name">Sales By Month</field>
+ <field name="name">Sales by Month</field>
<field name="res_model">sale.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>