Commit Graph
168 Commits
Author SHA1 Message Date
Martin Trigaux 604a47ead8 [IMP] *: remove global ACL
THese are rarely intended for all users but often intended only for
employees.

account:
account.incoterms: only used within internal business models
account.journal.group: same as account.journal, add sudo in computed field

account_edi: need access to accounting objects

base_address_extended:
res.city: only employees should access address data

board: only employees uses this (old) module

crm:
crm.stage: internal users business object

hr_recruitment: employees can read

im_livechat: apply same as for the steps

l10n_ar: used on partner, not only invoices
l10n_ec: accessed only through account.move
l10n_latam: accessed on res.partner

mail:
publisher.warrenty.contract: no data, only static models
mail.channel: group_user has already his own rule
mail.group: group_user has already his own rule
mail.message.subtype: group_user has already his own rule
mail.message.all: remove, already has a portal and employee rule

partner_autocomplete: no interaction with public

project:
project.tags: only needed for project sharing

sale_management:
sale.order.option: same as sale.order

utm: employee already has write access

web_editor: test models that have nothing to do here
web_tour: only employees uses tours

website_sale:
product.ribbon: add sudo for access

base:
ir.default: only employees uses set (could probably be converted to group_system)
ir.ui.view.custom: same as ir.ui.view, add sudo when needed
report.*: portal users don't configure reports
res.users.log: create in sudo, no access needed (adapt test to use another model)
res.lang: still needed for public

closes odoo/odoo#118701

Related: odoo/enterprise#41285
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-12 22:39:26 +02:00
Luis Torres 365017a950 [IMP] l10n_pe: Welcome PLE reports
Complement module to allow generate the PLE reports.

- Missing purchase tax groups and taxes added to complete the vendor
  bills flow
- Demo data completed to has data to allow generate the PLE reports
- Document types for vendor bills completed in the data
- Method to improve the domain in document types for customer invoices
  added
- Extend method to autocomplete the number on vendor bills with the
  standard expected by the document type.

closes odoo/odoo#124595

X-original-commit: 821d313a5de857a4903bb35aaea49c3a35f8781e
Related: odoo/enterprise#42345
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-06-12 17:41:22 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
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).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Maximilien (malb) 4f1f4e0d42 [IMP] l10n_pe: 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#114814

Task-id: 3052677
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-05-10 13:21:19 +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
desdelinux 27d9f5c8ff [FIX] l10n_pe_edi: Gain and Loss exchange rate accounts are on the opposite field by default
Issue:

When activating the multicurrency in PE, the default exchange rate accounts are placed in the opposite fields (gain account should be an income account and loss account should be an expense), currently they're the other way around.

Fix:

Change the default account so Odoo created the journal entries for exchange rate differences the correct way.

Task Latam: https://latam-localizations.odoo.com/web#id=967&menu_id=88&cids=1&action=188&model=project.task&view_type=form

Reference:

https://www.noticierocontable.com/diferencia-de-cambio-venta/
https://www.noticierocontable.com/asiento-contable-perdida-diferencia-cambio/

closes odoo/odoo#117745

Replace: #115361
X-original-commit: 45694e1b0eeb46a5f1b75cee738f20e9a670ae63
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-04-05 10:45:54 +02:00
desdelinux aea02e9860 [IMP] l10n_pe: Add List of Peruvian Banks
Provides data on Peruvian Banks extracted from the Central Reserve Bank of Peru https://www.bcrp.gob.pe/sitios-de-interes/entidades-financieras.html

closes odoo/odoo#95870

Related: odoo/enterprise#38293
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-03-24 07:44:44 +01: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
Denis Ledoux fdf2f0c095 [FIX] l10n_*: missing load_translations in manifest post_init_hook
There is a code pattern in l10n modules
to create a post init hook method `load_translations` in `__init__.py`
and to add it in the `post_init_hook` of the module  manifest.

For the modules part of this revision,
the method `load_translations` was created as expected,
but then was missing in the `post_init_hook` key of the manifest,
therefore leading to the fact this `load_translations`
method was never called for these modules,
despite their `spoken_languages` were correctly
set in their charf of account template.

closes odoo/odoo#108254

