Commit Graph
1594 Commits
Author SHA1 Message Date
jbw 5ab17ff395 [FIX] account,purchase,sale: fix typo and test for accrued orders
- Fix typo in accrued_orders.py
- Remove fields.Date.today() from purchase test
- Make more use of common resources

closes odoo/odoo#79159

X-original-commit: 31570e185dcb36145e28e42cda765284dc373294
Signed-off-by: Laurent Smet <las@openerp.com>
2021-10-29 08:43:31 +00:00
Akim Juillerat 18e805d0e6 [FIX] account: usage of self in loop of payment register compute
closes odoo/odoo#77699

X-original-commit: 7936736f208cd7483ae8b9a508cf7387cd504b83
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-10-04 14:12:19 +00:00
Nicolas (vin) eab2a5ce54 [IMP] account: hide journals without payment method line
When registering/creating payments, filter out from the selection
the journals that do not have any relevant payment method lines.

Also, always show payment method lines even when there are only
one of them.

closes odoo/odoo#74741

Related: odoo/upgrade#2861
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-09-30 18:27:49 +00:00
Nathan Marotte (nama) 4e59a600ce [FIX] account : resequencing showed a ghost state change draft -> posted
Issue: When resequencing an account_move, the chatter showed the
resequencing but also a ghost change of state from draft to posted

Steps to reproduce :
 1) Create an invoice and post it
 2) Look up the journal entry for the invoice and resequence it to some
 arbitrary other name
 3) Check the chatter for that invoice, it shows a change from draft to
 posted

Why is that a bug:
 The state isn't changed so it shouldn't be logged

Side-Note: I don't understand why in the code until this commit we had
to force change the state to draft to change the name of the move, when
I tested, we can change the name of a posted move without any issue

opw-2581248

closes odoo/odoo#76394

X-original-commit: e4f5c0d13fb5b04c4a334758c26e442efbb247d4
Signed-off-by: William André (wan) <wan@odoo.com>
2021-09-13 14:42:51 +00:00
qdp-odoo 97026f803d [IMP] account: accrued SO/PO tracability imp
* order lines are now not grouped anymore by account. That allows a more detailed label on the accrual entry line, as it's now directly related to a single order line
* we now create a single accrual entry counterpart, instead of one per order previously. That reduces the 'noise' in the accrual entry, at the cost of not having the sum per ordre anymore easilly but it doesn't seem to be important to audit that account

closes odoo/odoo#76037

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-09-09 13:17:28 +00:00
qdp-odoo 7b60ffaec4 [FIX] account: accrued SO/PO process
* the cache_invalidate() was invalidating the changes made in the wizard as well, make it impossible to set any value other than the default one, even though the preview entry was updated accordingly. That also prevented to simply validate the wizard as the accrual account was required but reset anytime we changed its value.
* the preview_data field was incorrectly set as Binary while the widget only supports Text

Part-of: odoo/odoo#76037
2021-09-09 13:17:27 +00:00
jbw 299ef94bcb [IMP] account: 'Import First Bill' Modal Improvement
Improve the wizard 'import your first bill':  usability + look & feel
    - Removed the PDF viewer interface which was ugly + useless in this context
    - Display an HTML preview instead which is dynamic
        - Current date
        - Company address depending on the Company
        - bill sequence depending on the date

In the modal of upload, detect if there is no hosting domain @false > then remove this third option

PR #75815

Task: 2581377
Related: odoo/upgrade#2806
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-09-06 12:03:10 +00:00
qdp-odoo 2dcbe92d78 [IMP] sale_stock, sale_timesheet, purchase_stock: accrual wizard now propose an amount taking care of the accrual date
This allows to solve the following use case:
* we are in March
* a SO created during January shows currently a delivered quantity (timesheet on service or delivered goods on storable products): timesheets/pickings were done in February
* creating the accrued entry for January 31 should display accordingly an amount of 0 by default since everything was done in February
Invoices invoice_dates are also taken into account:
* day 0 : delivered 10
* day 2 : 5 invoiced
* accrued entries for 10 if accrual date = day 1, accrued entries for 5 if accrual date = day 3,

followup of task 2255642

closes odoo/odoo#75886

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-09-02 15:36:50 +00:00
wan beb6f75d57 [IMP] account: resequence only in debug mode
* Move the action to "technical feature" debug mode group instead of
group "advisor"
* Set the action in noupdate="1" to facilitate customization of right

task-2604155

closes odoo/odoo#75819

