Commit Graph
15785 Commits
Author SHA1 Message Date
Laurent Smet 66a98f8ed8 [FIX] account: Use only partner bank accounts of the payment company
closes odoo/odoo#65418

X-original-commit: 8ff165025e18a8d49a5666caac1747046ce87b6e
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-02-02 14:05:10 +00:00
Michael Mattiello (mcm) 785b304876 [IMP] *: reduce shift in form views (xml)
* account, analytic, calendar, coupon, crm, crm_iap_lead_website,
  delivery, digest, event, event_crm, fleet, gamification, hr,
  hr_expense, hr_skills, im_livechat, lunch, mail, maintenance,
  mass_mailing, membership, mrp, point_of_sale, pos_mercury, product,
  purchase, purchase_requisition, sale_management, sales_team, sms,
  stock, stock_landed_costs, survey, website_crm_partner_assign,
  website_event_exhibitor, website_event_track, website_forum,
  website_slides, base

This commit removes oe_edit_only labels and adds placeholder
on fields in form views from a lot of apps to minimize the
shift when switching mode.

task 2330101
2021-02-02 12:40:22 +00:00
John (jol) 634e707b16 [FIX] account: remove constraint on bank statement line amount = 0
A former constraint made it impossible to import bank statements with lines = 0.
The task #2403369 removed that constraint.
But the user could no longer reconcile Bank Statement Lines = 0.

Drawbacks :
- The user is then blocked when setting a lock date.
- The bank statement remains endlessly in Status Processing

A previous fix made a bank statement line = 0 immediately reconciled.

Closes task #2449127.

closes odoo/odoo#65359

X-original-commit: ee4f7df8d34593bdde3fc6f9bd062f6dad238fcb
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-02-01 16:08:26 +00:00
Nicolas (vin) 164c467c3d [IMP] account: Improve distinction between payment and bank statement
Increase the distinction between a journal entry linked to a bank
statement line and another one linked to a payment by adding a smart
button linked to them.

Also improve the navigation from the Bank And Cash view to directly
open the linked bank statement line or payment.

Task id #2448618

closes odoo/odoo#65316

Signed-off-by: William André (wan) <wan@odoo.com>
2021-02-01 16:58:25 +00:00
Laurent Smet 0a2d73e738 [FIX] account: Fix 'is_reconciled' flag for zero-amount statement line
When the suspense account is not reconcilable, 'suspense_lines.reconciled' always gives 'False' leading to a not reconciled statement line.

closes odoo/odoo#65290

X-original-commit: 73ddcfbcc58b7a6542ced4bd8b20dd67c9f446ee
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-29 16:13:12 +00:00
Laurent Smet 73d363866e [IMP] account,point_of_sale: Remove dead code
This code is no longer needed since:
https://github.com/odoo/odoo/commit/6576e1388e0a3d2a822a768c6c563769afb392a1

closes odoo/odoo#65272

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-29 13:37:13 +00:00
Mohammed Shekha 706929e118 [FIX] *: update tour sequence
with this commit we are updating sequence of onboarding tours

task-2444153

closes odoo/odoo#65244

X-original-commit: a928beccb09f4db4234356e5e4f7bdf090ecc964
Related: odoo/enterprise#16026
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-01-29 09:03:08 +00:00
Goffin Simon 23f1a57f63 [FIX] account: Selecting a journal from Journal entries
Steps to reproduce the bug:

- Go to Accounting (module)> Accounting (menu) > Journal Entries
- Create a new account move M
- Remove the default journal

Bug:

Impossible to set a journal

opw:2445553

closes odoo/odoo#65200

X-original-commit: cd1823a1066dd9a820afed8427e3a9abc2faade0
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-01-28 10:25:39 +00:00
Jalpesh Patel 66637644ea [FIX] account: typo for return default_account_id value
closes odoo/odoo#64739

