Commit Graph
12 Commits
Author SHA1 Message Date
Maximilien (malb) 263ce4d050 [IMP] l10n_ph: 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 taxes name so that it's more clear for the users

closes odoo/odoo#114811

Task-id: 3052677
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-05-11 10:40:53 +02:00
william-andre 0611d8311e [IMP] l10n*: apply automatic icon building
task-3166075

closes odoo/odoo#108617

Related: odoo/enterprise#35547
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-05-10 04:14:50 +02:00
moerradi 56315dd6b9 [IMP] l10n_*: Update manifests to redirect to own documentation
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.

closes odoo/odoo#117005

Task-id: 3248632
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-04-12 16:33:11 +02:00
Andrea Grazioso (agr-odoo) 27cdc052dd [FIX] base_vat,l10n_ph: correct TIN check
Register a ph contact with vat 123-456-789-012
Validation Error will raise

Currently we use check the PH vat against regexp \d{3}-\d{3}-\d{3}-\d{5}
This seems to be not correct according to the official documentation
https://serp-p.pids.gov.ph/publication/public/view?slug=taxpayer-identification-number-tin-its-development-and-importance-in-tax-administration

"""
12 digit number (E.g. 123 456 789 002), of which the first digit
identifies type of taxpayer (0 for corporations, 1-9 for individuals
and other businesses), second to eighth digits are sequential numbers
between 0 and 9, ninth digit is a check number, last three digits are
000 for individuals and head office of businesses and 001-999 for
branches of businesses, if any
"""

The TIN should be a 9 digit code + 3 for the branch code

opw-3141793

closes odoo/odoo#116491

X-original-commit: f0e9a3ce7fec9bb86b8703a6d49c0bc70c80d5c3
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-03-28 18:45:47 +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
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
william-andre b46d2cd609 [IMP] l10n_{dz,ma,ph}: add demo company
Part-of: odoo/odoo#110016
2023-02-17 19:30:37 +01:00
niyasraphy 1b767908dd [FIX] l10n_ph: moves_to_export field alignment
install l10n_ph module and open any vendor bill, click on action button and click Download BIR 2307 XLS, in the opening wizard, the one2many field moves_to_export is not aligned well in the form due to missing colspan and currently the field is too compact in the form.

closes odoo/odoo#108094

X-original-commit: 53ffdccc0310c32980297d5dcc3f6a24fa852a8c
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-12-16 12:45:40 +01:00
Ricardo Gomes Rodrigues (rigr) 6b396c84e5 [IMP] account,l10n_*: clean country-specific fields from views
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.

closes odoo/odoo#106221

Related: odoo/enterprise#34226
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-12-09 11:48:42 +01:00
arsi 42859bed9c [FIX] account_taxcloud: change display_type filter
Traceback when computing taxes using TaxCloud.

Steps to reproduce:
-Activate TaxCloud in accounting settings, with valids "API ID" and
 "API KEY".
-Create an invoice for a USA customer with an invoice line and
 "Fiscal Position" set to "Automatic Tax Mapping (TaxCloud)" (in the
 "Other Info" tab).
-Confirm
-->Traceback

Traceback:
File
"/src/enterprise/16.0/account_taxcloud/models/taxcloud_request.py",
line 136, in get_all_taxes_values
for item in response.CartItemsResponse.CartItemResponse:
AttributeError: 'NoneType' object has no attribute 'CartItemResponse

Explanation:
-There's a traceback when CartItem is empty (like if there are no move
 lines).
-It is empty because of the filter in the function
 '_process_lines(self, lines)'.
 --> 'lines.filtered(lambda l: not l.display_type)'.
-The goal is to take only move lines that are not Notes or Sections.
-This worked in v15 because display_type was defined as:

    display_type = fields.Selection([
            ('line_section', 'Section'),
            ('line_note', 'Note'),
        ], default=False, help="Technical field for UX purpose.")

-But now in v16 it is defined as:

    display_type = fields.Selection(
            selection=[
                ('product', 'Product'),
                ('cogs', 'Cost of Goods Sold'),
                ('tax', 'Tax'),
                ('rounding', "Rounding"),
                ('payment_term', 'Payment Term'),
                ('line_section', 'Section'),
                ('line_note', 'Note'),
                ('epd', 'Early Payment Discount'),
            ],
            compute='_compute_display_type', store=True, readonly=False,
            precompute=True, required=True,
        )

-The display_type=False does not corresponds anymore to move lines
 that are not Sections or Notes, but it corresponds to no move lines at
 all.

The fix:
 Will filter move lines that are not of type 'line_section' or
 'line_note'.

Discussion:
 Do I fix the traceback that we get when there a no move lines?  This
 'issue' is present since at least v14 and it seems like nobody ever
 complained.

+:
 I've applied the similar change to some lines in the code that also
 check if 'display_type' is False for some 'account.move.line' records.

++:
 The fix revealed an other issue in the function
  '_inter_company_create_invoices' of the file
  enterprise/account_inter_company_rules/models/account_move.py:
  There's a call on a function that doesn't exist anymore
  'line._set_price_and_tax_after_fpos()'.  I've deleted the line.

opw-3064174

closes odoo/odoo#106452

X-original-commit: 8bfca5832adaf9e147f2443d0bf56cf921f9ff0c
Related: odoo/enterprise#34352
Signed-off-by: William André (wan) <wan@odoo.com>
2022-11-24 19:25:21 +01:00
Tommy (tong) d958068582 [ADD] l10n_ph
- add philippines localization

task-2713149

closes odoo/odoo#105062

X-original-commit: 60b9738f7923135ec018fbdcd2cbbfa6de8c75e0
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2022-11-08 07:46:40 +01:00