Commit Graph
16217 Commits
Author SHA1 Message Date
Thibault Delavallée 37db926fe8 [REF] various: remove usage and dependency on html2text library
We have our own html2plaintext, already used in lot of use cases instead of
just a few for the html2txt library.

Notably for emails: most emails going through Odoo stack use our simple
html2plaintext to format the body alternative. When no body alternative
is given to ``build_email`` an alternative is built using the library to
remove. Using our own parser allows to have the same results compared to
using ``MailMail.send()``. Difference lies in spaces and new lines as well
as markdown. Our html2plaintext is a bit simple and does not try to generate
Markdown but generates a simple plaintext version.

This also helps solving some issues with depending on that library.

Task-2702034

closes odoo/odoo#82486

X-original-commit: b3b9627b655cd7cb928925affed6cc8d92661e8d
Related: odoo/enterprise#23364
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-01-12 16:43:16 +00:00
Laurent Smet 10a3df3511 [FIX] account: 'ref' should be readonly on account.move.line
closes odoo/odoo#82508

X-original-commit: 38c13bbef39e3e82a77cfd4a316be94280e3cee5
Related: odoo/enterprise#23376
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2022-01-12 09:24:46 +00:00
roen-odoo ca6cd0362e [FIX] hr_expense: Expense not cancelled
Current behavior:
When cancelling an expense payment, the expense state was not modified and was still 'paid' when it should be 'refused'.

Steps to reproduce:
- Create an expense and post the expense and register a payment for the expense.
- Then go the vendor payments and cancel the associated vendor payment.
- The expense still shows as paid in the expenses page.

opw-2711383

closes odoo/odoo#82496

X-original-commit: 16459957d23f4bdfddfe96d72ef96cbdc6fec539
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-01-11 16:18:49 +00:00
Guillaume (guva) e666487446 [FIX] account: bank reconciliation: don't force partner when mixing payments with and without partner
Steps to reproduce :

- Create an invoice for a customer (ex $100)
- Create a payment for the invoice (ex $100)
- create a bank statement with a line item for $200
- In reconciliation, add either another journal entry or a manual operation without partner to reconcile the remaining $100

Issue:

All lines receive the partner from the invoice

opw-2691196

closes odoo/odoo#82517

X-original-commit: 6cda0780fdccf666f5a3fb0f39db59fcb0bd45c8
Signed-off-by: Guillaume Vanleynseele <guva@odoo.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
2022-01-11 08:36:51 +00:00
Stéphane Bidoul 9224313e34 [IMP] account: search on parent_state instead of move_id.state
By searching on account.move.line parent_state instead
of move_id.state, we avoid a join in many circumstances
and allow the database to benefit on an index on
company_id+parent_state to optimize several
queries, such as the default filter on the Journal Items
menu which shows posted items.

closes odoo/odoo#82504

X-original-commit: ef61db1cf8ebf1ab11e5dfdd439256d0607edba8
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-01-11 06:48:27 +00:00
Stéphane Bidoul 35f8e21c65 [IMP] account: avoid join when filtering on journal
account.move.line has a journal_id field that is related on move_id.journal_id.
By searching on journal_id we avoid a useless join,
offering more room for database query optimizations.

closes odoo/odoo#81856

X-original-commit: 2741f245f8a47e971309e97128662f1863329e45
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-01-10 14:49:49 +00:00
Sébastien BEAU ab4637f4cd [FIX] account: Fix counterpart statement line account from posbox
closes odoo/odoo#82457

X-original-commit: 336656e0e9677ccb2f43935b6f267fa83ed153df
Signed-off-by: Laurent Smet <las@odoo.com>
2022-01-10 13:53:01 +00:00
Brice bib Bartoletti 475719b101 [FIX] account: soften duplicate ref constrains
The aim of this commit is to allow EDIs to create and save account move
even if a supplier reference is duplicated.
This is achieved by delaying the moment to which the constrains is
triggered.