X-original-commit: 5495808c6504b3c8a026be92e53bb62326a1164f
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-01-19 10:10:57 +00:00
bve 2ad912900e [IMP] account: warn msg decimal accuracy on modification
commit 31e1322b40 is allowing the
customer to increase is decimal accuracy for currency without
consequences but triggering issue upon lowering it if entries
already exist.
+ Remove the redirection to the support.

Let's ensure that the behavior is consistent and the users are
warned on first modification. To do so, adding an alert msg
in addition of the blocking message in case of lowering the decimal
accuracy after already creating accounting entries.

opw-2428857

closes odoo/odoo#64757

X-original-commit: 66533ebd88ed89c3baae6fdb1d0a28a458fa0cb9
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-01-19 15:50:17 +00:00
wan db532b0804 [FIX] account: missing renaming type -> move_type
Following https://github.com/odoo/odoo/commit/d675dbaa4c7174591e0e7c1a3caf3e76877312ce

Also updated tests to be more consistant.

Regex used to find problematic lines:
`\btype\b.*\b(out|in)_(invoice|refund)\b`

closes odoo/odoo#64951

X-original-commit: 523cfc447bada2617d0e2cce61806aa188bc59b8
Related: odoo/enterprise#15917
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-01-22 15:24:22 +00:00
Nicolas Seinlet ea4e594b28 [FIX] account: restricted fields on notes
In 13.0, some account.move.line fields (amount_currency, debit, credit
and account_id) couldn't have a value when the line is of type 'note'.
Skiping them during line copy for notes is not an issue.

During 12.0->13.0 migration, we were facing issues with "grouped similar
invoice lines in a single move line", because this feature is not
available anymore in 13.0. To avoid any "loss of data" during migration,
we used lines of type note to create "missing" invoice lines in move
lines without altering accounting in any way. As a consequence, we have
13.0 databases with lines of type note having values for fields who
couldn't have ones.

closes odoo/odoo#64962

X-original-commit: 677edafeaf8d691764178f5e7e9639017b0249a8
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-01-22 17:12:07 +00:00
william 05dd0f6460 [IMP] account: populate
Task 2230635
Add _populate implementation for:
* Bank Statements
* Journals
* Journal Entries / Invoices
* Payments
* Reconcile Models

Load a chart of account for the first 3 companies, and load data only
for companies with a CoA installed.
2021-01-22 10:14:48 +00:00
Goffin Simon 8ce93bfbfb [FIX] account: Purchase journal and Sale journal
A purchase journal cannot be created without a default expense account
A sale journal cannot be created without a default income account

opw:2431278

closes odoo/odoo#64854

X-original-commit: c0af2df89dbe8f0cea384f15b2a7e3d53a16dfc6
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-01-21 12:05:14 +00:00
Nicolas (vin) 60f736656c [IMP] account: remove _inherits in account_tour_upload_bill
account_tour_upload_bill is using an inherits only to use a single m2m
field. This will remove the inherits and simply add the field directly
into the account_tour_upload_bill model.

task id #2339702

closes odoo/odoo#59169

Related: odoo/upgrade#1899
Signed-off-by: William André (wan) <wan@odoo.com>
2021-01-21 12:58:10 +00:00
Andrea Grazioso (agr-odoo) e08e4826d7 [FIX] account: allow to skip account constraint
To fully allow f4e67d8ae174d7e2ee75a1de1083b31a6ff2af8b
we need also to disable to check on account when
the constraint field has been used to set the account on
the journal

opw-2394959

closes odoo/odoo#64792

X-original-commit: 655597e9a3637abbaeffddcc78663e8733070db4
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-20 12:14:56 +00:00
Wolfgang Taferner 03f14189cb [FIX] account/purchase: onchange on purchase create bill does not work
closes odoo/odoo#64777

X-original-commit: 0f36bbd257ba5e8e03462f675d81fdbdece1893a
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-20 08:42:21 +00:00
Laurent Smet 01b27664dd [FIX] account: Fix automatic entry wizard with change_account
'percentage' is computed by default whatever the wizard action (change_period/change_account) but there is a constraint raised when the percentage is != 100 in change_account.

