Commit Graph

620 Commits

Author SHA1 Message Date
Danimar Ribeiro 1ac94db8e8 [FIX] context to map_tax
Missing context to map_tax calls
Fixes #9909
2015-12-15 16:10:16 +01:00
Olivier Dony 2ae6481233 [FIX] account, crm, l10n_fr: avoid exceptions when processing parameters 2015-11-03 21:38:53 +01:00
Goffin Simon ddd2a3e97c [FIX] account: prepare_move_lines_for_reconciliation_widget
In the case where target_currency == company_currency, the actual_debit or the
actual_credit must be equal to the amount_residual defined on the account.move.line
and expressed in the currency of the company. The actual_debit/actual_credit must
take into account the possible partial reconciliations and this is done by the
residual amount.

opw:648744
2015-09-24 12:54:49 +02:00
Christophe Simonis 9654b54d3c [MERGE] forward port of branch saas-3 up to b15461b 2015-07-10 16:46:40 +02:00
Christophe Simonis b15461baba [MERGE] forward port of branch 7.0 up to 1d01872 2015-07-10 16:30:48 +02:00
Guewen Baconnier 4fe0c6bd60 [IMP] account: updated index to optimize _default_get of account.move.line
A log analysis showed that the normalized query below was executed very often
with a slow explain plan using a seq scan.

```sql

SELECT move_id, date
FROM account_move_line
WHERE journal_id = <journal_id>
AND period_id = <period_id>
AND create_uid = <user_id>
AND state = 'draft'
ORDER BY id DESC LIMIT 0;

```

This query is called in the _default_get of account.move.line to find the last
unbalanced move line.

The existing index can be improved to cover this query as well, showing an
impressive improvement of the explain plan as explained here:
https://github.com/odoo/odoo/pull/7430#issuecomment-119521031

Closes #7430
2015-07-08 13:56:20 +02:00
Nicolas Martinelli 589f1efd5d [FIX] account: user of the analytic line should be the salesperson of the invoice
Fixes #7259
opw-643262
2015-06-29 15:04:13 +02:00
Daniel Dico 6f60153e5d [IMP] account: useless records browsing
A variable "lines" is instancied few lines above,
with the exact same browse call, and there is no
operation that could lead to an update of the result
between these two browse calls.

Closes #1394
2015-06-26 15:56:17 +02:00
Julien Legros 1c0f0dd43c [FIX] account: multi currency reconciliation
When invoicing in currency A and being paid in currency B, the exchange
rate between those currencies might differ between the invoice date and
the payment date.

When reconciling, invoiced amounts should be converted using the invoice
date exchange rate.

opw-640248
2015-06-23 17:27:07 +02:00
Christophe Simonis e20dcda50d [MERGE] forward port of branch 7.0 up to 99c87b6 2015-05-21 16:33:45 +02:00
Olivier Dony 99c87b6273 [FIX] account: prevent crashes when mixing types in context parameters 2015-05-21 16:08:17 +02:00
Olivier Dony 96402a8f3a [FIX] account: prevent crashes when mixing types in context parameters 2015-05-21 16:02:58 +02:00
Christophe Simonis 327e471c9b [MERGE] forward port of branch saas-3 up to b62ee07 2015-05-21 14:19:24 +02:00
Christophe Simonis b62ee0734c [MERGE] forward port of branch 7.0 up to eaaca65 2015-05-21 14:11:39 +02:00
xmo-odoo 6de6662ecb Merge pull request #6789 from savoirfairelinux/7.0-fix_account_move_line_exception_translation
[FIX] incorrect translation marking
2015-05-21 10:14:40 +02:00
Joao Alfredo Gama Batista 2e123fbb85 [FIX] Fix exception translation 2015-05-20 11:22:25 -04:00
Denis Ledoux 9335fed9fe [FIX] account: debit/credit values for move lines in foreign currencies
When the target currency is the company currency, there
is no need to re-compute the debit/credit amounts of the move lines,
since these debit/credit values already contains the amount
of the move line within the company currency.