Before this commit:
A user can only upload a bill once. (xml ubl format for instance)
If he needs to upload it a second time, he will be forced to find a
workaround.

After this commit:
User will be able to upload as many bill as he wants but will receive a
ValidationError when trying to post the invoice if the reference is
duplicated.
The user will be able to post the bill very easily by changing the
reference a bit if he wants to pursue.

closes odoo/odoo#82303

Community-pr: https://github.com/odoo/odoo/pull/81748
Enterprise-pr: https://github.com/odoo/enterprise/pull/23255
Task: 2612299
X-original-commit: 200614876e62192e1a5ce2f30ec7aa8a1de77672
Related: odoo/enterprise#23281
Signed-off-by: William André (wan) <wan@odoo.com>
2022-01-06 14:46:48 +00:00
Akim Juillerat 2aa5d2a666 account: Fix journal dashboard graph query order
As the query results are set in a list of dicts relying on the
position of the dicts inside the list, the SQL query must ensure
the results returned by postgres are ordered properly so that it
will match the order in which the dicts are defined inside the list.

closes odoo/odoo#81978

X-original-commit: bac93bf56ff67a89f9381137b0c67642a302e6bb
Signed-off-by: Laurent Smet <las@odoo.com>
2022-01-06 08:34:57 +00:00
Laurent Smet e9c61029e7 [FIX] account: Keep CABA tax account when reversing
When reversing the CABA entry, the CABA tax account was replaced by the transition tax account if not set on the repartition line.
To reproduce:
Set up a CABA tax with ACC1 as transition tax account and ACC2 as tax account.
When creating the CABA entry, there is a line on ACC1 and another on ACC2.
When reversing the CABA entry, both lines are now on ACC1.

Introduced by https://github.com/odoo/odoo/pull/79556

closes odoo/odoo#82004

Issue: 2718413
X-original-commit: 2f6a35eb73978ce0638765fd0981c7e95d9df696
Signed-off-by: Laurent Smet <las@odoo.com>
2022-01-03 12:34:07 +00:00
Florian Damhaut b52cd37c5e [FIX] account: accrual rounding error
Step to reproduce:
- Create PO with an item rounded to 0.01
- Deliver 0.48/1
- Open Accrual Expense Entry

Current Behaviour:
- Order line is not taken into account due to rounding error
- Wizard is empty

Behaviour After PR:
- Qty is correctly rounded and appear as expected
- Order line is taken into account

opw-2720161

closes odoo/odoo#82073

X-original-commit: 85c2ab58d9ce1ccefd02f8214937a649285fde4a
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2021-12-30 15:15:30 +00:00
Guillaume (guva) 5f721aab73 [FIX] account: right accounts in account group
Steps to reproduce:

- Create an account group for a range for example from 100000 to 200000
- Now edit the group to have a range from 100000 to 150000

Issue:

The accounts with code > 150000 are still in the account group

Solution

Adding an other intermediary table to the query in order to take into
account the accounts which have no group_id

opw-2695533

closes odoo/odoo#82023

X-original-commit: 05c3cb8dbb7a9bf0f438d5ee687b92e8d934f26b
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Guillaume Vanleynseele <guva@odoo.com>
2021-12-29 14:24:14 +00:00
Bruno-brsy 4036381b68 [FIX] account: Validate invoice with archived bank account
It's possible to confirm an invoice with an archived bank account of
the recipient. But it's not making any sense, since the bank account
is archived.

It's why we need to raise an error if the user want to confirm an
invoice with an archived bank account.

opw-2704605

closes odoo/odoo#81939

X-original-commit: 8b9ff034cb67b132cdb6736a5f18d70beb63c253
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Bruno-brsy <brsy@odoo.com>
2021-12-28 09:47:29 +00:00
Guillaume (guva) ef1afc1502 [FIX] account: right account on internal bank transfer
Steps to reproduce:

