Commit Graph
16565 Commits
Author SHA1 Message Date
Adrien Dieudonné 4202009086 [REF] account: remove unused views and model
This commit deletes all unsused views from the following models:
- `account.chart.template`
- `account.account.template`
- `account.common.report`

We also take the oppoturnity to remove ´account.common.report´.
This model is unused since https://github.com/odoo/odoo/commit/b7232b14b7f2423241b24b4eef1300f1a1b425cf#diff-61c2936e0566472acce71f3bb90f47ca5a709680322621dbcb735e3e2bd92f7eL11

This is a preliminary work in order to convert form views into grid.

Related commit:
https://github.com/odoo/odoo/commit/c04065abd8f62c9a211c8fa824f5eecf68e61b73#diff-f292b09f5efe026c65c27c5f0175b719a5d66999cbb15832c211796617ac082dL1976

closes odoo/odoo#99810

Related: odoo/upgrade#3875
Signed-off-by: William André (wan) <wan@odoo.com>
2022-09-08 21:43:12 +02:00
Fabien Pinckaers 1569100baa [IMP] account: index on account.move.line to open journal items
Opening journal items does a query similar to
```sql
  SELECT
       "account_move_line".id
       FROM "account_move_line"
       LEFT JOIN "account_move" AS "account_move_linemove_id" ON ("account_move_line"."move_id" = "account_move_linemove_id"."id")
  WHERE
       ORDER BY "account_move_line"."date" DESC,"account_move_line"."move_name" DESC,"account_move_line"."id" ,"account_move_line"."id" LIMIT 80
```

Indexes on `date` weren't used in such queries. Building a compound index that includes
`id` changes the index cost computation, and allows a Index Only Scal. So, it does not
have to jump on data pages anymore to retrieve the ID of rows.

Without that, postgresql will use a Seq Scan.  It went from 10s to 5ms in our production
database, to open the list of journal items.

Part-of: odoo/odoo#99795
2022-09-08 12:46:50 +02:00
Andrea Grazioso (agr-odoo) 938d88898c [FIX] account: fix caba tax tags missing in reconciliation
Have a CABA tax
Create a Bank statement with a line
Reconcile with manual operation adding the CABA tax

After reconciliation check the journal entries: the tags will be missing

opw-2865789

closes odoo/odoo#93878

X-original-commit: 49229615ca1ce3f85a254e402732f274eb354444
Related: odoo/enterprise#28520
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-09-08 11:44:42 +02:00
Florian Charlier 6c73ed6f4b [REF] base,*: fix typo + privatize onboarding method
* = account, sale

- Fix typo
- Make private as very specific role
- Allows to grep similar functionality from new onboarding module and previous
common implementation of onboardings.

Task-2852375
Part of Task-2900763

Part-of: odoo/odoo#97105
2022-09-07 23:10:18 +02:00
luvi 3d5b7010c0 [FIX] account: fix alignment of fields
This commit fixes the alignment of fields in the
setup wizard template. Since the conversion of those
fields, some parts of the DOM have been altered, and
the oe_inline class makes the inputs and selects
elements larger than it should.

After this commit, and its enterprise counterpart,
the UI is correctly aligned.

closes odoo/odoo#99675

Enterprise: https://github.com/odoo/enterprise/pull/31103
Related: odoo/enterprise#31103
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-07 11:25:55 +02:00
Laurent Smet 8003310ccc [FIX] account: Fix ensure_one method called on 'self' instead of 'st_line'
closes odoo/odoo#99664

X-original-commit: f95000096c848aabb1990237390a659ed739f491
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2022-09-07 02:18:05 +02:00
Pierrot (prro) 8e857752a2 [IMP] account: improve Journal Items reconciliation view
Clean the action for reconciliation view for the correct handling of it.

Removes the group by Matching in the Journal Items reconciliation
list.

Now includes all linked reconciliation account_move_lines for a better
representation of spaghetti reconciliation.

task-2959808

closes odoo/odoo#98827

Related: odoo/enterprise#30702
Signed-off-by: Laurent Smet <las@odoo.com>
2022-09-06 22:31:16 +02:00
Miquel Raïch f607572da6 [FIX] account: matched move lines should be marked as reconciled
Fine-tuning of https://github.com/odoo/odoo/commit/c8c3aa96e18827c3c032540b92e95b27bbed0fc3.

Also, in _prepare_reconciliation_partials, consider case of having aml without credit, debit and amount_currency.

