Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] l10n_es_pos: Migration to 17.0 #3548

Open
wants to merge 67 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
67b886a
[ADD] Add l10n_es_pos
May 6, 2015
4b8ff40
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
aa54c4f
[FIX] remove en.po that was erroneously created by transbot
sbidoul Aug 26, 2016
d53d414
[MIG] l10n_es_pos
xparsox Nov 14, 2017
ced17ad
[ADD] l10n_es_pos: posbox support and translations
acysos Mar 28, 2018
590cad7
[MIG] l10n_es_pos: Migration to 11.0
chienandalu Apr 10, 2018
70a64ec
[FIX] l10n_es_pos: typo in oldname (#886)
jonerikceberio Jul 9, 2018
0847a0e
[IMP] l10n_es_pos: Handle the sequence properly (#902)
jonerikceberio Aug 7, 2018
2ae4b8d
[FIX] l10n_es_pos: Import uninstall_hook
pedrobaeza Sep 5, 2018
04cf2ea
[IMP] l10n_es_pos: move simpl. inv. reference to standard field (#945)
chienandalu Nov 27, 2018
791127d
[MIG] l10n_es_pos: Migration to 12.0
chienandalu Dec 3, 2018
6eed5bf
Translated using Weblate (Spanish)
mvrodriguez Feb 11, 2019
f772eee
[FIX] l10n_es_pos: XmlReceipt doesn't show customer
chienandalu Apr 15, 2019
a77fc40
[FIX] l10n_es_pos: prevent duplicate or missing orders
chienandalu Apr 17, 2019
f293f0a
[FIX] l10n_es_pos: errors due to context
chienandalu Jun 17, 2019
42cb0ab
Added translation using Weblate (Catalan)
CarlesAntoli Feb 7, 2020
79fd0f9
Added translation using Weblate (Catalan)
CarlesAntoli Feb 7, 2020
ee7609d
Translated using Weblate (Spanish)
CarlesAntoli Feb 7, 2020
05a20b2
Translated using Weblate (Catalan)
CarlesAntoli Feb 7, 2020
9fcefe3
[IMP] l10n_es_pos: black, isort, prettier
CarlosRoca13 May 8, 2020
3e0d333
[MIG] l10n_es_pos: Migration to v13.0
CarlosRoca13 May 8, 2020
2d05f67
rename category of l10n_es_pos, as 'Point of Sale' is not valid in 13.0
JordiBForgeFlow Jul 9, 2020
a510d04
Translated using Weblate (Spanish)
danimv5 Jul 27, 2020
9819d2a
Translated using Weblate (Catalan)
danimv5 Aug 6, 2020
bca0a9f
[IMP] l10n_es_pos: black, isort, prettier
joao-p-marques Jan 29, 2021
a423bd9
[MIG] l10n_es_pos: Migration to 14.0
joao-p-marques Mar 4, 2021
7a1afc8
[IMP] l10n_es_pos: Export ticket correctly
joao-p-marques Mar 4, 2021
16e5355
[UPD] Update l10n_es_pos.pot
oca-travis Mar 4, 2021
2c3487c
[UPD] README.rst
OCA-git-bot Mar 4, 2021
78fb483
Update translation files
oca-transbot Mar 4, 2021
69b50b5
Translated using Weblate (Catalan)
danimv5 Mar 30, 2021
8fd3087
[14.0][FIX] l10n_es_pos: Incorrect label texts and translations
rauferdeveloper Jun 29, 2021
0d12b4f
[UPD] Update l10n_es_pos.pot
oca-travis Jul 5, 2021
60f7703
l10n_es_pos 14.0.1.1.0
OCA-git-bot Jul 5, 2021
0a9deaf
Update translation files
oca-transbot Jul 5, 2021
c94a48d
[FIX] Refactoring use of l10n_es_unique_id
Nov 25, 2021
3ebb447
[IMP] l10n_es_pos:
Feb 6, 2022
012ea7a
[MIG]l10n_es_pos: Migration to 15.0
manuelregidor Jan 4, 2022
3364a3a
[UPD] Update l10n_es_pos.pot
Jul 1, 2022
5f53c8d
[UPD] README.rst
OCA-git-bot Jul 1, 2022
fb27c09
[FIX]l10n_es_pos: Wrong customer info when reprinting receit
manuelregidor Mar 13, 2023
1dc37b9
l10n_es_pos 15.0.1.1.0
OCA-git-bot Mar 14, 2023
eacc1f3
[FIX] l10n_es_pos: offline simplified number
chienandalu Nov 3, 2022
721c2db
[IMP] l10n_es_pos: Extract logic to functions to ease inheritance
ao-landoo Feb 24, 2023
29c2ccf
[IMP] l10n_es_pos: Add is_simplified_config field for inheritance in …
ao-landoo Mar 23, 2023
f57d695
[UPD] Update l10n_es_pos.pot
Apr 5, 2023
0509c10
[UPD] README.rst
OCA-git-bot Apr 5, 2023
552473c
l10n_es_pos 15.0.2.0.0
OCA-git-bot Apr 5, 2023
fc2360d
Update translation files
weblate Apr 5, 2023
ac98f47
[FIX] l10n_es_pos: pos_restaurant compatibility
danielduqma Mar 16, 2023
21bf0b9
[MIG] l10n_es_pos: Migration to 16.0
danielduqma Nov 18, 2022
efbc3d0
[DEL] l10n_es_pos: deleting duplicated field
suker Mar 28, 2023
0f93c5b
[FIX] l10n_es_pos: duplicated POS names
danielduqma Apr 4, 2023
789e724
[FIX] l10n_es_pos: validation
danielduqma Apr 4, 2023
7cc7efb
[UPD] Update l10n_es_pos.pot
Jun 6, 2023
17c40ef
[UPD] README.rst
OCA-git-bot Jun 6, 2023
12c25eb
Update translation files
weblate Jun 6, 2023
6437a2d
[FIX] The value of the formatted_validation_date field was undefined,
zamberjo Jun 6, 2023
25a427a
l10n_es_pos 16.0.1.0.1
OCA-git-bot Jun 7, 2023
ca369af
Translated using Weblate (Catalan)
Jun 23, 2023
c0e1bd4
[UPD] README.rst
OCA-git-bot Sep 3, 2023
19fd4f1
Translated using Weblate (Spanish)
Ivorra78 Aug 21, 2023
7318a91
[FIX] *: Linter fixes
pedrobaeza Oct 28, 2023
6ee9204
[BOT] post-merge updates
OCA-git-bot Oct 28, 2023
5a0ef6d
Translated using Weblate (Spanish)
Ivorra78 Feb 11, 2024
6710ff5
[IMP] l10n_es_pos_oca: pre-commit auto fixes
peluko00 Sep 25, 2024
941e971
[MIG] l10n_es_pos_oca: Migration to 17.0
peluko00 Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 159 additions & 0 deletions l10n_es_pos_oca/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
=================================================
Punto de venta adaptado a la legislación española
=================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:58ee25e2b87c19728b5e42bf5406d8c09d1493ed61256017e38088e9e3bcda09
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-spain/tree/17.0/l10n_es_pos_oca
:alt: OCA/l10n-spain
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-spain-17-0/l10n-spain-17-0-l10n_es_pos_oca
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

- Adapta el terminal punto de venta a la legislación Española (no se
permite la emisión de tiquets, todo deben ser facturas o facturas
simplificadas con numeración)
- Adapta el ticket de venta a la factura simplificada, añadiendo una
secuencia correlativa y el NIF del emisor.
- Incluye los datos del cliente (nombre, NIF y dirección) si hay uno
asignado.
- Chequea que no se realice una factura simplificada con valor superior
a 3.000 euros (la cantidad es configurable por TPV).

**Table of contents**

.. contents::
:local:

Installation
============

Antes de instalar el módulo, podemos definir el relleno y el prefijo
automático en *Configuración > Parámetros del sistema*:

- l10n_es_pos.simplified_invoice_sequence.padding (o 4 cifras por
defecto)
- l10n_es_pos.simplified_invoice_sequence.prefix (nombre del TPV más
este valor)

Al instalarse el módulo, se define una secuencia para factura
simplificada por cada TPV existente.

Configuration
=============

Para activar la factura simplificada en un TPV, iremos a *Punto de Venta
> Configuración > Punto de Venta* y escogeremos uno de la lista. En la
sección *Facturación y recibos* activaremos la opción *Secuencia de
Factura Simplificada*. Podemos configurar el límite a partir del cual no
se considera factura simplificada, que por defecto es 3.000,00 €.

Si entramos en la configuración del TPV en modo debug, podremos también
configurar la sequencia asociada al TPV.

`Ver enlace de la
AEAT <https://www.agenciatributaria.es/AEAT.internet/Inicio/_Segmentos_/Empresas_y_profesionales/Empresas/IVA/Obligaciones_de_facturacion/Tipos_de_factura.shtml>`__

Known issues / Roadmap
======================

- No se comprueba el límite en operaciones separadas para un mismo
cliente, algo que Hacienda proscribe.
- El soporte para usuarios concurrentes sobre una misma sesión es
limitado y solo es fiable si ambos puestos están online. En el caso
de que cualquiera de ellos estuviese offline, se correría el riesgo
de solapar la secuencia de factura simplificada. Se recomienda que en
estos casos se añada mejor una configuración de punto de venta
adicional.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-spain/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_pos_oca%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Tecnativa
* Aselcis Consulting
* Acysos S.L.

Contributors
------------

- `Antiun <https://www.antiun.com>`__:

- Endika Iglesias <endikaig@antiun.com>

- `Aselcis <https://www.aselcis.com>`__:

- David Gómez <david.gomez@aselcis.com>
- Miguel Paraíso <miguel.paraiso@aselcis.com>

- `Acysos <https://www.acysos.com>`__:

- Ignacio Ibeas <ignacio@acysos.com>

- `Tecnativa <https://www.tecnativa.com>`__:

- David Vidal
- Pedro M. Baeza
- Antonio Espinosa
- Rafael Blasco
- Carlos Roca
- João Marques

- `Sygel <https://www.sygel.es>`__:

- Manuel Regidor

- `Factor Libre <https://factorlibre.com/>`__:

- Daniel Duque <daniel.duque@factorlibre.com>

- `APSL-Nagarro <https://www.apsl.tech>`__:

- Antoni Marroig <amarroig@apsl.net>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/l10n-spain <https://github.com/OCA/l10n-spain/tree/17.0/l10n_es_pos_oca>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions l10n_es_pos_oca/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
from .hooks import post_init_hook, uninstall_hook
from . import wizard
23 changes: 23 additions & 0 deletions l10n_es_pos_oca/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Punto de venta adaptado a la legislación española",
"category": "Sales/Point Of Sale",
"author": "Tecnativa, "
"Aselcis Consulting, "
"Acysos S.L., "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-spain",
"license": "AGPL-3",
"version": "17.0.1.0.0",
"depends": ["point_of_sale", "l10n_es"],
"data": ["views/pos_views.xml", "views/res_config_settings_views.xml"],
"assets": {
"point_of_sale._assets_pos": [
"l10n_es_pos_oca/static/src/**/*",
],
},
"installable": True,
"post_init_hook": "post_init_hook",
"uninstall_hook": "uninstall_hook",
}
48 changes: 48 additions & 0 deletions l10n_es_pos_oca/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2018 David Vidal <david.vidal@tecnativa.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


def post_init_hook(env, vals=None):
"""For brand new installations"""
IrSequence = env["ir.sequence"]
pos_config = env["pos.config"].search(
[("l10n_es_simplified_invoice_sequence_id", "=", False)]
)
pos_name_dupes = {}
vals = {} if vals is None else vals
for pos in pos_config:
pos_name_dupes.setdefault(pos.name, -1)
pos_name_dupes[pos.name] += 1
pos_vals = vals.get(pos, {})
pos_name = (
pos.name
if not pos_name_dupes[pos.name]
else "%s_%d" % (pos.name, pos_name_dupes[pos.name])
)
if not pos_vals.get("prefix"):
pos_vals["prefix"] = initial_prefix = "{}{}".format(
pos_name, pos._get_default_prefix()
)
ith = 0
while IrSequence.search_count([("prefix", "=", pos_vals["prefix"])]):
ith += 1
pos_vals["prefix"] = f"{initial_prefix}_{ith}"

Check warning on line 29 in l10n_es_pos_oca/hooks.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_pos_oca/hooks.py#L28-L29

Added lines #L28 - L29 were not covered by tests
pos.l10n_es_simplified_invoice_sequence_id = IrSequence.create(
{
"name": (
pos.with_context(lang=env.user.lang)._get_l10n_es_sequence_name()
% pos_name
),
"prefix": pos_vals.get(
"prefix", f"{pos_name}{pos._get_default_prefix()}"
),
"padding": pos_vals.get("padding", pos._get_default_padding()),
"implementation": pos_vals.get("implementation", "standard"),
"code": "pos.config.simplified_invoice",
"company_id": pos_vals.get("company_id", pos.company_id.id),
}
)


def uninstall_hook(env):
env["ir.sequence"].search([("code", "=", "pos.config.simplified_invoice")]).unlink()

Check warning on line 48 in l10n_es_pos_oca/hooks.py

View check run for this annotation

Codecov / codecov/patch

l10n_es_pos_oca/hooks.py#L48

Added line #L48 was not covered by tests
Loading
Loading