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

[MIG] sale_report_usability: Migration to 14.0 #39

Merged
merged 9 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ jobs:
run: pip3 install -e "git+https://github.com/sergiocorato/[email protected]_external_dbsource_mssql#egg=odoo14-addon-base_external_dbsource_mssql&subdirectory=setup/base_external_dbsource_mssql"
- name: Install purchase_line_procurement_group module not yet merged
run: pip3 install -e "git+https://github.com/decgroupe/[email protected]_line_procurement_group#egg=odoo14-addon-purchase_line_procurement_group&subdirectory=setup/purchase_line_procurement_group"
- name: Install sale_order_confirmation_date module from e-account repo
run: pip3 install -e "git+https://github.com/efatto/[email protected]#egg=odoo14-addon-sale_order_confirmation_date&subdirectory=setup/sale_order_confirmation_date"
- name: Install addons and dependencies
run: oca_install_addons
- name: Check licenses
Expand Down
Binary file not shown.
78 changes: 78 additions & 0 deletions sale_report_usability/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
=====================
Sale report usability
=====================

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

.. |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-sergiocorato%2Fe--efatto-lightgray.png?logo=github
:target: https://github.com/sergiocorato/e-efatto/tree/14.0/sale_report_usability
:alt: sergiocorato/e-efatto

|badge1| |badge2| |badge3|

This module enable ability to compare the same period for different years.

**Table of contents**

.. contents::
:local:

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

Questo modulo aggiunge dei campi data senza anno per permettere il confronto per lo stesso periodo in diversi anni. Per farlo è necessario andare nel menu Vendite > Rendicontazione > Vendite [modalità pivot] e selezionare per le righe uno dei campi data con la dicitura (senza anno) aggiunti:

.. image:: https://raw.githubusercontent.com/sergiocorato/e-efatto/14.0/sale_report_usability/static/description/selezione_date_valori.png
:alt: Selezione date valori

Questa selezione comporterà che a video risulteranno solo le date (mesi, giorni, settimane, ecc.) con la dicitura dell'anno in corso, anche se i dati non sono filtrati per l'anno in corso (ATTENZIONE!) in quanto il filtro per date sarà basato sull'intervallo temporale:

.. image:: https://raw.githubusercontent.com/sergiocorato/e-efatto/14.0/sale_report_usability/static/description/selezione_confronto.png
:alt: Selezione confronto

Alla fine si ottiene quindi una statistica che confronta i valori in maniera logica, invece di vedere diverse righe separate per ogni anno e non confrontate:

.. image:: https://raw.githubusercontent.com/sergiocorato/e-efatto/14.0/sale_report_usability/static/description/statistica.png
:alt: Statistica

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

Bugs are tracked on `GitHub Issues <https://github.com/sergiocorato/e-efatto/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/sergiocorato/e-efatto/issues/new?body=module:%20sale_report_usability%0Aversion:%2014.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
~~~~~~~

* Sergio Corato

Contributors
~~~~~~~~~~~~

* Sergio Corato <https://github.com/sergiocorato>

Maintainers
~~~~~~~~~~~

This module is part of the `sergiocorato/e-efatto <https://github.com/sergiocorato/e-efatto/tree/14.0/sale_report_usability>`_ project on GitHub.

You are welcome to contribute.
2 changes: 2 additions & 0 deletions sale_report_usability/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import report
19 changes: 19 additions & 0 deletions sale_report_usability/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2021 Sergio Corato <https://github.com/sergiocorato>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Sale report usability",
"version": "14.0.1.0.0",
"author": "Sergio Corato",
"website": "https://github.com/sergiocorato/e-efatto",
"license": "AGPL-3",
"category": "other",
"depends": [
"sale",
"sale_order_confirmation_date",
],
"data": [
"views/sale_report.xml",
],
"summary": "Add generic date to compare",
"installable": True,
}
69 changes: 69 additions & 0 deletions sale_report_usability/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_report_usability
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-12-11 11:25+0000\n"
"PO-Revision-Date: 2024-12-11 11:25+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_report_usability
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_order__assigned_attachment_ids
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_report__assigned_attachment_ids
msgid "Assigned Attachments"
msgstr "Allegati assegnati"

#. module: sale_report_usability
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_order__generic_confirmation_date
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_report__generic_confirmation_date
#: model_terms:ir.ui.view,arch_db:sale_report_usability.view_order_product_search
msgid "Confirmation Date (with current year)"
msgstr "Data di conferma (per report comparativo)"

