Commit Graph
289 Commits
Author SHA1 Message Date
Dylan Kiss (dyki) f31a0ea7a5 [IMP] account: add date options for tax periods
Currently the tax report always opens the previous month by default.
Since tax periods are not always months, it makes much more sense to
open the previous "tax period" (whatever length it has) when opening the
tax report.

In order to allow that, this commit introduces a "This Tax Period" and
"Previous Tax Period" option for reports and sets the default period
for the tax report to "Previous Tax Period". The rest of the
functionality is done in the related enterprise commit.

task-3481913

closes odoo/odoo#133715

Related: odoo/enterprise#46601
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-09-15 16:45:52 +00:00
Yannick Tivisse 8a83cbeb28 [IMP] account: Add salary accounts to generic CoA
Part-of: odoo/odoo#124222
2023-08-17 10:32:53 +02:00
Ruben Gomes a2b0c9281d [IMP] account: usability improvements
This commit is part of the refactoring and improvement of the html and css of account_reports (enterprise).

Here we:

- Remove blank_if_zero default value of True, it is now False by default. The zeros are now shown in a muted gray color.
- As we had a level of hierarchy 0 that allows for some further styling we needed to adapt _compute_hierarchy_level to take it into account when calculating the increase level. So if the level is 0 or 1, the child will have a level of 3 either way.
- Removed some UPPERCASE column styling.

Task-id 3251726

closes odoo/odoo#129232

X-original-commit: 56a7f7745c5df9b70e6fe5b78f401085ce46284c
Related: odoo/enterprise#44436
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-07-24 15:51:57 +02:00
Habib (ayh) 057472b873 [IMP] account: generic coa tax repartition lines
Since the refactoring of chart templates, the wrong account is used for the purchase tax (`Tax Received` instead of `Tax Paid`) in the generic COA taxes.

closes odoo/odoo#129130

X-original-commit: 25eff4142b7a8b57fc5e9b73ac92c4c54e29085b
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-07-20 14:23:26 +02:00
Florian Charlier 77f9ff50db [REF] *: use onboarding module
* = account{_payment}, base, onboarding, payment{_stripe},
sale{_management}, web, website_sale

Use the dedicated onboarding module introduced in 16.0 instead of
the res.company model to store onboarding progress.

It allows
 * onboarding steps to be reused across panels
 * to support steps that should be completed per-database or per-company
 * to clean the res.company model from many fields and methods,
 * to remove many views, controllers, actions

Module-specific notes:
* account: We also clean the remaining two steps that are not
part of an accounting panel but make the most sense to be kept here.
* account_payment: Following 8e4e8eb8, the payment provider step is
added to the invoicing onboarding panel. We apply this change here too.
Also impacts the website_sale_dashboard panel (see related ENT PR).
(The "sale tax" one is currently used for to the website sale dashboard).
* payment: Note that the step was already not part of an onboarding
panel within this module.
* website_sale: We clean
  * a field not used (The website_sale dashboard onboarding panel used
  the payment_provider_onboarding_state field).
  * a method that was only called from website_sale_dashboard, so it is
  moved there. See related ENT PR.

Includes a few tests.

Moving views/templates/styling, as well as cleaning residual onboarding-related fields and methods in base, including populate.

This also includes restoring the "onboarding_complete" overlay panel
animating it to disappear after a few seconds so that it doesn't hide
text and block buttons to re-open steps.

Task-3025136

Part-of: odoo/odoo#104223
2023-06-30 23:37:50 +02:00
John Laterre (jol) 6ba77562c0 [REV] account,l10n_*: remove company currency symbol in reports
This reverts commit d39396c728.

The feature was implemented in a rather rigid way,
and we think something more dynamic would be better.

closes odoo/odoo#115332

Related: odoo/enterprise#38208
Related: odoo/upgrade#4740
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-06-15 17:35:42 +02:00
Thibault Delavallée be398b428a [FIX] auth_*, sale: improve 'from' of templates by adding company fallback
Emails on Sale Order, Invoice, Recovery cart. When no sales on sale.order
use "COMPANY" <email of company> as fallback before the current user.
Reason is that odoobot is often used in automatized actions and having
it as email_from is not really user friendly.