- Create two bank journals Bank-1 and Bank-2
- Create one Oustanding Payments and one Outstanding Receipts account for each bank journal
- Create and confirm an internal tranfer from Bank-1 to Bank-2 for 100$
- A second payment is created

Issue:

The account on the line in the second payment is the Outstanding Payments account of Bank-1,
it should be the Outstanding Receipts account of Bank-2.

After this commit, the second payment will take into account the account set on bank journal,
and if not set, the one set on company. Otherwise, an error is raised.

opw-2711252

closes odoo/odoo#81938

X-original-commit: 51b5a9d4e56d8d2300cf1ee91f8030c57a41a856
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Guillaume Vanleynseele <guva@odoo.com>
2021-12-28 07:17:04 +00:00
oco-odoo 747d4da69b [FIX] account: don't mistake a tax with a sum of tax repartition factors == 0 for a 0% tax
Consider this example:

- Create a 42% tax, price-included, with two tax repartition lines doing +100 -100
- Create an invoice of 100€ using this tax, and look at the move lines generated

==> Only a base line of 100 and a receivable/payable line of 100 have been created; no tax line.

This is wrong, as we'd expect to see:

- 100 in payable/receivable
- 100 for the base line
- 42 for the +100 tax repartition line
- -42 for the -100 tax repartition line

The two tax lines are missing because the compute_all considers the tax as a 0% one, because of the +100 -100 stuff.

OPW 2716083

closes odoo/odoo#81771

X-original-commit: 9d24e3cf002bacb09d6e955b26124dda09c15f18
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
2021-12-22 00:12:48 +00:00
oco-odoo 5817e69a56 [IMP] account: reconciliation models: No confusing label anymore for "Match Invoice/bill with"
This label was defined with 'for="match_text_location_label"', even though it actually isn't met for just that field, but for the three boolean fields allowing to choose where to match on the statement line. As a consequence, in debug, it displayed the helper of that field, which was confusing for the user.

closes odoo/odoo#81730

X-original-commit: a89c6300f3b9b22fc4e18b286f2f28734e750638
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson <oco@odoo.com>
2021-12-21 15:55:56 +00:00
oco-odoo 840c93ddab [FIX] account: reconciliation models: properly match statement line fields when no partner is set
When no partner is set on a statement line, the reconciliation models try to find candidates using the payment reference or the partner name.

This was not working well when using reconciliation models configured to match on notes and/or reference. Only the default match on label was working.

As an example, consider the following case:

1) setup an invoice-matcing reconciliation model as such:
	- Partner Is Set and Matches = False
	- Match Invoice/bill with = Reference

2) Create an invoice with payment reference 123, for 100€

3) Create a statement line of 100€, with reference ('ref' field, inherited from account.move) = 123, label='test', and no partner set.

4) Try to reconcile the statement line

=> not match is found

OPW 2701729

X-original-commit: 74894b0da82f5f71cd22a3c9bb405696f908ef5c
Part-of: odoo/odoo#81730
2021-12-21 15:55:56 +00:00
Camille Spiritus fbb5b074f7 [IMP] account: rename non-trade filtering option, spread its use
Renamed the 'Other' account type into 'Non Trade' to enhance clarity and coherence

Changed the filtering system in the accounting search view to improve coherence with the filtering system available in the reports.
It is now possible to filter the trade/non trade accounts in the accounting views.
This change may be overriden by default selections already in place.

Renaming Receivable/Payable to Trade Receivable/Trade Payable could have turned out to be confusing for accustomed users.

They are now renamed Receivable/Payable, though the Non-Trade option is still present.

task-2669128

closes odoo/odoo#79752

Related: odoo/enterprise#21773
Related: odoo/upgrade#3004
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-21 12:54:54 +00:00
Andrea Grazioso (agr-odoo) 8465d19c06 [FIX] account: creation of redundant entries
Have an MX database set up
Activate multicurrency (MXN and USD)
Have several rate for USD
- yesterday 0.047939098170
- today 0.048486729180
Make an invoice, dated yesterday for USD 116, tax 16% (cash basis)
Create a received payment dated today, for USD 116
Reconcile invoice and payment

