Commit Graph

10097 Commits

Author SHA1 Message Date
Christophe Simonis ed76b2a782 [MERGE] forward port of branch 7.0 up to e470385 2015-06-11 12:46:06 +02:00
Odoo Translation Bot e2c9699cfc [I18N] Update translation terms from Transifex 2015-06-08 14:03:50 +02:00
Nicolas Lempereur 69f87cd34c [FIX] account: get uom at account invoice creation
For commit c63230d0d if there is no uom, it should not fail.

closes #6920
2015-06-01 16:03:46 +02:00
Nicolas Lempereur c63230d0d0 [FIX] account: force uom from product category
When we change a product line of an account invoice, a current unit with
a invalid unit category was not dropped which should be since:

- it is different from a sale.order,,
- there is a domain on the unit of measure only allowing units from the product's unit category.

This fixes drop the current unit of mesure in this case.

opw-640985
2015-06-01 15:27:58 +02:00
Martin Trigaux 4528ccf148 [I18N] First sync of translations from Transifex
Translation is that which transforms everything so that nothing changes.
 -- Grass Günter
2015-05-29 21:58:20 +02:00
Martin Trigaux 409ca3e009 [I18N] Update translations from Transifex
Now I am become Death, the destroyer of worlds
2015-05-29 18:28:10 +02:00
Olivier Dony b17c7d66c7 [I18N] Final sync + cleanup of Launchpad Translations, moving to Transifex
See https://github.com/odoo/odoo/wiki/Translations
2015-05-29 11:22:32 +02:00
Olivier Dony 1cea0dc4e9 [I18N] Final sync + cleanup of Launchpad Translations, moving to Transifex
See https://github.com/odoo/odoo/wiki/Translations
2015-05-29 10:55:06 +02:00
Nicolas Martinelli 4fec2447ec [FIX] account: default tax can be of type 'all'
opw-640984
2015-05-28 15:07:29 +02:00
Denis Ledoux 4dd5cabd30 [FIX] account: remove pudb
It has been a while since the last time.
2015-05-26 18:21:27 +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
Olivier Dony 3c3581e19f [I18N] Sync latest translations from Launchpad (not the final one) 2015-05-21 18:01:57 +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 53980b7c52 [FIX] account, mail, etc.: uniformize evaluated expressions
opw-626694
2015-05-21 16:07:21 +02:00
Olivier Dony 96402a8f3a [FIX] account: prevent crashes when mixing types in context parameters 2015-05-21 16:02:58 +02:00
Olivier Dony 8d745f9f50 [FIX] account, mail, etc.: uniformize evaluated expressions
opw-626694
2015-05-21 15:26:35 +02:00
Olivier Dony ebb5ddcd65 [I18N] Sync latest translations from Launchpad (not the final one) 2015-05-21 14:42:20 +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 ffc40b611b [MERGE] forward port of branch saas-3 up to e2bfb96 2015-05-12 17:55:50 +02:00
Stéphane Bidoul d83befdb0f [FIX] account: tax amount for include_base_amount
The tax_amount on account.move.line generated from the validation of an invoice
did not include the taxes with 'include in base amount' enabled.
Instead of using the line total, use the price_unit of the tax which is
correctly computed through compute_all method.
Fixes #5939
2015-05-12 16:07:24 +02:00
Denis Ledoux 73432ffe9f [FIX] *: accesses of views concernings specific groups
If the whole view relates to a specific group,
apply the group on the view itself instead of
each view part (each fields, each page, each div,...),
so the view is loaded / added to the base view
only if the user is in the right group.
So the view is not loaded uselessly
and the fields are not read for nothing
(performances & security).

Indeed, when a group is applied on a field itself, the field content
is read, but hidden, therefore reading the content of the field
uselessly, and potentially leading to accesses issues
if the user hasn't the rights to read the field.
(e.g. reading a property when not having access to the model
of the proprty, pricelists on partners for instance)

opw-634402
2015-05-12 11:33:43 +02:00
Matthieu Dietrich d1c4d16a3a [FIX] account: Don't copy many2many when copying statement line
When duplicating confirmed bank statement lines,
the many2many `move_ids` links were preserved, and,
therefore, there were links between the duplicated
lines and the move entries of the original lines.

