odoo/addons/account
Denis Ledoux 9fe040e592 [FIX] account: invoice analysis residual amount
When having an invoice with multiple lines having the same
product_id and account_id, the residual amount was wrong.

This is due to the fact the residual amount of each line
was computed on the residual amount of the invoice divided
by the number of lines of the invoice, and the fact the main
select of the sql view was grouped by product_id, account_id.

So, for an invoice defined as
Product Account Total
A       1       10
A       1       10
B       1       10

The invoice analysis, grouped by product, account, computed
Product Account Total   Residual
A       1       20      10
B       1       10      10

The residual amount '10' of the first line being
30 (the residual amount of the invoice)
divided by 3 (the number of lines in the invoice)

The residual amount of the invoice should actually be divided by
the number of lines in the invoice * the count
of occurences in the group by clause
So, in this case, (30 / 3) * 2 = 20

Replacing the big jointure by
SELECT count(*) FROM account_invoice_line l where invoice_id = ai.id
to get the number of lines in the invoice
is just an optimization for performances

opw-621672
2015-02-11 13:10:54 +01:00
..
data [FIX] account,account_followup,l10n_{ch,es,pt,us,ve}: correct or remove wrong fields in <record> creation 2013-10-31 19:43:21 +01:00
demo [FIX] account: removal of warnings at database creation due to unknown fields in account.payment.term.line model 2013-03-14 15:53:37 +01:00
edi [FIX] sale: quote character in company name is converted to html entity 2014-08-05 11:15:28 +02:00
i18n [I18N] Sync updated 7.0 translations from Launchpad 2015-01-07 17:57:28 +01:00
process [MERGE] Bugfixes from 6.1 until revision 6900 2012-12-18 03:11:23 +01:00
project [FIX] account: do not duplicate analytic lines on analytic journal duplicate 2014-11-18 16:27:57 +01:00
report [FIX] account: invoice analysis residual amount 2015-02-11 13:10:54 +01:00
security [FIX] account: add multicompany rule to account.subscription.line 2014-06-25 12:07:02 +02:00
static/src [FIX] account: move_line_quick_add js, set the domain in the dataset (for instance, for export tool) + performance improvement (no need to re-compute journal list and period list each time a search is done) 2014-02-13 19:04:59 +01:00
test [FIX] account: correct test on closing fiscal year to fail with error message and set the test to the previous year instead of next year (makes more sense) 2013-10-18 16:04:24 +02:00
tests [FIX] account: correct name_search on account to be validated even at negation 2013-12-06 18:00:12 +01:00
wizard [FIX] account: chart of account opening period selection 2014-12-01 17:38:29 +01:00
__init__.py removed lot of stuff 2012-09-17 17:10:31 +02:00
__openerp__.py [ADD] account: test for added check 2013-10-15 16:14:08 +02:00
account.py [IMP] Speedup test account_assert_test.xml in account 2014-11-13 17:00:42 +01:00
account_analytic_line.py [FIX] account: unit arg of on_change_unit_amount can be False 2014-07-31 18:15:41 +02:00
account_assert_test.xml [IMP] Speedup test account_assert_test.xml in account 2014-11-13 17:00:42 +01:00
account_bank.py [FIX] account: restrict bank account post creation for account and journal 2013-06-10 13:04:01 +02:00
account_bank_statement.py [FIX] account: self typo 2014-10-06 17:10:50 +02:00
account_bank_view.xml [IMP]Account:applying multi_currency group to currency fields 2012-08-27 18:33:40 +05:30
account_cash_statement.py [IMP] Improve typos in warning (Grammar mistake, Capitalize title, Typos) 2013-06-07 13:38:29 +02:00
account_end_fy.xml
account_financial_report.py [REF] account: added docstring in few methods of account.financial.report 2013-02-11 13:50:56 +01:00
account_financial_report_data.xml [FIX]account_financial_report_data: fix profit and loss sign, sign should be reverse for P&L journal and children 2013-04-22 16:44:38 +02:00
account_installer.xml [IMP] improved code to set default accounts in l10n_us,l10n_ma and added new currency_id field to set currency based on select coa, fixed installation time error of l10n_ve 2013-09-03 12:37:07 +05:30
account_invoice.py [FIX] account: prevent invoice line duplication on partner duplication 2014-11-25 18:23:45 +01:00
account_invoice_view.xml [IMP] account: do not offer closed analytic accounts on invoices 2014-07-24 16:23:49 +02:00
account_invoice_workflow.xml
account_menuitem.xml [IMP] Account : changed terms as suggested in account module 2012-12-19 12:26:45 +05:30
account_move_line.py [FIX] account: return format of function field 2014-10-03 09:59:38 +02:00
account_pre_install.yml
account_report.xml [IMP] account: (over)due payments report 2014-11-05 15:49:15 +01:00
account_unit_test.xml [IMP]: (Work in progress)* Changed demo references according to changes in server, Aim is to add more common names and easy demo. 2012-06-19 12:46:24 +05:30
account_view.xml [FIX] account: prevent selecting company's contacts for manual account.move.line 2014-12-17 11:24:08 +01:00
board_account_view.xml [FIX] removed buggy dashboard on treasury 2012-09-17 18:49:39 +02:00
company.py [IMP] use the openerp namespace. 2012-12-06 15:56:32 +01:00
company_view.xml [IMP] account, account_voucher: moved some fields from res.company to accounting settings + removed duplicated fields (in company form view AND accounting settings) 2012-10-15 15:50:27 +02:00
installer.py [FIX] account: Chart Installer: new way to get apps server 2013-07-18 14:35:26 +02:00
ir_sequence.py [IMP] use the openerp namespace. 2012-12-06 15:56:32 +01:00
ir_sequence_view.xml [IMP]Remove type field from the whole account 2012-08-08 16:29:07 +05:30
partner.py [FIX] account: move translatable tag 2014-06-11 14:53:59 +02:00
partner_view.xml [FIX] res.partner: Hide commercial-related fields on contacts form + autosync them from parent company 2013-04-08 01:50:13 +02:00
product.py [IMP] use the openerp namespace. 2012-12-06 15:56:32 +01:00
product_view.xml [FIX]account : account invoice balance is double the total 2013-05-31 11:59:46 +05:30
res_config.py [FIX] {account, sale_stock}: res_config: set_default as SUPERUSER_ID. check user group to avoid passthrough access rights security 2013-11-29 16:47:14 +01:00
res_config_view.xml [MERGE] fix of lp bug 1076509 2013-02-13 17:41:57 +01:00
res_currency.py [IMP] use the openerp namespace. 2012-12-06 15:56:32 +01:00