Commit Graph
15174 Commits
Author SHA1 Message Date
jbw 7b5664660f [IMP] hr_expense enable attachment preview in journal view
Adding preview of expenses attachment to journal view.

When creating an expense, files can be attached (e.g. scanned receipts).
Those attachment files where not displayed in "Accounting > Accounting > Journals > Purchases" move_line list.
They now appear in the document preview.

Task = 2176443

closes odoo/odoo#44161

Related: odoo/enterprise#8002
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-02-03 15:35:08 +00:00
Cedric Snauwaert 80c67aa26f [FIX] account: outstanding credit widget should be displayed in state in_payment
closes odoo/odoo#44595

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2020-02-04 13:35:34 +00:00
Katherine Zaoral d0cbd2a06d [FIX] account: be able to found the proper transfer account
Properly set the transfer account in the company taking account the accounts defined in th company domain.  We found this error because in l10n_ar module we have 3 chart of accounts based on the company AFIP responsability which actually have same transfer_account_code_prefix. For that reason it was setting a transfer account to the company which is not belongs to the current company.

closes odoo/odoo#44586

X-original-commit: d38228836b8944740f04ca355c997c4b6a346e48
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-02-04 12:25:39 +00:00
Swapnesh Shah 5706ff62df [FIX] account: Set newly created template
Before this commit, Creating New Template from "Send Invoice" wizard doesn't update template_id on the Wizard.

In this commit, We write newly created template_id on the wizard.

closes odoo/odoo#44561

X-original-commit: 454e6ed9d956ac131d6476c95e59b2ab390df5b6
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-02-04 09:55:06 +00:00
Swapnesh Shah c3151daea7 [FIX] account: Use current date as fallback to convert currency
Fixes #43705
Before this commit, There will be tracback on converting currecy if there is not date on tax line.

Now we use current date to as fallback to convert currency.

closes odoo/odoo#44559

X-original-commit: 2b88d71c6e4815334f0edaa24d6041c5facd811e
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-02-04 09:41:30 +00:00
Martin Trigaux be7b57a6fa [FIX] account: give a correct example
The computation was incorrect, the answer was 10, not 110 with the
previous formula

Courtesy of Frederico Freire Boaventura

closes odoo/odoo#44514

X-original-commit: 577e1ad8314cac6e61f60f997f338df4b7a1da38
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-03 16:16:20 +00:00
Thibault Francois 08dfa9ffc4 [FIX] account: take into account force_company for default journal
The default journal depends on the company define in the context or the company in the environment
In case of online signature/payment of a SO in a different company then the public user
The company will be wrong and the journal_id as well
It lead to a fail of the payment since the payment could not be reconciled with the invoices

This is happening because the force_company is not taken into account for the default journal

This commit take the force_company into account, it take the precedences on the default_company

closes odoo/odoo#44238

X-original-commit: 8158e286b0020daa994b593377a2c99234e66086
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-29 18:38:34 +00:00
jdoutreloux 62baa8a214 [IMP] sale_timesheet : change default values of projects
If sale_timesheet is installed, the timer is activated
by default.

Task-2125111

closes odoo/odoo#44468

Related: odoo/enterprise#8109
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-03 12:59:17 +00:00
Jinal Patel 0c075552f7 [FIX] account: change the type of name field in 'account.move.line'
-When 'Product Description' on several line in sale.order.line.
 In that case, In 'Sale Order' report description print as it is but
 In 'Invoice' report lines are all fitted into one single line.

-By this commit solved this issue.

task- 2127652
closes- odoo#42006

closes odoo/odoo#42006

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-12-17 12:08:46 +00:00
Laurent Smet 09e102ece5 [FIX] account: Prevent unbalancing a move when unlinking amls
There is nothing left preventing to delete an account.move.line making
the related account.move unbalanced.

closes odoo/odoo#44341

--issue: 2185112
X-original-commit: 92364270d21cc4688471597f04fe25206b320a58
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-01-30 16:08:00 +00:00
Nicolas Martinelli f028a5f410 [FIX] account: do not call action_invoice_paid
`action_invoice_paid` should be called when the computed field
`invoice_payment_state` is set. However, the recomputation doesn't go
through `create` or `write` (since the field is protected).