Related: odoo/design-themes#631
Related: odoo/enterprise#35084
Related: odoo/upgrade#4144
Signed-off-by: Christophe Simonis <chs@odoo.com>
2023-02-01 10:25:01 +01:00
Denis Ledoux b4a7996e96 [IMP] base, *: change the API of init hooks to pass env
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
2023-02-01 10:25:01 +01:00
Luis Torres 35959e9b0d [IMP] l10n_pe: New identification types requested by the SUNAT
By Sunat regulations a new type of identity document will be accepted:
License Permit Temp. Perman. This applies to a Boleta made to a foreign
customer and also to the operator of the vehicle when creating delivery
guides.

Legal ref:

Website: https://cpe.sunat.gob.pe/node/88
Document with Catalog Update No. 8:
https://cpe.sunat.gob.pe/sites/default/files/inline-files/AjustesValidacionesCPEv20210727%28ultimo%29.xlsx

closes odoo/odoo#108506

X-original-commit: 027bd9b0a1ea93744cc92a88efc1a77d142df23b
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-01-26 10:16:47 +01:00
niyasraphy 50ee5d7a09 [FIX] l10n_pe: documentation link
current link will return 404 error, updating the website link to correct documentation link

closes odoo/odoo#107399

X-original-commit: 33f94926038bb5cf9a9f7feadd2d6596e331b4e1
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-07 18:29:39 +01:00
Ricardo Gomes Rodrigues (rigr) 0ede4f5e56 [FIX] l10n_{bg,cn,hu,pe,pt,ro,rs,si}: translation of CoA
Steps to reproduce:
1. Create a BG company
2. Install the BG Chart of Accounts
3. Install the BG language
4. Switch to the BG language
5. The CoA is not translated

This is due to a missing field in the CoA xml: `spoken_languages` which is now fixed.

Moreover, the language code of Slovenian has been fixed from `si` (which is the country code) to `sl`.

closes odoo/odoo#107353

