Fixes a large number of cases where strings are translated then
formatted, instead of letting `_()` do the formatting internally,
which allows it to recover from incorrect translations (missing,
broken, or extra placeholders).
Also
- removes translation markers entirely when there's nothing to
translate e.g. `_("%s - %s")` is not useful
- fixes a few messes which lead to only partial translatability
(DRY is generally a bad idea when translations are involved, even
more so when you don't make the variable part translatable)
- fixes a few nearby issues noticed at the same time
- replaces a few `"%s"` by `%r`, which should automatically quote
strings relatively appropriately
- fixes translated strings which use `\` to escape a newline (in order
to fill-paragraph): `\` escapes only the newline, if the
continuation string is indented this results in a bunch of spaces
ending in the string to translate, which is pretty garbage for the
translator, using implicit concatenation works much better
Note: some of the updates revert f-string parameters to %, because
babel (2.9) apparently has trouble with f-strings and blows up trying
to extract them.
Not in scope:
Helping translators fix translatable strings e.g. any translation
string with more than one placeholder probably should use keyword
placeholders
- Provides more context / data to the translator to make sense of the
sentence.
- Allows reordering the translated terms, which can be necessary
depending on the sentence and language.
closesodoo/odoo#139314
Related: odoo/enterprise#49311
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This SIRET is valid according to `stdnum` but does not correspond to any
existing company.
closesodoo/odoo#138008
X-original-commit: 283e12353008812787711a664c3bc700b6f8982d
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
Problem
---------
In master, XML attributes have been modifed from attrs={'invisible':...}
to invisible=. During the conversion, the condition where not properly
cleaned up.
Objective
---------
Clean up the XML attributes.
Solution
---------
Reduce conditions by removing unecessary elements:
- `fiscal_country_codes` always returns at least an empty string.
- All country codes are in capital letters, no need to `lower` them.
task-3493124
closesodoo/odoo#134329
Related: odoo/enterprise#46920
Signed-off-by: Josse Colpaert <jco@odoo.com>
The default taxes for most localisations have been left undefined by
default. When loading the chart template, the model generally selects
the first sales and purchase taxes, based on the order in which the
taxes appear in the csv, for the default sales and purchase taxes
respectively.
This behaviour can be confusing to those who are not yet familiar with
it. It has been decided that it is preferable instead to specify the
default tax in _get_*_res_company function on the account chart template
model, such that the default taxes are defined explicitly for every
localisation.
task-3453997
closesodoo/odoo#130733
Related: odoo/enterprise#45531
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
In the taxonomy PR: odoo#114638, we changed the
name of the taxes but the description wasn't modified so the users have
difficulty understanding what the codes means. In this pr, we added a
description in english and in french so that people can have a better
understanding.
closesodoo/odoo#130996
Task: 3398682
X-original-commit: ea85cae2275fde939e63eebed73d3453c6b9dcd9
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
Allow sharing records between company
* accounts
* taxes
* fiscal positions
* products
* ...and some related models
These records can be read and used in children companies.
This can be used to
* have different branding for different businesses
* allow more complex security rules
* consolidate branches differently
* manage different tax reports with different tax ids in the same
country
task-3371677
closesodoo/odoo#125642
Related: odoo/enterprise#43215
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
In the translation PR (odoo/enterprise#35296), we translated the tax group and invoice label
but for the invoice label we didn't added to translation it needed to have.
This commit fix that.
Task: 3369579
Part-of: odoo/odoo#125017
French tax reports require that each line is rounded to the nearest euro.
This requires that a line is added to the closing entries to account for the
differences from rounding. The line requires a couple of default
accounts for the profit/loss from rounding to be applied.
These accounts for profit/loss are by default 758000/658000 and are inherited in the
chart of accounts for l10n_fr (you will only need them if you're doing
french tax reports). The fields are also added to res_company for
l10n_fr, non french companies can still file french tax reports, so if
they are filing french tax reports without these accounts then they'll
need to specify them in settings
This commit also adapts the subformula of the carryover line on the tax
report to round the final value, this means that a rounded value will
persist between periods.
task-2610752
closesodoo/odoo#75634
Related: odoo/enterprise#20245
Signed-off-by: Josse Colpaert <jco@odoo.com>
Steps to reproduce:
- create an invoice with a certain number of items so that when printed there are multiple pages
Issue:
- the invoice name does not appear on each page
According to the French legislation it is mandatory
See https://entreprendre.service-public.fr/vosdroits/F31808
Solution:
- set a config parameter specifically for l10n_fr in stable
- set it in account directly for Master
To allow the footer of the invoice to contain the name (and therefore the number) of the invoice
opw-3199906
closesodoo/odoo#124989
X-original-commit: 7b071c995f1c9587cf4de56d6d1a632ea39db8ac
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.
This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).
closesodoo/odoo#121629
Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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 taxes names so that it's more clear for users
closesodoo/odoo#114638
Task-id: 3052677
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Removing external links from localization manifests and redirect to our own documentation. Ensure that users can learn about our standard localization modules from a source of information that we have authorship on.
closesodoo/odoo#117005
Task-id: 3248632
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
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
A lot of the separate files were kept up to now because it made the
process easier while applying the script to rebase.
The files can now be merged.
Some code is also cleaned by using CSV instead of a python dict.
Part-of: odoo/odoo#114164
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
This is mostly a cleaning/refactoring change.
The current API for init hooks (pre, post, uninstall) is to pass
`cr, registry`.
But the first thing which was done by most
post init and uninstall hooks was to create an env using
the cr passed
e.g.
`env = api.Environment(cr, SUPERUSER_ID, {})`
and the `registry` argument was unused in all these hooks,
completely.
By changing the API of hooks to pass `env` instead
of `cr, registry`, we gain in average two lines in every
hooks:
- the line creating the env `env = api.Environment(cr, SUPERUSER_ID, {})`
- the line importing `api` and `SUPERUSER_ID`
Therefore removing ~250 lines of repeated code lines accross odoo/odoo and
odoo/enterprise.
In addition to these lines removed,
it also ease the API of init hooks for Odoo developers,
who are used to that `env` and not so much how to create an `env`
from a cursor.
Part-of: odoo/odoo#108254
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 #2868674closesodoo/odoo#109666
Related: odoo/enterprise#35671
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
This will allow to get the latest taxes.
closes odoo/odoo#109222
Task: 3111528.
Related: #84918, #107158
X-original-commit: 521c80477f9a664bb732ec54d18bdcf1b828072b
Signed-off-by: William André (wan) <wan@odoo.com>
The French localisation was written in french which was wrong, all the localisation have to be written in english and then translated back to the native language thanks to PO files.
Thanks to this PR, all the french localisation has been translated.
closesodoo/odoo#108816
Task-id: 3112366
Related: odoo/enterprise#35296
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Many country-specific fields were displayed while a company with another country was selected (in case of a multi-company environment).
These country-specific fields are now visible only if one of the selected companies with said country is selected.
closesodoo/odoo#106221
Related: odoo/enterprise#34226
Signed-off-by: John Laterre (jol) <jol@odoo.com>
A. UX Improvement:
1. get rid of the `.0%` in the tax names (makes the UI a bit harder to read)
2. For TTC taxes, remove the TTC in the description to prevent it from appearing on the invoice's pdf
B. Tax issue:
Fix some mistakes in the taxes, based on reliable feedback of french partner Didier Six.
1. Fuel purchase taxes: shouldn't imact the P1_base and P1_tax grids because these are for petroleum product to sale.
Instead, put them in grid 20 (normal goods bought)
2. All tax "IMPORT":
- base line shouldn't impact the [{08/09/9B}_{base/tax}] tax grid as these are for sales operation in France and the [I{number}_{base/ tax}] are already there
Currently, the tax is putting up [{08/09/9B} _tax] and [Ix_tax] which induce a double calculation of the due VAT
- tax line should also impact the [24] `24 - Dont TVA déductible sur importations` in addition of the [20]
This tax grid isn't taken into account for the total deductible VAT calculation as it is after the total and label "dont TVA déductible[...]"
4. OSS: add the tax grid E3 on invoice base line and F8 on refund base line
task-3087037
closesodoo/odoo#107351
X-original-commit: 0cea284eec5d3d2bb9aa8d94c0edcb211ba08a50
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
In the 2022 Tax report, box 16: 'Total de la TVA brute due (lignes 08 à 5B)'.
The formula is missing tags P1, P2, I1 to I6.
opw-3036679
closesodoo/odoo#106948
X-original-commit: 67a4538e4c9ff3c2df895dfd43843154af728997
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Due to the deprecation of t-esc to the unique use
of t-out in the rendering template, this replace
every usage of it and ensures everything continues to
work as inteded. Removing deprecation warnings
polluting terminal
deprecation commit: odoo/odoo:9ce5bc8881ae06b613ef61eb07453b224f62bae6
closesodoo/odoo#103731
Related: odoo/enterprise#33037
Signed-off-by: William André (wan) <wan@odoo.com>
This commit cleans the tax groups:
- it removes the negative tax groups
- it makes sure that there is only one tax group per tax rate
- all the taxes with the same rates are attached to a single tax group
This commit splits the taxes to make the distinction between the goods and services.
In addition, the fiscal positions are also updated accordingly (make sure to map to another
one having the same scope: goods/services and type: sale/purchase).
These changes are based on the reliable feedback of LPDE (Didier Six). No tax were removed
from the old version. Only some were split, the others were kept (but modified).
In addition, the tax report is updated to the 2022 version and the new tax report lines
are linked to the taxes.
task-2674047
closesodoo/odoo#102749
X-original-commit: a4c5171e1a79242bba201affba9d94bb9e137e94
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
The early payment cash discount functionality was merged in 16.0.
This PR allows for the behavior to be as localization specific as possible.
This concerns :
The tax computation (some countries leave it untouched after the discount, some countries discount it, and Belgium has a mixed behaviour)
The account in which the cash difference resulting of the cash discount should be put.
task- 2983913
related to #99572closesodoo/odoo#102032
X-original-commit: 591757902dcdf1e3609d9c5ae23e2b134ee8e4da
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
Following reportalypse, reorder the menu items in order to bring
some consistency to the report menu.
Also clean the menu items by removing all the menu items no longer
used since most reports are now selectable by going on the generic
reports and then switching to localized ones.
Task id #2965755closesodoo/odoo#99210
Related: odoo/enterprise#30854
Related: odoo/upgrade#3831
Signed-off-by: William André (wan) <wan@odoo.com>
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
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
closesodoo/odoo#93212
Related: odoo/documentation#2223
Related: odoo/upgrade#3595
Related: odoo/enterprise#28205
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Steps to reproduce:
- install l10n_fr, account_accountant
- generate an invoice with tax "TVA 0% autres opérations non imposables (vente)"
- Got to Accounting > Reporting > Tax Report
Issue:
The last invoice would appear in the 02 "Autres opérations imposables" meanwhile it should appear
in the Autres opérations non imposables
Solution:
Change the base data to fit
opw-2882543
closesodoo/odoo#94613
X-original-commit: f18d99699d37dc5c67f3cdae98d70865db0d8282
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
To find the 'country_code' field.
closesodoo/odoo#90255
X-original-commit: 980b7d09f63de17651e27d06170c8265530b99b1
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Every tax should have at least one tax line.
closesodoo/odoo#86158
X-original-commit: 0d1bb4718de1c797798bf52d8730b6ebce97793a
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.
Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)
closesodoo/odoo#84280
Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
While updating financial reports to help avoid misconfiguration,
slightly update the coa to fix some wrong account types or name.
Tax id #2585627closesodoo/odoo#83268
Related: odoo/enterprise#19835
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
These negative tax groups were removed in a previous commit:
1687248
The message of the previous commit was:
Remove the negative tax groups from account_data. The negative tax groups have no application. The taxes that were in the negative tax groups are reassigned to their positive counterparts.
The previous commit was accidentally overwritten in a forward-port:
odoo/odoo#77295closesodoo/odoo#76586closesodoo/odoo#80240
Signed-off-by: William André (wan) <wan@odoo.com>
Steps to reproduce:
-In a database with french accounting,
- The fields cash_basis_transition_account_id and invoice_repartition_line_ids are not well configured
opw-2669061
closesodoo/odoo#80229
X-original-commit: 17b9a2046502fffd9a21d6da3fff82a7dae54256
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Guillaume Vanleynseele <guva@odoo.com>
"account_tax_group.xml" and "account_data.xml" data files
have been renamed to "account_tax_group_data.xml"
when containing only tax groups, for compliance with the standard.
AE, AR, AT, BE, BO, BR, CA, CN, CR, CZ,
DE SKR03, DE SKR04, DO, ES, FI, FR, GR,
GT, HN, IL, IN, LT, MA, MX, NL, NO, PA,
PL, PT, RO, SG, SY, TH, TR, UA, UY, VE,
VN.
Part-of: odoo/odoo#77295