A workaround  is to call it at reconciliation. Indeed, an invoice can
only be paid when it is reconciled. For invoices with an amount of zero,
we call the method at posting.

closes odoo/odoo#44331

X-original-commit: 97b00da953f7860d51326a160c38fab0354458a8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-31 07:43:35 +00:00
oco-odoo 2221f03624 [IMP] account: make switch from Invoicing to Accounting app easier
This is done by introducing a new threshold setting, allowing choosing a date before which all invoices and payments have to be ignored by the accounting. Once this is done, all the balances can be reimported directly, easing the migration to Odoo Accounting a lot.

account.move objects having to be ignored because of this are cancelled, and receive the new 'invoicing_legacy' payment state. account.payment objects are moved to the new 'invoicing_legacy' state and their related account.move is cancelled and marked as invoicing legacy as well.

closes odoo/odoo#41416

Task:  2092377
Related: odoo/enterprise#7071
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-30 17:20:21 +00:00
Laurent Smet eec0b80756 [FIX] account: Fix computation of taxes with round_globally.
-github issue: 14673

closes odoo/odoo#44312

-task: 2007300
X-original-commit: 6d3f3c749dbccc875f67c17ee95086df494044f6
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-30 13:41:55 +00:00
Pedro M. Baeza 8e51fd2afe [FIX] account: Perform B2B/B2C overlapping check per user
Steps to reproduce the problem:

- Have user A with B2B group.
- Have user B with B2C group.
- Add simultaneously on both - via write - another group (or call `_check_one_user_type`).

Expected result:

- No problem

Got result:

- Error "A user cannot have both Tax B2B and Tax B2C..."

That's because the check is performed for more than one user each time, while it has
to be record per record. The implementation of `_has_multiple_groups` actually
checks if the passed recordset is only one record, and if not, it looks directly for all
existing users, so also the case of both users A and B being in the same B2x group, but
having a 3rd user in the other group will fail.

Revisiting the query in `_has_multiple_groups`, there's a hidden error when you use it
for only one ID because a missing space.

closes odoo/odoo#44300

X-original-commit: 83f104b2f2fc1345ad067430466c004697a91db9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-30 12:40:49 +00:00
wan 9d28c71a71 [IMP] account: add cumulated balance for general ledger list view
Task 2081612
* Add as an optionnal field "balance" (simple debit -credit)
  - usefull for "group by"
  - usefull when selecting several lines (in the footer total)
  - Hidden by default for journal view
  - Diplayed by default for ledger view
* Cumulative balance only for ledger views

closes odoo/odoo#38174

Related: odoo/enterprise#8024
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-30 10:17:34 +00:00
Akim Juillerat 1e5eca501f [FIX] account: Fix matching rules reconciliation when dealing with negative amounts
match_total_amount_param on account.reconciliation.model is not
respected when paying a vendor bill through bank statement because
the amounts from both the statement line and the move line that
are used in the comparison will be negative.

closes odoo/odoo#44234

X-original-commit: 1a9221584f78fc7619277c2c0e9b9659e7c80ee2
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-29 17:37:18 +00:00
Jorge Pinna Puissant cb2d8943ea [FIX] account: compute of amount residual in foreign currency
When having an invoice in foreign currency and a partial payment in
domestic currency (in a different date with a different exchange rate),
the computed amount due is incorrect. When computing the
amount_residual_currency the payment (in domestic currency) is converted
to the foreign currency using the exchange rate of the invoice date, and
not the one of the payment date (see 56d92213b8).

If the account.partial.reconcile line will have a currency_id and a
amount_currency the amount_residual_currency will not be converted but
simply added.

This behaviour was introduced with e130606602
and backported to version 11.0 with 3363d7235137f286458c734a1a0417beeb1f66bb.
In version 12.0 this behaviour was partially reverted in d3d2612061.

opw-2156001

closes odoo/odoo#44181

X-original-commit: 94d34e052f3757c21884fd5a57cc68ea8c51aafb
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-01-29 12:24:08 +00:00
wan c5e5e97888 [IMP] account_check_printing: log state for vendor checks
Task 2168197