Jounal items will be created for the invoice, for the exchange
difference and for the cash basis entries, but there are redundant
entries addressing the tax.
This occur because when reconciling the payment with the invoice the
system create the cash basis moves and reconcile them. During this inner
reconciliation exchange difference move are created (1) just for the tax
line.
Then the outer reconciliation flow continue and compute the exchange
difference moves, considering all cash basis items created before. A new
couple of journal items will be created to account for the difference in
tax, but this is redundant since it was already covered before (1)

opw-2685570

closes odoo/odoo#81624

X-original-commit: 03bf311bfde98f28a9b8e73953869a42b828c5e3
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2021-12-20 10:50:04 +00:00
aliya 0292e369fe [FIX] l10n_*: Change Bank Suspense Account type
Currently Bank Suspense Account has "Current Liabilities" type, while it should be "Current Assets"

Task ID: 2702804

closes odoo/odoo#81491

X-original-commit: c6d2a50499744a9ddbb09a9974d6ab52116ef542
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-15 22:31:20 +00:00
Paolo (pgi) b63901b41d [FIX] account: Manual write-off with tax fixed
When the Reconciliation Model had a tax on the writeoff,
the journal_id wasn't populated by widget.get_reconciliation_dict_from_model(),
preventing the reconciliation from happening.

opw-2689002

closes odoo/odoo#81396

X-original-commit: 17a1c960cc3cce1850a6009ebf9641174e0304fb
Related: odoo/enterprise#22891
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2021-12-15 10:18:09 +00:00
Julien Van Roy e4818b6821 [IMP] account: Invoice / Bill Outstanding Debit / credit improvement
This commit:
1) fixes the customer invoice/vendor bill outstanding debit/credit warning anchor link
2) improves the customer invoice/vendor bill outstanding section
3) fixes the customer invoice/vendor bill outstanding debit/credit warning messages when viewing an account move reversal
4) modifies the order of the 'invoice lines' tab for mobile view

1) The anchor link did not work when pointing to a field (the id of a field is not propagated into the DOM).
Hence,the target field is put inside a div with the correct id.

2) The outstanding section is placed to the right, below the amount due and next to the description for clarity purpose.
The 'Add' button is turned into a secondary button (s.t. it is more noticeable). Each entry name is now a link to to the corresponding account move.

3) The warning messages are modified because they were not consistent and confusing when viewing an account move reversal.

4) Previously, the order on the 'invoice lines' tab was: narration>total>widget, now it is: total>widget>narration

task-2669132

closes odoo/odoo#78550

Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-15 09:26:54 +00:00
Julien Van Roy e2c0fec9ff [IMP] account: remove dead code
Part-of: odoo/odoo#78550
2021-12-15 09:26:54 +00:00
Yannick TivisseandVictor Feyens 18952cdc76 [IMP] *: Convert single create method into multi
Taskid: 2703085
Part-of: odoo/odoo#80824
Co-authored-by: Victor Feyens <vfe@odoo.com>
2021-12-14 19:13:18 +00:00
Camille Spiritus 3732aea4b8 [IMP] account,sale: move partner_shipping_id field from sale to account
The computation of 'partner_shipping_id' is now done using a 'compute' instead of 'onchange'.

task-2601934

closes odoo/odoo#78449

Related: odoo/enterprise#22098
Related: odoo/upgrade#3000
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-14 14:47:25 +00:00
roen-odoo 017a572143 [FIX] account : Average price fix invoice report
Current behavior:
Invoices report had a wrong average price when invoice had credit note

Steps to reproduce:
Create a db with accounting
Create a customer C and a Product P
Create an Invoice for C for 10 pieces of P
Create a Credit note for C for 1 P
Go to Reporting > Invoice Analysis
Open the pivot view, in the Measures, display the Average Price, the Product quantity and the Untaxed Total
The Total multiplied by the quantity is not equals to the average.