closes odoo/odoo#64743

X-original-commit: 20d6efa817a4d839777c81d403bb8770807e784a
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-19 11:18:34 +00:00
Nasreddin (bon) b86207a418 [FIX] account: Set memo to ref if not payment_reference
Issue

	- Install "Accounting" module
	- Create a new bill :
	- Set vendor
	- Set no payment reference
	- Set a bill reference
	- Add products to bill
	- Confirm and click on Register Payment

	Memo field has no value.

Cause

	The memo field is based on lines name.
	Lines name is computed in `_onchange_payment_reference`
	and depends only on payment_referecence.

Solution

	If no `payment_reference`, fallback on `ref` to set line name.

opw-2440389

closes odoo/odoo#64692

X-original-commit: 31bc04afc3ed4ea74cd20f71ea10943b1026629c
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-01-18 13:29:17 +00:00
Ivan Yelizariev 090b7f1153 [FIX] account: make group_id readonly
WHY: it's computed field that is not supposed to be editable. In previous task
it was asked to make it visible, not editable.

closes odoo/odoo#64676

X-original-commit: f7788fdf03bcf81710f5b01fbf67a90aa30e1e58
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-01-18 11:54:44 +00:00
oco-odoo 88b5491c2f [FIX] account: fix typo
closes odoo/odoo#64675

X-original-commit: 00d69cdaf755271d954c3102dfd49ddcdaae112b
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-18 11:53:13 +00:00
Laurent Smet 5af64d1758 [FIX] account: Fix statement line rounding issue multi-currency
When reconciling a statement line with multiple lines in a multi-currency environment, it could lead to a rounding issue due to the currency rates. It could lead to an auto-generated open-balance of 0.01 amount to auto-balance the journal entry but the result is wrong since the partner has an open amount left on the receivable/payable account.

closes odoo/odoo#64636

X-original-commit: 4d4e6e588d14742f153a1c6b67d510e0c21e5d64
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-01-15 17:21:20 +00:00
Andrea Grazioso (agr-odoo) 543ccf2efd [FIX] account: compute composition mode before changing template
From Invoice list view select 2+ invoices (A, B), click Action>send and print
In each invoice 2 invoices will be sent:
- In A, you'll find A and A
- In B, you'll find A and B

This occur because the composition_mode of the composer is computed
after the attachment has been generated.
When the composer has an attachment, it is included into
the sent mail along the relevant one, generated on the fly for each record.

opw-2428544

closes odoo/odoo#64445

X-original-commit: 9b585963a4b4f53b856b219004322232c2acf318
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-01-12 17:34:12 +00:00
Florian Gilbert 4c51bd91bb [FIX] account: Support the context key "tracking_disable" for the tracking system of account.move.line
The tracking system causes some performances issues, this fix will allow to bypass the tracking for
heavy tasks.

closes odoo/odoo#64639

X-original-commit: e59aef66fb97da37b2fdcf282c7bd43c9beeedb9
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Florian Gilbert <FlorianGilbert@users.noreply.github.com>
2021-01-15 17:24:37 +00:00
oco-odoo e09fd75efd [FIX] account: correct tag inversion for lines of invoices with tags, but no tax
This use case can happen in case an invoice is imported without recreating all the taxes, only keeping the VAT information.

closes odoo/odoo#64638

X-original-commit: 7ad61842c703ceb031b2f917ad8bbc26d7d0b780
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-01-15 17:24:04 +00:00
Laurent Smet 68aa40de06 [IMP] account: introduce a new field on move lines to avoid inverting tax tags
The sign of tax tags sometimes could get inverted explicitly. It typically happened for misc operations, so :
    - manual entries
    - CABA entries
    - writeoffs created from the reconciliation widget

We had to do things this way in stable to fix those use cases, but it's not ideal, as the tags shown to the user were inverted, so it was a bit confusing, as one would have expected to see the exact same tags as on tax configuration.

