Metadata-Version: 2.1
Name: odoo-addon-l10n_es_genci_account_grouped_by_picking
Version: 16.0.1.0.0.1
Summary: Agrupa las líneas de la tasa GENCI por albarán
Home-page: https://github.com/sygel-technology/sy-l10n-spain
Author: Sygel
License: AGPL-3
Classifier: Programming Language :: Python
Classifier: Framework :: Odoo
Classifier: Framework :: Odoo :: 16.0
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Requires-Python: >=3.10
Requires-Dist: odoo-addon-account-invoice-report-grouped-by-picking<16.1dev,>=16.0dev
Requires-Dist: odoo-addon-l10n-es-genci-account<16.1dev,>=16.0dev
Requires-Dist: odoo<16.1dev,>=16.0a

.. image:: https://odoo-community.org/readme-banner-image
   :target: https://odoo-community.org/get-involved?utm_source=readme
   :alt: Odoo Community Association

===============================
Tasa Genci agrupada por albarán
===============================

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

.. |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/license-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-sygel--technology%2Fsy--l10n--spain-lightgray.png?logo=github
    :target: https://github.com/sygel-technology/sy-l10n-spain/tree/16.0/l10n_es_genci_account_grouped_by_picking
    :alt: sygel-technology/sy-l10n-spain

|badge1| |badge2| |badge3|

This module acts as a bridge between l10n_es_genci_account and
account_invoice_report_grouped_by_picking.

In the base GENCI module, contribution lines are generated at invoice
level, without considering stock pickings. As a result, when using
reports grouped by picking, GENCI lines are not properly distributed and
may appear without a picking reference.

This module enhances that behavior by:

Assigning the corresponding genci_rule_id to generated GENCI invoice
lines. Distributing GENCI lines across pickings based on the quantities
delivered per picking. Ensuring compatibility with the grouped invoice
report provided by account_invoice_report_grouped_by_picking.

The implementation is intentionally kept in a separate module to avoid
adding a direct dependency in the core GENCI module and to keep
responsibilities well separated.

**Table of contents**

.. contents::
   :local:

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

**Known issues**

It has been identified that when a delivery is returned and a customer
invoice is generated (standard invoice, not a refund), the GENCI line
associated with the returned product is displayed with a positive
amount, whereas it should be negative.

This issue does not occur in credit notes (out_refund), where the
behavior is correct.

The root cause is that the module
``account_invoice_report_grouped_by_picking`` applies a sign correction
when grouping invoice lines by picking. This logic is implemented in the
method lines_grouped_by_picking, where quantities are adjusted using an
internal sign computation together with ``_get_signed_quantity_done()``.

Reference:
https://github.com/OCA/account-invoice-reporting/blob/9a1c954f9b220fc90b507e2d8c52f83618c2797d/account_invoice_report_grouped_by_picking/models/account_move.py#L65

**Possible solution**

A possible solution would be to introduce a small helper method in this
module to replicate the sign logic used in the original implementation,
and apply it when computing GENCI quantities (e.g. in
``_get_genci_qty_by_picking_rule``).

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

Bugs are tracked on `GitHub Issues <https://github.com/sygel-technology/sy-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/sygel-technology/sy-l10n-spain/issues/new?body=module:%20l10n_es_genci_account_grouped_by_picking%0Aversion:%2016.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
-------

* Sygel

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

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

  - Ángel Rivas
  - Valentín Vinagre
  - Harald Panten

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

This module is part of the `sygel-technology/sy-l10n-spain <https://github.com/sygel-technology/sy-l10n-spain/tree/16.0/l10n_es_genci_account_grouped_by_picking>`_ project on GitHub.

You are welcome to contribute.
