Commit Graph
64 Commits
Author SHA1 Message Date
Christophe Simonis 5166fbd21b [MERGE] forward port of branch saas-10 up to 6d51bce 2016-06-28 15:12:06 +02:00
Christophe Simonis 841aa4e208 [MERGE] forward port of branch 9.0 up to 3e15b86 2016-06-28 14:10:35 +02:00
Martin Trigaux cc4f8df99f [FIX] account: compute total invoice in batch
The computation of the total_invoiced field did not work in batch mode.
When displaying a company in a form view (field invoice_total comptued), the
children of this company are present in the cache and the value of the field
invoice_total will be prefetched for these children as well (at least in 9.0).
Most of the time this is redudant information and the same value is computed
for each child while most of the invoices are on the parent.

Batching the computation per partner allows to make one global query for all
partners.

Add test to make sure the total increase correctly after a test invoice
confirmation.
2016-06-27 17:20:05 +02:00
Christophe Simonis ac5023060c [MERGE] forward port of branch saas-10 up to 2f948c7 2016-06-08 12:19:23 +02:00
Christophe Simonis 2f948c76aa [MERGE] forward port of branch saas-9 up to 3ed483c 2016-06-07 19:45:02 +02:00
Christophe Simonis 93d8f4f803 [MERGE] forward port of branch saas-6 up to 6b7caa0 2016-06-06 16:01:43 +02:00
Christophe Simonis ca2dad4c44 [MERGE] forward port of branch 8.0 up to b9a006c 2016-06-06 15:41:50 +02:00
Denis Ledoux b9a006c1c0 [FIX] account: Exchange test failing on Jun 6
The test `test_balanced_exchanges_gain_loss`
failed on Jun 6, because it created a specific rate
for today's date at midnight
(e.g. on Jun 6, 201x-06-06 00:00:00) for the test purpose,
but a rate is created in the demo data for Jun 6 midnight exactly:
`base.rateUSDbis`, making the test confused about which rate
to use.

We solve this by making the test use the rate `base.rateUSDbis`,
modifying the rate for its own need, instead of creating a new
rate.
2016-06-06 13:11:20 +02:00
Christophe Simonis e54fb3eb22 [MERGE] forward port of branch saas-9 up to 30864b6 2016-06-03 12:33:58 +02:00
qdp-odoo 5f9ca1b89b [FIX] account: manual reconciliation through the wizard on journal items were giving weird results. OPW 678153.
Symptoms: running a full reconciliation manually with that wizard was resulting in not fully reconciled aml altough the total in company currency and in secondary currency were perfectly matched. Full use case described in added test test_manual_reconcile_wizard_opw678153.
Problems:
 - The system was processing by pair of aml and creating exchange rate entry/full reconciliation as soon as possible whereas in that case it needs to be postponed at the end of the manual reconciliation otherwise some entries would be excluded from processing.
 - Another problem was that because of this batch processing, we ended with unconsistent amount_residual_currency values for some entries that were fully reconciled in company currency but not in foreign currency (also negative amount_residual_currency for a debit line which should never happens)... To solve that, we now process the manual full reconciliation in two steps: only in company currency first, then in secondary currency if needed. A small adaptation in the payment widget of invoices was needed for that too.
2016-05-27 16:52:51 +02:00
Christophe Simonis 6c8141a1df [MERGE] forward port of branch saas-10 up to 2483327 2016-04-01 16:15:35 +02:00
Christophe Simonis ddb0fb2739 [MERGE] forward port of branch saas-9 up to 59d3f63 2016-03-24 16:53:45 +01:00
Kinjal Mehta 93da11a59c [REM] account,analytic: removed wizard on Analytic Account menu
Display the analytic account list view directly instead
2016-03-23 16:35:34 +01:00
qdp-odoo d8137d35b7 [FIX] [tldr] account: multi-currencies fixes.
[FIX] account: fixed behavior in order to create the exchange rate difference entry at the full reconciliation only.

 This is needed in order to support the use case where an invoice in foreign currency is paid on a bank account in company currency,
 with the user encoding manually the difference due to the currency fluctuation (writeoff in the bank statement reconciliation interface): before
 this patch, Odoo was doing automatically the same, what results in a duplicated currency difference booking). ticket ID: 670876.
 A test has also been added in account/tests/test_reconcilication.py (test_statement_euro_invoice_usd_transaction_euro_full) to ensure that use case
 is now fixed.