#. module: sale_report_usability
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_order__display_name
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_report__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: sale_report_usability
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_order__id
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_report__id
msgid "ID"
msgstr ""

#. module: sale_report_usability
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_order____last_update
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_report____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: sale_report_usability
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_order__generic_date
#: model:ir.model.fields,field_description:sale_report_usability.field_sale_report__generic_date
#: model_terms:ir.ui.view,arch_db:sale_report_usability.view_order_product_search
msgid "Order Date (with current year)"
msgstr "Data ordine (per report comparativo)"

#. module: sale_report_usability
#: model:ir.model,name:sale_report_usability.model_sale_report
msgid "Sales Analysis Report"
msgstr "Resoconto di analisi vendite"

#. module: sale_report_usability
#: model:ir.model,name:sale_report_usability.model_sale_order
msgid "Sales Order"
msgstr "Ordine di vendita"

#. module: sale_report_usability
#: model:ir.model.fields,help:sale_report_usability.field_sale_report__generic_date
msgid "Used to compare dates on multiple years"
msgstr "Per comparazione date su diversi anni"
1 change: 1 addition & 0 deletions sale_report_usability/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order
30 changes: 30 additions & 0 deletions sale_report_usability/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from odoo import api, fields, models


class SaleOrder(models.Model):
_inherit = "sale.order"

generic_date = fields.Date(
"Order Date (with current year)",
compute="_compute_generic_date",
store=True,
)
generic_confirmation_date = fields.Date(
"Confirmation Date (with current year)",
compute="_compute_generic_confirmation_date",
store=True,
)

@api.depends("date_order")
def _compute_generic_date(self):
for order in self:
order.generic_date = (order.date_order or fields.Date.today()).replace(
year=2000
)

@api.depends("confirmation_date")
def _compute_generic_confirmation_date(self):
for order in self:
order.generic_confirmation_date = (
order.confirmation_date or order.date_order or fields.Date.today()
).replace(year=2000)
14 changes: 14 additions & 0 deletions sale_report_usability/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Questo modulo aggiunge dei campi data senza anno per permettere il confronto per lo stesso periodo in diversi anni. Per farlo è necessario andare nel menu Vendite > Rendicontazione > Vendite [modalità pivot] e selezionare per le righe uno dei campi data con la dicitura (senza anno) aggiunti:

.. image:: ../static/description/selezione_date_valori.png
:alt: Selezione date valori

Questa selezione comporterà che a video risulteranno solo le date (mesi, giorni, settimane, ecc.) con la dicitura dell'anno in corso, anche se i dati non sono filtrati per l'anno in corso (ATTENZIONE!) in quanto il filtro per date sarà basato sull'intervallo temporale:

.. image:: ../static/description/selezione_confronto.png
:alt: Selezione confronto

Alla fine si ottiene quindi una statistica che confronta i valori in maniera logica, invece di vedere diverse righe separate per ogni anno e non confrontate:

.. image:: ../static/description/statistica.png
:alt: Statistica
1 change: 1 addition & 0 deletions sale_report_usability/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sergio Corato <https://github.com/sergiocorato>
1 change: 1 addition & 0 deletions sale_report_usability/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module enable ability to compare the same period for different years.
1 change: 1 addition & 0 deletions sale_report_usability/report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_report
30 changes: 30 additions & 0 deletions sale_report_usability/report/sale_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from odoo import fields, models


class SaleReport(models.Model):
_inherit = "sale.report"

generic_date = fields.Date(
"Order Date (with current year)",
help="Used to compare dates on multiple years",
readonly=True,
)
generic_confirmation_date = fields.Date(
"Confirmation Date (with current year)",
help="Used to compare dates on multiple years",
readonly=True,
)

def _query(self, with_clause="", fields=None, groupby="", from_clause=""):
fields = fields or {}
fields["generic_date"] = (
", make_date(2000, "
"date_part('month', date_order)::int, "
"date_part('day', date_order)::int) as generic_date"
)
fields["generic_confirmation_date"] = (
", make_date(2000, "
"date_part('month', confirmation_date)::int, "
"date_part('day', confirmation_date)::int) as generic_confirmation_date"
)
return super()._query(with_clause, fields, groupby, from_clause)
Binary file added sale_report_usability/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading