Commit Graph
41 Commits
Author SHA1 Message Date
Maximilien (malb) e28a9a74a3 [IMP] l10n_mx: UI clean up
This commit aims at changing a tooltip

Task: 3270458
Part-of: odoo/odoo#134617
2023-10-20 11:22:01 +00:00
Julien Van Roy cdd29dfe98 [IMP] l10n_mx: add l10n_mx_tax_type on tax
Add a selection field `l10n_mx_tax_type` on account.tax. This field is
used in the CFDI attachment. This allows to avoid relying on the name of
the repartition line tags to export and import a CFDI.

task-3388347

closes odoo/odoo#135215

Related: odoo/enterprise#47321
Related: odoo/upgrade#5136
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-20 13:03:07 +00:00
Daniel Kosky (dako) 084408a9bb [FIX] l10n_*: set default taxes
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

closes odoo/odoo#130733

Related: odoo/enterprise#45531
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-08-17 18:42:46 +02:00
hupo-odoo a4583a1aa6 [IMP] l10n_{mx,ua,in,dz,ma}: activate default setting
For Mexican localization, activate by default the setting display_invoice_amount_total_words for the Mexican localization. As this localization uses its own amount to words function, the related commit enables an override of the generic function to use it correctly with Mexican localization.

For the other mentioned localizations (ua,in,dz,ma), the setting was already activated but overriding the create method was not a proper way of doing.

task - 3367243

closes odoo/odoo#124909

X-original-commit: 6ee9842764e0b1244927cb8ece1f6407ccec20d5
Related: odoo/enterprise#42510
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: hupo-odoo <hupo@odoo.com>
2023-06-14 10:54:24 +02:00
william-andre 8e6a3d7269 [REF] l10n_*: clean code
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
2023-03-06 23:34:49 +01:00
william-andre d782b8b925 [IMP] l10n_*: convert CoA in new format
Converted using https://github.com/william-andre/transform_coa

closes odoo/odoo#110016

Related: odoo/enterprise#35836
Related: odoo/documentation#3336
Related: odoo/upgrade#4276
Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-17 19:30:40 +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
Andrea Grazioso (agr-odoo) a4331a7c62 [FIX] l10n_mx: add missing account tags
Install MX CoA
"Cash" and "Bank Suspense Account" are missing the tag
"Transferencias bancarias moneda extranjera" account is using the wrong
tag

opw-3033611

closes odoo/odoo#111273

X-original-commit: 4860a77a51f72bbb51b435766733b3c0a74c9a32
Related: odoo/enterprise#36422
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-01-30 09:39:37 +01: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
william-andre beb6e17066 [FIX] account: remove dead code complete_tax_set
This field was used in version 9.0 [1] to allow users to select their
tax rate, but it was removed in version 12 [2]

[1] https://github.com/odoo/odoo/commit/c04065abd8f62c9a211c8fa824f5eecf68e61b73
[2] https://github.com/odoo/odoo/commit/87f0d2eefb77bfc6a9a0fa7f7dcd1475c7c34639

closes odoo/odoo#80185

Related: odoo/enterprise#22441
Related: odoo/upgrade#3057
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-03-31 17:24:55 +02:00
Nicolas (vin) 008ef45e91 [IMP] l10n_mx: set tags on suspense and outstanding accounts
Set a default tag on the bank suspense account, outstanding accounts
and transfer accounts so that they are found and used by the trial
balance and COA reports.

TAsk id #2612900

closes odoo/odoo#82532

Related: odoo/enterprise#23383
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-01-25 19:07:03 +00:00
Ivan Yelizariev 2d8a80d574 [REM] account,l10n_*: delete dead code about transfer account
`_prepare_transfer_account_for_direct_creation` is not used since https://github.com/odoo/odoo/commit/04522f01e6fdbf82a657b32b312449fd7d756f79

closes odoo/odoo#79520

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

closes odoo/odoo#68349

Related: odoo/upgrade#2322
Related: odoo/enterprise#17299
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-04-01 12:09:20 +00:00
Adrien Widart 567f192d98 [REV] l10n_mx: prevent MX from printing receipts
PR #66910 has been created so the MX can print their receipts.
Eventually, this needs to be reverted since printing a receipt is
actually illegal.