[FIX] account_full_reconcile: a reconciliation is full as soon as either total_debit = total_credit OR if total_amount_currency is 0
[FIX] account: when registering a payment with a writeoff, always create the writeoff line exactly as entered by the user. Before, it was modified
 by the exchange rate entry, for some reason...
[FIX] account: on invoices, show the payment widget and outstanding payments in the invoice's currency always
[FIX] account: when assigning a payment in company currency on an invoice in foreign currency, save the amount_currency in order to create the correct
 exchange rate.
[FIX] account: show the currency difference entry on the invoice payments widget
[FIX] account: fixed the reconciliation methods in order to work with exchange rate entries that have debit = credit = 0
[FIX] account: fixed reconciled field computation. A line is reconciled only if its amount_residual AND amount_residual_currency are 0
[IMP] display the move name of payments on the invoice payments widget
2016-03-23 09:57:59 +01:00
qdp-odoo 003f2ee9bc [FIX] [tldr] account: multi-currencies fixes.
[FIX] account: fixed behavior in order to create the exchange rate difference entry at the full reconciliation only.

 This is needed in order to support the use case where an invoice in foreign currency is paid on a bank account in company currency,
 with the user encoding manually the difference due to the currency fluctuation (writeoff in the bank statement reconciliation interface): before
 this patch, Odoo was doing automatically the same, what results in a duplicated currency difference booking). ticket ID: 670876.
 A test has also been added in account/tests/test_reconcilication.py (test_statement_euro_invoice_usd_transaction_euro_full) to ensure that use case
 is now fixed.

[FIX] account_full_reconcile: a reconciliation is full as soon as either total_debit = total_credit OR if total_amount_currency is 0
[FIX] account: when registering a payment with a writeoff, always create the writeoff line exactly as entered by the user. Before, it was modified
 by the exchange rate entry, for some reason...
[FIX] account: on invoices, show the payment widget and outstanding payments in the invoice's currency always
[FIX] account: when assigning a payment in company currency on an invoice in foreign currency, save the amount_currency in order to create the correct
 exchange rate.
[FIX] account: show the currency difference entry on the invoice payments widget
[FIX] account: fixed the reconciliation methods in order to work with exchange rate entries that have debit = credit = 0
[FIX] account: fixed reconciled field computation. A line is reconciled only if its amount_residual AND amount_residual_currency are 0
[IMP] display the move name of payments on the invoice payments widget
2016-03-15 11:54:47 +01:00
Nicolas Martinelli 932a83de32 [FIX] account: forward port typo
type is not redefined, so this comparison cannot work. Moreover, a lucky
combination made the test pass, while they should not have.

opw-667935
2016-02-03 08:28:34 +01:00
Denis Ledoux a842199687 [MERGE] forward port of branch saas-6 up to 2616def 2016-01-29 12:29:17 +01:00
Goffin Simon da03d97003 [IMP] account: test_product_id_change
Forward port of c4fb2c2 in new api
2016-01-06 23:18:54 +01:00
Martin Trigaux 8b4f052a38 [MERGE] Forwardport of branch saas-6 up to c649bb0df 2016-01-05 18:28:06 +01:00
Denis Ledoux aef8a4d618 [MERGE] forward port of branch 8.0 up to f9f7669 2015-12-21 18:24:22 +01:00
Olivier Dony 6579fc2d49 [FIX] account: fiscal position computation precedence
Zip range and state filtering were added at
377a6ecab0, but the
precedence between country, group, vat_required,
and not required were not correct.

This commit fixes the precedence as follows and adds
the corresponding tests:

 0. Explict position on partner
 1. Direct match on all criterions
 2. Match on country+zip before country+state
 3. Match on country before country group
 4. Match on `vat_required` criterion on all
    the above before trying them all again without