opw-2557420

closes odoo/odoo#81238

X-original-commit: ef26467e288a12571c37d4c133b44f08d99cc702
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2021-12-13 08:09:46 +00:00
Laurent Smet 26a5d7d299 [FIX] account: Fix available_partner_bank_ids in payment & register payment wizard
When paying an expense, we should take the bank accounts from partner instead of the ones set on the company.
Also, the computation of the partner bank account is different on the wizard and the payment.
To unify both models, the 'available_partner_bank_ids' should also be put on account.payment.

see https://github.com/odoo/odoo/pull/79737

closes odoo/odoo#81236

X-original-commit: 89d8c0a1ea03919e9f3085ea0d05aa80ad443ff7
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-10 16:24:45 +00:00
Brice bib Bartoletti 986b11c21f [FIX]account:reverse move condtnly hide btn and radio button
Aim of this commit:
- Hide the disabled radio button on reversal wizard when it's disabled.
(invoice residual_amount is 0)

before this commit:
- The radio buttons in the reversal wizard are visible even when it's
disabled.

after this commit:
- Radio buttons are hidden when it's disabled.

task/ticket:#2603144

closes odoo/odoo#81089

X-original-commit: e860a346ba6d7831674685817eed006dac86b264
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Brice Bartoletti <bib@odoo.com>
2021-12-09 10:26:58 +00:00
Laurent Smet 0cd014e1e9 [FIX] account: Add tax_repartition_line_id in tax details
closes odoo/odoo#81103

X-original-commit: 8dcfdf0f860246970ef375dfff755cbd2efcf697
Related: odoo/enterprise#22789
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-09 08:09:35 +00:00
Goffin Simon 5467389393 [FIX] account: Impossible to create account type
Steps to reproduce the bug:

- Go to Accounting>Journals and create new record
- In advanced settings tab, use 'Allowed Account Types' field to create a new one

Bug:

Form for account type does not have required internal_group

Introduced by https://github.com/odoo/odoo/commit/5aeec0c3dcd8aa20293167073f3f4f5cec323b74

opw:2497616

closes odoo/odoo#69455

X-original-commit: bacfea994ce7232af33d7e5525a5b56d5cba5871
Related: odoo/enterprise#22335
Signed-off-by: William André (wan) <wan@odoo.com>
2021-12-08 13:44:26 +00:00
Martin Trigaux d99cfd9416 [I18N] *: export saas-15.1 source terms
closes odoo/odoo#80964

X-original-commit: 0663892a34896980008eb0de69aeb58019a67e89
Related: odoo/enterprise#22759
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-07 13:48:53 +00:00
Stéphane Bidoul a79426c3e3 account: search on parent_state instead of move_id.state
By searching on account.move.line parent_state instead
of move_id.state, we avoid a join in many circumstances
and allow the database to benefit on an index on
company_id+parent_state to optimize several
queries, such as the default filter on the Journal Items
menu which shows posted items.

closes odoo/odoo#80815

X-original-commit: c2a72c268e6a28d7448b6dbf96fed4e36d24b3fe
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2021-12-06 09:06:06 +00:00
Laurent Smet 9f8b70aa68 [FIX] account: Fix wrong filter on partner banks
closes odoo/odoo#80811