Closes #6617
2015-05-11 16:54:30 +02:00
Goffin Simon af86f029c9 [FIX] account: Translation of journal name
The journal name showed in the pop over of the reconciliation bank statement wizard
must be in the language of the user.

opw:634378
2015-05-11 14:16:15 +02:00
Christophe Simonis 94aae97c04 [MERGE] forward port of branch saas-3 up to e2bfb96 2015-05-08 18:52:57 +02:00
Denis Ledoux 63db719151 [FIX] account: Exchanges rates gain/loss during supplier reconciliations
This revision is related to dd47b6f5bc.

The above revision was allmost correct, except that, in a supplier
invoices, the `amount_currency` of the invoice is negative,
and the one of the bank statement is possitive.

To check that both are equal, we should subtract one to each other,
and check that the diff is 0, but both part need to be the
absolute value.

opw-634263
closes #6533
2015-05-08 16:13:03 +02:00
Denis Ledoux 272e085df4 [MERGE] forward port of branch saas-3 up to da93981 2015-05-07 11:34:48 +02:00
Denis Ledoux da93981cb0 [MERGE] forward port of branch 7.0 up to f300d64 2015-05-07 11:33:59 +02:00
Denis Ledoux dd47b6f5bc [FIX] account: Exchanges rates gain/loss during reconciliations
When processing the reconciliation of a bank statement
within the company currency with an invoice in a foreign currency,
avoid to recompute the bank statement debit / credit within
the currency rate at the time of the invoice when the
`amount_currency` of the bank statement line and the `amount_currency`
of the invoice move line are the same
(while having the invoice move line and the
bank statement move line in the same currency,
and having the bank statement currency and
the company currency the same),
to prevent gain/loss exchanges during currencies conversion.

Computing the amount of the statement line
within the currency of the invoice is useful
to compute the difference of amount paid within the company currency
when a change of currency rates occured between the invoice date
and the date of the payment.

Nevertheless, recomputing the amount in the currency of the company
is useless when the payment currency
and the company currency are the same,
and the amount of the invoice and the statement in the foreign currency
are identical, since the amount is already computed, within the
debit/credit field of the invoice move line.

Besides, this prevents gain/loss changes.
opw-631748
opw-632133
opw-631895
closes #6559
2015-05-06 18:29:47 +02: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
Nicolas Martinelli 4392289745 [FIX] account_invoice: residual of invoices in foreign currencies
If a line of the invoice move was in a foreign currency
but its residual amount in this foreign currency was 0,
the `amount_residual` (in company currency) was used,
instead of the `amount_residual_currency`, which
is the residual amount in this foreign currency.

This was due to the fall back with the `and / or` statement.
Using `if / else` instead solves the issue.

This could lead to issues when the residual amount
in the foreign currency was 0, but the residual amount
in the company currency was 0.01, due to the exchange rate
loss.
2015-05-06 18:29:47 +02:00
Denis Ledoux 8aa6aa0c78 [FIX] account: entries analysis with null values in debit/credit
In SQL, the addition/subtraction between NULL and an integer/numeric
returns NULL.

Therefore, if either debit or credit was set to null instead
of 0.0, debit-credit returned null, instead of the actual subtraction

opw-634044
2015-05-06 18:22:16 +02:00
Denis Ledoux a939a272ef [MERGE] forward port of branch saas-3 up to ae634e7 2015-05-05 17:55:25 +02:00
Arthur Maniet bb252f201e [FIX] account: bank reconciliation widget: correctly set the 'New' button a new line (continuation of bf9544d7d4) 2015-05-05 12:50:37 +02:00
Arthur Maniet ce32867a90 [FIX] account: bank statement reconciliation:
- ctrl-enter only persist balanced reconciliations
- give a reconciliation proposition only if there's an unambiguous match
- added some missing tanslations
- use default order to display statement lines in reconciliation widget
2015-05-05 09:55:36 +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
Denis Ledoux 41f4b11ef4 [MERGE] forward port of branch saas-3 up to e552e09 2015-04-30 15:45:03 +02:00
Denis Ledoux 2c3c2b57db [MERGE] forward port of branch 7.0 up to f2f4391 2015-04-30 10:50:51 +02:00
Olivier Dony caf333eb59 [FIX] account.invoice.report: performance problem in currency rate computation
The SQL view implementing the "Invoice Analysis" report
JOINs the res.currency.rate table in order to obtain the
correct currency rate to convert each invoice line amount
in the same currency.