2015-12-18 10:12:53 +01:00
Goffin Simon c4fb2c2efc [FIX] account: Test product_id_change
Test that when an included tax is mapped by a fiscal position, the
included tax must be subtracted to the price of the product.
Inspired from 503820acb6
2015-12-09 09:13:44 +01:00
Xavier Morel a43b220b33 [FIX] make AccountingTestCase extend HttpCase
Fixes/hides a deadlock when running test_sale_order with either a single
database or a db_filter making a single database visible: the test
causes a report to be printed, which invokes wkhtmltopdf, which tries to
fetch assets using the registry which is being loaded. The asset request
thus waits on a lock which is held by the test which waits on the asset,
deadlocking the whole thing.

Using HttpCase means we're using the test_cr or something and bypassing
the deadlock, instead the asset requests just 404 as they do when using
the nodb routing.
2015-10-20 17:38:53 +02:00
Leonardo Rochael Almeida 06b3026bcd [IMP] unittest2 > unittest
The `unittest2` package is simply a backport of `unittest` from the
Standard Library of Python 2.7 to previous versions.

There is no reason to use it any longer.

Closes #6941
2015-09-28 10:37:27 +02:00
Christophe Simonis 731b9f60ea [FIX] account: skip tests using skipTest method 2015-09-23 17:02:42 +02:00
Raphael Collet d4a24f3663 [IMP] account: improve doc and add warning on post-install tests 2015-09-17 11:59:03 +02:00
Christophe Simonis df3e7fedcf [MERGE] forward port of branch 8.0 up to a0d44f9 2015-09-01 18:46:55 +02:00
Goffin Simon fdd08a8b4b [FIX] account: closed period in test
The period used to make the test must be closed.
2015-09-01 12:05:29 +02:00
Nicolas Martinelli 5cb2943cca [IMP] account*: adaptation due to the new Sale module
Major changes:
- No use of UoS anymore
- No analytic journal (journal_id) on account move lines

Reason: complete rewrite of the Sale module.

Responsible: fp, dbo, nim
2015-08-27 18:10:18 +02:00
Yannick Tivisse dfbc51135c [REM] Remove res_partner_13, replace him by res_partner_2 2015-08-25 19:27:21 +02:00
qdp-odoo 6cb6f43c2b [REF] base: simplified res.partner.bank and res.bank objects for a greater usability + [IMP] account: bank journals are now the bank accounts of a company 2015-08-19 15:44:59 +02:00
Josse Colpaert 6ef158b63b [IMP] stock: getting quants methods refactor
The methods for getting the quants took a lot of parameters,
as in most of the cases (only exception being the negative
quants reconcile) the parameters depended on the move/pack operation
being processed.  By just passing the move and ops the code gets simpler.

There should also only be one place where most of the domain for searching the quants
based on the move/ops is calculated.
2015-07-29 17:45:16 +02:00
Christophe Simonis 2cf91d16a5 [MERGE] forward port of branch saas-6 up to 63e92cb 2015-07-22 16:17:54 +02:00
Fabien Pinckaers 1fe10b5417 [IMP] Supplier --> Vendor. American English 2015-07-09 16:10:09 -07:00
Christophe Simonis a304194936 [MERGE] forward port of branch saas-6 up to 81b5c60 2015-06-25 00:26:31 +02:00
qdp-odoo 13050d3e4b [REF] base, account: removed vat_subjected field. Mainly because it's confusing and rarely really needed, like never + the same feature could be achieved by duplicating taxes for non-subjected companies (with fiscal position on them for mapping) 2015-06-24 08:37:12 +02:00
Mahendra barad 75d7bbb46e [REF]Account: Refactoring the account, Change some fields name according to new api guidelines
code improvement

code improvement

payment_method to payment_method_id

writeoff_account to writeoff_account_id

property_account_receivable to property_account_receivable_id

property_account_payable to property_account_payable_id

property_account_expense_categ to property_account_expense_categ_id

property_account_income_categ to property_account_income_categ_id

property_account_expense to property_account_expense_id

property_account_income to property_account_income_id

property_account_expense_categ fix

sale_tax to sale_tax_id and default_sale_tax to default_sale_tax_id