Forward-port-of: https://github.com/odoo/odoo/pull/80771
X-original-commit: bd24fbbe1d16280b014caadc5c65fddb5f10112c
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-03 08:55:50 +00:00
Yannick Tivisse 48401aa9a0 [IMP] sale: Convert _onchange_partner_shipping_id into computed field 2021-12-02 12:12:03 +01:00
Victor Feyens 302ad13b3d [IMP] sale,account: follow same pattern for all compute methods 2021-12-02 12:12:03 +01:00
Yannick Tivisse b9194406ec [IMP] account: Avoid multiple rebrowse in get_fiscal_position
+ Make it private, as it is not supposed to be called from the
webclient.
2021-12-02 12:12:01 +01:00
Yannick Tivisse 550eb0b73c [IMP] account: Convert _onchange_sale_tax into compute method 2021-12-02 12:12:01 +01:00
Philémon van Helden 3b833c73a7 [IMP] mass_mailing, *: improve mailing stat buttons
*mass_mailing_crm, mass_mailing_sale 

Currently, the Mailing stat buttons have a few problems.
The business reporting smart buttons send the user to a list of linked records,
which doesn't provide much value (e.g. what is the user supposed to do with a
list of 12345 leads?). They also show wrong values depending on access rights.
The Mailing KPI smart buttons lead to a blank screen if there's no data to show.

In this commit, we add/adapt all action helpers to help users understand what is
going on. For the business reporting smart buttons we instead send users to
relevant reporting actions, so they can make sense of the data we showed before.
The values of the business reporting smart buttons are now calculated as a super
user.
We also change some domains from the whole UTM Sale Domain to only using
Source ID, which simplifies computation while staying accurate.

task-2604515