We fix that by using a boolean field on account.move.line telling whether or not the sign must be inverted. This allows keeping the same tags as in the tax config, and simplifies the computation of the tax report's multiplicator, making the overall model more intuitive for both user and developper.

Task 2363287

closes #62536

closes odoo/odoo#64627

Related: odoo/enterprise#15031
Related: odoo/upgrade#1983
X-original-commit: 4e8581b6846ef8ee4601c994b0d586734a4fe117
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-15 15:40:16 +00:00
jbw 044250c08b [FIX] account: fix available payment methods for payments batch
Previously, in batch payments wizard, available payment methods where
always set to wizard.journal_id.outbound_payment_method_ids when
the batch length was > 1.
Event when the payment type was inbound and not outbound.

closes odoo/odoo#64624

Task: 2439250
X-original-commit: 603dbbe7a784c23b87682655963e82a42137d84c
Related: odoo/enterprise#15791
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-15 15:12:34 +00:00
jbw 9408e0d9db [IMP] account: Improve the validation process thanks to the "to check" boolean
- keep track of to_check changes in chatter
- add "set as checked" button
- make the "to_check" field optional in list view
- vendor bill / customer invoice : remove "entry" from "cancel entry" button.

Task: 2389849
2021-01-15 14:45:59 +00:00
Laurent Smet 3a756494fc [FIX] account: Hide 'Cut-off' button on invoice if not posted entry
If the journal entry is not posted, the 'Cut-off' button must not be visible on invoice lines.

closes odoo/odoo#64595

X-original-commit: 28b748a559e1ffb5fb7c3631bf77adba121b2ebf
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-15 10:05:30 +00:00
oco-odoo 32f28ff948 [REV] account: don't try to support tax exigibility modification on a tax if a draft entry is using it
This reverts commit 9d4b22fbf6469ada08c28bc2afcd5b5492eac52a.

We don't want to support this use case, as this kind of configuration change in the middle of creating an invoice is a very narrow corner case that can be avoided easily. Supporting it for tax exigibility would mean we also need to support it for repartition lines, amounts, affect base, ... This would be a lot of overhead for nothing.

closes odoo/odoo#64580

X-original-commit: ec414a5bb785375d13ea324f345c1eaf5747ddfa
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-14 18:25:08 +00:00
Nicolas (vin) 85f2c8b58a [IMP] account: Set accounting date to today when posting before lock date
When posting an account move before the tax lock date, Odoo will
automatically set its accounting date to the lock date + 1.

This can cause the chronology to be broken, which is not something we
want when automatically setting the date.

This will change that behavior to set the accounting date to today in
such case.

Task id #2411150

closes odoo/odoo#62787

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-01-14 14:22:37 +00:00
Paul Morelle 97c0a110e8 [FIX] account: fix regexp when partner name contains +
When the name of a partner contains a regular expression operator, such
as grouping parenthesis, +, *, brackets... the resulting regexp may
match wrong names or worse be invalid and lead to an exception.

With this commit, we create a regular expression from only the words
formed from at least 3 of [a-zA-Z0-9], ignoring all other characters,
including those who may have a meaning in a regular expression.

This avoids these issues:
- regexp injection (security issue)
- punctuation resulting in erroneous regular expression ("ABC + SPRL"
  resulted in "(?=.*ABC.*)(?=.*+.*)(?=.*SPRL.*)" which is invalid at
  the ".*+" part)
- false positives due to words that are too small (\b were added, and
  the minimal matching word size is 3)
- accentuation mismatch (both sides are filtered through unaccent)
- special cases in unicode that have a special behavior with lower().

See the discussion on odoo/odoo#63145 for a detailled explaination about
these issues.

OPW-2360687

closes odoo/odoo#64510

X-original-commit: 3c5296863f0030acc5d3dba0ff73a6f1b42d1255
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2021-01-13 18:42:10 +00:00
Adrien Widart fc986dc22d [FIX] account,sale: let a user print his invoices
If a user has no access to Invoicing module, he can not send and print his invoices.