Also add company fallback in auth modules email templates (if not already
using it) for the same reason.

Task-3346388

closes odoo/odoo#124472

X-original-commit: 597fc004148bf39e8f56e36e840aa6788872f237
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-09 18:30:31 +02:00
Maximilien (malb) 0a4f831c6f [IMP] account: generic taxes
We want to invigorate a Tax Name Taxonomy so that tax names are as codified as possible. This allow for a better display on Invoice Description, and allowed us to implement a smart name_search.

In this PR, we change the tax name of generic taxes

closes odoo/odoo#114537

Task-id: 3052677
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-05-10 18:16:03 +02:00
yhu-odoo 1eb2e7c814 [IMP] {,mrp_,stock_}account, *: add default stock accounts and production cost
account

1. We introduced a new Production Cost account that can be set on
locations with Production type. When products move into/out of a
production location. The account entry will be post on this account
instead of previous Stock in/out account.

2. On the accounting setting page, we can now set the default values for
all stock accounts. Users can also disable automatically accounting for
stock there.

Task-3046333

closes odoo/odoo#113973

Related: odoo/enterprise#37653
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-05-10 15:19:32 +02:00
Mahamadasif Ansari 02788e4076 [IMP] various: changes tips data due to changes in digest templates
With this PR, the `digest_data` template has been changed, so the `digest_tips`
is not compatible with the new changes.

This commit changes the `digest_tips` data to be compatible with the new changes.

Below are the modules affected:
 - account
 - crm
 - digest
 - hr_expense
 - hr_timesheet
 - im_livechat
 - mrp
 - project
 - purchase
 - sale_management
 - stock
 - website

task-2717426

Part-of: odoo/odoo#89549
2023-03-31 15:51:58 +02:00
Claire Bretton (clbr) 82e1a2b1cb [IMP] account, l10n_*: add field invoice_label, field description back to initial purpose
Taxes have a `description` field that has been hijacked to
represent tax label on invoices. We want the description field
to be used for its original purpose, thus created a dedicated field
`invoice_label` in which we transferred `description` content.
We also make description translatable.
This is part of the Tax Taxonomy 2 rework.

Task: 3052677
Part-of: odoo/odoo#113236
2023-03-07 10:06:13 +01:00
Laurent Smet 955091e707 [IMP] account*: send&print with documents
Refactoring send&print wizard.
==============================

Main reason for this commit is that we want to let the user
decide when to generate the relevant documents / approvals
for its invoices. The natural choice is when the information
leaves Odoo. So now, each time the users decide to
download/send its invoices, he will be able to select the
relevant documents to be generated and the approvals to be
requested from the send&print wizard.

This used to happen automatically during the posting with lots
of undesirable behaviors (difficulty to update/revert, hard to
know exactly what will happen,...)

Main changes:

1/ Send&print wizard

- The model 'account.invoice.send' has been replaced by
'account.move.send' and became models.Model to handle
asynchrounous generation of documents (webservice,..) in
case of more than one invoice.

- The wizard is meant to be overriden in order to add
checkbox and document to be generated. A comprehensive exemple
can be found in account_edi_ubl_cii.

2/ Import invoice from attachments

- The decoding logic has moved from account_edi to account
on the attachemnts.

- The function _extend_with_attachments() serve as a common
entry point for import (from chatter, dashboard).

3/ Export invoice pdf / document

- All the specific actions to export attachments should be
implemented on the account.move and called from the wizard in
 _generate_documents()

- The official pdf for the invoice is now only generated once
 the user request it. In order to regenerate the pdf and
documents, it needs to be deleted.