The matching of the rate needs to be done on the date
of that rate (`name` column) - the last rate preceding
the invoice date is presumed to be the right one.
However there is no simple way to make a direct JOIN between
account.invoice.line and res.currency.rate with a single
match, without using an ORDER BY clause and LIMIT 1.
This requires a costly SUBSELECT query for each invoice
line, quickly becoming prohibitive.

Through the use of PostgreSQL's Common Table Expressions
(CTE) it is possible to construct a temporary table
with the rates' start and end date of application.
This temporary table can then be used in a direct
JOIN with account.invoice.line, delivering much better
performance (no SUBSELECT needed for each invoice line)

On a database with 50k invoice lines this makes invoice
analysis return results in less than 800 ms instead of
10+ seconds.
2015-04-30 00:20:12 +02:00
Mohammad Alhashash a6a3db3188 [FIX] account: custom '_where_calc' method instead of 'search'
The domain on account.account was preprocessed in search method but it had no
effect on read_group. This lead to inconsistency or errors when using 'goup by'
filter.

Move domain processing in '_where_calc' method instead as this is used by both
'search' and 'read_group'.
2015-04-29 11:17:47 +02:00
Mohammad Alhashash 717a695317 Revert "[FIX] account: remove journal_id from account domains"
This reverts commit 24526b18a7.
The journal_id field is not present on account.account but is processed in
search method.
Next commit will improve the processing to also accept journal_id in read_group.
2015-04-29 11:06:29 +02:00
Mohammad Alhashash 24526b18a7 [FIX] account: remove journal_id from account domains
From invoice lines and move lines views.

The model 'account.account' has no field journal_id.
2015-04-28 16:34:29 +02:00
Goffin Simon 37bf219643 [FIX] account: Display Taxes
The function _unite_compute and _unit_compute_inv did not give the same display result.
Regardless the way the tax is computed, the display must be the same. The display must
only shows the name of the tax.

opw:633828
2015-04-28 11:25:44 +02:00
Olivier Dony 622e00baa5 [I18N] Sync 8.0 translations from Launchpad 2015-04-28 09:45:53 +02:00
Goffin Simon 3c055a769f [FIX] account: Taxes report
The Tax Report printed with details should not include draft accounting entries.
Technicaly, the account move lines include in a draft account move do not have to be
printed

opw:633642
2015-04-27 16:25:43 +02:00
Denis Ledoux cf4d14ce39 [MERGE] forward port of branch saas-3 up to 09b277c 2015-04-27 14:02:52 +02:00
Denis Ledoux d6ae7fb7db [MERGE] forward port of branch 7.0 up to 3e7d3c7 2015-04-27 12:19:43 +02:00
Denis Ledoux 3e7d3c7ee4 [FIX] account: tax_amount can be null in database
The `tax_amount` of move lines is by default set to `0.0`.
Nevertheless, this default value is set by Odoo,
not by postgresql.

This is therefore likely that the `tax_amount` is set as
null instead of 0.0, in database.

Therefore, when getting this value directly with a SQL
request, this is possible that `null` will be returned.

Therefore, in this specific case, `res.get(record.id, 0.0`
could return `False`, if the sum of `tax_amount` is `null`,
and try to multiply a boolean with an integer is not possible:
`_rec_get(rec) * rec.sign`

opw-633903
2015-04-27 12:01:21 +02:00
Nicolas Lempereur bf9544d7d4 [FIX] account: float issue in reconciliation wizard
The CSS on the linei with the "New" button of an bank statement
reconciliation wizard was only applied when there was only a multiple of
two "block" before.

Hence it worked when there was a multiple of 2 cases before, but if not
(for example when account_analytic_plans is installed) on:

- google chrome: the button is on the right (instead of on a line by its
  own).

- firefox: idem, but also a difference in float display positioning
  caused the parent container to not take floating elements into account
  to calculate it's height.

This fix apply the CSS independently if the last block is even or odd.

Before this fix in firefox:
 https://cloud.githubusercontent.com/assets/9977887/7315195/70ca5eca-ea6b-11e4-8892-1272f7ee0cb4.png

After this fix in firefox:
 https://cloud.githubusercontent.com/assets/9977887/7315194/6e2b05ca-ea6b-11e4-9400-69c9cd587756.png