Related: odoo/upgrade#2794
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-09-02 14:15:25 +00:00
jbw 064edb2223 [IMP] account, sale, purchase: accrued entries from purchase & sales orders.
Accrued liabilities, or accrued expenses, occur when you incur an expense that you haven’t been billed for (aka a debt).
For example, you receive a good now and pay for it later (e.g., when you receive the invoice). The same opposite approach for sales.

Why do accountants need such entries ?
- Accounting must give a fair view of the financial situation of a company. The loss/profit must be booked regarding the effective deliveries of goods/services, not on the paperwork only.
- On a fiscal point of view, if you want to be allowed to deduct a loss from your taxable basis, it has to be in the right period. If you didn't announce it on time, the loss might be rejected by fiscal authorities. Same goes for the augmentation of the taxable basis, it has to reflect real deliveries and not only paperwork.

was Task: 2555642
was PR #73707

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-08-26 11:34:14 +00:00
Thibault Delavallée e9af609616 [IMP] mail, various: reorganize and lint composer action name
In this commit some reorganization is performed within mail compose message
code. Purpose is to reorder a bit methods by main usage: onchange, CRUD,
actions, values generation with rendering and template management.

Some renaming is performed on action methods, notably send_mail that has some
impact on sub-addons. Finally we also set onchange and sub-onchange methods
private.

No functional change should be implied by this commit.

LINKS

Task ID-2377974
Community PR odoo/odoo#61467
Enterprise PR odoo/enterprise#14633
2021-08-18 13:35:07 +00:00
Nathan Marotte (nama) 2a0ae1114c [FIX] purchase : Missing access right for User in Purchase group
Issue: When closing a PoS session, the user can Cash In/Out of the
register but it requires Accounting/Billing group or Purchase/User
group. However with Purchase/User group, there was an access right
error (not allowed to create account.move.line

Steps to reproduce :
 1) Install PoS Module
 2) PoS > Your Shop > Settings and enable Advanced Cash Control
 3) As administrator and in debug mode go to
  Settings > Users & Companies > Users
 4) Remove Accounting, Inventory and Purchase group of [User A]
 5) Log in with [User A], open a PoS Session, close it, and in Cash
 Control form, click Cash In/Out
 6) Remove or add money
 -> Access right error, you need to be Accounting/Billing or
 Purchase/User
 7) As administrator, add the User group to Purchase for [User A]
 8) As [User A], click Cash In/Out, removed or add money
 -> Still access right error

Why is that a bug:
 The first warning asks us to give the Purchase/User group to the user
 if we want to Cash In/Out but even when doing that, the access rights
 are still not enough to allow the creation of the entry

opw-2611298

closes odoo/odoo#75156

X-original-commit: a28c9c1dd773f26151d6734d476e7f8d5a3d971b
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Nathan Marotte <nmarotte@users.noreply.github.com>
2021-08-16 13:13:24 +00:00
jbw 67a5f581c0 [FIX] account: journal_id value change in account payment register wizzard
In payment register wizard, when registering payments on invoices, the journal_id
selected in the view would sometimes be replaced by another on save because journal_id
was recalculated in _get_line_batch_key().
All journal_id default value logic moved in _compute_journal_id()
This is a major redesign of commit: https://github.com/odoo/odoo/commit/a3c3cd68329935896e4ebb1e853824de2009e16b related to task : 2524441

closes odoo/odoo#74942

X-original-commit: 69429365c2c490f8f15cd02ee4d1cbee9caa7524
Signed-off-by: William André (wan) <wan@odoo.com>
2021-08-11 06:45:25 +00:00
william-andre 21e30ca209 [FIX] account: automatic entry rights for non db admins
The non readonly computed field with inverse on the company was raising
an access error for users that have accounting rights but not admin
rights to write on the company.

opw-2446242

closes odoo/odoo#74643

X-original-commit: 0b2fa7b0e5d826b1ba08cd7723a3f40b792e82ba
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-08-03 14:20:42 +00:00
Laurent Smet 17b42902ae [IMP] account: Remove 'Take money in/out' button
closes odoo/odoo#73708

Task: 2596069
Signed-off-by: William André (wan) <wan@odoo.com>
2021-07-14 12:13:13 +00:00
jbw cef3f87321 [IMP] account: Allow batching vendor bills and refunds for same partner
Improve usability of payments. Allow selecting multiple Vendor Bills AND Refunds
and pay them all together in one single payment.

E.g. When running server action “Register Payment” for :
 - one 100€ Vendor Bill
 - one 50€ Vendor Bill
- one 80€ Refund
Previous result = one 150€ outgoing payment + one 80€ incoming payment
New result = one 70€ outgoing payment