To reproduce the error:
(Need sale_management,account)
1. Connect with admin account
2. Settings > Users & Companies
3. Create/Edit a salesman
	- Remove access rights to Invoicing module
4. Connect with this user
5. Create & Confirm a SO
6. Edit the SO and fill in the "Delivered" field, Save
7. Click on "Create Invoice", "Create Invoice"
7. Connect with admin account
8. Invoicing > Go to the previously created invoice
9. Confirm it
10. Connect with the user account
11. Sales > previously created SO > "1 Invoices"

=> The user can read the invoice, but he can not send and print it. This is an error.

OPW-2389428

closes odoo/odoo#64508

X-original-commit: f64f7ca309f9228e58b1487a286f2302ff8f035e
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-01-13 17:55:25 +00:00
oco-odoo b6616b0945 [FIX] account: reconciliation models: allow disabling bypass of matching amount check for more advanced cases
Reconciliation models can now create partial payment on invoices. Because of that, the default behavior is not anymore to fully pay the invoice and create an open balance write off.

In some cases, though, this is what we want (exchange difference, ...). The solution for that is to create a reconciliation model with write off lines (telling it it must only apply if there is a 90% percent match on the amount, for example), and then create another one not checking the amount to just match the things to reconcile partially by using the partner.

However, as it is now, reconciliation models always bypass the check made on the amount in case the statement line's label matches the invoice's payment reference exactly. This can lead to cases where we are matching elements we shouldn't with the rule doing the write off.

Example:

- use only two 'invoice matching' reconciliation models, in the following application sequence:
	- model 1, matching partner if with amount matching percentage is 90%, and doing a write-off for the unmatched amount
	- model 2, matching partner with no amount matching percentage, and no write off

- create an invoice with payment refrence INV1 for partner A, amount: 100

- create an invoice with payment refernce INV2 for partner A, amount: 200

- create a statement with two lines:
	- line 1, with 99 for partner A, label= INV1.
	- line 2, with 1 for partner A, label= INV2.

- Open the reconciliation widget

==> Before the fix:
model 1 is applied on both statement lines, as their label match payment references. This is what we want for line 1, but probably not for line 2, which will create a write off of 199, while we'd have wished for a partial payment, leaving the invoice with 199 open.

==> After the fix
The behavior is the same unless the config_parameter is set. If it is:
	- line 1 will be matched by model 1 (as 99 - 9,9 < 100 < 99 + 9,9). INV1 will be paid with a write off of 1.
	- line 2 will not be matched by model 1 (as 200 is not between 1 - 0,1 and 1 + 0,1), but it will be by model 2 (since line 2 and INV 2 share the same partner). So, INV2 will be partially reconciled with line 2.

OPW 2419030

closes odoo/odoo#64504

X-original-commit: ed023e208736e58d14649aa2fd91fb00510f20c1
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-13 16:19:49 +00:00
Laurent Smet ba0890ebb3 [FIX] account: Fix empty 'account_type' in automatic entry wizard
Since 'move_line_ids' isn't inside the view, `account_type` is never computed and then, the accrual account is never displayed/editable on the view.

closes odoo/odoo#64495

X-original-commit: cefbd5f3adebe1c620c070f7767d368e65242d37
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-13 15:26:47 +00:00
Martin Trigaux ade40f9028 [I18n] *: export saas-14.1 source terms
closes odoo/odoo#64393

X-original-commit: eaf7ec38b2f13b044768ccb457c5523cd24753f6
Related: odoo/enterprise#15693
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-12 10:38:54 +00:00
Adrien Widart fa2837b924 [FIX] account: sending several invoices at one
When sending several invoices, customers also receive those that do not
concern them.

To reproduce the error:
(Need mailcatcher)
1. Go to Invoicing
2. Select two invoices
    - Status must be "Posted"
    - Customers must be different
3. Action > Send & Print
4. Uncheck "Print", then click on "Send"
5. Repeat 2-4

Err: Each customer receives both invoices. (In some cases, a third mail
is event sent). Each customer must receive his own invoices.

