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

[16.0][MIG] l10n_es_pos: Migration to 16.0 #2615

Merged
merged 54 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
75f2778
[ADD] Add l10n_es_pos
May 6, 2015
5f38135
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
6e3aac2
[FIX] remove en.po that was erroneously created by transbot
sbidoul Aug 26, 2016
e9eb144
[MIG] l10n_es_pos
xparsox Nov 14, 2017
3cda889
[ADD] l10n_es_pos: posbox support and translations
acysos Mar 28, 2018
eef58cf
[MIG] l10n_es_pos: Migration to 11.0
chienandalu Apr 10, 2018
41c0779
[FIX] l10n_es_pos: typo in oldname (#886)
jonerikceberio Jul 9, 2018
84dd9da
[IMP] l10n_es_pos: Handle the sequence properly (#902)
jonerikceberio Aug 7, 2018
8399366
[FIX] l10n_es_pos: Import uninstall_hook
pedrobaeza Sep 5, 2018
0d9b115
[IMP] l10n_es_pos: move simpl. inv. reference to standard field (#945)
chienandalu Nov 27, 2018
3afd887
[MIG] l10n_es_pos: Migration to 12.0
chienandalu Dec 3, 2018
fe00bd9
Translated using Weblate (Spanish)
mvrodriguez Feb 11, 2019
cb5799b
[FIX] l10n_es_pos: XmlReceipt doesn't show customer
chienandalu Apr 15, 2019
0b8c33a
[FIX] l10n_es_pos: prevent duplicate or missing orders
chienandalu Apr 17, 2019
9707615
[FIX] l10n_es_pos: errors due to context
chienandalu Jun 17, 2019
dadd36d
Added translation using Weblate (Catalan)
CarlesAntoli Feb 7, 2020
cc58ff0
Added translation using Weblate (Catalan)
CarlesAntoli Feb 7, 2020
9904331
Translated using Weblate (Spanish)
CarlesAntoli Feb 7, 2020
c8ab14f
Translated using Weblate (Catalan)
CarlesAntoli Feb 7, 2020
14589ad
[IMP] l10n_es_pos: black, isort, prettier
CarlosRoca13 May 8, 2020
c1cf77e
[MIG] l10n_es_pos: Migration to v13.0
CarlosRoca13 May 8, 2020
a524cc5
rename category of l10n_es_pos, as 'Point of Sale' is not valid in 13.0
JordiBForgeFlow Jul 9, 2020
8661d48
Translated using Weblate (Spanish)
danimv5 Jul 27, 2020
9dac9af
Translated using Weblate (Catalan)
danimv5 Aug 6, 2020
a2d82b9
[IMP] l10n_es_pos: black, isort, prettier
joao-p-marques Jan 29, 2021
9e74df7
[MIG] l10n_es_pos: Migration to 14.0
joao-p-marques Mar 4, 2021
735bfea
[IMP] l10n_es_pos: Export ticket correctly
joao-p-marques Mar 4, 2021
cee8d27
[UPD] Update l10n_es_pos.pot
oca-travis Mar 4, 2021
dd6511f
[UPD] README.rst
OCA-git-bot Mar 4, 2021
5fa8add
Update translation files
oca-transbot Mar 4, 2021
834249d
Translated using Weblate (Catalan)
danimv5 Mar 30, 2021
f674a46
[14.0][FIX] l10n_es_pos: Incorrect label texts and translations
rauferdeveloper Jun 29, 2021
06ff200
[UPD] Update l10n_es_pos.pot
oca-travis Jul 5, 2021
af35fb6
l10n_es_pos 14.0.1.1.0
OCA-git-bot Jul 5, 2021
04f0be3
Update translation files
oca-transbot Jul 5, 2021
178a4e4
[FIX] Refactoring use of l10n_es_unique_id
Nov 25, 2021
670817d
[IMP] l10n_es_pos:
Feb 6, 2022
537b2ef
[MIG]l10n_es_pos: Migration to 15.0
manuelregidor Jan 4, 2022
a605853
[UPD] Update l10n_es_pos.pot
Jul 1, 2022
271c925
[UPD] README.rst
OCA-git-bot Jul 1, 2022
0250142
[FIX]l10n_es_pos: Wrong customer info when reprinting receit
manuelregidor Mar 13, 2023
0ea23f3
l10n_es_pos 15.0.1.1.0
OCA-git-bot Mar 14, 2023
a53377b
[FIX] l10n_es_pos: offline simplified number
chienandalu Nov 3, 2022
a63700d
[IMP] l10n_es_pos: Extract logic to functions to ease inheritance
ao-landoo Feb 24, 2023
0fb5c00
[IMP] l10n_es_pos: Add is_simplified_config field for inheritance in …
ao-landoo Mar 23, 2023
596f85a
[UPD] Update l10n_es_pos.pot
Apr 5, 2023
fe9b3a1
[UPD] README.rst
OCA-git-bot Apr 5, 2023
019a6ca
l10n_es_pos 15.0.2.0.0
OCA-git-bot Apr 5, 2023
d5a340d
Update translation files
weblate Apr 5, 2023
2e61cf6
[FIX] l10n_es_pos: pos_restaurant compatibility
danielduqma Mar 16, 2023
70d5607
[MIG] l10n_es_pos: Migration to 16.0
danielduqma Nov 18, 2022
3077205
[DEL] l10n_es_pos: deleting duplicated field
suker Mar 28, 2023
9270da5
[FIX] l10n_es_pos: duplicated POS names
danielduqma Apr 4, 2023
bb5ee01
[FIX] l10n_es_pos: validation
danielduqma Apr 4, 2023
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
144 changes: 144 additions & 0 deletions l10n_es_pos/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
=================================================
Punto de venta adaptado a la legislación española
=================================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/15.0/l10n_es_pos
: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-15-0/l10n-spain-15-0-l10n_es_pos
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/189/15.0
:alt: Try me on Runbot

|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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_pos%0Aversion:%2015.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 <[email protected]>

* `Aselcis <https://www.aselcis.com>`_:

* David Gómez <[email protected]>
* Miguel Paraíso <[email protected]>

* `Acysos <https://www.acysos.com>`_:

* Ignacio Ibeas <[email protected]>

* `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

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/15.0/l10n_es_pos>`_ 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/__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
27 changes: 27 additions & 0 deletions l10n_es_pos/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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": "16.0.1.0.0",
"depends": ["point_of_sale"],
"data": ["views/pos_views.xml", "views/res_config_settings_views.xml"],
"assets": {
"point_of_sale.assets": [
"l10n_es_pos/static/src/xml/pos.xml",
"l10n_es_pos/static/src/xml/Screens/OrderManagementScreen/TicketScreen.xml",
"l10n_es_pos/static/src/js/PaymentScreen.js",
"l10n_es_pos/static/src/js/models.js",
"l10n_es_pos/static/src/js/Screens/TicketScreen/TicketScreen.js",
],
},
"installable": True,
"post_init_hook": "post_init_hook",
"uninstall_hook": "uninstall_hook",
}
52 changes: 52 additions & 0 deletions l10n_es_pos/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2018 David Vidal <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import SUPERUSER_ID, api


def post_init_hook(cr, registry, vals=None):
"""For brand new installations"""
env = api.Environment(cr, SUPERUSER_ID, {})
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"] = "{}_{}".format(initial_prefix, ith)
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", "{}{}".format(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(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
env["ir.sequence"].search([("code", "=", "pos.config.simplified_invoice")]).unlink()
Loading