closes odoo/odoo#69578

Task: 2475598
Related: odoo/enterprise#19902
Signed-off-by: William André (wan) <wan@odoo.com>
2021-07-27 09:06:18 +00:00
dasa-odoo 90d23eb3e2 [IMP] account: only generate email and pdf once on send&print invoice
action_invoice_sent() triggers two onchanges which normally don't happen at the same time. Added a check to one of them (onchange_is_email()), so that on action_invoice_sent(), only one of them calls the computationally expensive onchange_template_id_wrapper(), effectively halving the time taken.

Time for executing the action for one invoice dropped from over 3 seconds to a bit over 1.

closes odoo/odoo#74160

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-07-23 11:22:19 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
Nicolas (vin) 9e432ed243 [FIX] account, payment: Various fixes for account payments/method lines
There is an issue when computing the suitable payment token ids making it impossible to
open a payment for a user without access to payment acquirers.

Also, the default computation of payment token was wrong and would never set it
correctly.

The compute for the method lines in payment would not filter unavailable acquirers
line and thus select them by default if they were first in line.

Also fix an issue with the ordering of payment method lines

X-original-commit: 73410a0fd76a70e1730883d35b79fc603741b59c
2021-07-19 15:17:32 +00:00
Anh Thao Pham (pta) 23ebf96cb6 [FIX] account: fix account resequence for "other" lines
Linked to commit https://github.com/odoo/odoo/commit/3e6b7dfd4854069724dde2df43ab2eb7d850e9b5

Resequence wizard will not show if "other" lines are generated to reduce the set
to display in preview, because those lines don't have "id" to be used as t-key in
the resequence template.

opw-2590273
opw-2581306

closes odoo/odoo#73811

X-original-commit: 70baff1aac1ab39c4e27f8078d404e8fdfa325db
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-07-15 23:58:36 +00:00
Nicolas (vin) 3a98bf80ec [FIX] account: payment method dependencies
Change dependencies of a few computed fields in order
to avoid triggering them wrongly when migrating.

Also add a company check on the constrains blocking
deletion of payment method lines linked to an active
acquirer.

closes odoo/odoo#73731

X-original-commit: e94b4f09a4c5664360594bee6475cb2ef756be47
Related: odoo/enterprise#19663
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-07-14 15:22:31 +00:00
Anh Thao Pham (pta) 892087c71b [FIX] account: fix invoices/bills resequence with same name
- Create 2 invoices (or 2 bills) but let them in draft
- In invoices list view, select all invoices
- Execute Action > Resequence
Resequence wizard will not show.

It comes from a template in resequence renderer using account move name as t-key
that silently crashes because both draft invoices have the same name ("/").

opw-2590273

closes odoo/odoo#73724

X-original-commit: 3e6b7dfd4854069724dde2df43ab2eb7d850e9b5
Signed-off-by: William André (wan) <wan@odoo.com>
2021-07-14 13:43:20 +00:00
jbw 6adaec714a [IMP] account: Reversal on same journal type as original AccountMove
For data quality purposes and bug prevention, when I reverse an entry,
the reversal should always be postable on a journal having the same type
as the initial Journal Entry's journal.

closes odoo/odoo#72431

Task: 2497529
Related: odoo/enterprise#19543
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-07-13 10:00:38 +00:00
Nicolas (vin) c1693581d7 [IMP] account: payment method improvements
To improve the payment method system, proceed to a few changes
such as changing the view a bit, making sure payment acquirers are not
linked to a journal by default and that only the manual payment method
type can be used multiple times in a single journal.

Task id #2573145

closes odoo/odoo#73596

X-original-commit: 9122b367baea10e59b66e45bf7c458a6f1e82efb
Related: odoo/enterprise#19623
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-12 18:10:36 +00:00
Nicolas Lempereur 725a30c2f9 [FIX] account: remove duplicate _compute_payment_method_id
seen when working on opw-2508263c

forward-port of #72654

closes odoo/odoo#72895

X-original-commit: 38906fb5a9c65335f15fd3d09399988616fbe18f
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-06-28 17:01:52 +00:00
John (jol) 43b41ad948 [IMP] account: use config bar for real config steps
The purpose is to use config bar for real config steps rather than highlighting tour steps.
Mainly by:
- Removing "First Bill" step from the configuration bar and replacing it by "Company Data".
- Adding "Taxes Review" step in the configuration bar as the last step (after CoA). This step opens the Taxes list view.
- Adapting the Tour according to these changes.

closes odoo/odoo#70115