Avoiding the recomputation prevents gain/loss during currencies exchanges

opw-631748
opw-632133
opw-631895
2015-05-06 18:29:47 +02:00
Christophe Simonis 2492503dcc [MERGE] forward port of branch saas-3 up to 50665b4 2015-04-16 19:25:53 +02:00
Christophe Simonis 50665b499a [MERGE] forward port of branch 7.0 up to d0ef1b9 2015-04-16 19:13:56 +02:00
Martin Trigaux 884864c40f [FIX] account: do not show empty partners in manual reconciliation
When doing a manual reconciliation, the current filter could restrict the
visibility of move lines and show empty results for some partners (e.g. filter
the lists on only one partner will show empty list of moves for other partners).
This is also the case for multicompany restrictions.
Integrate the current filter to the search to only get results for displayed
lines.
Fixes #3817, opw 618134
Fixes #5221, opw 632095
2015-04-15 17:10:01 +02:00
Christophe Simonis d3e7a8ef5e [MERGE] forward port of branch 7.0 up to 856bc6f 2015-04-10 18:24:46 +02:00
Somesh Khare 39010d3856 [FIX] account: wrong amount for tax included
Backport of 8.0 code, rev f61339b
Create a new journal item with an tax included, the automatically created tax
line had the amount computed as tax excluded.
Fixes #3731, opw 618305
2015-04-10 12:17:52 +02:00
Christophe Simonis d780014248 [MERGE] forward port of branch saas-3 up to ce69064 2015-03-26 18:00:06 +01:00
Christophe Simonis ce690649e9 [MERGE] forward port of branch 7.0 up to 2a0c018 2015-03-26 17:56:05 +01:00
Nicolas Lempereur aaf9badbce [FIX] account: context/domain in move line tree
On a line write in a account.move.line tree view, the on_write return all the
sibling move lines of the written move line. The lines are then displayed even
if they do not match the current search domain.

This fix adds the context on the given on_write callback request, and in
on_create_write use a on_write_domain in this context to filter the returned ids.

fixes #3161, closes #5727

opw-630093
2015-03-26 08:59:23 +01:00
Christophe Simonis 416f0246ac [MERGE] forward port of branch saas-3 up to 4a3c471 2015-03-09 12:03:22 +01:00
Christophe Simonis 4a3c4713e9 [MERGE] forward port of branch 7.0 up to 209ce6f 2015-03-09 11:24:32 +01:00
Laetitia Gangloff f18304c0cd [IMP] account: Add auto_join on account move line
As the number of journal entries can grow quickly, domains such as
[('move_id.state', 'in', ['draft'])] will degrade very quickly.
Fixes #5573
2015-03-04 14:55:17 +01:00
Olivier Dony f55a6046a8 [FIX] account.move.line: no move revalidation for trivial changes
Many trivial changes to journal items, such as the
"blocked" flag for litigation (follow-up), do not affect
the balance of the whole entry. These should not cause
the account.move to be (re)validated.

For example it should be possible to change trivial
fields even on journal entries recorded in a closed
fiscal period.
2015-02-20 12:24:49 +01:00
Arthur Maniet 6c37747057 [FIX] account: don't create move lines that have neither an amount or a tax code
Fixes 51e9f90981
2015-02-20 06:07:56 +01:00
Arthur Maniet 51e9f90981 [FIX] account: avoid 0.0 tax lines
Don't create useless journal entries for taxes whose amount is 0.0.
Keep tax code lines creation unmodified.
Fixes #5036, opw 627055
2015-02-17 17:39:29 +05:30
Arthur Maniet 058a010456 [FIX] account: in bank statement reconciliation widget, make sure a move line 'ref' is an empty string if the field has no value
Fixes #5272
2015-02-17 11:30:34 +01:00
Denis Ledoux c9154e08aa [FIX] api: environment recomputation
In a workflow context (for instance, in the invoice workflow),
context is not passed.

