This wizard also reconciles automatically entries done on reconcilable accounts. It can hence for example be used to "move" the balance of a receivable account into a payable account (or the opposite), using the generated transfer entry to do as if the receivable and payable accounts were directly reconciled together.
[IMP] account: display 'P' as matching number when account.move.line objects are partially reconciled
For this, we introduce a new matching_number field, used in account.move.line's tree views instead of full_reconcile_id, which used to be shown directly.
Was task: 2037318
closesodoo/odoo#39415
Related: odoo/enterprise#6544
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
- Create a 10 % purchase tax with price included
- Create a Purchase Receipt with a price unit of 100 and the 10 % tax
The total is 90.91 + 8.26 = 99.17.
The root cause of the issue is that... actually I have no idea. For some
mysterious reasons, in case of an `in_invoice`, `in_refund` and
`in_receipt`, we go through `_compute_base_line_taxes` when the price is
changed. In case of the `in_receipt`, we compute the tax based on the
`balance` (= 90.91) rather than the price unit, which screws things up.
Note that in case of `out_*` moves, we simply don't go through
`_compute_base_line_taxes` at all, so Sales Receipts are fine.
opw-2170975
closesodoo/odoo#43475
X-original-commit: 1bbf66937c2b4fdb45318652e3ed1147f1edd29b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The creation of an account with a single character code crashes.
opw-2176764
closesodoo/odoo#43455
X-original-commit: 7b1e881e60d6424f7b3a676c06a4b5b8a222d025
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- 'partial' payment state corresponds to invoices whose payable/receivable move line has been partially reconciled with some other line.
- 'reversed' payment state corresponds to entries that have been cancelled by the creation of a single reverse entry (using the dedicated button on the form view). This state can be set on invoice as well as on regular entries.
=> To stay consistent with the naming conventions, this commit also renames invoice_payment_state field to payment_state, since it's no longer only applicable on invoices.
closesodoo/odoo#41723
Related: odoo/enterprise#7202
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Description of the issue:
Transfer between Bank1 (550001) and Bank 2 (550002) of the same company via the intercompany bank account (580000) :
Bank 1: minus 1000 EUR, we create the following accounting entry via the reconcile widget
account 550001 credit 1000
account 580000 debit 1000
Bank 2 : Plus 1000 EUR
When we select the counterparty 580000 entry of the Bank 1 statement via the reconcile widget
than the statement_line_id of the entry from Bank 1 statement is replaced by the one of the Bank 2 statement.
Hence this account.move.line is linked to the wrong statement line.
closesodoo/odoo#43371
X-original-commit: 3d74e7397e15311f1e9189589a435d9683376317
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
When switching a invoice to a refund, the bank account to which the move
should be paid should be removed: while it (might) contain the partner's
bank account before, when becoming a refund it makes no sense to keep
the partner's bank account as the recipient.
closesodoo/odoo#43176
X-original-commit: e94234f435622b7de00c917ca7c6302fd6c92881
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Before the merge of account.invoice with account.move, a group of taxes was
expanded on journal items and not on invoice lines. Since both are now the
same thing, we only get the group of taxes when using the 'tax_ids' field.
To correctly handle this new behavior, we need to call 'flatten_taxes_hierarchy'
every time we use the 'tax_ids' field to get the children taxes instead of the
group of taxes itself.
[FIX] account: Wrong unit price with included tax and fiscal position
Steps to reproduce the bug:
Let's consider a sale included tax T1 of 10% and a sale excluded tax T2 of 0%
Let's consider a product P with T1 and a sale price of 110€
Let's consider a fiscal position FP that mappes T1 to T2
Let's consider a customer C with FP as fiscal position
Create a customer invoice for C
Add P on the first line and T1 is replaced by T2
Bug:
The unit price of P was still 110€ instead of 100€ because the included tax was not removed from the base
price of P.
Same behavior as in 11.0 and 12.0
opw:2150564
closes odoo/odoo#43100
Co-author: simongoffin (sig@odoo.com)
Forward-port-of: #42926
Forward-port-of: #42188
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
If the opening entry is balanced, the auto-balance line is unlinked.
However, before unlinking we test if it is balanced, which it is not. A
solution is removing the line from the move and it will be unlinked
automatically.
closesodoo/odoo#43045
X-original-commit: 56ecc9c4c2e9dcc3e06ee0a388d439845ddeedfc
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Activate Multicurrency
Create a Journal Entry with default currency (USD)
Save
Error will trigger because of the sql constraint
'check_amount_currency_balance_sign'
The currency_id and company_currency_id are the same while they
shouldn't because company_id should be unset if it is the same as the
company_currency.
Fix to update the error message to let the user know that it's best to
keep the field empty so the company_id would not be set
opw-2169523
closesodoo/odoo#43082
X-original-commit: 6a420921818d741d48bf873e0a62a220c135fbfa
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- In a multi currency company, create an invoice with the domestic
currency ($);
- Add a product (500$) with taxes;
- Change the currency to a foreign one (€);
- The product don't change of amount but only of currency (500€);
- Save the invoice, and print it.
Before this commit, the base_amount_tax of the tax wasn't be updated.
Note that the base_amount_tax it should be expressed in domestic
currency. As this field didn't update in this case, the base_amount_tax
is expressing the amount in foreign currency. As this amount is supposed
to be in domestic, for the sake of the reports, it's change in currency
of the invoice (in this case the foreign one), and it's shown in the
report. The amount shown is not correct.
Now, the base_amount_tax is recompute and setted in domestic currency.
opw-2157853
closesodoo/odoo#43071
X-original-commit: 226a1155124e890d00e33968feb43b9fd6b99fa5
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Create an invoice, click on send and print without an associated
template.
Traceback will occur because the lang parameter is set correctly only
from a template. Adding a fallback in case there is no template setting
opw-2168623
closesodoo/odoo#43008
X-original-commit: 8fd8fdcf0fa6fb26a1797ad2b40fcaf34d23eee2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Create a journal.
- Create a vendor bill on this journal.
=> Odoo allows you to set a starting sequence number for your invoice.
This number must always use the sequence used when posting the invoice.
However, the invoice date was taken instead of the accounting date.
Before this commit, when setting an invoice date at Y and an accounting date at Y - 1,
the edited sequence was the one in Y - 1 but at the one in Y was used at the validation.
Manual forward-port of 42579
closesodoo/odoo#42914
X-original-commit: 525b5b1a8676e4d1ed1082505c33afb29fed6a42
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
When an account of type receivable or payable is used as default debit
account or default credit account of a journal of type sale or
purchases, an error is raised.
Now, constraints are added to avoid this.
opw-2151924
closesodoo/odoo#42817
X-original-commit: 0c90eb50b352ee003d52ef927260d1b9310ec69f
Related: odoo/enterprise#7562
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Create multiple tax and assign them to the same tax group. Now create an
invoice, in the line add all the taxes in the group. Save and click on
"Preview". In the tax recap the tax group will be reported applied on a
total equal to the number of used taxes multiplied by the total of the
product. This append because in the calculation the tax are included
multiple times and not just once per group.
opw-2158989
closesodoo/odoo#42814
X-original-commit: 261c528b87bd8e5b5e4cd0dbaf01c49197bf192c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce the bug:
- Create a journal entry JE
- Add a partner P and an account A
- Click on 'Add a line'
Bug:
A line with P and A was suggested instead of only P as smart suggestion
opw:2152827
closesodoo/odoo#42699
X-original-commit: b71143bb3d68ed5ecab97e45699f001914bbc00f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Tests about financial reports could be not determinist because the tests are made
using two companies having the same chart of accounts.
closesodoo/odoo#42226
Related: odoo/enterprise#6432
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Steps to reproduce:
-install accounting
-go to accounting > accounting > assets
-create a deprecable asset (account moves for deprecations
are set automatically)
-change your user's language to blank
-try to post one of the automatically created deprecations line
Previous behavior:
you get a traceback error
"TypeError: strftime() argument 1 must be str, not bool"
Current behavior:
you get the intended error message
opw-2162318
closesodoo/odoo#42641
X-original-commit: 6cd38a64893428db5c2b30e85b09a34b90aa8f4f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This method makes a write on res.company but many people do not have
access to the company
closesodoo/odoo#42644
X-original-commit: 130f08f13b49a529c1da0e1dc603c62337842f45
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Activate multicurrency. The default currency for the company should be
USD. Make an invoice in EUR, with taxes, save and create the invoice.
The tax section will display the correct tax amount but the displayed
amount on which the tax should be applied is wrong: it's displayed the
amount in the company currency rather than the invoice currency.
Adding a _convert step to restore the correct currency since that
information does not appear to be saved in the database
opw-2161039
closesodoo/odoo#42494
X-original-commit: f9a8015ef8231a23cf8e5552c08248cfc95e977c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
TaskID: 2088586
Beside this override, the records in timesheets often change order
because the date field is a date type and then, many timesheets can
have the same date, thus the order isn't the same every time.
When we remove this override in account module, the default order is
restore for account.analytic.line model and it's 'date desc, id desc',
with this order, we keep the same order every time in the different
views of timesheet.
There is actually nothing preventing changing the company of some records even
there is some journal entries/items that are using them.
closesodoo/odoo#41945
X-original-commit: b3b66304eb98819cd87d6e4c7a29ca4803ffc3ff
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Slight semantics change on the behavior of _onchange_journal with
respect to payment_method_id: in the old version, it would be set to
the first method of the new journal if no default had been provided.
However if a default had been provided, a non-default method selected,
then the journal was changed, the method could remain to something
invalid. Instead, check if the method is still valid and if not reset
to either the default (if one was provided) or the journal's first.
It also seems like it'd make sense to update self.amount based on
self.invoices directly (instead of going back to the active_ids) but
TestAccountMovePayment does *not* like that.
Task 2115472
closesodoo/odoo#41868
Related: odoo/enterprise#7260
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
`possible_bank_partner_ids` is an override hook, it's not useful in
and of itself.
Task 2115472
closesodoo/odoo#41872
Related: odoo/enterprise#7261
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
It seems very strange that we'd want to use active_ids as invoices to
work with when when we already have invoices available, and these are
browsed / converted from the active_ids if they weren't provided
explicitly.
There's also an odd divergence between the filtering on the journal's
company here and in the default_get too: in the default_get we get a
journal in the user's company but then we only allow selecting a
journal from the invoices' company...
Task 2115472
closesodoo/odoo#41871
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The dynamic domain really seems wholly unnecessary (though the static
one does require adding a field to a bunch of views)
Task 2115472
closesodoo/odoo#41870
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Pretty straightforward so long as you know `current_company_id` is the
currently active company for the user, which is exactly what we need.
Task 2115472
closesodoo/odoo#41869
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Steps to reproduce:
-install the POS module
-install the Contacts module
-create or use an existing partner as a customer during the pos session
-go to contacts and activate the "customer" filter
-> partners used during the pos session are not showing in the list
The problem was that the 'customer_rank' property
https://github.com/odoo/odoo/blob/d8d7635d6cf2af60791f25201a7bd1c2d5ec238b/addons/account/models/partner.py#L430
was not updated properly after a pos account move was done
Previous behavior
After ending a POS session, partners that are created and/or used
during the session are not showing on the Contacts views when the
'customer' filter is active
Current behavior:
The customer_rank of the partners is increased by one for every sale
during the pos session
Partners created or linked during a POS session are now considered
customers and appear in the contact view when the "customer"
filter is active
opw-2148894
closesodoo/odoo#41792
X-original-commit: 22874376594f94232e0c4ad5a4db3ee76f24b39a
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Before that, an empty account.bank.statement.line recordset was passed to the function, and caused the recordset containing the currency to use to also be empty, eventually leading to a rounding value of 0, which raised and error.
closesodoo/odoo#41474
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
- Create a misc. journal entry.
- Add a foreign currency on the line.
- Change the date.
=> The currency is erased because the onchange works only for invoices.
X-original-commit: e0bb4134512ec252b66ecfe91ce259d8cdcffedf
Fix _get_bar_graph_select_query to correctly compute the residual
amount when calculating the values for the graph of a bill or invoice
journal.
closesodoo/odoo#41592
X-original-commit: 73d28be404901378dc06e756868e5a1ef6cf7b0b
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Before that, we deleted all the tags and removed them from the repartition lines all the time; we only want to do that if the tags are not shared with another report, so we use == instead of 'in'.
closesodoo/odoo#41579
X-original-commit: 5f147681c721f5de609622f2cf80b3919eaf49bf
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Before that, upgrading a l10n_* module with a tax report removed all the tags from the tax repartition lines.
X-original-commit: a1364bde860266154298034bbae3693161834f49
— Enabled multi currency;
— Create new journal entry;
— Add a new line;
— Add the column 'amount in currency';
— Select a different currency than the company currency;
— Set an amount in 'amount in currency'.
Before this commit, the amount in currency is not converted into debit
or credit fields.
Now, the amount is correctly converted into debit or credit fields.
opw-2129294
closesodoo/odoo#41580
X-original-commit: ae3d7aeb706dc1bc3216fd63c6a943e5d9cb56e7
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Search bank account with company to handle the case where the res.partner.bank
is defined in several companies. Without this commit, a Value error was raised
because we expect only one record returned.
closesodoo/odoo#41469
X-original-commit: 9be0adb99561c68ea2f2e3e5710f7437ef16d2f9
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
List of improvements:
Invoice/Bill
- Hide "untaxed amount" section when there is no tax.
- Remove tooltips for tax groups field.
- Remove invoice_partner_icon and set this icon in "Vendor" (in a list view)
Chart of Accounts
- Same views for config bar and regulare one
- By default don't show deprecated accounts and add filter to display them.
- Add some optional fields in list view (taxes, tags, ...)
Dashboard opening balance wizard
- The opening move entry date equals to the opening date - 1 day.
Bank Statements
- Set default order for the list view (by date desc and name desc)
Tax report configuration:
Add 3 new columns for the list view (country_id, code, tag_name)
Add 4 new searchs (name, tag_name, code, country_id)
Task ID: 2048225
closesodoo/odoo#38694
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Task 2046908
Instead of having all the fields duplicated with second_*, we have now a
o2m allowing us to
* have more than 2 lines
* reduce duplicated code
* fix bugs and add features at only one place
We also remove the computation of writeoff and suggestions from the
client side as some code was 4-upled before (twice in in client and
twice in server side). The logic is now only at one place.
closesodoo/odoo#38119
Related: odoo/enterprise#6324
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
If we do a payment with:
- a currency different than the journal
- the journal currency the same as company currency
=> it fails, because of the constraint on account.move.line:
> The amount expressed in the secondary currency must be positive when
> account is debited and negative when account is credited.
with code:
```
CHECK(currency_id IS NULL OR company_currency_id IS NULL OR
((currency_id != company_currency_id) AND {conditions on balance}))
```
This happens because in this use case, a NON-NULL currency_id means that
the currency is different than the company currency, this was not taken
into account when creating a liquidity line.
opw-2150267
closes#41244closesodoo/odoo#41278
X-original-commit: f9d75e3a5442162538c727eb7e4f111c9b792104
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
The field user_id was created twice in the model with the same values and options, only a different help message. This removes the duplicated one.
closesodoo/odoo#40542
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
- Introduce a new account.tax.report object
> Tax report lines now refer to a tax report, and the tax report to a country
- Tax report lines can share tags accross reports within the same country
> To support the cases where some report is a simplified version of another one: some of its lines can be computed in the same way as the 'bigger' report.
> This is done by giving the same tag_name to the tax report lines, and the same country_id to their parent report.
> Full support for tag name modification, and the way it impacts the shared tags (sometimes, we can overwrite them all, sometimes we must delete them, sometimes, we create new tags to replace them on some report lines).
- Support copying tax report (and the lines/tags linked to it), so that it is possible to duplicate them and change the country set on the duplicate for use in another country (coopying is way better as replacing in place, as we don't keep any link to an xmlid, and still allow using the original report in the original country it was created for).
- Make all l10n* modules compatible with those changes
closesodoo/odoo#38964
Related: odoo/enterprise#6217
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
1) Don't set an amount_currency without currency_id set.
2) Use the journal's currency only if different of the company one.
closesodoo/odoo#41094
X-original-commit: 3dd8bf6a38704df0db4f0879e685d2230be572a2
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
The trailing check on the fiscal year lock date is wrong and is
triggered whatever the values passed to 'write'.
closesodoo/odoo#41100
X-original-commit: 5b3486a434dbb0d9d1ed583e59f6b478b33e9745
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>