The mail composer wasn't correctly configured.

OPW-2422117

closes odoo/odoo#64340

X-original-commit: 603752df5444f60ac7282758c7e6596940747889
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-01-11 14:04:28 +00:00
wan d9ab32fef8 [FIX] account: dashboard view cash statements
Fine tuning of 78286851034b8f3ef4dcab78e50b7220c0bdd213

The link to view Cash Statements on the dashboard openned the wrong
action.
Also in some cases, removing the context key `search_default_journal`
was not enough so we set it to `False` instead.

closes #64118

closes odoo/odoo#64279

X-original-commit: 95ffa9fd122eae82d12d40db3cb7364cf3d3c919
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2021-01-08 16:42:38 +00:00
Goffin Simon 1febb882ac [FIX] account: Bank account not selectable
Steps to reproduce the bug:

An account with the type "Credit Card" can not be chosen for the
creation
of a journal with the type "Bank" as the domain for bank account filter
only for accounts with the type "Bank and Cash"

As the filter on the `user_type_id` is too restrictive we remove it in
case the journal is bank or cash

Bug:

Impossible to select the correct account.

opw-2394959

closes odoo/odoo#64288

X-original-commit: f4e67d8ae174d7e2ee75a1de1083b31a6ff2af8b
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-01-08 17:33:09 +00:00
oco-odoo 237574c48c [FIX] account: reconcile models: create write-offs properly when matching a statement line with no partner
Before that, write-offs were simply never created in this case ; only an open balance. This was (obviously) wrong.

Also, the partner set on the statement line was not modified, and kept empty. We fix that so that, when a statement line without is reconciled with lines sharing the same partner, this partner is also assigned to the statement line.

Task 2423231

closes odoo/odoo#64253

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-01-08 11:10:01 +00:00
oco-odoo d9c5c3e095 [FIX] account: reconciliation models: make auto_reconcile rules work properly with write-offs
- Create an invoice for 100
- Create a bank statement for 95
- Setup your reconciliation model so that it will match them and create a write-off for the remaining 5. Make it auto_reconciled.

=> Doing that, we expect the bank journal move to be created like this:

- 100 on payable/receivable, reconciled with the invoice
- 95 on the bank account
- 5 on the write-off account

This wasn't the case. Instead, Odoo created the following (correct from an accounting point of view, but weird):

- 95 on payable/receivable, reconciled with the invoice
- 5 on payable/receivable, not reconciled
- 95 on the bank account
- 5 on the write-off account

=> So an open balance of 5 was actually created. This was weird, and also caused an additional bug, as only the first payable/receivable line was reconciled with the invoice, making it only partially paid.

This commit restores the expected behavior.
2021-01-08 11:09:48 +00:00
Andrea Grazioso (agr-odoo) afed9f0d80 [FIX] account: label for internal transfer
Create two differnt journals for two different bank accounts (A, B).
Create an Internal Transfer in bank A to send money, then reconcile.
Create an Internal Transfer in bank B to receive money, then try to
reconcile

Internal transfers are labeled 'Customer Reimbursement' and 'Customer
Payment' even if no external partner is involved in the process,

opw-2423161

closes odoo/odoo#64258

X-original-commit: 4fcacfac8967a3facbe751f748faff02033ce0ae
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-08 12:17:06 +00:00
Laurent Smet 221e6da548 [FIX] account: Allow sharing outstanding accounts on bank journals
In the bank reconciliation widget, allow matching a payment (blue lines) owned by another bank journal as the statement line one if both journal are sharing the same outstanding account.
It implies to remove the constraint preventing such accounts sharing.

The purpose is the following.
Suppose you are working with payment acquirers generating payments on a bank journal A.
At the end of the month, the bank journal B is debited to pay the payment acquirer.
At this point, you get a statement line on journal B you need to match with payments generated on A.

closes odoo/odoo#64115