closes odoo/odoo#67209

X-original-commit: 7e9261cacd9f6963dca517fe7b1f3de067af1366
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-03-04 10:33:08 +00:00
Adrien Widart 286e512ff2 [FIX] l10n_mx: allow MX to print receipts
To reproduce the error:
(Need MX configuration)
1. Go to Accounting > Customers > Receipts
2. Create a Receipt
3. Post and Print it

Error: An error message is displayed: "Only invoices could be printed."
However, MX should be allowed to print the receipts.

OPW-2456374

closes odoo/odoo#66954

X-original-commit: 0f0238c64cda308098eb5b3d30e3177cfcb4bab7
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-02-26 17:24:11 +00:00
Laurent Smet 6d03583a82 [FIX] account,l10n_: Restore journal liquidity account hook
The overrides in l10n_ modules are broken since 14.0 because the hook no longer exists.

closes odoo/odoo#61610

X-original-commit: 1fe852e032876f2f3212a43fc3115e49f4de618d
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-11-10 16:55:31 +00:00
Victor Feyens 1b67affe7d [FIX] *: avoid direct references to countries
Ensure the code works fine even if countries are deleted.

Also consider "re"-created countries after deletion, by only considering
the country code, not the data reference.

This should reduce support requests related to deleted countries, and
ease the resolution of such problems by the users themselves.

TASK ID - 2368842

closes odoo/odoo#60558

X-original-commit: 037012bc4e2935eb00a7f353529bb7ec55066733
Related: odoo/enterprise#14347
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-10-22 16:17:26 +00:00
Benjamin Frantzen (bfr) e2c6a37d32 [REF] l10n_mx_edi: Refactoring of l10n_mx_edi depending account_edi
closes odoo/odoo#52407

Task: 2247368
Related: odoo/enterprise#12226
Related: odoo/upgrade#1571
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-08-17 10:22:02 +00:00
Nicolas (vin) 41f119d532 [IMP] account: Misc. improvements
Miscellaneous changes aiming to improve the user experience in the accounting module,
mainly in the journal model and its form view.

Also aim to improve the bank account creation wizard.

Task ID: #2250349

closes odoo/odoo#54494

Related: odoo/upgrade#1546
Related: odoo/enterprise#11862
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-08-11 12:41:13 +00:00
Luis Torres cb787377b9 [IMP] l10n_mx: Completed data for Mexican banks
This module provide you a data from Mexican Bank data extracted
from `SAT Bank catalog
<http://www.sat.gob.mx/fichas_tematicas/buzon_tributario/Documents/catalogo_bancos.pdf>`_.

Additionally was added the following fields:
- ASM code in Banks: to identify banking institutions by ASM standard
- CLABE code in Bank Accounts: required to the sending and receiving
of domestic inter-bank electronic funds transfer.

closes odoo/odoo#35742

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-08-15 06:14:03 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Olivier Colson db21ef7578 [FIX] l10n_de, l10n_mx, l10n_nl: isolate account.tag creation by country
Before that, the specific account tags created in l10n modules were not only assigned when the company was in the right country.

closes odoo/odoo#29030
2018-11-26 13:17:10 +00:00
Christophe Simonis a12c4d284c [MERGE] forward port branch saas-11.4 up to a1b384d66b 2018-09-18 11:42:52 +02:00
Christophe Simonis a1b384d66b [MERGE] forward port branch saas-11.3 up to 2de573440e 2018-09-17 19:40:47 +02:00
Martin Trigaux a47f7ee0e4 [FIX] product: do not translate at code import
Defined as this, the label of the selection field were translated during code
import, when building the python model, not when a user access the field values
as it should (and is already the case thanks to the ORM).

Trying to translate a string when no user-context is available is not only
useless but may cause bug on services with multiple databases (e.g. a SaaS).

In a multi-worker environment, when the code is imported, the _ method will use
multiple scenarios to detect the language and get a cursor.