X-original-commit: ce8f692256714df57864e991e050734b5e04b1f9
Signed-off-by: Laurent Smet <las@odoo.com>
2022-12-07 12:53:55 +01:00
Ivan Yelizariev 22efbe2cfc [FIX] l10n_pe: create related field directly to speed it up
Odoo ORM has special optimization for installing module with a stored related
fields, but it requires the final field be not computed [1] (I'm not sure why),
which is not the case for the `group_id` field. Since `account.move.line` table
may have millions of records, we have to optimize the installation and fill
`l10n_pe_group_id` via a single sql query.

[1]: https://github.com/odoo/odoo/blob/0aff8bb9484a23c0d875d3b12259dd4e0d51e716/odoo/fields.py#L818

opw-2762510

closes odoo/odoo#107157

X-original-commit: 63341b5856b4a5cbc6fda17a4cc1d40f84cf7476
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2022-12-06 17:11:56 +01:00
Julien Alardot (jual) 4562ebe983 [ADD] l10n_pe: Add COA & tax data
Add the Coa and tax data for the peruvian
localisation (in english with translations)

closes odoo/odoo#104073

Task: task-2774275
Related: odoo/enterprise#33183
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-01 16:27:39 +01:00
niyasraphy 4959d3c707 [IMP] improve module names and unify module author names
closes odoo/odoo#105616

Signed-off-by: William André (wan) <wan@odoo.com>
2022-11-11 17:54:39 +01:00
Camille Spiritus 78dfa2a07d [IMP] account : cash discount: set up default accounts and configs
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 #99572

closes odoo/odoo#102032

X-original-commit: 591757902dcdf1e3609d9c5ae23e2b134ee8e4da
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
2022-10-04 13:29:08 +02:00
Luis Torres 82ae8ba0f0 [IMP] l10n_pe: Welcome ISC tax
The SUNAT requires than when a ISC tax is used on an invoice, on the
cbc:TierRange attribute be specified the ISC type.

Now, the 3 options could be:
- 01: System to value
- 02: Application of the Fixed Amount
- 03: Retail Price System

To this, now was added a new field on the tax, with this options.

Extra, the ISC could have many amount options, for now, only is
generated a tax for 0%, that allows to the customer only change the
percentage that will to use.

Legal Reference:

Catalog No 08:  https://cpe.sunat.gob.pe/node/88

Guide for the Preparation of Electronic Invoice:
https://cpe.sunat.gob.pe/sites/default/files/inline-files/gu%C3%ADa%20xml%20para%20factura%20electr%C3%B3nica%20%28ubl%202.0%29_0.pdf

Impuesto selectivo al consumo (ISC):
https://www.gob.pe/7918-impuesto-selectivo-al-consumo-isc

closes odoo/odoo#98962

Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-09-01 21:25:29 +02:00
Laurent Smet bedf191134 [IMP] account,l10n_*: Set 100 as default value for factor_percent in tax repartition lines
closes odoo/odoo#94125

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

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

See enterprise commit for full details.

Task 2524389

Part-of: odoo/odoo#94125
2022-08-25 19:56:55 +02:00
Josse Colpaert 4e6f88fd44 [IMP] l10n_pe: add document type nota de debito boleta electronica
For them, we are going to add the corresponding type of document, as was done in the credit notes

This is a fw-port, but it had to be done in community instead of enterprise
https://github.com/odoo/enterprise/pull/27180/commits

closes odoo/odoo#96111

X-original-commit: 7a5e9b280ad10f52f5412505aa7fb250011a12ef
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-07-22 08:01:39 +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
Josse Colpaert 16227a15c8 [FIX] l10n_ec,pe,ar,cl: when installing demo data, use the fiscal country instead
Because of the change in order of operations, for the main company
when we install e.g. l10n_ec, the CoA installed is the Ecuadorian
one, which makes the fiscal country EC, but the country_id still US.

We suspect https://github.com/odoo/odoo/blob/7cb109e7b0ee2e46cef79ec7d3076d16715567f9/addons/account/models/chart_template.py#L278
for the change in behaviour as the generic coa does not have US as
company anymore and that somehow led for the sales journal to
require to use document types.  (there we use the fiscal country which
is set to Ecuador)

The solution anyhow here, is that for the demo data, we should
use the fiscal country as well to see if we need to add the
document type to the demo invoices or not.

closes odoo/odoo#92772

X-original-commit: 40dab08559d5b4c837589ce96d6d7ce23f14fd98
Signed-off-by: William André (wan) <wan@odoo.com>
2022-06-02 16:54:33 +02:00
Josse Colpaert c690c674a4 [FIX] l10n_pe: street_name and street had wrong edit/read only class
Before, if you would put Peru Street 23, it would put Peru in House number.
This is because the editable field was the street field, so behind the scenes,
Odoo will split it and according to the standard format without country,
this means Peru will go into House.

We tried first with a change inversing it, but as we are doing the change,
the best thing is to remove the split all together.  We added also onchange
logic that if you put a district it would automatically put the right city.

City or city_id should depend on the country and is correctly inherited by a
fields_view_get.

Task 2724531

closes odoo/odoo#85194

X-original-commit: 47cd0b51fb60cebb88e3a84b7e332e1ff800b0a8
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-23 12:08:57 +00:00
Antoine Vandevenne (anv) adf70bf9dc [FIX] *: retarget documentation links to master
closes odoo/odoo#84990

X-original-commit: 39bdf46
Related: odoo/enterprise#24582
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-21 17:01:02 +00:00
aliya 47cf4e8066 [FIX] l10n_ar, l10n_ec, l10n_pe: use fiscal country
Currently all latam localizations except Chile use country_id in _localization_use_documents().
account_fiscal_country_id should be used instead in all modules.

closes odoo/odoo#84756

Task: 2761248
X-original-commit: cf61089d9480d7450d2916911b0859cd5f6efcce
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Tastemirova Aliya (alta) <alta@odoo.com>
2022-02-17 09:06:57 +00:00
Fabien Pinckaers 10a5796d4b [IMP] speed up load_menus() by using SVG icons instead of png
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)

closes odoo/odoo#84280

Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-02-12 08:55:18 +00:00
Fabien Pinckaers 5b72f01766 [IMP] cleanup of base_address_city & base_address_extension
Rely on country.address_view_id instead of hacking the view on the fly. The
address layout (street VS street_name street_number street_number2) depends now
on the country of the user, not on the installed localisation. (it's now
configurable per country)

Unified street format to "Chaussee de Namur 40 - Appt 12"; the
configurable ones where actually wrong by country.

Allow street split without base_address_extended; all EDIs can now be
used with or without base_address_extended.

Merged base_address_city into base_address_extension, to avoid creating bridge
modules for no reason. Uses city_id instead of city if the country of the user
defines it AND if enforce_cities is set on this country.

Improved post_init script for large databases.

Split of street removed on res.company. (not required by any l10n)

[IMP] l10n_cn_city,l10n_nl,l10n_cl,l10n_co,l10n_pe: base_address_extended improvements

l10n_cn_city defined cities but did not provide a means to edit the city_id, so enforce_cities
l10n_nl only requires street names and numbers and thus does not need to depend on base_address_extended
l10n_cl should not depend on base_address_extended as none of the features are used
l10n_pe improve the view
l10n_co remove base_address_city dependency - move to l10n_co_edi