closes odoo/odoo#76798

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2021-11-30 16:53:33 +00:00
snd 102e7d8c35 [FIX] account_journal: ignore line_section and line_notes in account_control
When using account control on a journal, line_section and line_note do not
block the process even though they are not in the allowed accounts (they
don't have an account at all).
But when adding new accounts in the account_control_ids field, the
constraint is triggered by those lines.
This PR makes the constraint ignore those lines when assessing if
there's an issue.

opw-2677597

closes odoo/odoo#80313

X-original-commit: 9a42ebf1d9d482b031bc5bb7839cc9a8a09090ea
Signed-off-by: Florian Gilbert <flg@odoo.com>
2021-11-29 07:21:05 +00:00
jbw 5063948519 [FIX] account: fix _is_end_of_seq_chain exception when sequence is empty
Prevent calling _get_sequence_format_param() with None as parameter in _is_end_of_seq_chain() when sequence is empty.
Would cause an error when deleting an invoice with an empty sequence.

closes odoo/odoo#80467

Task: 2697771
X-original-commit: 6a5aab047c1e540505ba84a1ef2dcc3356e89708
Signed-off-by: William André (wan) <wan@odoo.com>
2021-11-26 16:42:22 +00:00
jbw 08b12bbdc7 [FIX] account: fix misc reverse tags
Before this fix, all moves of type “entry“ were considered as misc operations in regard to repartition tags and the tax report. And only moves of type “out_refund” and “in_refund” were considered refunds.
Now reverse entries with sale/purchase taxes get their tags set accordingly to repartition lines.

Account                                    D      C      Tax   Tax Grids
700000 Ventes en Belgique (marchandises)   0      1000   21%   +03
451000 T.V.A. à payer                      0      210          +54
400000 Clients                             1210   0

Was reversed to:
Account                                    D      C      Tax   Tax Grids
700000 Ventes en Belgique (marchandises)   1000   0      21%   +03
451000 T.V.A. à payer                      210    0            +54
400000 Clients                             0      1210

Is now reversed to:
Account                                    D      C      Tax   Tax Grids
700000 Ventes en Belgique (marchandises)   1000   0      21%   +49
451000 T.V.A. à payer                      210    0            +64
400000 Clients                             0      1210

closes odoo/odoo#80427

X-original-commit: a337d5d5b3886eabbdc8de95eb615dffc91d5d8e
Related: odoo/enterprise#22532
Signed-off-by: Olivier Colson <oco@odoo.com>
2021-11-26 10:32:07 +00:00
jbw bc772f4784 [IMP] account: track lock dates changes
Allow log date changes tracking by adding chatter on company and tracking lock date fields.

closes odoo/odoo#78730

Task: 2651834
Related: odoo/enterprise#22479
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-25 09:13:47 +00:00
wan caa0ac2bdc [IMP] account: allow declaration of tax report without report_id
The `report_id` is redundant and can be computed from the parent.

Part-of: odoo/odoo#76675
2021-11-25 00:31:17 +00:00
Julien Van Roy c31f971508 [IMP] account: hide field currency on misc journal
- Hide the field 'currency' on the journal entries (for the miscellaneous journals only) because it is neither necessary functionally nor doing anything technically.
- Accounting journal views: amount in currency is made optional (shown by default)
- Journal entry view: currency is made optional (hidden by default)

closes odoo/odoo#79486

Purpose: lighten the user interface/make it clearer
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-11-24 14:04:28 +00:00
jbw 82763d81bf [FIX] account: fix manual reconciliation widget
- set journal_id, tax_ids, analytic_account_id, analytic_tag_ids & force_tax_included as optional hide
- fix _get_write_off_move_lines_dict to make clicking a reconciliation model button have the same result as doing the operation manually :
    - add journal_id parameter
    - use reco line label in new aml name

closes odoo/odoo#80176

Task: 2611348
X-original-commit: 4514f0ec4a1eebb4652c34c4926d0cd1ff336e17
Related: odoo/enterprise#22435
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-23 14:42:05 +00:00
Thibault Delavallée 869ada08a0 [IMP] mail: rename tracking methods and clean dead code
Purpose is to have tracking methods beginning with ``_track``, indicating
those are tool methods used for tracking. It helps organizing the mail thread
file and having short but precise method names.

We also remove the usage of ``mail_track_log_only`` context key that is not
used anymore in the code. It allows to shorten a bit the code and make it
easier to read.

Task-2671709

Part-of: odoo/odoo#78648
2021-11-23 09:39:52 +00:00
Laurent Smet 6227007b7a [FIX] account: Fix Receive bank account on register payment wizard
- Create a partner with 2 bank accounts: BNK1 and BNK2

Wrong flow with vendor bill:
- Create an vendor bill => BNK1 is set by default
- Change BNK1 to BNK2
- Register a payment
=> BNK1 is proposed by default instead of BNK2

Wrong flow with customer invoice:
- Set BNK3 on your company
- Create a customer invoice
- Register a payment
=> BNK1 is suggested instead of BNK3

closes odoo/odoo#80175

Issue: 2683197
X-original-commit: ec0d807b2b6ff3596d9b591bd8ec7d8889d41d8a
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-23 08:53:39 +00:00
Martin Trigaux a8e50921af [FIX] *: correct typos and English errors
closes odoo/odoo#80181

X-original-commit: efd178daee689192d4e930a075475587038b3e0d
Related: odoo/enterprise#22439
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-22 14:48:04 +00:00
Laurent Smet 6d77ec0d99 [FIX] account: Fix currency of write-off lines generated by a reco model button
Steps to reproduce:
- Create a journal with a custom currency
- Create a statement line
- Create a reconciliation model button putting the residual to a random account
- Reconcile the statement line using the button
=> The amount lands inside the debit/credit instead of amount_currency

Introduced by:
https://github.com/odoo/odoo/commit/5ad660877f485d741a0120e07eb73178f59d2dfc#

closes odoo/odoo#80173

X-original-commit: fc9b8dc6611d761f2c8778254dcbad52091404dc
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-22 12:43:37 +00:00
Goffin Simon 773583b17b [FIX] account,purchase: do not override analytic values
Editable computed fields need to have their own compute
method.

Otherwise, when providing one of the two fields at create/write time
will not be taken into account because the compute method will be
triggered for the other field.

closes odoo/odoo#77912

X-original-commit: e35dc4c87821bbb668657eed99bb51c1f853c208
Related: odoo/enterprise#21685
Signed-off-by: William André (wan) <wan@odoo.com>
2021-11-18 10:54:03 +00:00