Part-of: odoo/odoo#99537
2022-09-05 18:35:41 +02:00
Stanislas Gueniffey 7a049df904 [IMP] account: dedicated payments sequence
Add setting on bank/cash journals to have dedicated payments sequences
Enabled by default

closes odoo/odoo#99058

See: odoo/enterprise#31059
Task: 2894299
Signed-off-by: Laurent Smet <las@odoo.com>
2022-09-05 18:35:05 +02:00
Rémy Voet (ryv) 4087bcdc5e [IMP] core: add unaccent to trigram indexes
We added trigram index for char fields since https://github.com/odoo/odoo/pull/83015.
But if `unaccent` is installed in the database (and isn't force to
`False` on field), these new trigram indexes are pointless and cost a
lot for nothing (almost nothing, it still can be used for equality
operator but in this case a btree will be far more efficient).

The simple way to fix it is to add `unaccent(<column>)` in the index
trigram definition, but unfortunately `unaccent` is not immutable and
may therefore not be indexed.  In order to make `unaccent` indexable, we
must declare it as immutable (see
https://stackoverflow.com/questions/11005036/does-postgresql-support-accent-insensitive-collations/11007216#11007216
for more information and how to do that).

With this patch, trigram indexes are created with `unaccent(<column>)`
if the function `unaccent` is available in the database, and for the
fields that are not declared with `unaccent=False`.  Moreover, we issue
a warning when `unaccent` is available but is not immutable, in which
case most trigram indexes will be useless.

odoo/upgrade#3736
task-2551518

closes odoo/odoo#95943

Signed-off-by: Rémy Voet <ryv@odoo.com>
2022-09-05 18:34:53 +02:00
Aaron Bohy 3cf611e229 [FIX] account: fix chart of accounts searchpanel style
Before this commit, the values in the CoA searchpanel weren't
visible, making it unusable. This was due to the use of bootstrap
classes in /web, which have padding rules that took the priority
over the account customization to make it as thin as possible.

Part-of: odoo/odoo#99503
2022-09-05 12:40:30 +02:00
Samuel Degueldre 138f00255a [FIX] account, hr_timesheet, product, web: add missing oe_inline classes
Since the fields were rewritten in owl, they all have a width of 100% by
default, which is what we want when displaying a field on their own.
In some places, fields are used as part of a longer block of content (eg
unit of measure behind a number). In those cases, we want to display the
field inline, which requires the addition of the oe_inline class in the
arch.

There was also a missing piece of css for the monetary field, as the
previous rule no longer applied because of the slight changes to the DOM
structure.

closes odoo/odoo#99529

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-05 09:31:57 +02:00
Xavier Morel 5afcd06168 [REM] *: incorrect taggings which break tests when applied
Not entirely sure about TestAllocationRights. For TestEsEdiCommon
issue is quite obviously that it's inherited by tests which are
external, so when the `post_install_l10n` tag gets applied those tests
get run during "normal" l10n and they break.

closes odoo/odoo#98814

Related: odoo/enterprise#30825
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-09-05 08:33:13 +02:00
oco-odoo d33aca38c3 [FIX] account: fix template consistency check
plus_report_line_ids and minus_report_line_ids have now been replaced by plus_report_expression_ids and minus_report_expression_ids on tax templates.

The test was failing locally but not on runbot, because it was missing the post_install tag.

closes odoo/odoo#99462

Signed-off-by: Laurent Smet <las@odoo.com>
2022-09-02 23:16:20 +02:00
Nicolas (vin) 1418388343 [IMP] POS: allows to create invoices for a pos order at a later time
Some countries, such as mexico, require a seller to be able to
generate an invoices from a ticket from a sale done in a shop,
even after a few days.
This change aims to allow this, by allowing to create an invoice at
a later date after the POS has been closed.
This is done by partially reversing the POS closing entry, and then
generating an invoice the same way it would be done at the POS closing.

The customer can scan a QR code if enabled in order to request the
invoice by himself, requiring him to fill a for to give the customer
information required for the invoicing.

Allows to fill additional fields dependent on the localization that are
required to be set on the partner or the invoice.

Task id #2946604

closes odoo/odoo#97675