closes #6459
opw-633703
2015-04-27 09:26:23 +02:00
Goffin Simon 296130fbd3 [FIX] account: Invoice's creation problem
The action window "action_invoice_refund_out_tree" must have the same
context that "action_invoice_tree1"

opw:633635
2015-04-24 13:39:17 +02:00
Richard deMeester 555b5487c9 [FIX] account: Bank Statement Action View Sequence
Ensure correct sequence of bank statement action views.
As the views are sorted based on the sequence, make sure the tree is selected
before the form view.
Fixes #6413
2015-04-23 15:26:44 +02:00
Goffin Simon 6f679678f6 [FIX] account: duplicate tax
the duplication of a tax must duplicate the child_ids.

opw:630510
2015-04-21 10:09:56 +02:00
Goffin Simon 0422df2ad7 [FIX] account: general ledger report
The "Progress" column must be renamed in "Balance".

opw:633076
2015-04-20 15:53:38 +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
Goffin Simon 397892a6c8 [FIX] account: invoice_form for button invoiced
Button "invoiced" only shows customer invoices. The form view used must be
"invoice_form".

opw:632853
2015-04-15 17:48:17 +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
Denis Ledoux 5fb717a971 [FIX] account: display name field in supplier refunds
The name field contains the refund reason.
The reason is filled when you create the refund
from the refund wizard available when
pressing "Ask Refund" on a supplier invoice.

As this field wasn't visibile on the supplier
invoice form, this wasn't possible to change
the reason on draft supplier refunds after
having created them through the wizard, while
you could change your mind or having done a
silly mistake in the wizard, that you could
edit since the invoice is stil draft.

This was also not possible to set a reason
when creating the refunds without going through
by the wizard.

This was also not possible to change the reason
when you duplicated your supplier refunds.

opw-632756
closes #6301
2015-04-15 17:00:25 +02:00
Martin Trigaux a82da88c3d [IMP] account: help to configure fiscal year
Fiscal year is created when a chart of account is installed on the company.
If no chart of account is installed, setting dates will have no effect in the
accounting configuration wizard.
Fixes #3547
2015-04-14 11:50:31 +02:00
Goffin Simon eb0a309522 [FIX] account: lang used for invoice taxes
The lang used for invoice taxes must be the lang of the partner.

opw:631461
2015-04-13 17:12:45 +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
Denis Ledoux 972d966554 [FIX] account: ACLs contracts button in partner form
contracts_count function field
&
journal_item_count function field

used for the "contracts" and "journal items" buttons
in the partner view are computed by the same
method.

But, this is possible that you have access to
one without having access to the other.
e.g., Project users not being salesman nor accountant
must have access to the contract counts,
but not to the journal items.

Besides, these buttons are added to the partner form
by two separated views, applied to analytic accounting group
& accountant group, respectively.

We therefore avoid to compute the journal items count when
not needed, when not loaded in the partner view.
We therefore prevent the access right issue, and provide
a performance improvment at the same time. Yay.

opw-632454
2015-04-09 17:23:42 +02:00
Martin Trigaux a3c0742b77 [IMP] account: display currency in import invoice wizard
Fixes #3830 (really)
2015-04-09 16:32:31 +02:00
Denis Ledoux aa15c1ffe6 [FIX] account: missing translations in bank statements reconciliation
opw-632158
2015-04-09 14:10:40 +02:00
rmu-odoo 8b95a8424b [FIX] account: import invoice in multicurrency
Missing values for fields amount_curreny and currency_id when importing
an invoice from a bank statement.
Fixes #3830, opw 618764
2015-04-09 12:17:39 +02:00
rmu-odoo 223c92f3c0 [FIX] account: prioritize supplier number over reference on invoice
When generating the accounting entries, to compute the name, the invoice
reference (e.g. origin purchase order name) was first used before the supplier
invoice number. To facilate reconciliation of bank statements, the supplier
invoice number makes more sense.
Fixes #3839, opw 618765
2015-04-09 11:33:44 +02:00
Commandant Custo 3935da9ad4 [REM] account: Useless inherited product.template search view
The fields added by this view are already present in the parent view.
Conflict between 86f99ef and 43977de both adding it in different modules.
2015-04-08 09:18:45 +02:00
Martin Trigaux 365eb138b4 [FIX] account: set reconciliation reference for opening entries
When opening entries are generated, the reconcile_id field is updated in SQL
(probably for performances reasons) but the computed and stored field
reconcile_ref is not recomputed by the ORM.
Force the recomputation of the field by calling ORM method _store_set_values.
Fixes #4267, opw 620369
2015-04-07 13:33:02 +02:00
Denis Ledoux 69890cf33e [FIX] account: general ledger, currency displayed twice
When printing the general ledger with "With Currency"
checked, two currencies were displayed in the colum
"Currency" when an amount was set, one time the company
currency, one time the move line currency. Only
the move line currency should be displayed.