Especially when writing out checks we would like to track the value of
the state of the vendor payment in the chatter. This way we can see who
prints it, cancels it, etc and at what time this happened. It's
important for traceability. I think we can just enable it for all
payments in general, I can't think of any downsides and payments are
usually sensitive documents so I imagine people want as much info as
possible.

closes odoo/odoo#43505

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-17 15:41:40 +00:00
Martin Trigaux a74a648030 [IMP] *: use ast.literal_eval
When simply need to parse a domain, it is easier

Add .strip() on ir.ui.view as ast.literal_eval produces an syntax
error if the node starts with spaces (as done in the xpath of
hr_attendance.view_employee_form_inherit_hr_attendance)

closes odoo/odoo#43831

Related: odoo/enterprise#7894
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-28 13:58:05 +00:00
wan 3c7bc9721b [FIX] account: allow opening entries with multiple lines on the same account
When we had multiple journal items with the same account in either debit or credit on the opening move, only the last one was taken into account. This could happen when the opening entry had modified manually (not through the list view opened by the setup bar).

We now take multiple lines into account when computing the opening balance. Also, this multiple lines case is also now supported by the setup list view allowing editing the opening balances : when multiple lines exist for the same account, we group them into one and edit the total just like before.

closes https://github.com/odoo/odoo/issues/43736

closes odoo/odoo#44088

X-original-commit: c5a8051a2c840b2be545eee2f173261a908de737
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-28 11:29:36 +00:00
wan f315df2e58 [IMP] account, hr_expense: misc improvements of accounting
Task 2176461
* Dashboard: don't show lins if there is no data
* Add new menu for expense reports
* Reorganize notes on bottom of printed invoice

closes odoo/odoo#43787

Related: odoo/enterprise#7880
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-22 16:49:18 +00:00
Laurent Smet 62ae169dfb [FIX] account, sale: Fix account.move (invoices) access rights
Without any access rights on the 'account' module, a salesperson should be able to
create a new invoice from a sale order.

Since the merge of account.invoice with account.move, we need to manage carefully the
access rights when dealing with invoices. A salesperson must not be able to manage the
journal entries except the one being an invoice created for a sale order.

To make such restriction on the journal entry's type, we need additional record rules
- in sale: to restrict the access to invoices.
- in account: to exit such restrictions when having billing access rights.

closes odoo/odoo#44023

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-28 08:18:10 +00:00
Laurent Smet efa60a1538 [FIX] account: Fix rounding issue on price_unit with price included tax
Suppose a price_unit of 2300 with a 5.5% price-included tax applied on it.

The computed balance will be computed as follow: 2300.0 / 1.055 = 2180.0948 ~ 2180.09.
Since accounting / business fields are synchronized, the inverse computation will try to
recompute the price_unit based on the balance: 2180.09 * 1.055 = 2299.99495 ~ 2299.99.

--issue: 2168073
2020-01-28 08:01:21 +00:00
Yannick Vaucher e6f0cc0d44 [FIX] account: Trim all space chars in reconciliation match
PostgresSQL TRIM function does not trim line return and other space characters
that are not white space.

For references having a non trimmed character regexp_split_to_array would create an array
with an empty element. Such element could be matched to a counterpart with no numerics in
the reference.

TRIM(' \n001') => '\n001'
regexp_split_to_array('\n001') => {"", "001"}

By replacing the TRIM function by a substring using a regexp we
also remove the other space characters such as tab and line return.

closes odoo/odoo#44026