Related: odoo/enterprise#18125
Related: odoo/upgrade#2449
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-28 08:07:52 +00:00
Ivan Yelizariev 52e06bc615 [REM] account: remove unexisted attribute "reason"
There is no reason to have attribute reason.

Also, fix domain notation.

What the hell is going on this line of code???

closes odoo/odoo#72400

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-06-21 08:13:09 +00:00
alt-odoo 1d6076a668 [FIX] account: use default bank account in batch payments
In case we register one payment on a single accounting entry, we can manually
specify the bank account that will be used. In case we register one global payment
for several entries, the bank account is not visible in the payment register wizard.
We should use the first bank account set on the partner as a default case to allow
it and not block the whole process.

closes odoo/odoo#72080

X-original-commit: 23560f70592fa3ae481d0ba7617cfeae243b7594
Related: odoo/enterprise#18968
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2021-06-11 16:15:19 +00:00
Nicolas (vin) 04522f01e6 [IMP] account: allows multiple payment acquirers on a journal.
Users may want to be able to have transactions coming from multiple
payment acquirers to be registered in the same journal.

This will allows that.

Task id #2414749

closes odoo/odoo#67331

Related: odoo/upgrade#2500
Related: odoo/enterprise#17258
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-03 10:00:26 +00:00
jbw a3c3cd6832 [IMP] account: Right payment journal based on bank account on invoice
On an invoice, we have the possiblity to set the bank account where
the client's payment has to be done.
If our company has two payment journal with 2 differents bank accounts
(bank A & bank B) set on each of the journal (journal A & journal B),
if I create an invoice and set bank B as bank account, after clicking
on "Register Payment", the journal A will be automatically selected.

With this PR the payment journal linked to the bank account set on the
invoice is automatically selected

closes odoo/odoo#71191

Task: 2524441
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-05-28 07:51:01 +00:00
yograj tandel e893651cec [IMP] *: remove widget='selection' from many2one fields
Currently, across Odoo, there are around 40+ many2one fields defined with a
'selection' widget. Since the many2one widget has options to limit record
creation and opening, there is no reason to define a many2one field with a
selection widget. The selection widget does not allow for searching, and is
limited to 100 records.

PURPOSE
to update the definition of any many2one on which we applied a 'selection'
 widget, and instead use the standard many2one widget with disabled
opening/creation instead.

after this commit,
for each many2one field defined with widget="selection",  widget="selection" is
replaced with options="{'no_open': True, 'no_create': True}"

Task : 2476488

closes odoo/odoo#68387

Related: odoo/enterprise#17316
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-20 11:01:28 +00:00
wan 33bba28e87 [FIX] account: resequence journal entry in purchase journal
The resequence wizard should consider that the sequence is shared for
invoices, journal entries and receipts; only refunds have a separate
sequence.
You could have journal entries in the purchase journal for expense
reports for instance. In that case, we want to be able to resequence all
of it at once.

closes odoo/odoo#68871

X-original-commit: 365da2a0aca1503133433f9dc66b6866e7867974
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-04-07 09:22:26 +00:00
oco-odoo 17610e8ca9 [IMP] account, account_edi, l10n_*, purchase, sale: Generalize the use of account_fiscal_country_id
Before, account_fiscal_country_id was only use for tax operations; and country_id was used for all the other accounting stuff. Now, with the new ability to use foreign tax reports (with foreign VAT fiscal positions), we can generalize the fiscal country, sot that it is the one that needs to be used for the whole accounting. Since foreign tax reports were not supported before, account_fiscal_country_id is already set on existing database as the country for the "main" accounting, so the impact of this change is small.

closes odoo/odoo#68349

Related: odoo/upgrade#2322
Related: odoo/enterprise#17299
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-04-01 12:09:20 +00:00
Djamel (otd) d569a71250 [FIX] accounting: fix the creation of the first sample vendor bill during the tour
Steps to follow to reproduce the bug:
-In V14
-Go to accounting
-In the tour, click on Create First Bill
-Choose ‘Try a sample vendor bill’ and click on continue
-an error is triggered

Problem:
The returned  value of ”create_invoice_from_attachment” method is treated as an “account.move” recordset, but it is a dict used for ‘ir.actions.act_window'

Solution:
We retrieve the ‘account.move’ from the ‘res_id’ found in the dict.

The issue was introduced by this commit : https://github.com/odoo/odoo/commit/8435d0e8990509ee67425977f970ab27bea8133a

opw-2469567

closes odoo/odoo#68595

