From d0b7e32efc3490420f5228c0cd31ea1a024449fe Mon Sep 17 00:00:00 2001 From: Quentin Dupont Date: Wed, 11 May 2022 11:45:01 +0200 Subject: [PATCH] [IMP] stock_report_picking_summary: optional print prices --- stock_picking_report_summary/README.rst | 17 ++++ stock_picking_report_summary/i18n/fr.po | 75 +++++++++++------- .../models/picking_summary_wizard.py | 60 +++++++------- .../models/picking_summary_wizard_product.py | 6 +- .../readme/DESCRIPTION.rst | 3 + stock_picking_report_summary/readme/USAGE.rst | 6 ++ .../report_print_picking_summary_template.xml | 23 +++--- .../static/description/icon.png | Bin 9455 -> 20390 bytes .../static/description/index.html | 9 +++ .../static/description/pdf_report.png | Bin 75743 -> 91197 bytes .../description/pdf_report_wo_prices.png | Bin 0 -> 85584 bytes .../static/description/wizard.png | Bin 22634 -> 33240 bytes stock_picking_report_summary/views/action.xml | 1 - .../views/view_picking_summary_wizard.xml | 1 + 14 files changed, 128 insertions(+), 73 deletions(-) create mode 100644 stock_picking_report_summary/static/description/pdf_report_wo_prices.png diff --git a/stock_picking_report_summary/README.rst b/stock_picking_report_summary/README.rst index 2ecc8d6..f3ab7ea 100644 --- a/stock_picking_report_summary/README.rst +++ b/stock_picking_report_summary/README.rst @@ -26,6 +26,9 @@ print a Report summary with two sheets : * Detail Part (each Picking is shown) +You can choose to print standard prices or not. It can be useful to check some +values when you prepare your pickings. + **Table of contents** .. contents:: @@ -42,10 +45,16 @@ To use this module, you need to * Select any pickings and click on 'Action' / 'Print Picking Summary (PDF)' +* Choose your options + .. figure:: https://raw.githubusercontent.com/quentinDupont/stock-logistics-reporting/12.0_ADD_picking_summary_report/stock_picking_report_summary/static/description/wizard.png .. figure:: https://raw.githubusercontent.com/quentinDupont/stock-logistics-reporting/12.0_ADD_picking_summary_report/stock_picking_report_summary/static/description/pdf_report.png +Without prices : + +.. figure:: https://raw.githubusercontent.com/quentinDupont/stock-logistics-reporting/12.0_ADD_picking_summary_report/stock_picking_report_summary/static/description/pdf_report_wo_prices.png + Bug Tracker =========== @@ -72,6 +81,14 @@ Contributors Maintainers ~~~~~~~~~~~ +.. |maintainer-quentinDupont| image:: https://github.com/quentinDupont.png?size=40px + :target: https://github.com/quentinDupont + :alt: quentinDupont + +Current maintainer: + +|maintainer-quentinDupont| + This module is part of the `quentinDupont/stock-logistics-reporting `_ project on GitHub. You are welcome to contribute. diff --git a/stock_picking_report_summary/i18n/fr.po b/stock_picking_report_summary/i18n/fr.po index ac51d0e..a97b4e2 100644 --- a/stock_picking_report_summary/i18n/fr.po +++ b/stock_picking_report_summary/i18n/fr.po @@ -1,13 +1,13 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * stock_picking_report_summary +# * stock_picking_report_summary # msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-12-02 13:25+0000\n" -"PO-Revision-Date: 2020-12-02 13:25+0000\n" +"POT-Creation-Date: 2022-05-11 09:34+0000\n" +"PO-Revision-Date: 2022-05-11 09:34+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -25,6 +25,16 @@ msgstr "Annuler" 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,help:stock_picking_report_summary.field_picking_summary_wizard_product__standard_price +msgid "Cost used for stock valuation in standard price and as a first price to set in average/fifo. Also used as a base price for pricelists. Expressed in the default unit of measure of the product." +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__create_uid #: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_picking__create_uid @@ -39,11 +49,6 @@ msgstr "Créé par" 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__picking_line_qty -msgid "Number of Selected Picking" -msgstr "Quantité selectionné" - #. 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 @@ -68,7 +73,7 @@ msgstr "" #: 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" +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 @@ -84,10 +89,15 @@ msgstr "Dernière mise à jour par" 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é selectionné" + #. 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 "Bon de livraison" +msgstr "Opération de manutention" #. module: stock_picking_report_summary #: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard__picking_line_ids @@ -99,6 +109,21 @@ msgstr "Ligne de bon de livraison" msgid "Picking Summary (PDF)" msgstr "Résumé des opérations (PDF)" +#. 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.view_picking_summary_wizard_form msgid "Pickings Details" @@ -124,6 +149,11 @@ msgstr "Résumé des opérations (PDF)" msgid "Print Product Summary" msgstr "Imprimer le résumé des opérations" +#. 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 #: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.view_picking_summary_wizard_form @@ -168,6 +198,11 @@ msgstr "Quantité total" 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.view_picking_summary_wizard_form msgid "Summary" @@ -178,11 +213,6 @@ msgstr "Résumé" 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 Price" -msgstr "Prix unitaire" - #. module: stock_picking_report_summary #: model_terms:ir.ui.view,arch_db:stock_picking_report_summary.picking_summary msgid "Unity" @@ -193,18 +223,3 @@ msgstr "Unité" #: model:ir.model.fields,field_description:stock_picking_report_summary.field_picking_summary_wizard_product__wizard_id msgid "Wizard" msgstr "Assistant" - -#. 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 "" diff --git a/stock_picking_report_summary/models/picking_summary_wizard.py b/stock_picking_report_summary/models/picking_summary_wizard.py index a9d38bd..ba480c8 100644 --- a/stock_picking_report_summary/models/picking_summary_wizard.py +++ b/stock_picking_report_summary/models/picking_summary_wizard.py @@ -10,6 +10,37 @@ class PickingSummaryWizard(models.TransientModel): _name = 'picking.summary.wizard' _description = 'Picking Summary Wizard' + # Columns Section + print_summary = fields.Boolean( + string='Print Summary', default=True) + + print_detail = fields.Boolean( + string='Print Detail', default=True) + + print_unity_in_list = fields.Boolean( + string='Print Unit in Pickings List', 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=dp.get_precision('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()) + # Default Section def _default_picking_line_qty(self): return len(self._context.get('active_ids', [])) @@ -48,9 +79,6 @@ class PickingSummaryWizard(models.TransientModel): # 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'])) - # product_lines_sorted = sorted( - # dict(product_lines_sorted).items(), - # key=lambda x: ) for product_id, name_qty in product_lines_sorted: res.append((0, 0, { 'product_id': product_id, @@ -58,32 +86,6 @@ class PickingSummaryWizard(models.TransientModel): })) return res - # Columns Section - print_summary = fields.Boolean( - string='Print Summary', default=True) - - print_detail = fields.Boolean( - string='Print Detail', default=True) - - print_unity_in_list = fields.Boolean( - string='Print Unit in Pickings List', default=True) - - product_line_ids = fields.One2many( - comodel_name='picking.summary.wizard.product', - inverse_name='wizard_id', default=_default_product_line_ids) - - standard_price_total = fields.Float( - compute='_compute_standard_price_total', - digits=dp.get_precision('Product Unit of Measure')) - - picking_line_ids = fields.One2many( - comodel_name='picking.summary.wizard.picking', - inverse_name='wizard_id', default=_default_picking_line_ids) - - picking_line_qty = fields.Integer( - string='Number of Selected Picking', readonly=True, - default=_default_picking_line_qty) - # Compute Section @api.multi def _compute_standard_price_total(self): diff --git a/stock_picking_report_summary/models/picking_summary_wizard_product.py b/stock_picking_report_summary/models/picking_summary_wizard_product.py index a50854a..db38042 100644 --- a/stock_picking_report_summary/models/picking_summary_wizard_product.py +++ b/stock_picking_report_summary/models/picking_summary_wizard_product.py @@ -16,9 +16,13 @@ class PickingSummaryWizardProduct(models.TransientModel): quantity_total = fields.Float() + standard_price = fields.Float( + related='product_id.standard_price', + digits=dp.get_precision('Product Price')) + standard_price_total = fields.Float( compute='_compute_standard_price_total', - digits=dp.get_precision('Product Unit of Measure')) + digits=dp.get_precision('Product Price')) @api.multi def _compute_standard_price_total(self): diff --git a/stock_picking_report_summary/readme/DESCRIPTION.rst b/stock_picking_report_summary/readme/DESCRIPTION.rst index 7bb0835..6792935 100644 --- a/stock_picking_report_summary/readme/DESCRIPTION.rst +++ b/stock_picking_report_summary/readme/DESCRIPTION.rst @@ -4,3 +4,6 @@ print a Report summary with two sheets : * Products Summary (where the total sum is calculated for each product) * Detail Part (each Picking is shown) + +You can choose to print standard prices or not. It can be useful to check some +values when you prepare your pickings. diff --git a/stock_picking_report_summary/readme/USAGE.rst b/stock_picking_report_summary/readme/USAGE.rst index 492f478..6c4be3d 100644 --- a/stock_picking_report_summary/readme/USAGE.rst +++ b/stock_picking_report_summary/readme/USAGE.rst @@ -6,6 +6,12 @@ To use this module, you need to * Select any pickings and click on 'Action' / 'Print Picking Summary (PDF)' +* Choose your options + .. figure:: ../static/description/wizard.png .. figure:: ../static/description/pdf_report.png + +Without prices : + +.. figure:: ../static/description/pdf_report_wo_prices.png 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 index 9021568..b061044 100644 --- a/stock_picking_report_summary/reports/report_print_picking_summary_template.xml +++ b/stock_picking_report_summary/reports/report_print_picking_summary_template.xml @@ -4,16 +4,16 @@