X-original-commit: 93f63c331781179fc6b81c14563a97b1d6a9b300
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-27 15:20:55 +00:00
Pierre Paridans ffaa3eb0d3 [FIX] account: fake notebook misses tabs container
Since commit odoo/odoo@43db60d `<notebook>` elements
have also a wrapper element (with class `o_notebook_headers` around
their tabs.

Since account module reuse the markup and styling of the `<notebook>`
but without using the tag itself (cf. done by hand) the reconciliation
line's tabs style was broken.

This commit adds the missing wrapper element and set the
margin-{left,right} reset to the that element.

closes odoo/odoo#43959

X-original-commit: 8d45e3d52a7312addb05dd6cb39d68f9d61144da
Related: odoo/enterprise#7941
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2020-01-24 21:55:49 +00:00
Sylvain LE GAL 1e1e511cea [FIX] call _get_product_accounts() everywhere
closes odoo/odoo#41632

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-23 14:29:45 +00:00
Jorge Pinna Puissant 6754d87ac8 [FIX] account: invoice partner name
Before this commit, in the list of invoices the customers were displayed
using only their names and not the company that they belong.

For instance, if 'Brandon Freeman' is part of the 'Azure Interior'
company, only his name was shown.

Now, the company names is also shown. In our example, the customer will
be displayed as : 'Azure Interior, Brandon Freeman'.

This behaviour was already the case in version 12.

opw-2179722

closes odoo/odoo#43824

X-original-commit: ca57cdeb80729a3e3b4bc2cc91376b625e1934ed
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-01-23 09:53:14 +00:00
Luis González dbb7bc0fd5 [FIX] account: Don't try to reconcile a CABA Entry line if already reconciled
Main
-----

For Huge Amount Invoices with small residual being paid and the Invoice and the
initial payment which almost paid, the invoice in full can render the
reconciliation of the Tax Entry Lines as fully reconciled.

Description
-----------

In case of multi-currency transactions where CABA Journal Entries are involved,
there could be a case where, in Mexican Localization, so far, a small entry
line cannot be reconciled with their counterpart because the previous
counterparts are already reconciled. (Though this is still unproved in a lab,
i.e. UnitTest, can be seen in the wild, i.e.Customer's Production Instance)

The following is an hypothetical case yet to be proven:

        Test to validate tax effectively receivable

        My company currency is MXN.
        Invoice issued two days ago in USD at a rate => 1MXN = 0.80 USD.
        Booked like:
            Receivable          1450                1160    USD
                Revenue                 1250       -1000    USD
                Taxes to Collect         200        -160    USD (Hypothetical Fully Reconciled with A1)
        Payment issued today in USD at a rate => 1 MXN = 1.25 USD.
        Booked like:
            Bank                 927.99                1159.99    USD
                Receivable               927.99       -1159.99    USD

        And a Tax Cash Basis Entry is generated for the ratio being paid
        Booked like:
            Tax Base Account     800                1000.00    USD (sometimes this base can be rounded up and instead of being 999.99 it ends up as 1000.00 which leads to taxes to be as fully reconciled)
                Tax Base Account         800       -1000.00    USD
            Taxes to Collect     128                 160    USD (Hypothetical Fully Reconciled with A1)
                Taxes to Paid            128        -160    USD

        I will neglect to depict here the FX Journal Entry for Tax to Collect account for the hypothetical reconciliation A1. And any other FX Journal Entries.

        At this moment Invoice has a USD 0.01 residual which on same date will be tried to write-off manually.

            Write-off              0.01                   0.01    USD
                Receivable                 0.01          -0.01    USD

        At this moment Invoice has a USD 0.01 residual which on same date will be tried to write-off manually.
        This small amount will create while running in run-time following CABA Journal Entry:
            Tax Base Account     0.01                0.01    USD (sometimes this base can be rounded up and instead of being 0.00 it ends up as 0.01 which leads to taxes to be created and be tried to reconcile)
                Tax Base Account         0.01       -0.01    USD
            Taxes to Collect     0.01                 0.01    USD (Hypothetical This will be tried to reconcile with the items in Full Reconciliation A1 but raise an error)
                Taxes to Paid            0.01        -0.01    USD

closes odoo/odoo#43819

X-original-commit: 00861974c259fbbf381a597ed9d233525185a005
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-23 09:16:05 +00:00
jerome hanke (jhk) 862f28dd5c [FIX] account: keep the code leading zeros on account duplication
Steps to reproduce:
- install accounting
- go to accounting > configuration > charts of account
- create a chart of account with a code containing leading zero's
(ex: 000022)
- duplicate the previously created chart of account

Previous behavior:
leading zero's are not kept trough duplication

Current behavior:
the new code is padded with leading zero's to keep the same length

opw-2172816

closes odoo/odoo#43802

X-original-commit: c458c8ecee6b544b4056ccf5a9af591622238182
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-22 21:13:08 +00:00
wan d8c5cc1335 [IMP] account: add a readonly group
Task 2092079
Accounting firms that want to give access to their customers avoiding
mistakes and risks will love this profile that can't do anything
wrong... Maybe as well as companies auditors..?

closes odoo/odoo#39860

Related: odoo/enterprise#6576
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-22 11:23:16 +00:00
wan 76a35c125c [IMP] account: reorganize ir.model.access.csv for more clarity 2020-01-22 11:23:16 +00:00
wan 59619987e9 [FIX] account: multi-post order compare bool and str
The `ref` field on `account.move` is not required and can yield a falsy
value. This produces a TypeError while doing the comparison in sorted().

closes #42434

closes odoo/odoo#43674

X-original-commit: 3bb4c0c99b29bb85916af95361b86e9dc3287546
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-21 15:30:44 +00:00
Jorge Pinna Puissant 7fe7d0acc0 [FIX] account: display name of journal entries
1- create a group payment (10 ~ 15 invoices);
2- Open the created journal entry.

The first issue we see is that the breadcrumb is too big to the size of
the screen.

3- Open the 'Reconciled Entries'.

Before this commit, the screen was completely shifted and not visible.
This occurs also because the breadcrumb is too big.

Now, the references added to the name of the entry is limited to 50
characters.

opw-2166551

closes odoo/odoo#43644

X-original-commit: d679c75bbeaf3e41dcdb8c91996a89ea5080669f
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-01-21 12:05:07 +00:00
Andrea Grazioso (agr-odoo) a1c522128a [FIX] account: avoid base being included twice in group
Create multiple tax and assign them to the same tax group.
Create an invoice, with two lines, each one with one tax of the group.
Save and click on "Preview" or print invoice.

The tax group will be reported applied on just the first line
This append because of 4d62a94a31c3967bfd34396a3448a3e925422634.
Reverting commit to restore the former behavior in which the tax base
amount is added for every line in which the tax group component is
found. While this other behavior could be an issue for some user the
behavior is more consistent accounting-wise and the template could easily
be changed to adapt to user needs.

opw-2170069

closes odoo/odoo#43553

X-original-commit: 43de214bf2d0da20b7609e392d800b49465b483d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-20 11:09:04 +00:00
oco-odoo 170eaa4743 [IMP] account: add wizard to perform transfers between accounts
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

closes odoo/odoo#39415

Related: odoo/enterprise#6544
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-17 13:34:15 +00:00
Nicolas Martinelli 990a299b3a [FIX] account: purchase receipt with included tax
- 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

closes odoo/odoo#43475

X-original-commit: 1bbf66937c2b4fdb45318652e3ed1147f1edd29b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-17 11:58:45 +00:00
Elmeri Niemelä 6c634c7890 [IMP] account: ability to localize the conditions for automatically generated invoice references
closes odoo/odoo#35369

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-17 10:53:34 +00:00
Nicolas Martinelli e3f1802d4c [FIX] account: account with single character code
The creation of an account with a single character code crashes.

opw-2176764

closes odoo/odoo#43455

X-original-commit: 7b1e881e60d6424f7b3a676c06a4b5b8a222d025
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-17 09:07:04 +00:00
Prakash Prajapati 4bb5ba65a6 [IMP] account: Rename customer/vendor filters on a partner
PURPOSE
=======

When the customer and supplier boolean fields were dropped
from res.partner in 13.0, the 'customers' and 'vendors' filters
were removed as well.

Two new 'customers' and 'vendors' filters have since been added
in the account module.

They might look identical to the former ones at first, but those
are instead based on two brand new 'rank' integer fields:
customer_rank and supplier_rank.

Those fields start off at zero and are increased by one each
time an in_invoice/out_invoice line is posted for the res.partner.

This means that, to be considered as a customer, a res.partner
has to have at least one invoice line posted.

This has stem confusion in both former and new users of Odoo:
- users do not have a clear idea of how this filter actually
  works. (I personally had to go through xml and python code to
  understand how to turn a res.partner into a 'customer')
- to the users that were used to the 'customer/supplier' boolean
  fields, it simply looks like the old filters stayed while the
  boolean fields were removed
- one of the reason why we got rid of the 'is a customer' field,
  is that there is no unanimous definition of what a customer
  actually is
    - is it when the lead is won? when the quotation is
      created/sent/confirmed? when the invoice is
      created/sent/confirmed?
    - here, we decided that is it when the invoice is posted,
      but whether the user agrees or not with this definition,
      there is no way for him to know this is where we decided
      to draw the line

A simple way to clarify all this is to rename the 'Customers' and
'Vendors' filters to make it obvious that they are based on the
customer invoices and vendor bills.

closes odoo/odoo#43349

Taskid: 2166410
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-17 08:51:49 +00:00
oco-odoo 8e4158af81 [IMP] account: add 'partial' and 'reversed' payment states to invoices
- '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.

closes odoo/odoo#41723

Related: odoo/enterprise#7202
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-16 18:04:26 +00:00
Odoo's Mergebot 5f65d9c9fc [FW][MERGE] project, hr_expense: Fix several multi-company issues + tests
Purpose
=======

Fix multi-company access issues following the big changes that happened
(the 13.0). Make the usability better in order to avoid potential
multi-company issues for the user.

Specification
=============

Check the related commits to see the different fixes that have been
made. For more information about the technical/functional considerations,
check the related task.

closes odoo/odoo#43321

Taskid: 2088891
Forward-port-of: odoo/odoo#43230
Forward-port-of: odoo/odoo#42418
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-16 14:20:37 +01:00
Luc De Meyer f08204c69c [FIX] account: don't overwrite statement_line_id when reconciling transfer account
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.

closes odoo/odoo#43371

X-original-commit: 3d74e7397e15311f1e9189589a435d9683376317
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-01-15 16:36:27 +00:00
fw-bot fccaa703c4 [MERGE] project, hr_expense: Fix several multi-company issues + tests
Purpose
Fix multi-company access issues following the big changes that happened
(the 13.0). Make the usability better in order to avoid potential
multi-company issues for the user.

Specification
Check the related commits to see the different fixes that have been
made. For more information about the technical/functional considerations,
check the related task.

Taskid: 2088891
X-original-commit: 5c8df3a5e5f7960e5eab6439e0a32a06224ba826
2020-01-15 15:11:50 +01:00
Thibault Delavallée d6e6e2d771 [IMP] base, account: move bank accounts partner information from base to account
Before this commit, bank accounts tab on partner view is available directly
in base whereas it should not, as it contains information useful only
for accountants. We therefore move them directly to account.

Task ID: 2172260

closes odoo/odoo#43322

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-01-15 09:30:07 +00:00
Florimond Husquinet (fhu) 34dd971ddc [IMP] base, account: move basic bank accounts info from account to base
Before this commit:
If neither Invoicing nor Accounting are installed, users are stuck with menus
items to create bank-related informations (Banks and Bank accounts). They won't
be able to set these information directly on their contacts.

After this commit:
The Bank Accounts part of the Invoicing tab has been moved from the `account`
module to `base`, so it's now visible in the partner form even when only
`contacts` is installed

Task ID: 2126832

closes odoo/odoo#40563

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-01-08 16:21:10 +00:00
Damien Bouvy b5c9387c70 [FIX] account: remove bank accounts when switching move type
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.

closes odoo/odoo#43176

X-original-commit: e94234f435622b7de00c917ca7c6302fd6c92881
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-01-13 09:37:29 +00:00
fw-bot eeac89f055 [FIX] account: Manage group of taxes everytime
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>
2020-01-10 15:16:58 +00:00
wan 3d4369c26f [FIX] account: auto-balance opening entry
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.

closes odoo/odoo#43045

X-original-commit: 56ecc9c4c2e9dcc3e06ee0a388d439845ddeedfc
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-01-09 12:51:36 +00:00
Andrea Grazioso (agr-odoo) a50cefb769 [FIX] account: unset currency_id if equal to company_currency_id
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

closes odoo/odoo#43082

X-original-commit: 6a420921818d741d48bf873e0a62a220c135fbfa
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-09 15:35:41 +00:00
Victor Feyens 2691c66dbc [FIX] account: use the right company to access partner properties.
closes odoo/odoo#42955

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-09 10:04:32 +00:00