Besides, the total of currencies amount
for each account should not display the currency symbol
at all, as the total may be composed of multiple currencies.

opw-632086
2015-04-03 13:31:56 +02:00
Christophe Simonis 8ad11055bb [MERGE] forward port of branch saas-3 up to 12f600c 2015-04-01 19:13:25 +02:00
Christophe Simonis 12f600cec9 [MERGE] forward port of branch 7.0 up to 35077af 2015-04-01 19:07:59 +02:00
Denis Ledoux 433feb5a38 [FIX] account: partner ledger with currency.
In the partner ledger wizard, you can check
a boolean to display the amount within the
currency the amount has been invoiced.

This feature was simply no more working
in Odoo 8.0.

opw-630268
2015-04-01 15:36:40 +02:00
Goffin Simon 680e6889b1 [FIX] account: Partner Ledger wizard didn't consider all filters and type of entries:
The report generated by this wizard considered all the partners without taking into account
the filters and target entries set.
To show the right partner the function _set_context
must consider the "self.query" which sets the period, the dates, the states, the accounts and
the journals of the sql query used to give the demanded partner.

opw:631649
2015-04-01 08:53:55 +02:00
Denis Ledoux 31e10ec0a0 [FIX] account: multi-company partner ledger.
If a customer changed of company while having
account.move.line records in the former company he was in
It wasn't possible for someone else than the admin
to print the partner ledger report including this partner.

opw-631800
2015-03-31 11:04:40 +02:00
han-odoo 0a1f52ccb5 [FIX] account: prevent removing closing entries for closed period
As the target period is closed, should not be able to delete closing entries.
opw 610428
2015-03-30 17:10:16 +02:00
Rifakathusen Haradwala 3cae2c5155 [FIX] account: wrong tax amount for manual tax line
On an invoice, tax lines are generated in tax_line field. When modifying
manually the tax amount, the recomputed tax_amount field was incorrect in
multicurrency environment, leading to an entry with different tax amount and
debit value.
opw 611474
2015-03-30 16:43:08 +02:00
nachosalvador 75f0c7df4d [FIX] account: fetch name from first line only
invoice_line is a one2many, causes expected singleton error if the invoice has
more than one line.
2015-03-30 10:45:27 +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
Goffin Simon 3eda25119f [FIX] account: Invoiced doesn't take into account cancelled invoices
"Invoiced" stat button on the res.partner form view must not include cancelled and draft invoices.
The button triggered an action which shows a tree view with invoices where:
type in ['out_invoice'] and all states.
Now the button triggers a tree view with invoices where: type in ['out_invoice' , 'out_refund']
and state not in ['draft', 'cancel'].

opw:472318
2015-03-26 16:27:27 +01:00
Laurent Mignon 2faf4b7747 [IMP] Display the line note in the details
When reconciling, it's sometimes useful to have access to the note since the note can be filled with some information by the parser.
2015-03-26 09:57:56 +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 3540ec53e4 [MERGE] forward port of branch saas-3 up to 6b70b80 2015-03-25 18:00:08 +01:00
Goffin Simon 940a0e45d4 [FIX] account: choosing the right fiscal position
for a partner who has vat number, fiscal positions with vat_required
are prefered.

opw:630849
2015-03-24 13:00:39 +01:00
Christophe Simonis e27744df0c [MERGE] forward port of branch saas-3 up to b79f64f 2015-03-18 13:16:23 +01:00
Christophe Simonis b79f64f1f8 [MERGE] forward port of branch 7.0 up to e1daaff 2015-03-18 12:52:33 +01:00
David Monjoie 373b560511 [FIX] account: added check if country has a code
It is possible, if the user created a new country by himself, to have a country without a code, we then need to check that.