purchase_tax to purchase_tax_id and default_purchase_tax to default_purchase_tax_id

ref_companies to ref_companies_ids

property_account_position to property_account_position_id

property_payment_term to property_payment_term_id

property_supplier_payment_term to property_supplier_payment_term_id

bank_accounts_id to bank_accounts_ids

payment_method fix after rebase

user_type after rebase

payment_method fix after rebase

after rebase

invoice to invoice_id

fix payment_method_id after rebase

code improvement

[IMP]user_type to user_type_id

[IMP]property_stock_account_input_categ, property_stock_account_output_categ to _id

[IMP]improve after rebase

[IMP]fix type

[IMP]Account: code improvement
2015-06-23 14:00:43 +02:00
Cedric Snauwaert 2c5739de93 [FIX] account: fix payment on multiple invoices 2015-06-22 13:32:37 +02:00
Christophe Simonis 2dd558fb0e [FIX] account: correct tests
da92283 was an attempt to fix tests due to screwed-up conflict
resolution during forward-port at 8b5a1f1.
This has been fixed with b173e8e. Now, time to test correctly.
2015-06-08 18:35:05 +02:00
Christophe Simonis da922833c7 [FIX] account: adapt tests to match new behavior introduced in a475a2721a 2015-05-28 19:15:43 +02:00
Christophe Simonis 8b5a1f1035 [MERGE] forward port of branch 8.0 up to 9fe0590 2015-05-28 15:53:42 +02:00
Christophe Simonis fe2b5f35a4 [MERGE] forward port of branch saas-6 up to bf1e999 2015-05-28 14:27:38 +02:00
Denis Ledoux a475a2721a [FIX] account: foreign exchanges gain/loss in reconciliation
When processing the reconciliation of invoices with bank statements
in foreign currencies, this is possible that there is a cent of difference,
due to the fact
the sum of amount exchanged could not be equal to the exchanged
sum of amount received.

For instance,
with a company in EUR as currency,
with a rate of 0.033 for USD,
with an invoice of 2.00 USD
(60.606060... rounded to 60.61 EUR)
and a bank statement of two lines of 1.00 USD
(30.30303030... rounded to 30.30 EUR)
The exchanged invoice amount, 60.61 EUR, is not equal to the sum of
statement lines exchanged amount (30.30 + 30.30 = 60.60 EUR).

In such a case, two journal items should be created in addition:
 - 0.01 in the debtors account
 - 0.01 in the foreign exchange loss account

opw-640078
2015-05-26 18:18:51 +02:00
qdp-odoo b8759cc348 [REF] account, base: refactoring/improvements/fixes of bank accounts and payments 2015-05-22 17:35:54 +02:00
Cedric Snauwaert 73a3bea15e [FIX] account: fix transfer_account in settings + create sale/purchase tax template for l10n_generic_coa 2015-05-22 10:52:34 +02:00
Christophe Simonis 2260496879 [MERGE] forward port of branch 8.0 up to a939a27 2015-05-05 18:48:34 +02:00
qdp-odoo c04065abd8 [IMP] accounting v9. Yeeeeaah 2015-05-05 17:28:04 +02:00
Nicolas Lempereur dd88f3c82f [FIX] search: searching fields.property not set
When searching if a many2one property field is not set, there may be less
results since only the ones with a reference set to NULL are returned.
We should also get those not in the table.

This commit change this case so instead of returning ['id', 'in', {matching non-set ids}],
the ['id', 'not in', {matching set ids}] is returned.

e.g: if (1, 3, 8) are set, (5, 9) are not set. ['id', 'not in', (1, 3, 8)] would
be returned instead of ['id', 'in', (5, 9)] which might not select all non-set
property fields.

closes #6044
opw-631057
2015-05-04 12:00:22 +02:00
Christophe Simonis 2565aa60e0 [MERGE] forward port of branch saas-6 up to c2b4766 2015-03-25 19:14:46 +01:00
Olivier Dony 35aa5c31d1 [MERGE] Forward-port latest bugfixes from 8.0, up to d544bb9b46 2015-03-24 15:46:44 +01:00