X-original-commit: 8d34e1606f930deaa148563ffd40c69457650305
Related: odoo/enterprise#15577
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-01-05 18:38:05 +00:00
Adrien Dieudonne 81180146b7 [IMP] account: add kanban view for journal items in invoice on mobile
The list view wasn't suitable for mobile devices. It's why we added
a kanban view for the followings menus:

- Accounting/Invoicing > Customers > Invoices > Journal Items
- Accounting/Invoicing > Vendors > Bills > Journal Items
- (in debug mode) Accounting > Accounting > Journal Items
- Accounting > Journals > Sales
- Accounting > Journals > Purchases
- Accounting > Journals > Bank & Cash
- Accounting > Journals > Miscellaneous

closes odoo/odoo#64138

Task-id: 2157725
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-01-07 10:08:30 +00:00
Laurent Smet dc3df030f8 [FIX] account: Fix 'change_account' automatic entry wizard
Percentage is not used when change_account is selected. Then, the constraint must not be triggered in that case.

closes odoo/odoo#64112

X-original-commit: a23a47457d98aba4ec643f4422f3735d98fab2b4
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-01-05 18:18:25 +00:00
mir-odoo fc348de003 [IMP] various: Do not allow create/open on country_id
Purpose of the task, is to prevent users from inadvertently
creation/opening countries from country_id fields.
Countries should be managed from their dedicated menu item.

so in this commit, we have set both no_open and no_create to True
so user should not update and create a country from the many2X fields.

closes odoo/odoo#63773

Taskid: 2241677
Related: odoo/enterprise#15464
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-24 12:51:04 +00:00
Jorge Pinna Puissantandwilliam-andre 27a2701ff0 [FIX] account: new journal name sequence on old journal
- Create a new sales journal;
- Start creating a new invoice using the new journal (the name/sequence
    will be editable) and before saving, change the journal to the
    old one;

Before this commit, the invoice will be on the old journal and will have
the new journal name/sequence and after validate the invoice all the new
invoices on the old journal will have the new journal name/sequence.

Now, when you change to the old journal the name of the invoice came
back to 'Draft'.

opw-2415975

closes odoo/odoo#64146

X-original-commit: 3b64640076af472b64a72c7061696772d0e118de
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Co-authored-by: william-andre <wan@odoo.com>
2021-01-06 11:39:15 +00:00
Raphael Collet 664ac15b59 [FIX] account: flushing while recomputing fields is not a good idea
The Python constraint method `_check_unique_sequence_number` performs an
SQL query, and therefore needs to `flush()` the some fields before doing
so.  However, it uses a generic call to `flush()`.  In some situations,
the call to `flush()` ends up into recursive flushing, and that's the
beginning of a nightmare:
 - write on account.move.state,
 - which calls account.move._check_unique_sequence_number(),
 - which calls flush(),
 - which computes purchase.order.line.qty_invoiced,
 - which reads field purchase.order.line.invoice_lines,
 - which calls flush() for account.move.line.move_name,
 - which computes account.move.line.move_name,
 - which computes account.move.name,
 - which calls account.move._check_unique_sequence_number(),
 - which calls flush(),
 - which computes purchase.order.invoice_status,
 - which uses the not-yet-computed value of purchase.order.line.qty_invoiced,
   and computes an incorrect value.

We fix it simply by making the call to `flush()` more specific: we only
need to flush 4 fields.  This avoids the nightmare above.

X-original-commit: cf5f50a733ddfd87985a39ffe7daffc48cfb582f
2021-01-04 09:16:20 +00:00
Adrien Dieudonne 89beb798ff [REF] *: o_button_import doesn't exist anymore
closes odoo/odoo#42082

Related: odoo/enterprise#15492
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-12-29 13:41:25 +00:00
shreya thakrar 3b63b3a4d7 [IMP] account: add kanban view for the 'Generated Documents'
This commits adds kanban view for the 'Generated Documents' for better
readability on mobile devices. Also, for consistency, this commit
adds 'Upload' button on the invoice kanban view as well.

Task-ID: 2152183
2020-12-29 13:39:37 +00:00