diff --git a/stock_picking_report_summary/README.rst b/stock_picking_report_summary/README.rst new file mode 100644 index 000000000..4614843c7 --- /dev/null +++ b/stock_picking_report_summary/README.rst @@ -0,0 +1,119 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================ +Stock Picking Report Summary +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:970f2abf7e2416b1682cd4a6c3b172671d3761dbe646ab2107e48360a186cb42 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-OCA%2Fstock--logistics--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-reporting/tree/19.0/stock_picking_report_summary + :alt: OCA/stock-logistics-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-reporting-19-0/stock-logistics-reporting-19-0-stock_picking_report_summary + :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/stock-logistics-reporting&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Select several Pickings to print a PDF summary with two sheets : + +- Products Summary (where the total sum is calculated for each product) +- Detail Part (each delivery is detailed product by product, with lines + at 0 printed in grey) + +You can choose to print standard prices or not (can be useful to check +some values when you prepare your pickings). + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to + +- Go to Inventory +- Choose a Operation +- Select any pickings and click on 'Action' / 'Picking Summary' + +|image1| + +- Choose your options + +|image2| + +|image3| + +.. |image1| image:: https://raw.githubusercontent.com/OCA/stock-logistics-reporting/19.0/stock_picking_report_summary/static/description/new_print_action.png +.. |image2| image:: https://raw.githubusercontent.com/OCA/stock-logistics-reporting/19.0/stock_picking_report_summary/static/description/wizard.png +.. |image3| image:: https://raw.githubusercontent.com/OCA/stock-logistics-reporting/19.0/stock_picking_report_summary/static/description/pdf_report.png + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Grap + +Contributors +------------ + +- Quentin DUPONT (quentin.dupont@grap.coop) + +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. + +.. |maintainer-quentinDupont| image:: https://github.com/quentinDupont.png?size=40px + :target: https://github.com/quentinDupont + :alt: quentinDupont +.. |maintainer-legalsylvain| image:: https://github.com/legalsylvain.png?size=40px + :target: https://github.com/legalsylvain + :alt: legalsylvain + +Current `maintainers `__: + +|maintainer-quentinDupont| |maintainer-legalsylvain| + +This module is part of the `OCA/stock-logistics-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_picking_report_summary/__init__.py b/stock_picking_report_summary/__init__.py new file mode 100644 index 000000000..5cb1c4914 --- /dev/null +++ b/stock_picking_report_summary/__init__.py @@ -0,0 +1 @@ +from . import wizards diff --git a/stock_picking_report_summary/__manifest__.py b/stock_picking_report_summary/__manifest__.py new file mode 100644 index 000000000..7098728f6 --- /dev/null +++ b/stock_picking_report_summary/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright (C) 2020 - Today: GRAP (http://www.grap.coop) +# @author: Quentin DUPONT (quentin.dupont@grap.coop) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Stock Picking Report Summary", + "summary": "Stock Picking Report Summary", + "version": "19.0.1.0.0", + "development_status": "Beta", + "author": "Grap, Odoo Community Association (OCA)", + "maintainers": ["quentinDupont", "legalsylvain"], + "website": "https://github.com/OCA/stock-logistics-reporting", + "category": "Warehouse Management", + "license": "AGPL-3", + "depends": [ + "stock", + ], + "data": [ + "security/ir.model.access.csv", + "reports/report_print_picking_summary.xml", + "reports/report_print_picking_summary_template.xml", + "wizards/view_picking_summary_wizard.xml", + ], + "installable": True, +} diff --git a/stock_picking_report_summary/i18n/fr.po b/stock_picking_report_summary/i18n/fr.po new file mode 100644 index 000000000..2d7aad741 --- /dev/null +++ b/stock_picking_report_summary/i18n/fr.po @@ -0,0 +1,230 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_report_summary +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-03-15 14:52+0000\n" +"PO-Revision-Date: 2024-03-15 14:52+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "Cancel" +msgstr "Annuler" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Category" +msgstr "Catégorie" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__standard_price +msgid "Cost" +msgstr "Coût" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__create_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__create_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__create_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__create_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__create_date +msgid "Created on" +msgstr "Créé le" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__display_name +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__display_name +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__display_name +msgid "Display Name" +msgstr "Nom affiché" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "For Pickings details" +msgstr "Pour les détails des livraisons" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "For Summary" +msgstr "Pour le résumé" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "General informations" +msgstr "Informations générales" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__id +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__id +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__id +msgid "ID" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,help:stock_picking_report_summary.field_picking_summary_wizard_product__standard_price +msgid "" +"In Standard Price & AVCO: value of the product (automatically computed in " +"AVCO).\n" +" In FIFO: value of the next unit that will leave the stock " +"(automatically computed).\n" +" Used to value the product when the purchase cost is not known (e.g. " +"inventory adjustment).\n" +" Used to compute margins on sale orders." +msgstr "" +"Également utilisé comme prix de base pour les listes. Exprimé dans l'unité " +"de mesure par défaut du produit." + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard____last_update +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking____last_update +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__write_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__write_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__write_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__write_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__picking_line_qty +msgid "Number of Selected Picking" +msgstr "Quantité sélectionnée" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__picking_id +msgid "Picking" +msgstr "Livraison" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__picking_line_ids +msgid "Picking Line" +msgstr "Ligne de bon de livraison" + +#. module: stock_picking_report_summary +#: model:ir.actions.act_window,name:stock_picking_report_summary.action_picking_summary +#: model:ir.actions.report,name:stock_picking_report_summary.report_picking_summary +msgid "Picking Summary" +msgstr "Résumé des livraisons" + +#. module: stock_picking_report_summary +#: model:ir.model,name:stock_picking_report_summary.model_picking_summary_wizard +msgid "Picking Summary Wizard" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model,name:stock_picking_report_summary.model_picking_summary_wizard_picking +msgid "Picking Summary Wizard Picking" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model,name:stock_picking_report_summary.model_picking_summary_wizard_product +msgid "Picking Summary Wizard Product" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Pickings Details" +msgstr "Détails des livraisons" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "Print PDF" +msgstr "Imprimer le PDF" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_details +msgid "Print Picking Details" +msgstr "Imprimer le détail des livraisons" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_prices +msgid "Print Standard Prices" +msgstr "Imprimer les prix de revient" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_summary +msgid "Print Summary" +msgstr "Imprimer le résumé" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_unit_in_list +msgid "Print Units" +msgstr "Imprimer les unités de mesure" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__product_id +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Product" +msgstr "Article" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__product_line_ids +msgid "Product Line" +msgstr "Ligne de produit" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Products Summary" +msgstr "Résumé des bons de livraison" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Quantity" +msgstr "Quantité" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__quantity_total +msgid "Quantity Total" +msgstr "Quantité totale" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__standard_price_total +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__standard_price_total +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Standard Price Total" +msgstr "Total prix de vente" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Standard Unit Price" +msgstr "Coût unitaire" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Total price" +msgstr "Prix total" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Unit" +msgstr "Unité" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__wizard_id +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__wizard_id +msgid "Wizard" +msgstr "Assistant" diff --git a/stock_picking_report_summary/i18n/it.po b/stock_picking_report_summary/i18n/it.po new file mode 100644 index 000000000..8f0e190db --- /dev/null +++ b/stock_picking_report_summary/i18n/it.po @@ -0,0 +1,232 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_report_summary +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-07-31 15:58+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.6.2\n" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "Cancel" +msgstr "Annulla" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Category" +msgstr "Categoria" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__standard_price +msgid "Cost" +msgstr "Costo" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__create_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__create_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__create_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__create_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__display_name +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__display_name +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "For Pickings details" +msgstr "Per dettagli prelievi" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "For Summary" +msgstr "Per riepilogo" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "General informations" +msgstr "Informazioni generali" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__id +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__id +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__id +msgid "ID" +msgstr "ID" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,help:stock_picking_report_summary.field_picking_summary_wizard_product__standard_price +msgid "" +"In Standard Price & AVCO: value of the product (automatically computed in AVCO).\n" +" In FIFO: value of the next unit that will leave the stock (automatically computed).\n" +" Used to value the product when the purchase cost is not known (e.g. inventory adjustment).\n" +" Used to compute margins on sale orders." +msgstr "" +"Nei prezzi standard & costi medi: valore del prodotto (calcolato " +"automaticamente nei costi medi).\n" +" In FIFO: valore dell'unità successiva che lascerà il magazzino (" +"calcolato automaticamente).\n" +" Utilizzato per valutare il prodotto quando il costo di acquisto non " +"è noto (es. rettifiche di inventario).\n" +" Utilizzato per calcolare i margini negli ordini di vendita." + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard____last_update +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking____last_update +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__write_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__write_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__write_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__write_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__picking_line_qty +msgid "Number of Selected Picking" +msgstr "Numero del prelievo selezionato" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__picking_id +msgid "Picking" +msgstr "Prelievo" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__picking_line_ids +msgid "Picking Line" +msgstr "Riga prelievo" + +#. module: stock_picking_report_summary +#: model:ir.actions.act_window,name:stock_picking_report_summary.action_picking_summary +#: model:ir.actions.report,name:stock_picking_report_summary.report_picking_summary +msgid "Picking Summary" +msgstr "Riepilogo prelievo" + +#. module: stock_picking_report_summary +#: model:ir.model,name:stock_picking_report_summary.model_picking_summary_wizard +msgid "Picking Summary Wizard" +msgstr "Procedura guidata riepilogo prelievo" + +#. module: stock_picking_report_summary +#: model:ir.model,name:stock_picking_report_summary.model_picking_summary_wizard_picking +msgid "Picking Summary Wizard Picking" +msgstr "Prelievo procedura guidata riepilogo prelievo" + +#. module: stock_picking_report_summary +#: model:ir.model,name:stock_picking_report_summary.model_picking_summary_wizard_product +msgid "Picking Summary Wizard Product" +msgstr "Prodotto procedura guidata riepilogo prelievo" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Pickings Details" +msgstr "Dettagli prelievo" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "Print PDF" +msgstr "Stampa PDF" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_details +msgid "Print Picking Details" +msgstr "Stampa dettagli prelievo" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_prices +msgid "Print Standard Prices" +msgstr "Stampa prezzi standard" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_summary +msgid "Print Summary" +msgstr "Stampa riepilogo" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_unit_in_list +msgid "Print Units" +msgstr "Stampa unità" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__product_id +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Product" +msgstr "Prodotto" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__product_line_ids +msgid "Product Line" +msgstr "Riga prodotto" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Products Summary" +msgstr "Riepilogo prodotto" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Quantity" +msgstr "Quantità" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__quantity_total +msgid "Quantity Total" +msgstr "Totale quantità" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__standard_price_total +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__standard_price_total +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Standard Price Total" +msgstr "Totale prezzo standard" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Standard Unit Price" +msgstr "Prezzo unitario standard" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Total price" +msgstr "Prezzo totale" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Unit" +msgstr "Unità" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__wizard_id +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__wizard_id +msgid "Wizard" +msgstr "Procedura guidata" diff --git a/stock_picking_report_summary/i18n/stock_picking_report_summary.pot b/stock_picking_report_summary/i18n/stock_picking_report_summary.pot new file mode 100644 index 000000000..78f3863c5 --- /dev/null +++ b/stock_picking_report_summary/i18n/stock_picking_report_summary.pot @@ -0,0 +1,214 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_report_summary +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 19.0\n" +"Report-Msgid-Bugs-To: \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: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "Cancel" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Category" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__standard_price +msgid "Cost" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__create_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__create_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__create_uid +msgid "Created by" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__create_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__create_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__create_date +msgid "Created on" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__display_name +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__display_name +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "For Pickings details" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "For Summary" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "General informations" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__id +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__id +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__id +msgid "ID" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__write_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__write_uid +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__write_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__write_date +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__write_date +msgid "Last Updated on" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__picking_line_qty +msgid "Number of Selected Picking" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__picking_id +msgid "Picking" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__picking_line_ids +msgid "Picking Line" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.actions.act_window,name:stock_picking_report_summary.action_picking_summary +#: model:ir.actions.report,name:stock_picking_report_summary.report_picking_summary +msgid "Picking Summary" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model,name:stock_picking_report_summary.model_picking_summary_wizard +msgid "Picking Summary Wizard" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model,name:stock_picking_report_summary.model_picking_summary_wizard_picking +msgid "Picking Summary Wizard Picking" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model,name:stock_picking_report_summary.model_picking_summary_wizard_product +msgid "Picking Summary Wizard Product" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Pickings Details" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form +msgid "Print PDF" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_details +msgid "Print Picking Details" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_prices +msgid "Print Standard Prices" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_summary +msgid "Print Summary" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__print_unit_in_list +msgid "Print Units" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__product_id +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Product" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__product_line_ids +msgid "Product Line" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Products Summary" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Quantity" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__quantity_total +msgid "Quantity Total" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__standard_price_total +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__standard_price_total +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Standard Price Total" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Standard Unit Price" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Total price" +msgstr "" + +#. module: stock_picking_report_summary +#: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary +msgid "Unit" +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,help:stock_picking_report_summary.field_picking_summary_wizard_product__standard_price +msgid "" +"Value of the product (automatically computed in AVCO).\n" +" Used to value the product when the purchase cost is not known (e.g. inventory adjustment).\n" +" Used to compute margins on sale orders." +msgstr "" + +#. module: stock_picking_report_summary +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__wizard_id +#: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__wizard_id +msgid "Wizard" +msgstr "" diff --git a/stock_picking_report_summary/pyproject.toml b/stock_picking_report_summary/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/stock_picking_report_summary/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_picking_report_summary/readme/CONTRIBUTORS.md b/stock_picking_report_summary/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..1eb208c3c --- /dev/null +++ b/stock_picking_report_summary/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Quentin DUPONT () diff --git a/stock_picking_report_summary/readme/DESCRIPTION.md b/stock_picking_report_summary/readme/DESCRIPTION.md new file mode 100644 index 000000000..fde4d7aba --- /dev/null +++ b/stock_picking_report_summary/readme/DESCRIPTION.md @@ -0,0 +1,8 @@ +Select several Pickings to print a PDF summary with two sheets : + +- Products Summary (where the total sum is calculated for each product) +- Detail Part (each delivery is detailed product by product, with lines + at 0 printed in grey) + +You can choose to print standard prices or not (can be useful to check +some values when you prepare your pickings). diff --git a/stock_picking_report_summary/readme/USAGE.md b/stock_picking_report_summary/readme/USAGE.md new file mode 100644 index 000000000..aaa353729 --- /dev/null +++ b/stock_picking_report_summary/readme/USAGE.md @@ -0,0 +1,13 @@ +To use this module, you need to + +- Go to Inventory +- Choose a Operation +- Select any pickings and click on 'Action' / 'Picking Summary' + +![](../static/description/new_print_action.png) + +- Choose your options + +![](../static/description/wizard.png) + +![](../static/description/pdf_report.png) diff --git a/stock_picking_report_summary/reports/report_print_picking_summary.xml b/stock_picking_report_summary/reports/report_print_picking_summary.xml new file mode 100644 index 000000000..b9413278e --- /dev/null +++ b/stock_picking_report_summary/reports/report_print_picking_summary.xml @@ -0,0 +1,16 @@ + + + + Picking Summary + picking.summary.wizard + qweb-pdf + stock_picking_report_summary.picking_summary + stock_picking_report_summary.picking_summary + + + report + + diff --git a/stock_picking_report_summary/reports/report_print_picking_summary_template.xml b/stock_picking_report_summary/reports/report_print_picking_summary_template.xml new file mode 100644 index 000000000..724c483ac --- /dev/null +++ b/stock_picking_report_summary/reports/report_print_picking_summary_template.xml @@ -0,0 +1,184 @@ + + + + diff --git a/stock_picking_report_summary/security/ir.model.access.csv b/stock_picking_report_summary/security/ir.model.access.csv new file mode 100644 index 000000000..c206d8840 --- /dev/null +++ b/stock_picking_report_summary/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +picking_summary_wizard,picking_summary_wizard,stock_picking_report_summary.model_picking_summary_wizard,stock.group_stock_user,1,1,1,0 +picking_summary_wizard_product,picking_summary_wizard_product,stock_picking_report_summary.model_picking_summary_wizard_product,stock.group_stock_user,1,1,1,0 +picking_summary_wizard_picking,picking_summary_wizard_picking,stock_picking_report_summary.model_picking_summary_wizard_picking,stock.group_stock_user,1,1,1,0 diff --git a/stock_picking_report_summary/static/description/icon.png b/stock_picking_report_summary/static/description/icon.png new file mode 100644 index 000000000..7630b14a4 Binary files /dev/null and b/stock_picking_report_summary/static/description/icon.png differ diff --git a/stock_picking_report_summary/static/description/index.html b/stock_picking_report_summary/static/description/index.html new file mode 100644 index 000000000..b5021b7c6 --- /dev/null +++ b/stock_picking_report_summary/static/description/index.html @@ -0,0 +1,454 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Stock Picking Report Summary

