diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2016-05-06 17:59:43 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2016-05-12 13:11:47 +0200 |
| commit | f41bcda03b3eb054f640355ce4e165a1e5c99c8f (patch) | |
| tree | 8d703c848f4dac8635323cccdb37960d4529f344 | |
| parent | 53f86de70db63244a2fc19e7a0bd776528cadecc (diff) | |
[IMP] account: invoice analysis pivot quantities
In the report "Invoice Analysis", the view under the report is grouping
lines by invoice and also by product on this invoice.
Thus, quantities in the pivot view are not the real quantity of invoice
lines, but of invoice lines with different products.
eg:
invoice a:
- line 1: product X
- line 2: product Y
- line 3: product X
in the report there would appear to only be 2 invoice line, whilst there
is in realy three (this information is accessible via "# of Lines").
closes #11954
opw-676651
| -rw-r--r-- | addons/account/i18n/account.pot | 2 | ||||
| -rw-r--r-- | addons/account/report/account_invoice_report.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot index 2031a086405..80638ce39b4 100644 --- a/addons/account/i18n/account.pot +++ b/addons/account/i18n/account.pot @@ -97,7 +97,7 @@ msgstr "" #. module: account #: model:ir.model.fields,field_description:account.field_account_invoice_report_nbr -msgid "# of Invoices" +msgid "# of Lines" msgstr "" #. module: account diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index b2f2f0fa83c..319983c65f2 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -46,7 +46,7 @@ class AccountInvoiceReport(models.Model): price_average = fields.Float(string='Average Price', readonly=True, group_operator="avg") user_currency_price_average = fields.Float(string="Average Price", compute='_compute_amounts_in_user_currency', digits=0) currency_rate = fields.Float(string='Currency Rate', readonly=True) - nbr = fields.Integer(string='# of Invoices', readonly=True) # TDE FIXME master: rename into nbr_lines + nbr = fields.Integer(string='# of Lines', readonly=True) # TDE FIXME master: rename into nbr_lines type = fields.Selection([ ('out_invoice', 'Customer Invoice'), ('in_invoice', 'Vendor Bill'), @@ -102,12 +102,12 @@ class AccountInvoiceReport(models.Model): def _sub_select(self): select_str = """ - SELECT min(ail.id) AS id, + SELECT ail.id AS id, ai.date_invoice AS date, ail.product_id, ai.partner_id, ai.payment_term_id, ail.account_analytic_id, u2.name AS uom_name, ai.currency_id, ai.journal_id, ai.fiscal_position_id, ai.user_id, ai.company_id, - count(ail.*) AS nbr, + 1 AS nbr, ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id AS account_line_id, ai.partner_bank_id, SUM(CASE @@ -146,7 +146,7 @@ class AccountInvoiceReport(models.Model): def _group_by(self): group_by_str = """ - GROUP BY ail.product_id, ail.account_analytic_id, ai.date_invoice, ai.id, + GROUP BY ail.id, ail.product_id, ail.account_analytic_id, ai.date_invoice, ai.id, ai.partner_id, ai.payment_term_id, u2.name, u2.id, ai.currency_id, ai.journal_id, ai.fiscal_position_id, ai.user_id, ai.company_id, ai.type, ai.state, pt.categ_id, ai.date_due, ai.account_id, ail.account_id, ai.partner_bank_id, ai.residual_company_signed, |