Fixes opw 629891, where the customer wrote "Belgie" trying to find "België", didn't find it and created a new "Belgie" country without code.
2015-03-16 10:35:01 +01:00
Commandant Custo deb1db281b [FIX] account: Missing label for partner VAT in invoice report
Missing label for partner VAT field in invoice report
2015-03-13 11:50:01 +01:00
Denis Ledoux 43b3b28708 [FIX] account: Possibility to choose employees in bank statements
The domain on the partner field in the bank statement lines
was too restrictive: You should be able to select partners
that aren't either customer or suppliers. For instance, your
employees.

opw-630017
2015-03-12 11:34:15 +01:00
Goffin Simon 0f943ef736 [FIX] account: Impossible to reconcile a partially reconciled invoice.
In Bank Statements,  reconciliation of a partially reconciled invoice
is possible.

opw:629443
2015-03-11 10:13:14 +01:00
Nicolas Martinelli f7de3f0603 [FIX] account: product variants prices in invoices
when a customer invoice is created directly,
if a product variant is selected,
it now computes the price from the product variant and
not from the product template.

opw: 629285
2015-03-10 14:56:25 +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
Laetitia Gangloff eda2736e4c [FIX] account: journal_id should be readonly when there is already invoice internal number
Closes #5162, #5167
2015-03-01 03:23:01 +01:00
Denis Ledoux 4928db70ad [FIX] account: partner form buttons access rights
When having account installed, but having as only
access right "Contacts creation", it wasn't possible to
display the partner form.

Setting the "groups" on the button itself has as effect
to hide the button, but not to prevent its value computation.
If you did not had the access rights required to compute the
buttons values, it leaded to security issues.

Put the "groups" on the view instead prevent the button to be loaded,
and its value to be computed. It therefore avoids both
a useless computation (computing the value of a hidden button
is not really useful), and prevent any access rights warnings.

Besides, 3 different groups were needed to display the
three buttons:
 - account.group_account_invoice
 - account.group_account_user
 - analytic.group_analytic_accounting

Not having one of these tree groups could lead to security
warnings. We therefore split this view into three sub-views,
with each one a group set (and a button)

opw-628668
2015-02-23 15:39:07 +01:00
Arthur Maniet 25429656c7 [FIX] account: rounding error when the balanced operation done in bank statement reconciliation is converted to the company currency. 2015-02-23 15:08:49 +01:00
Denis Michiels 4bf5ce94d2 [FIX] account_invoice : origin field for refund invoice
When creating a Refund invoice, the field "origin" is fill with
the number of the invoice to refund

fix #5233
opw 627828
2015-02-23 13:38:44 +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
Olivier Dony 91d4b947f6 [I18N] Update translations from Launchpad 8.0 branches 2015-02-18 11:51:07 +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
Arthur Maniet 69b6cf44bd [FIX] account: in bank statement reconciliation, show the invoice line from a partial reconciliation.
Since all the lines in a partial reconciliation share the same state and the same amount_residual, we need to keep only one 'result' line.
It was the first line found that was kept ; now it's the line whose amount is greater than amount_residual, whiwh most likely is the significant one.

Fixes #5129
2015-02-17 11:07:14 +01:00
Arthur Maniet 32b4ded242 [FIX] account: bank account field of the transactions in a bank statement
- Field is readonly when the statement is closed
- Only bank accounts with the same partner as the transaction or no partner can be selected
2015-02-16 11:55:45 +01:00
Arthur Maniet d1be21dfdf [IMP] account: feature that links bank accounts to partners upon bank statement closing.
Retreive additional informations to write on the res.partner.bank by using the onchange_partner_id, instead of only writing the partner_id
2015-02-16 11:55:45 +01:00
Denis Michiels 8da53f9dec [FIX] account: taxes translated in partner language
Regression introduced during cbe2dbb672
Fixes #5132
opw-627826
2015-02-16 10:20:51 +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
Christophe Simonis 33a8989d77 [MERGE] forward port of branch saas-3 up to d73eeab 2015-02-11 16:40:01 +01:00
Christophe Simonis d73eeab5ba [MERGE] forward port of branch 7.0 up to 9fe040e 2015-02-11 16:39:11 +01:00
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
Martin Trigaux 3c3f54549a [FIX] account: typo in 45485fe
My bad, blame the heat
2015-02-10 14:11:08 +05:30
Alexis de Lattre 45485fe1d6 [FIX] account: multicompany with currency rates
A record rule exists on currencies but not on rates.
If creates multiple currencies with rate = 1, we could fetch the wrong one in
the search and get a security exception while trying to convert rates.
Fixes #3323, opw 626353
2015-02-10 14:06:29 +05:30
Goffin Simon d5a50fd346 [FIX] sale: fiscal position wrongly taken based on country group.
An automatic fiscal position with a country group can only match with a sale order from a customer who has a country defined.
opw:627087
2015-02-05 11:15:28 +01:00
Denis Ledoux c331e963cd [FIX] account: invoice analysis product quantity
This rev. is related to 6641c61ce6

