30 Commits
Author SHA1 Message Date
Luis Torres 6a255786ab [FIX] l10n_pe: Add domain 01 for export refunds
In commit 355250d, the domain was adjusted to automatically select the
invoice document type for customers with a RUC and limit others to the
"boleta" document type. This generally holds true, except for export
invoices requiring the 01 document type. This commit addresses the
current restriction, allowing the selection of document type 01 other
than "credit note boleta."

closes odoo/odoo#154511

Related: odoo/enterprise#56465
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-03-11 16:37:32 +00:00
Luis Torres 7414b6b850 [FIX] l10n_pe: Fixed document type domain for not sale documents
In the commit 355250d062 was improved the
domain, to filter based in the document type, but was not considered
that only is for sales documents.

On the vendor bills could be used more document types, now is fixed.

closes odoo/odoo#139409

X-original-commit: e4a54d9a6988812e40b9054b8b5f4308d97cbff9
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-10-21 02:22:48 +00:00
Luis Torres 355250d062 [IMP] l10n_pe_edi: Improve sales invoice document type selection
The domain to document type on the invoice  has been updated to filter
based on the partner's identification type.

If the partner identification type is RUC, the default document type is
set to 'Factura', but allows assign Boleta if its necessary; for all other
partner identification types, the domain document type only allows 'Boleta'.

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

closes odoo/odoo#126760

Related: odoo/enterprise#44302
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-07-19 00:35:21 +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
Luis Torres 051178d374 [FIX] point_of_sale: Fixed key in dict for update
Taxes field is not defined in the pos.order model, so, if you call
the onchange you get the next error:

```
  File "/home/odoo/instance/odoo/addons/point_of_sale/models/pos_order.py", line 1159, in _onchange_amount_line_all
    line.update(res)
  File "/home/odoo/instance/odoo/odoo/models.py", line 5520, in update
    self[name] = value
  File "/home/odoo/instance/odoo/odoo/models.py", line 5860, in __setitem__
    return self._fields[key].__set__(self, value)
KeyError: 'taxes'
```

closes odoo/odoo#112524

X-original-commit: af35c97866fdb271881b7d2b007a3d79f41a910a
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-02-13 14:05:32 +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
Luis Torres 3b5baa2e34 [FIX] account_edi_ubl_cii/l10n_it_edi: call to super fixed
The `test_mode` flag was removed in 22e04c6d56

closes odoo/odoo#100042

X-original-commit: b0e960bbe142f6d00b444f78fe11e63b83cecb29
Signed-off-by: William André (wan) <wan@odoo.com>
2022-09-13 11:31:30 +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
Luis Torres 3882ec7c39 [FIX] hr_contract: Missing field added in the contract view
The field contract_type_id is added in hr_contract, but is not present
in the view.

Why not a custom module to add this field in the view?
The hr_contract is the base module, then, my custom module install it,
but it need to set the contract type and the field is not present.

The field cannot be added in the custom module, because some customers
that use my module also needs hr_contract_salary, that adds the field in
the view.

Then, this is related with another PR in enterprise that removes the
field from the view on that module.

closes odoo/odoo#79763

X-original-commit: 9bb0227423b97d085e53e7297a85bbb2fff4a0e0
Related: odoo/enterprise#22248
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-11-15 16:41:15 +00:00
Luis Torres e53faee0ea [FIX] l10n_mx: Correct account type in MX chart template
Fix account type on 108.01.01 & 108.02.01

According to the SAT catalog must be an account of Current Assets

Fix the account type and the tag on 811.01.01
According to the SAT catalog must be an account of Expenses, and the tag
must be 811.01

The correct account for unaffected earnings in the SAT catalog is 305.01,
then, was added the account and assigned the correct type.

closes odoo/odoo#46046

X-original-commit: 632cc5417796ff375d47767fd7cdb358a5d4ce94
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-24 09:59:07 +00:00
Luis Torres e7bbe5dc0e [FIX] l10n_mx: Country in tags is required for domain
The domain for the tags in the taxes indicates that the country must be
the same that the tax country:
domain="[('applicability', '=', 'taxes'), ('country_id', '=', country_id)]"

For this reason is necessary assign the country in the tags, to allow
register new taxes or change the tag in the records created.

closes odoo/odoo#37482

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-26 19:10:09 +00:00
Luis Torres 9dfc9ac76c [FIX] l10n_mx: account_cancel module was removed
In https://github.com/odoo/odoo/pull/36304 was removed the module
account_cancel, but missing remove the dependence. Now is
removed

closes odoo/odoo#37455

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-25 18:11:40 +00:00
Luis Torres f266eff7c4 [FIX] l10n_mx: Revert change that remove tax data
The tags in the tax are created for the Mexican taxes (IVA, ISR & IEPS)

This was assigned in the taxes on 3efefd2171,
but in the commit 333c22edd9
was removed from the tax 0%.

Now was returned that data, to be consistent with the tax for 16%

closes odoo/odoo#36206

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-03 15:08:33 +00:00
Luis Torres b050712afd [IMP] l10n_mx: completed tags for second level in CoA
When is used the option to get the CoA reports based on groups, is
necessary set the tag in each group, then, is necessary load the tags
for second level in the SAT catalog for accounts.
2019-09-03 15:08:33 +00:00
Luis Torres b4ef0299db [FIX] account: Remove supplier/customer in default_partner_type
The fields supplier/customer was removed from the partner, then, they
cannot be used in the default for the views.