Related: odoo/enterprise#30599
Signed-off-by: Laurent Smet <las@odoo.com>
2022-09-01 19:16:34 +02:00
Ricardo Gomes Rodrigues (rigr) 3dad4b3cb1 [IMP] account: improve payment terms with new options
This commit improves the payment terms by:
- making the payment terms lines editable on-the-fly removing the need for a wizard
- refactoring the computation of the payment terms
- adds new demo data for payment terms
- adds an example section where the user can test and preview the due dates and amount of its payment terms
- adding a new parameter "Display terms on invoice". If set, the payment deadlines and respective due amounts will be detailed on invoices.

The refactoring:
- adds a field `months` (months to add after the invoice date)
- adds a field `end_month` (if True, switch to the end of the month after having added months or days)
- renames the field `day_of_the_month` to `days_after` (days to be added after the switching to the end of the month, only if `end_month` is set)
- deletes the field `option` which was too restrictive
- modifies the calculation of the payments terms taking into account these new fields

This allows some combinations that were not possible before.
Example: The French payment terms "30 jours fin de mois le 10" (which should be interpreted as "10 days after the end of the next month") can be encoded as
```
months = 1
days = 0
end_month = True
days_after = 10
```

Task id 2852814

closes odoo/odoo#91490

Related: odoo/enterprise#29661
Related: odoo/upgrade#3524
Signed-off-by: Laurent Smet <las@odoo.com>
2022-09-01 19:16:19 +02:00
Laurent Smet a372772ba6 [IMP] account[_edi], l10n_*: Make the EDI taxes computation helper usable on any models
The current taxes computation method defined in account_edi has been moved to account on account.tax to be usable on any models.

closes odoo/odoo#99401

Related: odoo/enterprise#30967
Signed-off-by: Laurent Smet <las@odoo.com>
2022-09-01 18:11:02 +02:00
Habib (ayh) 31e381f170 [FIX] account: upload buttons on Accounting Dashboard are disabled
OWL disables view buttons that are missing attributes.
These buttons used legacy javascript, and were omitted from the accounting owl migration.

Activate those buttons.

closes odoo/odoo#99066