closes odoo/odoo#81710

Related: odoo/enterprise#23108
Related: odoo/upgrade#3129
Signed-off-by: Laurent Smet <las@odoo.com>
2022-01-25 17:21:04 +00:00
Josse Colpaert 6789b8f977 [FIX] l10n_ar, l10n_cl, l10n_pe, l10n_ec: only change invoice demo data when the company has the right country
Before when you installed one localization e.g. PE, but then you would
install another one with a demo company, then that demo company's demo invoices
might have adapted to the structure of PE, while it might be for another
country.

In the meantime we check that the necessary latam_document_numbers are set.

closes odoo/odoo#82998

X-original-commit: bef38eaee0e389554d35fede53a1224b72271d7f
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-01-18 16:17:43 +00:00
Antoine Dupuis (andu) 7b21821d60 [FIX] l10n_pe: demo: set l10n_latam_identification_type_id to 'RUC'
The issue:
When creating a fresh DB with demo data, the demo company and
customer are created with l10n_latam_identification_type_id set to
the default, which is 'VAT', rather than 'RUC'.

This creates a problem when we create an invoice with the demo
company and the demo customer and validate it: when the l10n_pe_edi
module sends the invoice to the OSE, the OSE responds with the
following error code:

'1007|El dato ingresado no cumple con el estandar - [...]
error: Error Factura (codigo: 1007): 1007
(nodo: "cbc:ID/schemeID" valor: "0")'

Some observations on how the issue occurs:
Interestingly, when you create a new company or partner using the UI,
the `l10n_latam_identification_type_id` is automatically set to 'RUC'.
This is ensured by the `ResCompany.create()` and
`ResPartner._onchange_country()` methods, see
https://github.com/odoo/odoo/blob/f84dbf63b9354a3c577589178a09c3ffb151cba3/addons/l10n_latam_base/models/res_company.py#L10 and
https://github.com/odoo/odoo/blob/f84dbf63b9354a3c577589178a09c3ffb151cba3/addons/l10n_latam_base/models/res_partner.py#L24

However, when the demo company is created, the `create()` method is
called at the first <field> element, which is `name`, and so,
`create()` does not set `l10n_latam_identification_type_id`.

And because the demo partner is created without the UI, the onchange
is not called when the partner's country is set.

The solution:
Therefore it is necessary to manually set the
`l10n_latam_identification_type_id` in the demo data.

closes odoo/odoo#82920

X-original-commit: 33e174d58e7ad2a5a965f31a23c4b8281fedef79
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Antoine Dupuis (andu) <andu@odoo.com>
2022-01-17 17:50:29 +00:00
ren-odoo b8110de4ed [IMP] l10n_pe: Update website reference
The website is now referenced to Odoo's website, with the most updated documentation.

closes odoo/odoo#80514

X-original-commit: 98025e4919e8a907419794b03d0386648c31343f
Signed-off-by: Josse Colpaert <jco@odoo.com>
2021-12-06 11:21:47 +00:00
Paolo (pgi) 423c7029d9 [IMP] l10n_pe: Moved ICBPER tax group from enterprise to community
closes odoo/odoo#78187

Related: odoo/upgrade#2914
Related: odoo/enterprise#21596
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-12-01 11:04:56 +00:00
desdelinux e0763a9adb [FIX] l10n_pe: l10n_pe_vat_code for VAT must be 0
closes odoo/odoo#76927

X-original-commit: 310835756fac1ce0c92675721e4cf4f5bba98c46
Related: odoo/enterprise#21952
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-05 08:49:47 +00:00
Josse Colpaert f0b3250945 [FIX] l10n_pe: demo data should have correct invoice names
closes odoo/odoo#78352

X-original-commit: a35cd6a33cd27b13f8472f898f2a0eba0f7c6932
Related: odoo/enterprise#21683
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-13 23:33:44 +00:00
Paolo (pgi) bcb1bd2212 [FIX] l10n_*: Localization tax group localization data normalization
"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
2021-10-01 12:40:54 +00:00
Paolo (pgi) e21331c1eb [FIX] l10n_*: Review of tax groups, tax templates and their countries
Many changes involved several localizations.

Tax groups data files that were missing the country_id:
AR, AU, EC, ET, HR, HU, IT, JP, LU, MN, NZ, SI, UK, ZA

Account_data.xml files being renamed or split to account_tax_group.xml
AT, CH, CL, PE, SK

Tax templates that were missing tax group information:
CH