Avoid the next traceback in the next case:
'''raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))
ValueError: Invalid field 'supplier' in leaf "<osv.ExtendedLeaf: ('supplier', '=', True) on res_partner (ctx: )>"```

1. Go to create a new payment for supplier
2. Try select the supplier

closes odoo/odoo#35743

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-21 15:07:23 +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
Luis Torres 9b921dae5e [FIX] hr_expense: Correct states are used in the payment_mode field
The states for the expense are:
- draft
- reported
- approved
- done
- refused

So in the definition of the `payment_mode` field, these states must be used.

Before this fix, wrong states were used in the definition of the field
`payment_mode`.

opw:2038715

closes odoo/odoo#35051

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-07-22 08:42:39 +00:00
Luis Torres 25bb9eab17 [master] hr_expense: Make consistent selection field
The field payment mode in the expense sheet is related with the same
field in the expense, but this must be consistent, and if a new option
is added in the expense must be considered in the sheet.

In Odoo v11 > is not necessary indicate the selection parameter in the
field definition.

closes odoo/odoo#30933
2019-02-12 23:43:26 +00:00
Luis Torres a66d42ff34 [FIX] account, membership: Fix use of date.min() in place of '0000-00-00'
Avoid traceback by:

TypeError: '>' not supported between instances of 'datetime.date' and
'str'

After that was migrated the use of native date/datetime for
Date/Datetime fields.

Based on
https://github.com/odoo/odoo/commit/960360afe478a8f7b9c456721b5591154952a37d#diff-dd671a54296b170ea1393dca1a5f7798L348

closes odoo/odoo#27819
2018-10-15 21:34:37 +00:00
Luis Ernesto Torres Macías 4a4e564c2c [FIX] account: compare datetime.date to datetime.date
Cannot compare datetime.date to '0000-00-00' as it's a string, must be a datetime.date
2018-08-22 10:53:29 +02:00
Luis Ernesto Torres Macías 82e205701e [FIX] l10n_mx: fix DIOT report by adding tags
- DIOT report is splitted in some columns like Tax 16% , Tax 0%, Retention and Exempt. was added a tag by each column, to allow indicate the correct column. However, this report is broken since this commit:

https://github.com/odoo/odoo/commit/3fb4159ad9c9b9488912292b7b339d9f1fd2ce3c#diff-0cd8c6aab13e39d5fe3ec259db54035cL3)

- Assign the new tags in the correct tax
2017-09-27 10:24:54 +02:00
Luis Ernesto Torres Macías 6630ce7e76 [FIX] l10n_mx: changing nature of accounts
Was PR #19137
2017-08-30 09:40:24 +02:00
Luis Torres bf201e9014 [IMP] l10n_mx: Complete fiscal regime catalog
To CFDI 3.3 the SAT provide the new catalog that need be used to
"RegimenFiscal" node used by the company that emit the documents.

Definition:
Atributo requerido para incorporar la clave del régimen del
contribuyente emisor al que aplicará el efecto fiscal de este
comprobante.

And the attribute need the code from the catalog, and validate that it exist.

In CFDI 3.2 the attribute was required but free. Then the code also
could be used in CFDI 3.2.

Like fiscal position have not field to save the code, is used the next
structure

`code - name`

And when is used this element in the XML generation take only the first
three characters.

`company_id.partner_id.property_account_position_id[:3]`
2017-05-29 13:25:08 +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
Luis Torres 2d9399fe0e [I18N] mail: fixed Spanish translation
saas-14 is no longer present on Transifex. A pr is still the most efficient way
to backport translations done on upper version.

Closes #16750
Fixes #16749
2017-05-08 15:07:25 +02:00
Luis Ernesto Torres Macías 4cb1750a61 [FIX] base: correct Mexican state code based in SAT catalog
The SAT provide this catalog to state codes:
http://www.sat.gob.mx/informacion_fiscal/factura_electronica/Documents/Complementoscfdi/catNomina.xls

This attribute is required in payroll v1.2.
Previous code version did not match the validation

Closes #15535
2017-02-17 15:04:56 +01:00
Luis Torres cdfc8cf6f3 [FIX] l10n_mx: Add fiscal position template_id and encoding for xml
data file
2017-02-14 16:25:56 +01:00
Luis Torres 486ae7fda7 [FIX] l10n_mx: Only add the three tags that need in Mexico to set in the
XML.

The SAT xsd allow only three values to tax name, that is IVA, IEPS &
ISR, now are created this tags and are assigned in the sale taxs to use
in the XML generation.
2017-02-01 09:45:43 +01:00
Luis Torres e54fd92282 [IMP] l10n_mx: Removed note description in data to fiscal position
This value is not required in Fiscal Regime, and if is present, this is
printed in the invoice report when is used like fiscal position on
invoice.
2017-01-25 09:59:06 +01:00
luistorresm 01e4b76f65 [FIX][sale_stock]Added validation in get_partner_to_invoice, to only check sale.orders when the picking that call this method coming from a sale.order 2015-07-01 08:26:06 +02:00