During the above revision, a new jointure has been added
with product_uom, on product template uom_id
The join link was wrong, it was:
 - LEFT JOIN product_uom u2 ON u.id = pt.uom_id
and it must be:
 - LEFT JOIN product_uom u2 ON u2.id = pt.uom_id

 as the alias 'u' is the previous jointure, not this new one.

Besides, the uom_name is now the name
of the product uom of this second jointure
As the uom is now the product default uom
instead of the category reference uom

The groupby clause has been adapted, as the selection was slightly altered
Besides, grouping by u.uom_type, u.category_id was pointless
2015-02-04 20:28:48 +01:00
Martin Trigaux 16374dfa33 [FIX] account: error message not translated 2015-02-04 15:28:56 +01:00
Rifakat Haradwala a08b9c2c41 [FIX] account: forbid creating entries on closed period
Prevent creating/modifying accounting entries made on close periods.
The period_id and journal_id field on a account.move.line is a related so was
silently (without write call) updated so did not triggered the call to
_update_journal_check while modiying the linked account.move
Force the check in the validation of the move. As the move can not be balanced
without going through this method, this will prevent posted entries in closed
accounting period.
Fixes #1633, opw 615886
2015-02-04 15:28:55 +01:00
Goffin Simon 6641c61ce6 [FIX]report:wrong uom for "product_qty in invoices analysis
opw:626411
2015-02-03 08:52:42 +01:00
Denis Ledoux f043c41ac9 [FIX] account: report_vat with several periods
When fetching the VAT reports for several periods, only the last period was took into account
This is due to the fact that a browse record assignation no longer works in Odoo 8.0 API
at least not the same way.

code.sum_period = sum_tax_add just do nothing in Odoo 8.0.
Besides, using the variable "code" outside its loop is kinda crappy.
2015-01-29 16:26:58 +01:00
Olivier Dony 8e03852fd4 [I18N] Update translations from Launchpad 8.0 branches 2015-01-26 16:36:51 +01:00
Olivier Dony 6ebdcbd2cd [FIX] account: misleading labels/tooltips on new fiscal position fields 2015-01-26 11:27:01 +01:00
Arthur Maniet eed09ba410 [FIX] account: reconciliation widget was not assigning an amount on writeoffs lines when a tax with amount == 0 was applied. This undefined amount was interpreted as 0, resulting in tragically unbalanced journal entries.
Fixes #4871
2015-01-23 22:46:46 +01:00
Denis Ledoux 0ec3c75c2d [FIX] account: default value for report_vat report
If the report was printed from the tax codes list
Accounting > Configuration > Taxes > Tax codes
There is no information concerning what should be displayed (periods, details, etc.)
as the user did not printed the report from the wizard
(from Accounting > Reporting > Generic Reporting > Taxes > Taxes report)
We therefore set default values, in order the report to not crash

Nevertheless, the user has obviously to go through the wizard
if he wants to set a configuration different than the default one
2015-01-23 14:13:13 +01:00
Aaron Bohy ef986fe9de [FIX] Account, portal_sale, sale, website_quote: local paypal gif
Add local copies of the paypal gif to the archive. This fix was required
for Debian packaging. It fixes the privacy-breach-donation lintian error.
2015-01-23 11:11:26 +01:00
Olivier Dony 495ec92251 [I18N] Update translations from Launchpad 8.0 branches 2015-01-21 15:36:54 +01:00
Olivier Dony 39f00b3637 [I18N] Update translation templates with latest terms
Total new terms: 270
Total deleted terms: 82
Total identical terms: 19653
Old total number of terms: 19735
New total number of terms: 19923
2015-01-21 15:31:22 +01:00
Denis Ledoux e07309d809 [FIX] account: bank statement line needaction domain
Before 8.0, the field journal_entry_id did not exist.