As we have no available cursor in the frame (method _get_cr from GettextAlias),
the fallback is made on the cursor of the request.
In a multi-worker environment, this could be a cursor linked to a database in
another language than English.
In such scenario, the selections would be translated in the language of the
other database instead of displaying it in English

opw-1881956
2018-09-14 11:20:38 +02:00
Toufik Benjaa 0c67985023 [FIX] l10n_de, l10n_mx, l10n_nl: bad command sent to ORM
When we get the existing tags to append them a new id, we don't get a
list of id but a list of tuple with one id, this only append if you have
more than one accounting of these country installed, as the first time
it will return an empty list. So the command sent to the ORM, is not
built correctly.

To fix this we just append commands '4' that will be append in a list.
2018-09-11 17:54:40 +02:00
Yanina (Vauxoo) 384f6a6254 [FIX] l10n_mx: bad function renaming in COA creation
_prepare_transfer_account had been renamed _get_default_bank_journals_data instead of _prepare_transfer_account_for_direct_creation, by mistake. The original renaming was made at https://github.com/odoo/odoo/commit/87f0d2eefb77bfc6a9a0fa7f7dcd1475c7c34639#diff-ce53c5491cb2c9ab3dbbd41ecabf594f
2018-08-21 10:28:08 +02:00
Olivier Colson 87f0d2eefb [REF] account, account_check_printing, payment, l10n_do, l10n_de, l10n_fr, l10n_nl, l10n_mx: chart templates installation: remove old useless wizards and move everything to account.chart.template
Was task 1858974
Was PR https://github.com/odoo/odoo/pull/25243
2018-08-07 17:11:08 +02:00
Laurent Smet 7a31a92afa [ADD] account, l10n_*: create transfer account based on prefix.
This commit changes the mechanism to get the transfer account.
As the bank/cash accounts, the transfer account is now created automatically based on
a prefix.

-task: https://www.odoo.com/web#id=35857&action=333&active_id=967&model=project.task&view_type=form&menu_id=4720
2018-05-23 15:43:39 +02:00
Christophe Simonis 66ca687324 [MERGE] forward port branch saas-17 up to ed901bedcb 2017-09-15 18:09:39 +02:00
Christophe Simonis ed901bedcb [MERGE] forward port branch saas-16 up to 80f916e8e0 2017-09-15 17:20:01 +02:00
Jose Suniaga [Vauxoo] 27edcaafd6 [FIX] l10n_mx: company in the journal cash basis configuration
When have more than one company, for all companies, the cash
basis journal  set in accounting configuration will be
always the related to first company.

This issue cause the followiong error trying to validate an
invoice for a company different to fisrt one:

'Cannot create moves for different companies.'

Because exist a 'cross-configuration' in the cash basis
journal.

The solution to this issue is include the company in domain
that does the search for cash basis journal.
2017-09-15 10:39:32 +02:00
Yannick Tivisse 781a03b2bc [IMP] res_config: Update file names, xmlids, class names according to guidelines
Now that we only have one model (res.config.settings). Uniformize everything according to the guidelines.
2017-09-01 13:03:18 +02:00
Deep Patel 898224f110 [IMP] web,account,...: Regroup settings, add a nav and search bar
Purpose
=======

Settings are often way too long and hard to scan and sometimes you don't know where to find the settings you're looking for.
By adding a left navigation, you can already have an overview of the settings, and switch easily between them.

Specification
=============

- Add a search bar on all the apps that have settings which can search results from all the installed apps.
  (If i'm on sales settings,and I search anything then it shows results from sales settings and also shows
  all the other matching results from all the other apps such as, Inventory...etc) with app name.