Tax groups missing that were added:
EC

Part-of: odoo/odoo#77295
2021-10-01 12:40:54 +00:00
desdelinux 884ad2444c [IMP] l10n_pe: class 60 accounts should be of type expense
[IMP] l10n_pe: class 60 accounts should be of type expense

[IMP] l10n_pe: class 60 accounts should be of type expense

closes odoo/odoo#75489

X-original-commit: 0ecf9062397c16dbb987ee53774f5d41f850e503
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-09-14 16:40:53 +00:00
desdelinux b201ac6649 [IMP] l10n_pe: New identification types requested by the SUNAT
By Sunat regulations from 08/01/2021 two new types of identity documents
will be accepted: Temporary Residence Permit and Safe Passage.

Legal ref:

Website: https://cpe.sunat.gob.pe/node/88
Document with Catalog Update No. 8:
https://cpe.sunat.gob.pe/sites/default/files/inline-files/AjustesValidacionesCPEv20210727%20%28ultimo%29.xlsx

Replaces #74342

closes odoo/odoo#74506

X-original-commit: d7a701910520c22d963e21e3a9cc6d4122ead003
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-07-30 14:15:43 +00:00
Touati Djamel (otd) deb7b0dfc2 [FIX] l10n_pe: add zip to Peru address format
Steps to reproduce the bug:
- Install eCommerce and l10n_pe
- Go as website visitor
- Add anything to your cart
- Continue with checkout to go to the address page
- Select country Peru and fill in all the required fields
- Validate
- You will get an error message telling you that you forgot to fill in a required field.

Problem:
You cannot validate the address because zip code is not displayed, but required.
This field is based on the country format address to be displayed before or after the `" City "` field
and is not displayed if `" zip "` is not present in the country format address.

https://github.com/odoo/odoo/blob/b1107cba38e296f17d03d9919be67e6789a407be/addons/website_sale/views/templates.xml#L1208-L1223

https://github.com/odoo/odoo/blob/15fe3d43b4b925a32b42eb46048a33987e10336b/openerp/addons/base/res/res_country.py#L77

Solution:
"zip" is required for the Peru country, so it must be added in the address format

opw-2600526

closes odoo/odoo#73763

X-original-commit: 996260c04a52055a7000ede7be87460707f3990f
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-07-15 11:13:20 +00:00
Nicolas (vin) adfb20537b [IMP] account: add country_id on tax groups
In order to not show unnecessary tax groups when configuring a tax,
we'll now filter them to only shows the tax groups that are either
linked to no country, or that are linked to the same country as the tax.

Task id #2206280
2021-05-26 10:51:29 +00:00
Josse Colpaert f986a0e4c5 [FIX] l10n_pe: add electronica to the report name as it is a legal obligation
See also #17550 in enterprise

closes odoo/odoo#69051

X-original-commit: 68ca0884d07854ca227a20427d53068e2fcce3f5
Related: odoo/enterprise#17591
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-04-09 14:35:31 +00:00
oco-odoo 7922e5d102 [IMP] l10n_*: set newly-introduced country_id field on chart templates 2021-04-01 12:09:20 +00:00
bat-odoo feca3ad527 [IMP] base: update l10n icons
Purpose of the task is to update all l10n modules icon with new icon that i have
found in task attachment.

So in this commit, Updated all l10n modules icon with new icon.

closes odoo/odoo#65329

Taskid: 2442631
Related: odoo/enterprise#16054
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-25 15:01:43 +00:00
Arturo Flores b7af1774b0 [ADD] l10n_pe: add Spanish translations
closes odoo/odoo#67656

X-original-commit: c72994ea297d755919a35011c2626ffad2a2dea8
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-03-11 10:29:03 +00:00
wan c92332f555 [FIX] l10n_pe: depend on l10n_latam_invoice_documents
Part of task 2124952

This is needed in order to be able to create the demo data.
It was not done earlier because of stable policy but it was added to
l10n_pe_edi instead.

closes odoo/odoo#60148

Related: odoo/enterprise#15213
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-02-17 08:39:29 +00:00
Nhomar Hernández 230014b8af [IMP] l10n_pe: demo partner, export taxes and proper fiscal positions 2021-02-01 14:49:22 +00:00
wan 8aa68445a6 [IMP] l10n_*: remove icon.png and use country_fla from base
* We are gaining ~1.2MB by doing this.
* The flags are unified with the same looks.
* Some flags were missing.
2021-01-15 15:56:47 +00:00