For database coming from older release, like 7.0, this field is not filled in during the migration, because this is not possible.
Set the needaction to depend only on the journal_entry_id will have as effect to have every bank statement line entered when the database was under 7.0 to match the domain, while the needaction is made to display the number of records that need an action.

Besides, even in 8.0, this is possible that a line has not the journal_entry_id set, while not needing any actions (see 2bb38ca89d)
2015-01-15 16:53:59 +01:00
Denis Ledoux 2bb38ca89d [FIX] account: closing of bank statement without reconciliation
For bank statement line having an account_id, but no journal_entry_id, it is not possible to reconcile the line in the bank statement reconciliation tool, as a filter is applied to only reconcile lines having journal_entry_id AND account_id not set.

As written in the help message of the account_id field:
This technical field can be used at the statement line creation/import time in order to avoid the reconciliation process on it later on. The statement line will simply create a counterpart on this account

Not allowing the reconciling should not prevent to close the statement in such a case. The button "close" was displayed only when all lines had journal_entry_id set.
2015-01-15 16:45:47 +01:00
Xavier Morel 65cd4a2a33 [FIX] remove deprecated checks/fast_suite test attributes from standard modules 2015-01-15 14:31:40 +01:00
Denis Ledoux b4094d0998 [FIX] account: bank statement reconciliation come back
Once the bank statement reconcilation done, the back button should not come back to Home when it does not found the bank statement list in the breadcrumb history, but simply perform a history_back action, which will come back to the previous action, the statement form for instance.

opw-625397
2015-01-13 15:13:46 +01:00
Denis Ledoux 220999037e [FIX] account: financial reports, report value visible when type account_report
Regression introduced with rev. f081a5e441

opw-621989
2015-01-12 11:12:18 +01:00
Olivier Dony d0cd92bb9f [I18N] Sync updated 7.0 translations from Launchpad 2015-01-07 17:57:28 +01:00
Aaron Bohy ba37ae3cf3 [DEL] Cleaning: key 'images' removed from all __openerp__.py 2015-01-06 14:20:38 +01:00
Arthur Maniet a6f31ee8e8 [IMP] account: bank statement reconciliation widget: added a 'Show more' button to load further reconciliations. PR #4519 2015-01-06 11:50:49 +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
Arthur Maniet 2107896d22 [FIX] account: bank reconciliation widget: a currency amount was not rounded
Fixes #4450
2015-01-05 16:00:58 +01:00
Martin Trigaux fefc13a2db [IMP] account: better fix than edbd0df for reconciliation test
Revert edbd0df
Instead of removing the demo data (demo data is our friend), make the test more
specific, adding a date to match the rate of 1.5289 all year long.
2015-01-05 11:30:49 +01:00
Martin Trigaux edbd0df9a0 [FIX] account: test assuming specific currency rate
Old demo data hardcoded the currency rate of USD to 1.5289 at the half
of the year, introducting new year red runbot.
Using assertAlmostEquals to avoid values like 32.730000000000004
2015-01-02 14:24:56 +01:00
Guewen Baconnier 718c94cb48 [FIX] account: Discount is an amount and should be right aligned
The header already is but the value isn't.
Fixes #4372
2014-12-22 15:10:34 +01:00
Denis Ledoux 8d9473553a [MERGE] forward port of branch saas-3 up to 36bf774 2014-12-17 14:08:23 +01:00
Denis Ledoux 36bf774d20 [MERGE] forward port of branch 7.0 up to 43cf6d5 2014-12-17 14:05:44 +01:00
Denis Ledoux 43cf6d51d2 [FIX] account: aged partner balance, advance partial payment
Partners totals were not correct if the partner paid partially an invoice in advance
For an invoice of 20.000 in the future, with a payment made in advance of 5000
The column not due must contains 20.000, as the amount is not yet due
One of the column 1-30, 30-60, ... (accordingly on when the payment was made). must contains -5000
The total should be 15.000
2014-12-17 13:57:34 +01:00