- Able to activate feature from the current page results (no matter if the searched result is from another apps).
- Highlight searched word in results
- Delete the sheet, have a full white background
- Add left navigation bar on setting
- Left navigation bar fixed
- List displayed based on installed apps
- On right panel, by default display current app setting and change accordingly
- [Mobile] Left navigation bar displayed on top
- Add Breadcrumb on top of the page: have the name "Settings" + Save / discard CTA + Search
- Add General Settings on the nav bar
- remove "save this page..." notif in all settings
- Delete all recommanded apps section + all checkbox that install app should disappear:
	payroll: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrSkMzWVpuZ0ZoaFE/view?usp=drivesdk
	Events: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrYXlHMHd2NTM2blE/view?usp=drivesdk
	Manufacturing: Delete Repair - Quality Control - Maintenance - Product Lifecycle Management [LAP][ok]
	Timesheets: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrdFg5XzNydkd2TlU/view?usp=drivesdk
	project: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrraWo3NE04TktwcTQ/view?usp=drivesdk
	inventory: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrQkRaVUR5ekFQYTQ/view?usp=drivesdk
	recruitment: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrbDdqLWQweF80UkE/view?usp=drivesdk
	purchase: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrRlAyUDBnb0trQWs/view?usp=drivesdk
	email marketing: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrOUZONjhvX2k3Y2s/view?usp=drivesdk
	expenses: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrR0JpN1ZpQmtxU3M/view?usp=drivesdk
	attendances: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrralpjZ1VJclNpMWs/view?usp=drivesdk
- About duplicate settings:
	Docsaway: Delete from Sales + delete Default Print Provider
	Attributs & Variants: Delete from Purchases - Manufacturing
	Multi-currencies: delete from Sales
	Unit Of Measures: Delete from Purchase & Expenses
- Add a scroll bar on the left bar when there's too many apps
- Keep the navbar visible even when you search
- Move General Settings to the bottom of the list
- Update on Settings:
    - Accounting:
        - rename automatic rates
        - Anglo Saxon Account: Should be in technical feature
        - Place Accounting Reports section before Taxes section
    - CRM:
        - Phone Validation: Enforce international format becomes
        - Local Numbers: (2 radio buttons proposals) Add international prefix / No prefix
    - Fleet: typo " ... a new car if ..." + text is too long <br>
    - project: fix tooltip for colab pads
2017-09-01 13:02:54 +02:00
Yannick Tivisse a38a3e93c2 [MOV] *: Reorganize configuration files according to guidelines 2017-06-19 17:37:38 +02:00
Luis Torres 8bb9869812 [FIX] l10n_mx: set cash basis configuration in taxes.
Courtesy of Vauxoo. Was PR #17055
2017-05-23 11:35:50 +02:00
Laurent Smet 3b774ee329 [FIX] l10n_mx: fix bad reference to account.account skiping the mapping to templates
Hardcoded reference skips the mapping (company, template) -> account.account leading to key error.
2017-03-21 10:13:11 +01:00
Laurent Smet 450bdd95da [IMP] l10n_mx: add settings to install l10n_mx_edi 2017-01-05 17:39:38 +01:00
qdp-odoo 4f29b77e3d [MERGE] foward port of 10.0 up to revision 84a650e33a 2016-12-30 17:21:25 +01:00
Nhomar Hernandez 9a0e3a11db [IMP] l10n_mx: Completely refactored Mexican CoA Template. Courtesy of Vauxoo.
* Added accounts provided following the structure provided by the SAT
this accounts are only the minimal necessary ones, with the objective
to set the first easiest engagement to new users and tags will represent the actual information
from the document linked.

* The name of the tag is the concatenation of tag.code + tag.name, because the account.tag
model have not the code field.

Note: we will need more accounts but some of them for special operations
which are not basic at all, then it is better just propose the operational accounts
once we understand a proper closing process.

* Set the proper user-types on accounts in order to be able to use it with the official reports this CoA
for operational purpose.

* Added nature field and data in tags to allow set this value in electronic account report, and
set this value with data pre loaded, we did not use user.type for this due to the fact that the same user type can have different nature (if it grows for credit or debit), I do not know if this field brakes the stable rule we can discuse about that.

* Assign the account tags with in the Mexican CoA template installation, and with an onchange(account.code) when manually modifying/creating accounts.

Rationale: If the code of the accounts follows the pattern 111.00.00 or 111-00-00 then it will
set the tag 111.00 if the tag exists, if not then this will be ignored.

* Generate an account tag by each second level account in SAT catalog, and assign to the corresponding account.
2016-12-09 13:59:09 +01:00