Related: odoo/enterprise#30815
Signed-off-by: William André (wan) <wan@odoo.com>
2022-09-01 13:08:53 +02:00
Nicolas (vin) 623d3bfe0f [IMP] account: ensure account's code compatibility with reportalypse
The new account report engine requires account codes to only contain
alphanumeric characters and dots.
(see https://github.com/odoo/enterprise/blob/f435654f70f3d6a1fec7fa696945f2c0eb9a7056/account_reports/models/account_report.py#L2523)
Add two new constrains on account_account and account_account_template
to block the creation of accounts with codes that would cause issues
in account reports.

Task id #2960486

closes odoo/odoo#98900

Related: odoo/enterprise#30841
Related: odoo/upgrade#3824
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-08-31 16:05:10 +02:00
Aaron Bohy bedce02bb7 [REF] web,mail,account: orm service: move context in kwargs
This commit standardizes the API of orm service functions by adding
a "kwargs" parameter, s.t. one can always use those functions even
if the target model overrides the corresponding method to add the
support of a given kwargs. Furthermore, to simplify those function
API, and to close the gap between the js and python APIs, we moved
the "context" argument inside the kwargs.

closes odoo/odoo#99018

Related: odoo/enterprise#30830
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-08-30 20:23:17 +02:00
Aaron Bohy 002a76eaaa [IMP] web,account: orm service: allow to create in batch
This commit changes the API of the "create" function of the orm
service to better reflect the API of the corresponding method in
models.py, which takes a list of record values in argument.
Before this commit, a call to "create" only allowed to create a
single record.

Part-of: odoo/odoo#99018
2022-08-30 20:23:17 +02:00
Raphael Collet b38a5f78b6 [FIX] *: avoid non-searchable field dependencies
closes odoo/odoo#98562

Related: odoo/enterprise#30639
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-08-29 22:43:11 +02:00
Denis Ledoux 8b91cab67f [IMP] base: remove groups_id from ir.ui.view
The goal of this revision is to get rid of the `groups_id` field of the model `ir.ui.view`.

- This feature wasn't really known or used by most developers,
   and not straight-forward to understand.
   Removing it allows one less complicated thing to learn for developers.
   Besides, thanks to odoo/odoo#95729,
   changing the behavior of the `groups=` attribute,
   we can easily get rid of this `groups_id` feature
   by simply adding `groups=` in the elements of the views
   using the `groups_id` field, it will have the same effect:
   adding the elements in the view only for the users part of the specified group.

- By getting rid of the groups_id many2many field on ir.ui.view,
   it makes possible to cache the view architecture without
   requiring to use the groups in the cache key.
   Currently, if we want to cache the view architecture,
  it would be required to use the intersection of the user
  groups with the groups_id groups of the view,
  making it costly to compute the cache key,
  therefore altering the performance point to cache the view
  architectures.

Part-of: odoo/odoo#98551
2022-08-29 22:42:50 +02:00
Nshimiyimana Séna 99f7d9e7f1 [IMP] account: add default filter to journal items when coming from an account
This PR adds the 'posted' filter by default on the journal items list
view, when coming from an account's form view.

opw-2896728

closes odoo/odoo#99012

X-original-commit: c976a0920dd8d7910c7635cc1e2bbff47edcafa9
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
2022-08-29 16:30:21 +02:00
Mathieu Duckerts-Antoine 8b1d92c787 [REF] *: list: renderer templates called dynamically
Several modules need to modify some parts of the templates used by the
list renderer. Those being called recursively (and with parameters
sometimes), it is quite lengthy to do. Now the call to templates are done
dynamically so that it is easier to extend the templates by specifying
some static keys of the ListRenderer.

Part-of: odoo/odoo#97984
2022-08-29 13:49:09 +02:00
Brice bib Bartoletti 12cf871f8e [REF] account: structure folder to component
closes odoo/odoo#96672

Related: odoo/enterprise#30076
Signed-off-by: William André (wan) <wan@odoo.com>
2022-08-27 19:01:14 +02:00
Brice bib Bartoletti d6ab621198 [FIX] account: resequence widget template
There should be several line in t-body but not several t-body

Part-of: odoo/odoo#96672
2022-08-27 19:01:14 +02:00
Habib (ayh) d36a4dd14e [FIX] account,l10n_ar,test_main_flows: tour
As the owl views gets activate, the tours gets broken.

Part-of: odoo/odoo#96672
2022-08-27 19:01:13 +02:00
Brice bib Bartoletti a3c7a06dc3 [REF] mail: remove account.move.line hack
While refactoring the move_line_list_views.js in owl, we provided the
account.move id and model + "generate" a thread in the front-end for
account.move.line instead of only providing account.move.line model and id.

This allows us to get rid of this hacky special case

Task-id: 2857743
Part-of: odoo/odoo#96672
2022-08-27 19:01:13 +02:00
Habib (ayh) 569ca1bd20 [REM] account: account_dashboard_setup_bar.js
Part-of: odoo/odoo#96672
2022-08-27 19:01:13 +02:00
Habib (ayh) b093ed5997 [FIX] account: tax_totals.js
Part-of: odoo/odoo#96672
2022-08-27 19:01:13 +02:00
Habib (ayh) 5d4a337a2b [IMP] account: account_move_form owl migrate
Part-of: odoo/odoo#96672
2022-08-27 19:01:12 +02:00
Habib (ayh) 4f4e31c623 [IMP] account: mail activity kanban widget - owl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:12 +02:00
Habib (ayh) c2e3f94bde [IMP] account: open_move_widget owl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:12 +02:00
Habib (ayh) 41b32b47c4 [IMP] account: account_type_selection widget owl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:12 +02:00
Habib (ayh) 3d08246818 [IMP] account: fixes for owl. underscore.js removed
Part-of: odoo/odoo#96672
2022-08-27 19:01:11 +02:00
Habib (ayh) db008ff03a [IMP] account: bills upload wowl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:11 +02:00
Habib (ayh) b0ee5be676 [IMP] account: account_payment_field wowl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:11 +02:00
Habib (ayh) 5a21823f43 [IMP] account: section_and_note_fields wowl migration
Part-of: odoo/odoo#96672
2022-08-27 19:01:10 +02:00
aliya 2de3e3cbe5 [FIX] account: constrain foreign currency in bank statements
On a bank statement line:
If a foreign currency is set and the amount in currency is not set, the line is reconciled automatically (because the amount is 0) and this should not be the case.

Add a constraint on `account.bank.statement.line`: raise an error if the foreign currency is added, but the amount in currency is not.

This conflicts with the tests that allow this behaviour, so the related tests are deleted as this should not be allowed anymore.

task-2956422

closes odoo/odoo#99028

X-original-commit: 1dfa3d074c7368abb51df56cb7fd1ee5115399b1
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2022-08-27 07:06:48 +02:00
Laurent Smet 8b1ed8e510 [REV] account: cash discount improvements
Current task is not covered the whole cash discount feature. For now, we decided to revert the current feature and make a new more complete one later.

This reverts commit 7482aff6d7.

closes odoo/odoo#98986

Related: odoo/enterprise#30783
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-08-27 03:33:55 +02:00
Camille Spiritus b373d12252 [IMP] account: import soda files
Added ids necessary for the soda files to be imported on l10n_be.

see https://github.com/odoo/enterprise/pull/30680

closes odoo/odoo#98904

Related: odoo/enterprise#30680
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-08-27 03:33:36 +02:00
Pierrot (prro) edfcb5e626 [MOV] account: move reconciliation scss to enterprise
The commit https://github.com/odoo/enterprise/commit/0063d7d6a09c16716dcd9125c291a1041f9ed255
forgot to include the corresponding scss file.

closes odoo/odoo#98920

Related: odoo/enterprise#30748
Signed-off-by: Laurent Smet <las@odoo.com>
2022-08-26 23:15:51 +02:00
aliya 514ff773a2 [IMP] account, base_import: improve accounting import
- Remove FEC from res.config.settings - everything is now linked in the import guide (in enterprise)
- Compute debit and credit from opening_balance
- Update import templates for account.account, account.move, res.partner
- Small UI changes in base_import: add an action title and improve the template button design

task-2888243

closes odoo/odoo#96291

Related: odoo/enterprise#29627
Related: odoo/upgrade#3794
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
2022-08-26 17:16:52 +02:00
Laurent Smet 8295bd1ba0 [FIX] account: Fix demo data for matching rules
Fix a bug introduced by:
https://github.com/odoo/odoo/commit/4b23d11184be9bac5ef9790cc7f38bc4d637b47a

Since this commit, the matching rules's regex "BRT: ([\d,]+)" that was matching "BRT: 100,00" is no longer matching "BRT: $ 96.67".

closes odoo/odoo#98698

Related: odoo/enterprise#30490
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2022-08-26 11:51:40 +02:00
Laurent Smet 8f7fe1aeb3 [IMP] account: Add link to statement lines used to match a payment
On the bank reconciliation widget, we need to open the statement line matched with the payment.

Part-of: odoo/odoo#98698
2022-08-26 11:51:39 +02:00
jbw 62a5af923a [FIX] account: take sequence_override_regex int account when resequencing
Before this fix, resequencing would use values from _get_sequence_format_() run from an empty model.
This method result is influenced by the sequence_override_regex param of the move journal.
This means that if the journal of the moves that are resequenced has a sequence_override_regex param, it will be ignored in the wizard.
This fix run the _get_sequence_format_() method on the first move to take the journal into account.
Note that the wizard only allows resequencing moves from one same journal.

closes odoo/odoo#98926

Task: opw-2825699
X-original-commit: b22c37a5f173161b4a5f798462ea05142bb9334a
Signed-off-by: William André (wan) <wan@odoo.com>
2022-08-26 06:55:46 +02:00
Laurent Smet bedf191134 [IMP] account,l10n_*: Set 100 as default value for factor_percent in tax repartition lines
closes odoo/odoo#94125

Related: odoo/enterprise#28648
Related: odoo/upgrade#3695
Related: odoo/documentation#2557
Signed-off-by: Laurent Smet <las@odoo.com>
2022-08-25 19:56:56 +02:00
oco-odoo b7232b14b7 [IMP] account, l10n_*: Introduce unified reporting engine
This commit adapts account's model to the new report engine introduced for v16, and updates the data files accordingly.

account.report model is now declared in community, together with the other models used by the reporting. This is done so that the tax tags can properly be created by the tax report and used on tax templates. All the actual computation logic stays in enterprise.

See enterprise commit for full details.

Task 2524389

Part-of: odoo/odoo#94125
2022-08-25 19:56:55 +02:00
Nicolas (vin) 3bac0f9d68 [FIX] account: Do not add tax grids for CABA taxes upon reversal
When using CABA and reversing a move, we expect the CABA move to
be the one impacting the tax grids, and not the reversed move.
Thus, we now avoid setting the tax grids for CABA taxes on
move lines created when making a reverse move.

Task id # 2895267

closes odoo/odoo#98789

X-original-commit: 5dd50ac1433be262ddd49d8b165e240afd16e675
Signed-off-by: Laurent Smet <las@odoo.com>
2022-08-25 12:05:10 +02:00