Therefore, relying on the 'recompute' key being the context
in order to not recompute the fields does not work with Workflows.

It leads to huge performance issues,
as fields are recomputed recursively (instead of sequentially)
when several records are implied.
For instance, when reconciling several invoices with one payment
(100 invoices with 1 payment for instance),
records of each invoice are recomputed uselessly in each workflow call
(for each "confirm_paid" method done for each invoice).

With a significant number of invoices (100, for instance),
it even leads to a "Maximum recursion depth reached" errror.

closes #4905
2015-02-12 14:57:31 +01:00
Denis Ledoux ee8919af84 [MERGE] forward port of branch saas-3 up to fe8845a 2015-02-12 11:05:00 +01:00
Denis Ledoux fe8845ade6 [MERGE] forward port of branch 7.0 up to 0b5271e9 2015-02-12 11:04:36 +01:00
Denis Ledoux 0b5271e90d [FIX] account: always use a copy when altering a context
To avoid wrong context propagation
2015-02-12 11:03:54 +01:00
Martin Trigaux 16374dfa33 [FIX] account: error message not translated 2015-02-04 15:28:56 +01:00
Arthur Maniet 239e1618f2 [FIX] account: do not restrict tax move lines creation from account_move_line.create() 2015-01-05 16:29:08 +01:00
Arthur Maniet 371e96767d [FIX] account: account.move.line creation with account_tax_id accepts taxes with both base code and tax code or neither. base code xor tax code raises a warning.
Fixes #4452
2015-01-05 16:00:58 +01:00
Stéphane Bidoul c68ecbe093 [FIX] account: do not validate move when novalidate is in context
The key 'novalidate' is added in the context when an operation not impacting
the validation of a move is made. The validation recreates analytic lines
which decrease the performances.

In case of registrating a payment, the skipped validation are the one from
the reconcile method (reconciliation does not change the validity)
Fixes #3787, opw 618529
2014-12-08 16:47:47 +01:00
Arthur Maniet 43f29b2b13 [FIX] account: bank statement reconciliation widget: correct multicurrency display 2014-11-26 11:27:46 +01:00
Martin Trigaux aa9914568b [FIX] account: default partner format
When creating a new account.move.line, the computation of the default values should accept both `id` and `(id, name)` format.
The key partner_id may be containing a tuple so browsing should only be done on the first element of the tuple.
Fixes #3386
2014-10-31 08:40:30 +01:00
Somesh Khare 74157326f0 [FIX] account: domain on wrong field
The store recomputation method failed as the search was made comparing id of account.move.line to the account.journal values. Search was returing no result most of the time (opw 615554)
Fixes #2454
2014-10-30 15:21:27 +01:00
Martin Trigaux 8843974d04 Forward port of branch saas-3 up to fc9fc3e 2014-10-06 15:52:23 +02:00
Denis Ledoux 76fdbec3bb [MERGE] forward port of branch 7.0 up to 6d4e1cc 2014-10-03 11:22:47 +02:00
dhr-odoo b2cb31c0fb [FIX] account: return format of function field
When no result is found on the function field 'invoice' (account.move.line), instead of returning {move_id: (False, '')}, return {move_id: False} (expected for m2o fields)
Fixes #2138, opw 613096
2014-10-03 09:59:38 +02:00
Denis Ledoux 14f3085776 [MERGE] forward port of branch saas-3 up to 77500e5 2014-10-02 15:36:58 +02:00
Denis Ledoux 77500e54ec [MERGE] forward port of branch 7.0 up to eb9113c 2014-10-02 15:34:02 +02:00
Humberto Arocha 6d3855e9dc [FIX] account: remove orphan analytic lines
If the analytic account is not present on an entry, still removes the Analytic Journal Items linked to it.
Fixes #1194, opw 610784
2014-10-01 16:18:47 +02:00
qdp-odoo 625f858e07 [REF] account: minor change made during the code review 2014-09-17 16:13:45 +02:00