X-original-commit: 2252cae941efcca36f981d50c546cacf70ff760d
Signed-off-by: William André (wan) <wan@odoo.com>
2021-03-31 11:54:16 +00:00
Laurent Smet fbe1cca0d6 [FIX] account: Set 'move_id.ref' as payment memo with vendor bill
The current behavior was to set the label as memo in the payment register wizard.
However, this is to restrictive when a vendor bill hasn't any payment reference but a bill reference.
In that case, the user is expecting to have the bill 'ref' in the payment 'memo'.

Since the matching rules in the reconciliation widget are matching line.name, then line.move_id.ref and then line.move_id.name, the same logic is applied here to construct the payment 'memo'.

closes odoo/odoo#68004

Opw: 2440389
X-original-commit: 92ceb86d58f4d78c8a4256f29d101d3730517b93
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-03-17 11:08:05 +00:00
Martin Trigaux 706ff8fbff [FIX] account: translate selections
X-original-commit: 4b6e933d5826830b24297355a9cea8a8615bc646
2021-03-01 10:31:31 +01:00
Martin Trigaux 52a7efbaf5 [FIX] account: translate wizard line message
X-original-commit: 2f3701d97568d965a7665bf7126032d3b7527ae4
2021-03-01 10:31:30 +01:00
Nicolas (vin) 7c9c9e391a [IMP] account: add mail template for send&print credit note
There is only a single mail template for invoices at the moment.
To make things easier to work with, this will add a new template for
credit notes.

Task id #2343331

closes odoo/odoo#58244

Signed-off-by: William André (wan) <wan@odoo.com>
2021-02-22 12:51:48 +00:00
Benjamin Frantzen (bfr) fbc77a6ecd [FIX] account_edi: a failed import of an attachment with account_edi now allows OCR to run automatically.
Before this commit, account_invoice_extract and account_edi where independent in parsing files uploaded or added as attachment in an invoice. Some tricks where used to avoid clash, but they were not perfect and some bugs appeared like the OCR not triggering automatically or an attachment being parsed twice by account_edi when parsing failed. The goal of this commit is to unify the import of files between the two features and ensure that they will not clash.

For more information about potential problems that appeared before :
See https://github.com/odoo/odoo/pull/61169
See https://github.com/odoo/enterprise/pull/15124/

closes odoo/odoo#65660

X-original-commit: 8435d0e8990509ee67425977f970ab27bea8133a
Related: odoo/enterprise#16172
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-02-05 17:56:12 +00:00
Anh Thao Pham (pta) c695b2a3d1 [FIX] account: fix unselectable Report Line in Tax Adjustments wizard
- Go to Accounting > Configuration > Tax Report
- Create a Tax Report (with Lines having Tag Name)
- Go to Accounting > Accounting > Tax Adjustments
In wizard, no Report Line can be selected for mandatory "Report Line" field.

Report lines are filtered on "report_id" field, which is a related field to the report line field.
Therefore there is no way to select a Report Line.

opw-2449295

closes odoo/odoo#65502

X-original-commit: 0311cffd89c375a6fc1babacaa19029776bfebfb
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-02-04 07:47:03 +00:00
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
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
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
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
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
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
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
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
Adrien Widart d4eeb23397 [FIX] account: list all credit note methods
When adding a credit note, the user can only select the "Partial
Refund" credit method.

To reproduce the error:
1. Go to Invoicing
2. Create a new one
	- Add at least one invoice line
3. Save, Confirm
4. Click on "Add Credit Note"

=> You can not change the credit method.

The method field is editable only when the residual amount is different
from 0. Here is the issue: when clicking on "Add Credit Note", it
actually triggers some `onchange` methods. The latter uses a new record
to compute the values:
https://github.com/odoo/odoo/blob/45422d56bce413b8577f1784e10dd22ede93c751/odoo/models.py#L6147-L6148
Then, some `_compute` methods are also triggered. Among them, the amount
residual computation of the associated `account_move_line`. However,
`_compute_amount_residual` will skip the not-yet-created objects and set
the amount residual to 0. This is the reason why the residual amount of
the account move is zero and therefore, the user can't change the credit
method.

OPW-2418582

closes odoo/odoo#63780

X-original-commit: 13e33fdd9722a7022d56538ab69dda0200b3aaa2
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2020-12-24 13:47:21 +00:00
oco-odoo 71ebdcbf3c [REV] account: remove the ability for the automatic entries wizard to generate multiple entries at once
This reverts commit 7e3e99adb4.

Usability of that new wizard was too poor. We revert it for now; it'll make a comeback eventually.

closes odoo/odoo#63436

X-original-commit: 1d75786b8b45fd4f6b08d726165b60875b62b1e7
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-12-16 11:29:57 +00:00