task-id: 3117238
[enterprise](https://github.com/odoo/enterprise/pull/36757)
[community](https://github.com/odoo/odoo/pull/111857
)

[IMP] web: enable close on ir.actions.act_url in wizard

Before this commit, calling ir.actions.act_url on a modal
leaves the modal open. Which feels ackward in the send&print
wizard.

We now enable 'close' parameter on ir.actions.act_url. If set,
the wizard will close after act_url.

closes odoo/odoo#111857

Related: odoo/enterprise#36757
Related: odoo/upgrade#4387
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-03 19:10:10 +01:00
maximilien(malb) 9c134ec379 [IMP] account: simplify payment term usability
v16.0 introduced a new payment term view and the possibility of an early payment discount.

However, this view and the underlying behaviour can be simplified.

- Changed the payment term view and the report invoice view to better display the installment
- Removed the balance field from payment terms, replacing it with percentage
- Simplified the due date configuration in the payment terms
- Simplified early payment discount by only enabling it on one-line payment term, so it's user-friendlier
- Moved the early payment computation on the payment term rather than the company

task-3090382

See :
Enterprise : https://github.com/odoo/enterprise/pull/36046

closes odoo/odoo#110274

Upgrade: https://github.com/odoo/upgrade/pull/4349
Related: odoo/enterprise#36046
Related: odoo/upgrade#4349
Signed-off-by: Laurent Smet <las@odoo.com>
2023-02-28 19:08:51 +01:00
wan 5125748616 [REF] account: remove chart template
Rewrite the whole chart template mechanism, removing the templates
stored in the database. The new format will mainly use CSV.

Speed up install time
---------------------

* About half of the time of installing a localization for the first time is
  taken by creating the template records. This new in code format gets
  completely rid of this.
* Creating the template records could often not be done in batch because
  of parent/children relations.
* The instanciation of the accounts on the company has been entirely
  reworked too, by
  - optimizing the order of creation of records to avoid UPDATE queries
  - using precomputed fields to avoid UPDATE queries
  - updating the translation in batch
  - deactivating logging in the chatter
  - avoiding access rights checks by checking the rights at the start

Overall, when installing a chart template for the first time, it is 4
times faster because half of the time spent on saving the template in
the database is not done at all anymore, and the instanciation on the
company is more than twice as fast.

Reduce technical debt
---------------------

There is no need to synchronize the templates with the real records
anymore. No need to use hooks to copy the data from one to the other.

It is easier to change a template in a stable version, which can often
be necessary due to legal reasons (i.e. a change of tax rates, reporting
tags,...)

Two modules have been removed:
* `l10n_generic_coa`: since there is nothing left datawise in this
  module, it can be integrated in `account` for free. It is just code
  and CSV.
* `l10n_multilang`: the fields that this module modified to be
  translatable are now always translatable:
  - there was an issue when updating modules that deleted all the
    translations because the fields were not translatable at some point
    during the loading of the registry, then they because translatable
    again but lost all translations because of the column type change.
  - most devs are not able to understand all the languages needed for
    all the localization available. Therefore, english has been added in
    the sources in most localization to understand better issues while
    debugging.
  - no need to call post init hooks anymore, doing the sync with the
    templates.
  - more: see "Translations" section

Because most of the data is now in CSV, it is also easier for product
owners to edit, audit, modify files themselves, removing one layer
during trivial development processes when only data should be changed.

More flexibility for declaration
--------------------------------

The data declaration can now be done easily in python or CSV.
A nice feature is that you can declare everything at once, even for some
more complex chart of accounts:
* if you have to set default taxes on accounts, would need to
  - declare the accounts because accounts are required on the taxes
  - declare the taxes
  - declare the taxes to put on the accounts
  This would lead to scatter information in multiple files. Now,
  everything can be declared in the same place and the loading of the
  chart of accounts will do the 3 steps automatically.
* if you have a relation of child/parent, you would first need to
  declare the parents then the children, and the loading would not be
  efficient because done one by one. Now, everything is done in batch
  automatically without having to think about it.

It is also easier to update fields on records where there was no field
for that on the templates, like
* setting a restriction for journals on accounts
* setting specific values on the company
* modifying journals and linking them easily by using the xml_id instead
  of having to compute it manually

Translations
------------

Some countries have multiple languages (i.e. Belgium uses officially
French, Dutch and German, and the CoA also has an official English
version) and we must support the languages in all these countries.
All these translations are known, and hard coded without using out
translation platform (Transifex). We also like to have the English
version (even if an official one doesn't exist) so that support can be
done more easily in databases using chart templates in other languages
(especially using a non roman alphabet).

Because the translations were not on Transifex for these records, it was
really hard to maintain: the translation templates (`.pot` files) were
not easy to extract as the automatic export would give values mixing
both the CoA and the menuitmes, the fields' strings,... But we don't
want to translate the CoA as we already know the value.
Managing the translations in the `.po` files was also annoying:
- it is easy to forget that the translations need an update too
- it requires a special editor, special terminal commands that everyone
  is not familiar with
- it is easy to make mistakes in the source string

The new format is the following: `field@en_US` where `field` is the
translatable field (usually `name`) and `en_US` is the locale code.
This allows to have the whole declaration on one line, everything in one
file. It also makes the process easier when debugging: instead of
searching for the translation in the `.po` files, it directly appears
next to the configuration of the account/tax/... .

Update of the code
------------------

The code can be updated using this script
https://github.com/william-andre/transform_coa
Forward ports can be managed too by stashing/resetting/checkout the new
modules or the changes in the modules updated in the same PR.

task-2687567

Part-of: odoo/odoo#110016
2023-02-17 19:30:40 +01:00
Thibault Delavallée 28b4ba4049 [IMP] mail, various: allow to link multiple reports to templates
RATIONALE

Improve usage of composer in comment or email mode: support batch-posting in
comment, support more configuration from templates, improve global model.

SPECIFICATIONS

Update report_template field on template model to be a many2many field instead
of a many2one. It allows to attach multiple dynamic reports to a given template
instead of being limited to a single one.

Name should now come from the report itself, which should be considered as
complete by itself. Template cannot override report naming anymore.

Task-2868153 (Mail: Allow multi reports in mail templates)

Part-of: odoo/odoo#99482
2023-01-17 20:58:40 +01:00
Nicolas (vin) d39396c728 [IMP] account,l10n_*: remove company currency symbol in reports
There is a lot of use case where reports are exclusively in the company
currency, or have columns only in this currency. In these case, showing
the currency symbol is redundant, takes space and makes the reading
slower.

With this change, we will avoid displaying the symbol in a variety of
use case where it is not needed.

Task id #2868674

closes odoo/odoo#109666

Related: odoo/enterprise#35671
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-01-17 19:55:50 +01:00
Dossogne Bertrand 7c4da16b59 [IMP] mail, various: improve mail template usability
Allow our users to modify mail template more easily

- make the list accessible from the settings
- give them a link to update relevant views to update header/footer
- make the list and form of templates more readable
- add a description on templates, allowing to describe their usage

In order to better filter templates, a new category field is added that
is computed based on active flag, description being set and the template
having an xml ID. Master templates are active, with a description and an
xml ID.

Update master data to add description on some templates.

task-2944770

closes odoo/odoo#101730

X-original-commit: dfa867343ee8842f3f127ac62584fd471b41dde1
Related: odoo/enterprise#32079
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-04 09:55:46 +02:00
Stanislas Gueniffey 520f50c125 [IMP] account: add payment term with early payment discount to demo data
closes odoo/odoo#101107

X-original-commit: 99c61033124fde28a767e78b936823ef643612f5
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Stanislas Gueniffey (stgu) <stgu@odoo.com>
2022-09-26 13:41:50 +02:00
John Laterre (jol) 5f66c57389 [IMP] account_reports,l10n_*: create abstract model for custom reports
In Reportalypse, custom reports use fields to refer to functions
allowing customizing different behaviors of the engine.

With this, all account.report models contain all the functions
of all the custom reports, leading to possible name clashes
if the functions aren't properly prefixed.

We can improve that a little: instead of having multiple fields,
we use but one, referring to an AbstractModel inheriting
from a new AbstractModel called account.report.custom.handler.

This AbstractModel simply contains the different functions
that can be overridden, and its subclasses are responsible to do so.

In the code, instead of calling _get_custom_report_function,
we check whether there is a custom handler for the report,
and call the right function on it.

task-2954761

closes odoo/odoo#98973

Related: odoo/documentation#2673
Related: odoo/enterprise#30777
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-09-09 12:16:58 +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
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
aliya 26b2472f49 [IMP] account: refactor account types
Task: 2856281

- Remove user_type_id, account.account.type model, internal_type
- Add account_type that is a simple selection field
- Move internal_group and include_initial_balance to account.account
- Because of these changes, type_control_ids on account.journal is also removed

closes odoo/odoo#93212

Related: odoo/documentation#2223
Related: odoo/upgrade#3595
Related: odoo/enterprise#28205
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
2022-07-08 19:52:15 +02:00
Stanislas Gueniffey 564af98969 [IMP] account_move: recurring entries
Recurring entries are created using the 'auto_post' selection field
- 'no' for regular entries
- 'at_date' for non-recurring auto-posted entries
- 'monthly', 'quarterly', 'yearly' for recurring auto-posted entries

Auto-posted entries can also be posted manually.
For recurring entries, the next one is  created upon posting.

See : odoo/enterprise#27798
See : odoo/upgrade#3543

closes odoo/odoo#92348

Task: 2855545
Signed-off-by: William André (wan) <wan@odoo.com>
2022-06-07 12:11:29 +02:00
Fabio Barbero 1356a490e1 [IMP] digest, *: show pictures stored on Odoo
Purpose
=======
Pictures from the digest emails are currently stored on the database
itself, meaning that if the database expires (e.g. after trial expires) all
pictures from previously sent emails won't be visible.
This is an issue since digest tips are meant as a marketing tool to bring
people to Odoo after trying a database.

Digest pictures are now taken from Odoo's server
(https://download.odoocdn.com/digests) so that the pictures will still
be visible after the database has expired.

From this commit onwards, it should not be allowed to change a digest
picture with the same name (to display a gif of a newer version), since
all databases with previous versions would receive pictures of a version
that does not correspond to theirs.

This also means that everyone client's Odoo  server will contain pictures
that are never used. This could be fixed if Odoo stored them somewhere
else and didn't make them dependent from the git repository.

Task-2372195

closes odoo/odoo#87343

X-original-commit: 35157677a2a63a2559a72aff21e62e23a3c671a2
Related: odoo/enterprise#25654
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-29 00:08:59 +02:00
Florian Charlier 332bfade6e [FIX] mail: adjust emails design
Improve the design of SO/PO/INV mails together with the other changes of the
release, i.e. fixes a few imprecisions introduced by odoo/odoo#82167.

In particular, these changes enforce
* a responsive, mobile friendly layout tested on many devices and OS
* more generally, a consistent styling. Note that some redundancy in directives
 is required for compatibility across email clients.

Translation files are included.

Task-2751139
Follow-up of Task-2712450
See odoo/enterprise#25154

closes odoo/odoo#86494

X-original-commit: 4914127b428802d2ff2e15351238a3ffef24b9cc
Related: odoo/enterprise#25306
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-16 13:16:46 +01:00
Thibault Delavallée bf6c805b66 [FIX] mail, *: add signature in email layouts only if requested and set
* = account, purchase, sale

Purpose of this commit is to add signature only if really asked. A variable
is available for that purpose (``email_add_signature``, recently renamed from
``add_sign``). We also correctly check signature is not void or pseudo-void
using tool ``is_html_empty``. Indeed editor may generates pseudo-void content
like ``<p><br /></p>``.

As signature is not added when a template is used (see composer code) we ensure
it is defined in mail templates used in "Send by email" flows. Indeed we cannot
know if a template already has a signature or not. To avoid having twice a
signature no signature is added in email notification layout when a template
is involved.

Continuation of odoo/odoo#76418 .

Task-2712450 (Mail/Sale: Improve 'Pay Now' notification template)

Part-of: odoo/odoo#82167
2022-01-31 17:47:33 +00:00
Nicolas Bayet 4813f42997 [IMP] mail,*: replace jinja with qweb
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment

By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).

There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).

We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.

To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.

This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
  (for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
  in order to see only one at once
- a floating select input to switch visibility of a particular logical
  branching

Task-27033

X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
2021-09-28 23:42:54 +00:00
Thibault Delavallée 1766e0147d [MOV] various: reorganize templates into their right files
Purpose is to have all mail template into a mail_template_data.xml file
when possible. It eases maintenance and update when having to work globally
on template records.

Also update some ``body_html`` declarations still using ``xml`` instead of
``html``.

Task ID-2534550 (Template usage improvement)
Task ID-2477164 (Composer mixin)
Prepares Task ID-27033 (QWeb in templates)
COM PR odoo/odoo#70889
ENT PR odoo/enterprise#18352
2021-06-01 09:19:45 +00: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
Thibault Delavallée da1f3d3ce4 [MOV][IMP] account: reorganize qweb / jinja templates used for mailing
PURPOSE

Clean organization of templates in odoo apps: mail.template records in data,
qweb templates (views) used directly in code, notably using post with view.
Purpose is to ease future improvements in posting based on templates.

SPECIFICATIONS

  * move those templates in their own file to ease their discovering and
    maintenance;
  * put them into data (as those are not views even if it contains qweb)
  * guidelines are now :

    -> Qweb templates should be in data/mail_templates.xml;
    -> mail.template records should be in data/mail_template_data.xml;

  * put their declaration in no update when not done if template has no
    technical code or complex dependency on underlying code;
  * move found mail data (mail.message.subtype or mail.activity.type) records
    in a mail_data file that should contain only "core" records linked to mail;

LINKS

Task ID-2375767
COM PR odoo/odoo#61814
ENT PR odoo/enterprise#14775
UPG PR odoo/upgrade#1936
2020-11-25 12:31:09 +00:00
IEL 3c7694b409 [FIX] *: fix image parsing error on saving res config
WHAT: apply 93a7695f65baf00d1f82481d6a2a97e6c11940a8 for all res.config.settings
menus

WHY: the same reason as in 93a7695f65baf00d1f82481d6a2a97e6c11940a8:

	When saving, a read is called. By default, read has
	bin_size to true to avoid performances issues.
	It will return the image size instead of the content

it may lead to image dissapearing or "Incorrect padding" error

HOW:

    find . -iname "*.xml"|xargs grep "\"context\".*'module'" -l | xargs sed -i "s/\(\"context\".*'module'.*\)\}/\1, 'bin_size': False}/"
    git checkout  -- addons/base_setup/views/res_config_settings_views.xml

---

PR for General Settings: https://github.com/odoo/odoo/pull/47297

opw-2346644

closes odoo/odoo#61215

X-original-commit: 7c55efa88b72bd1f3f0f32f7f738e2fda5aa4abd
Related: odoo/enterprise#14547
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-11-02 18:25:20 +00:00
Laurent Smet 325af9e412 [FIX] account,*: Manage 'in_payment' state correctly
closes odoo/odoo#60951

X-original-commit: 0a83aa2d6811c3638db151991938473a892c5452
Related: odoo/enterprise#14473
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-29 10:05:55 +00:00
e3069655d3 [FIX] account, mail: properly evaluate and clean xml context
Before this commit, there were some traceback while performing
several actions due to context that was not properly evaluated.

This commit fixes those traceback by evaluating the context and
thus enabling user to perform those actions without traceback.

We also clean some badly-configured email actions in accounting.

Task Id : 2302572
PR #56501

X-original-commit: 71a39c6650e18b71a212bf21150fece683ae01c7
Co-authored-by: D J <dja@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-09-29 10:28:18 +00:00
Anousone Phaysomphot 1b67e2ed17 [IMP] account: add new digest tips
PURPOSE

Review the tips and digest layout design to make sure they have a WOW effect
and increase trial conversion/retention.

SPECIFICATIONS

“No need to print, put in an envelop and post your invoices”
See code for specifications.

LINKS

Task ID-2274264
COM PR: odoo/odoo#53580
ENT PR: odoo/enterprise#1139

X-original-commit: 58bcc8c3c509df9e3774369ac1a626d528eba598
2020-08-12 12:22:58 +00:00
Xavier Morel 6835aeb0de [REM] core, *: deprecate <act_window> and <report>
Convert deprecated tags through the codebase.
2020-07-28 13:03:13 +00:00
Benjamin Frantzen (bfr) f81c83153e [FIX] l10n_se_ocr, account : renamed old reference to invoice_payment_ref to payment_reference
closes odoo/odoo#54735

X-original-commit: a44db615d1fa6443810e88cc55471aff110c1393
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-07-22 06:37:26 +00:00
Andrea Grazioso (agr-odoo) ce3c7d8714 [FIX] account: change composition mode to allow multi send
Go to Payments view
Select multiple confirmed payments, click on Actions>Send receipt by
email

Only for the first payment will be sent an email.
This occur because in composition mode 'comment' (the default)
mail composer sens the mail to a single record
Adding a duplicate action to handle multi send
Updating translation accordingly

opw-2278971

closes odoo/odoo#54108

X-original-commit: 11fd7687047b2c17e9464e8415087d9a9fcf58a8
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-07-06 09:09:59 +00:00
Josse Colpaert 4bbc666cae [IMP] account: put payment reference in invoice mail
Before, only when you had installed the Belgian
structured communication module, when you sent an
invoice by mail then only the structured communication
would be added in the mail.

But it should be visible all the time when
you have a payment reference.

closes odoo/odoo#52618

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-06-08 14:05:36 +00:00
Laurent Smet caeb782841 [IMP] account,*: Improve bank statements/payments workflow
- Create journal entries as soon as bank/cash statement lines are created, temporary booked on a suspense account set on the journal.
- Simplify the management of "blue" lines in the reconciliation widget. A "blue" line is now a journal item using a temporary liquidity account (outstanding payment/receipt accounts, set on the journal).
- Adapt and simplify the bank reconciliation report.
- Remove the bank reconciliation threshold date. The reconciliation report will show the not already reconciled journal entries using a liquidity account and the not already reconciled journal entries using a temporary liquidity account. Without accounting, an account.payment will involve directly the liquidity account and then, will be considered as a statement line directly.
- Remove the post_at bank reconciliation feature. The "paid" state will be set on the invoices only if reconciled with a journal entry involving the journal's liquidity account.
    With invoicing, the payment will do that so the "in_payment" state should never be shown up.
    With accounting, only the statement lines have the power to move an invoice to the "paid" state.
- Fix various corner cases about the management of multi-currency in bank statement lines.
- Fix the conversion dates in multi-currency: Since the bank/cash is always used on the statement lines, it will use always the real "bank" date instead of the fictive payment one.
- Ensure the 'reconcile' method will raise an error if the involved moves are not posted.

related enterprise PR odoo/enterprise#7019

closes odoo/odoo#41301

--task: 2092096
Related: odoo/upgrade#1018
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-10 09:47:24 +00:00
Mitali Patel b47aa1b005 [IMP] account: update incoterms list
Purpose of this commit is to update incoterms list
base on new incoterms guidlines and add incoterms in RFQ/PO
and invoices/venderbills reports

task-2179236

closes odoo/odoo#43883

Related: odoo/upgrade#922
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-17 13:01:57 +00:00
mcm-odooandThibault Delavallée de1743ab12 [REF] mail, various: remove user_signature field from mail.template
RATIONALE

Mail template model holds a field telling odoo mail engine to automatically
add the current user's signature to the body. Its use depends on the use
case

  * using the template in the composer on a single record: it is displayed
    in the rendered template in the composer, meaning people could change it.
    This behavior is interesting as it allows to see the email content;
  * using the template in the composer in mass mail mode: it is not displayed
    as only the raw jinja is displayed. It is therefore not obvious that it
    will be appended to the body of the mail. People could add it manually and
    have 2 signatures as a result;

A mechanism automatically adding a signature to sent emails when posting a
message is already implemented and is based on template existence. If a
template has been used when posting, no signature is added in sent emails.
Otherwise it is automatically added. This behavior should not change.

Behavior will therefore be

  * use a template -> specify signature usage in it manually through jinja;
  * do not use a template -> signature added in sent emails;

SPECIFICATIONS

Remove user_signature.

Update template body accordingly. In customer oriented templates that are using
it and do not already contain it, manually add a call to user.signature within
the jinja code. When set to False, just remove its declaration.

Quickly clean some signature integration.

LINKS

Task ID 2089252
Community PR odoo/odoo#39482
Enterprise PR odoo/enterprise#6459
Upgrade PR odoo/upgrate#761

Related: odoo/enterprise#6459
Related: odoo/upgrade#761
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-02-11 14:01:13 +00:00
wan d8c5cc1335 [IMP] account: add a readonly group
Task 2092079
Accounting firms that want to give access to their customers avoiding
mistakes and risks will love this profile that can't do anything
wrong... Maybe as well as companies auditors..?

closes odoo/odoo#39860

Related: odoo/enterprise#6576
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-22 11:23:16 +00:00
oco-odoo 8e4158af81 [IMP] account: add 'partial' and 'reversed' payment states to invoices
- 'partial' payment state corresponds to invoices whose payable/receivable move line has been partially reconciled with some other line.

- 'reversed' payment state corresponds to entries that have been cancelled by the creation of a single reverse entry (using the dedicated button on the form view). This state can be set on invoice as well as on regular entries.

=> To stay consistent with the naming conventions, this commit also renames invoice_payment_state field to payment_state, since it's no longer only applicable on invoices.

closes odoo/odoo#41723

Related: odoo/enterprise#7202
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-01-16 18:04:26 +00:00
qdp-odoo fd5264c5a5 [REV] account: reverts tags of the Indirect Method Cash Flow
This reverts commit 4f524dbad6 that was merged with PR #36206.

Those tags are unused, were added in account module by mistake (could maybe be acceptable in a l10n_xx module) and were rejected in master (at PR #35522) because of https://github.com/odoo/enterprise/pull/5052#issuecomment-540456794...

closes odoo/odoo#40575

X-original-commit: ed981b02fe2cd000c53f1f995b31c3860e0781c3
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-11-20 15:47:36 +00:00
Christophe Simonis 0f6d2a42ca [FIX] account: remove duplicated record definition
closes odoo/odoo#38333

X-original-commit: aab017f1489b8c966b9de1f8c900f7cb9eab0656
Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-10-10 06:33:54 +00:00
wan efd97b7ea0 [IMP] account: review the hierarchy of account type selection
* Add an equity section inside the balance sheet
* Divide profit and loss into Expense and Income
* Reorder the Expense and Income types

closes odoo/odoo#36599

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-09-10 09:11:35 +00:00
Humberto Arocha 4f524dbad6 [IMP] account: Adding Accounting Tags for Indirect Method Cash Flow 2019-09-03 15:08:33 +00:00
mcm-odoo d4710d92dd [IMP] account: add payment terms to data
- This commit moves the Payment Term "End of Following Month" from
  demo data to data and adds two new Payment Terms: "21 Days" and
  "30% Now, Balance 60 Days".
  It allows the customer to define less Payment Terms

task-2032586
2019-08-29 11:49:17 +00:00
wan 5aeec0c3dc [IMP] account: Hierarchy in account type selection field
Task 2041865

We want to show a hierarchy to ease the account type selection (hack in the select widget)
BALANCE SHEET
ASSETS
Fixed Assets
Non-current Assets
Current Assets
Prepayments
Receivable
Bank and Cash
LIABILITIES
Equity
Current Year Earnings
Non-current Liabilities
Current Liabilities
Credit Card
Payable
PROFIT & LOSS
Income
Other Income
Expenses
Cost of Revenue
Depreciation
OTHER
Off-Balance Sheet

closes odoo/odoo#36170

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-29 15:07:47 +00:00
wan 1576c91c9a [IMP] account_reports: add off sheets acount type
Task 1998268

closes odoo/odoo#35150

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-21 14:28:19 +00:00