+ +

Beta License: AGPL-3 OCA/stock-logistics-reporting Translate me on Weblate Try me on Runboat

+

Select several Pickings to print a PDF summary with two sheets :

+
    +
  • Products Summary (where the total sum is calculated for each product)
  • +
  • Detail Part (each delivery is detailed product by product, with lines +at 0 printed in grey)
  • +
+

You can choose to print standard prices or not (can be useful to check +some values when you prepare your pickings).

+

Table of contents

+ +
+

Usage

+

To use this module, you need to

+
    +
  • Go to Inventory
  • +
  • Choose a Operation
  • +
  • Select any pickings and click on ‘Action’ / ‘Picking Summary’
  • +
+

image1

+
    +
  • Choose your options
  • +
+

image2

+

image3

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Grap
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

Current maintainers:

+

quentinDupont legalsylvain

+

This module is part of the OCA/stock-logistics-reporting project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/stock_picking_report_summary/static/description/new_print_action.png b/stock_picking_report_summary/static/description/new_print_action.png new file mode 100644 index 000000000..c8c1f8ff5 Binary files /dev/null and b/stock_picking_report_summary/static/description/new_print_action.png differ diff --git a/stock_picking_report_summary/static/description/pdf_report.png b/stock_picking_report_summary/static/description/pdf_report.png new file mode 100644 index 000000000..10e6412f5 Binary files /dev/null and b/stock_picking_report_summary/static/description/pdf_report.png differ diff --git a/stock_picking_report_summary/static/description/wizard.png b/stock_picking_report_summary/static/description/wizard.png new file mode 100644 index 000000000..0eb3989bb Binary files /dev/null and b/stock_picking_report_summary/static/description/wizard.png differ diff --git a/stock_picking_report_summary/tests/__init__.py b/stock_picking_report_summary/tests/__init__.py new file mode 100644 index 000000000..d9b96c4fa --- /dev/null +++ b/stock_picking_report_summary/tests/__init__.py @@ -0,0 +1 @@ +from . import test_module diff --git a/stock_picking_report_summary/tests/test_module.py b/stock_picking_report_summary/tests/test_module.py new file mode 100644 index 000000000..e688476bf --- /dev/null +++ b/stock_picking_report_summary/tests/test_module.py @@ -0,0 +1,154 @@ +# Copyright (C) 2022 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import Command + +from odoo.addons.base.tests.common import BaseCommon + + +class TestModule(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.PickingReportWizard = cls.env["picking.summary.wizard"] + cls.StockPicking = cls.env["stock.picking"] + cls.outPickingType = cls.env.ref("stock.picking_type_out") + cls.stock_location = cls.env.ref("stock.stock_location_stock") + cls.customer_location = cls.env.ref("stock.stock_location_customers") + cls.uom_unit = cls.env.ref("uom.product_uom_unit") + cls.uom_dozen = cls.env.ref("uom.product_uom_dozen") + cls.ir_actions_report = cls.env["ir.actions.report"] + cls.report_name = "stock_picking_report_summary.report_picking_summary" + + cls.partner_1 = cls.env["res.partner"].create({"name": "Picking Partner 1"}) + cls.partner_2 = cls.env["res.partner"].create({"name": "Picking Partner 2"}) + cls.product_category = cls.env["product.category"].create( + {"name": "Summary Category"} + ) + cls.product_a = cls.env["product.product"].create( + { + "name": "Summary Product A", + "categ_id": cls.product_category.id, + "standard_price": 4.0, + "uom_id": cls.uom_unit.id, + } + ) + cls.product_b = cls.env["product.product"].create( + { + "name": "Summary Product B", + "categ_id": cls.product_category.id, + "standard_price": 2.0, + "uom_id": cls.uom_unit.id, + "uom_ids": [Command.link(cls.uom_dozen.id)], + } + ) + cls.product_without_category = cls.env["product.product"].create( + { + "name": "Summary Product Without Category", + "categ_id": False, + "standard_price": 1.0, + "uom_id": cls.uom_unit.id, + } + ) + cls.picking_1 = cls._create_picking( + cls.partner_1, + [ + Command.create(cls._move_vals(cls.product_a, 3.0)), + Command.create(cls._move_vals(cls.product_b, 0.0)), + ], + ) + cls.picking_2 = cls._create_picking( + cls.partner_2, + [ + Command.create(cls._move_vals(cls.product_a, 2.0)), + Command.create( + cls._move_vals(cls.product_b, 2.0, product_uom=cls.uom_dozen) + ), + Command.create(cls._move_vals(cls.product_without_category, 1.0)), + ], + ) + + @classmethod + def _move_vals(cls, product, quantity, product_uom=None): + product_uom = product_uom or product.uom_id + return { + "product_id": product.id, + "product_uom_qty": quantity, + "product_uom": product_uom.id, + "location_id": cls.stock_location.id, + "location_dest_id": cls.customer_location.id, + } + + @classmethod + def _create_picking(cls, partner, move_commands): + return cls.StockPicking.create( + { + "partner_id": partner.id, + "picking_type_id": cls.outPickingType.id, + "location_id": cls.stock_location.id, + "location_dest_id": cls.customer_location.id, + "move_ids": move_commands, + } + ) + + def _create_wizard(self, **values): + return self.PickingReportWizard.with_context( + active_model="stock.picking", + active_ids=(self.picking_1 | self.picking_2).ids, + ).create(values) + + def _render_wizard(self, wizard): + html = self.ir_actions_report._render_qweb_html(self.report_name, wizard.ids)[0] + return html.decode() if isinstance(html, bytes) else html + + def test_wizard_summary_lines(self): + wizard = self._create_wizard() + + self.assertEqual(wizard.picking_line_qty, 2) + self.assertEqual( + wizard.picking_line_ids.mapped("picking_id"), + self.picking_1 | self.picking_2, + ) + + product_lines = { + line.product_id: line.quantity_total for line in wizard.product_line_ids + } + self.assertEqual(product_lines[self.product_a], 5.0) + self.assertEqual(product_lines[self.product_b], 24.0) + self.assertEqual(product_lines[self.product_without_category], 1.0) + + sum_th = sum(wizard.mapped("product_line_ids.standard_price_total")) + wizard._compute_standard_price_total() + self.assertEqual(sum_th, wizard.standard_price_total) + self.assertEqual(wizard.standard_price_total, 69.0) + + def test_report_render_options(self): + custom_note = "Picking summary custom note" + self.picking_1.note = custom_note + wizard = self._create_wizard(print_prices=True) + + html = self._render_wizard(wizard) + + self.assertIn("Products Summary", html) + self.assertIn("Pickings Details", html) + self.assertIn(custom_note, html) + self.assertIn("Standard Unit", html) + self.assertIn("Standard Price Total", html) + self.assertIn("Summary Product A", html) + self.assertIn("Summary Product B", html) + self.assertIn("Summary Product Without Category", html) + self.assertIn("color:gray;", html) + + def test_report_render_without_optional_sections(self): + wizard = self._create_wizard( + print_summary=False, + print_unit_in_list=False, + print_prices=False, + ) + + html = self._render_wizard(wizard) + + self.assertNotIn("Products Summary", html) + self.assertIn("Pickings Details", html) + self.assertNotIn("Standard Unit", html) diff --git a/stock_picking_report_summary/wizards/__init__.py b/stock_picking_report_summary/wizards/__init__.py new file mode 100644 index 000000000..f8a989551 --- /dev/null +++ b/stock_picking_report_summary/wizards/__init__.py @@ -0,0 +1,3 @@ +from . import picking_summary_wizard +from . import picking_summary_wizard_picking +from . import picking_summary_wizard_product diff --git a/stock_picking_report_summary/wizards/picking_summary_wizard.py b/stock_picking_report_summary/wizards/picking_summary_wizard.py new file mode 100644 index 000000000..2769d3000 --- /dev/null +++ b/stock_picking_report_summary/wizards/picking_summary_wizard.py @@ -0,0 +1,106 @@ +# Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import Command, fields, models + + +class PickingSummaryWizard(models.TransientModel): + _name = "picking.summary.wizard" + _description = "Picking Summary Wizard" + + # Columns Section + print_summary = fields.Boolean(default=True) + + print_details = fields.Boolean(string="Print Picking Details", default=True) + + print_unit_in_list = fields.Boolean(string="Print Units", default=True) + + print_prices = fields.Boolean(string="Print Standard Prices", default=False) + + product_line_ids = fields.One2many( + comodel_name="picking.summary.wizard.product", + inverse_name="wizard_id", + default=lambda self: self._default_product_line_ids(), + ) + + standard_price_total = fields.Float( + compute="_compute_standard_price_total", + digits="Product Price", + ) + + picking_line_ids = fields.One2many( + comodel_name="picking.summary.wizard.picking", + inverse_name="wizard_id", + default=lambda self: self._default_picking_line_ids(), + ) + + picking_line_qty = fields.Integer( + string="Number of Selected Picking", + readonly=True, + default=lambda self: self._default_picking_line_qty(), + ) + + def _get_product_category_name(self, product): + return (product.categ_id.name or "").capitalize() + + # Default Section + def _default_picking_line_qty(self): + return len(self.env.context.get("active_ids", [])) + + def _default_picking_line_ids(self): + picking_obj = self.env["stock.picking"] + res = [] + picking_ids = self.env.context.get("active_ids", []) + for picking in picking_obj.browse(picking_ids): + res.append( + Command.create( + { + "picking_id": picking.id, + }, + ) + ) + return res + + def _default_product_line_ids(self): + picking_obj = self.env["stock.picking"] + res = [] + product_lines = {} + picking_ids = self.env.context.get("active_ids", []) + # move.product_qty is real quantity with referent uom + for picking in picking_obj.browse(picking_ids): + for move in picking.move_ids: + if move.product_id.id not in product_lines.keys(): + product_lines[move.product_id.id] = { + "name": move.product_id.name, + "categ": self._get_product_category_name(move.product_id), + "qty": move.product_qty, + } + else: + old_qty = product_lines[move.product_id.id]["qty"] + product_lines[move.product_id.id] = { + "name": move.product_id.name, + "categ": self._get_product_category_name(move.product_id), + "qty": old_qty + move.product_qty, + } + # Arranged in alphabetical order for category then product name + product_lines_sorted = sorted( + product_lines.items(), key=lambda x: (x[1]["categ"], x[1]["name"]) + ) + for product_id, name_qty in product_lines_sorted: + res.append( + Command.create( + { + "product_id": product_id, + "quantity_total": name_qty["qty"], + }, + ) + ) + return res + + # Compute Section + def _compute_standard_price_total(self): + self.ensure_one() + self.standard_price_total = sum( + self.mapped("product_line_ids.standard_price_total") + ) diff --git a/stock_picking_report_summary/wizards/picking_summary_wizard_picking.py b/stock_picking_report_summary/wizards/picking_summary_wizard_picking.py new file mode 100644 index 000000000..4cb67dc83 --- /dev/null +++ b/stock_picking_report_summary/wizards/picking_summary_wizard_picking.py @@ -0,0 +1,14 @@ +# Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class PickingSummaryWizardPicking(models.TransientModel): + _name = "picking.summary.wizard.picking" + _description = "Picking Summary Wizard Picking" + + wizard_id = fields.Many2one(comodel_name="picking.summary.wizard") + + picking_id = fields.Many2one(comodel_name="stock.picking") diff --git a/stock_picking_report_summary/wizards/picking_summary_wizard_product.py b/stock_picking_report_summary/wizards/picking_summary_wizard_product.py new file mode 100644 index 000000000..f9d91fe93 --- /dev/null +++ b/stock_picking_report_summary/wizards/picking_summary_wizard_product.py @@ -0,0 +1,31 @@ +# Copyright (C) 2015 - Today: GRAP (http://www.grap.coop) +# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class PickingSummaryWizardProduct(models.TransientModel): + _name = "picking.summary.wizard.product" + _description = "Picking Summary Wizard Product" + + wizard_id = fields.Many2one(comodel_name="picking.summary.wizard") + + product_id = fields.Many2one(comodel_name="product.product") + + quantity_total = fields.Float() + + standard_price = fields.Float( + related="product_id.standard_price", digits="Product Price" + ) + + standard_price_total = fields.Float( + compute="_compute_standard_price_total", + digits="Product Price", + ) + + def _compute_standard_price_total(self): + for line in self: + line.standard_price_total = ( + line.product_id.standard_price * line.quantity_total + ) diff --git a/stock_picking_report_summary/wizards/view_picking_summary_wizard.xml b/stock_picking_report_summary/wizards/view_picking_summary_wizard.xml new file mode 100644 index 000000000..b9f86857d --- /dev/null +++ b/stock_picking_report_summary/wizards/view_picking_summary_wizard.xml @@ -0,0 +1,51 @@ + + + + + picking.summary.wizard + +
+ + + + + + + + + + + + + +
+
+
+
+
+ + + Picking Summary + picking.summary.wizard + form + new + + report + +