diff --git a/stock_picking_report_valued/README.rst b/stock_picking_report_valued/README.rst new file mode 100644 index 0000000..587b935 --- /dev/null +++ b/stock_picking_report_valued/README.rst @@ -0,0 +1,110 @@ +===================== +Valued Picking Report +===================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fstock--logistics--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-reporting/tree/13.0/stock_picking_report_valued + :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-13-0/stock-logistics-reporting-13-0-stock_picking_report_valued + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/151/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Add amount information to Delivery Slip report. +You can select at partner level if picking list report must be valued or not. +If the picking is done it's valued with quantity done, otherwise the picking +is valued with reserved quantity. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +#. Go to *Customers > (select one of your choice) > Sales & Purchases*. +#. Set *Valued picking* field on. + +Usage +===== + +To get the stock picking valued report: + +#. Create a Sale Order with stockable products a *Valued picking* able + customer. +#. Confirm the Sale Order. +#. Click on *Delivery* stat button. +#. Go to *Print > Delivery Slip*. + +Known issues / Roadmap +====================== + +* If the picking is not reserved, values aren't computed. + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Avanzosc `_: + + * Oihane Crucelaegui + +* `Tecnativa `_: + + * Pedro M. Baeza + * Antonio Espinosa + * Carlos Dauden + * David Vidal + * Luis M. Ontalba + * Ernesto Tejeda + * Sergio Teruel + +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/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_valued/__init__.py b/stock_picking_report_valued/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/stock_picking_report_valued/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/stock_picking_report_valued/__manifest__.py b/stock_picking_report_valued/__manifest__.py new file mode 100644 index 0000000..484364e --- /dev/null +++ b/stock_picking_report_valued/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2014 Pedro M. Baeza - Tecnativa +# Copyright 2015 Antonio Espinosa - Tecnativa +# Copyright 2016-2019 Carlos Dauden - Tecnativa +# Copyright 2017 David Vidal - Tecnativa +# Copyright 2017 Luis M. Ontalba - Tecnativa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Valued Picking Report", + "summary": "Adding Valued Picking on Delivery Slip report", + "version": "13.0.1.0.0", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/stock-logistics-reporting", + "category": "Warehouse Management", + "license": "AGPL-3", + "depends": ["sale_management", "stock"], + "data": ["views/res_partner_view.xml", "report/stock_picking_report_valued.xml"], + "installable": True, +} diff --git a/stock_picking_report_valued/i18n/es.po b/stock_picking_report_valued/i18n/es.po new file mode 100644 index 0000000..267713e --- /dev/null +++ b/stock_picking_report_valued/i18n/es.po @@ -0,0 +1,154 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_report_valued +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-21 08:13+0000\n" +"PO-Revision-Date: 2017-08-21 10:13+0200\n" +"Last-Translator: Carlos Dauden \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"X-Generator: Poedit 1.8.7.1\n" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Discount" +msgstr "Dto" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +#, fuzzy +msgid "Qty Reserved" +msgstr "Precio Unidad" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Subtotal" +msgstr "Subtotal" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Taxes" +msgstr "Impuestos" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Total" +msgstr "Total" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Unit Price" +msgstr "Precio Unidad" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Untaxed Amount" +msgstr "Base imponible" + +#. module: stock_picking_report_valued +#: model:ir.model,name:stock_picking_report_valued.model_res_partner +msgid "Contact" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__currency_id +msgid "Currency" +msgstr "Moneda" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_subtotal +msgid "Price subtotal" +msgstr "Subtotal" + +#. module: stock_picking_report_valued +#: model:ir.model,name:stock_picking_report_valued.model_stock_move_line +msgid "Product Moves (Stock Move Line)" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_line +msgid "Related order line" +msgstr "Línea de pedido relacionada" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__currency_id +#, fuzzy +msgid "Sale Currency" +msgstr "Moneda" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_tax_id +msgid "Sale Tax" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_discount +msgid "Sale discount (%)" +msgstr "Descuento venta (%)" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_unit +msgid "Sale price unit" +msgstr "Precio venta" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_tax_description +msgid "Tax Description" +msgstr "Descripción de impuesto" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_tax +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__amount_tax +msgid "Taxes" +msgstr "Impuestos" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_total +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__amount_total +msgid "Total" +msgstr "Total" + +#. module: stock_picking_report_valued +#: model:ir.model,name:stock_picking_report_valued.model_stock_picking +msgid "Transfer" +msgstr "Transferir" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__amount_untaxed +msgid "Untaxed Amount" +msgstr "Base imponible" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_res_partner__valued_picking +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_res_users__valued_picking +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__valued +#, fuzzy +msgid "Valued Picking" +msgstr "Albarán valorado" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,help:stock_picking_report_valued.field_res_partner__valued_picking +#: model:ir.model.fields,help:stock_picking_report_valued.field_res_users__valued_picking +#: model:ir.model.fields,help:stock_picking_report_valued.field_stock_picking__valued +msgid "You can select which partners have valued pickings" +msgstr "Puede seleccionar qué empresas tienen albarán valorado" + +#~ msgid "Packing Operation" +#~ msgstr "Operación de empaquetado" + +#~ msgid "Partner" +#~ msgstr "Empresa" + +#~ msgid "Website Messages" +#~ msgstr "Mensajes del sitio web" + +#~ msgid "Website communication history" +#~ msgstr "Historial de comunicaciones del sitio web" diff --git a/stock_picking_report_valued/i18n/hr.po b/stock_picking_report_valued/i18n/hr.po new file mode 100644 index 0000000..fee7088 --- /dev/null +++ b/stock_picking_report_valued/i18n/hr.po @@ -0,0 +1,149 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_report_valued +# +# Translators: +# Bole , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-12-01 02:22+0000\n" +"PO-Revision-Date: 2017-12-01 02:22+0000\n" +"Last-Translator: Bole , 2018\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Discount" +msgstr "Popust" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +#, fuzzy +msgid "Qty Reserved" +msgstr "Jed.cijena" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Subtotal" +msgstr "Subtotal" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Taxes" +msgstr "Porezi" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Total" +msgstr "Total" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Unit Price" +msgstr "Jed.cijena" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Untaxed Amount" +msgstr "Bez poreza" + +#. module: stock_picking_report_valued +#: model:ir.model,name:stock_picking_report_valued.model_res_partner +msgid "Contact" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__currency_id +msgid "Currency" +msgstr "Valuta" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_subtotal +msgid "Price subtotal" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model,name:stock_picking_report_valued.model_stock_move_line +msgid "Product Moves (Stock Move Line)" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_line +msgid "Related order line" +msgstr "Povezana stavka ponude" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__currency_id +#, fuzzy +msgid "Sale Currency" +msgstr "Valuta" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_tax_id +msgid "Sale Tax" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_discount +msgid "Sale discount (%)" +msgstr "Popust prodaje (%)" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_unit +msgid "Sale price unit" +msgstr "Prodajna cijena" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_tax_description +msgid "Tax Description" +msgstr "Opis poreza" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_tax +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__amount_tax +msgid "Taxes" +msgstr "Porezi" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_total +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__amount_total +msgid "Total" +msgstr "Ukupno" + +#. module: stock_picking_report_valued +#: model:ir.model,name:stock_picking_report_valued.model_stock_picking +msgid "Transfer" +msgstr "Transfer" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__amount_untaxed +msgid "Untaxed Amount" +msgstr "Iznos bez poreza" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_res_partner__valued_picking +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_res_users__valued_picking +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__valued +msgid "Valued Picking" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,help:stock_picking_report_valued.field_res_partner__valued_picking +#: model:ir.model.fields,help:stock_picking_report_valued.field_res_users__valued_picking +#: model:ir.model.fields,help:stock_picking_report_valued.field_stock_picking__valued +msgid "You can select which partners have valued pickings" +msgstr "" + +#~ msgid "Packing Operation" +#~ msgstr "Operacija pakiranja" + +#~ msgid "Partner" +#~ msgstr "Partner" diff --git a/stock_picking_report_valued/i18n/stock_picking_report_valued.pot b/stock_picking_report_valued/i18n/stock_picking_report_valued.pot new file mode 100644 index 0000000..841d1f8 --- /dev/null +++ b/stock_picking_report_valued/i18n/stock_picking_report_valued.pot @@ -0,0 +1,136 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_picking_report_valued +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.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_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Discount" +msgstr "" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Qty Reserved" +msgstr "" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Subtotal" +msgstr "" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Taxes" +msgstr "" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Total" +msgstr "" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Unit Price" +msgstr "" + +#. module: stock_picking_report_valued +#: model_terms:ir.ui.view,arch_db:stock_picking_report_valued.valued_report_picking +msgid "Untaxed Amount" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model,name:stock_picking_report_valued.model_res_partner +msgid "Contact" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__currency_id +msgid "Currency" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_subtotal +msgid "Price subtotal" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model,name:stock_picking_report_valued.model_stock_move_line +msgid "Product Moves (Stock Move Line)" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_line +msgid "Related order line" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__currency_id +msgid "Sale Currency" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_tax_id +msgid "Sale Tax" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_discount +msgid "Sale discount (%)" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_unit +msgid "Sale price unit" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_tax_description +msgid "Tax Description" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_tax +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__amount_tax +msgid "Taxes" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_move_line__sale_price_total +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__amount_total +msgid "Total" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model,name:stock_picking_report_valued.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__amount_untaxed +msgid "Untaxed Amount" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_res_partner__valued_picking +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_res_users__valued_picking +#: model:ir.model.fields,field_description:stock_picking_report_valued.field_stock_picking__valued +msgid "Valued Picking" +msgstr "" + +#. module: stock_picking_report_valued +#: model:ir.model.fields,help:stock_picking_report_valued.field_res_partner__valued_picking +#: model:ir.model.fields,help:stock_picking_report_valued.field_res_users__valued_picking +#: model:ir.model.fields,help:stock_picking_report_valued.field_stock_picking__valued +msgid "You can select which partners have valued pickings" +msgstr "" + diff --git a/stock_picking_report_valued/models/__init__.py b/stock_picking_report_valued/models/__init__.py new file mode 100644 index 0000000..c1e5051 --- /dev/null +++ b/stock_picking_report_valued/models/__init__.py @@ -0,0 +1,3 @@ +from . import res_partner +from . import stock_move_line +from . import stock_picking diff --git a/stock_picking_report_valued/models/res_partner.py b/stock_picking_report_valued/models/res_partner.py new file mode 100644 index 0000000..9af0967 --- /dev/null +++ b/stock_picking_report_valued/models/res_partner.py @@ -0,0 +1,14 @@ +# Copyright 2014 Pedro M. Baeza - Tecnativa +# Copyright 2015 Antonio Espinosa - Tecnativa +# Copyright 2016 Carlos Dauden - Tecnativa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + valued_picking = fields.Boolean( + default=True, help="You can select which partners have valued pickings" + ) diff --git a/stock_picking_report_valued/models/stock_move_line.py b/stock_picking_report_valued/models/stock_move_line.py new file mode 100644 index 0000000..aa51c2f --- /dev/null +++ b/stock_picking_report_valued/models/stock_move_line.py @@ -0,0 +1,79 @@ +# Copyright 2014-2018 Tecnativa - Pedro M. Baeza +# Copyright 2015 Antonio Espinosa - Tecnativa +# Copyright 2018 Luis M. Ontalba - Tecnativa +# Copyright 2016-2018 Carlos Dauden - Tecnativa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StockMoveLine(models.Model): + _inherit = "stock.move.line" + + sale_line = fields.Many2one( + related="move_id.sale_line_id", readonly=True, string="Related order line" + ) + currency_id = fields.Many2one( + related="sale_line.currency_id", readonly=True, string="Sale Currency" + ) + sale_tax_id = fields.Many2many( + related="sale_line.tax_id", readonly=True, string="Sale Tax" + ) + sale_price_unit = fields.Float( + related="sale_line.price_unit", readonly=True, string="Sale price unit" + ) + sale_discount = fields.Float( + related="sale_line.discount", readonly=True, string="Sale discount (%)" + ) + sale_tax_description = fields.Char( + compute="_compute_sale_order_line_fields", + string="Tax Description", + compute_sudo=True, # See explanation for sudo in compute method + ) + sale_price_subtotal = fields.Monetary( + compute="_compute_sale_order_line_fields", + string="Price subtotal", + compute_sudo=True, + ) + sale_price_tax = fields.Float( + compute="_compute_sale_order_line_fields", string="Taxes", compute_sudo=True + ) + sale_price_total = fields.Monetary( + compute="_compute_sale_order_line_fields", string="Total", compute_sudo=True + ) + + def _compute_sale_order_line_fields(self): + """This is computed with sudo for avoiding problems if you don't have + access to sales orders (stricter warehouse users, inter-company + records...). + """ + for line in self: + sale_line = line.sale_line + price_unit = ( + sale_line.price_subtotal / sale_line.product_uom_qty + if sale_line.product_uom_qty + else sale_line.price_reduce + ) + taxes = line.sale_tax_id.compute_all( + price_unit=price_unit, + currency=line.currency_id, + quantity=line.qty_done or line.product_qty, + product=line.product_id, + partner=sale_line.order_id.partner_shipping_id, + ) + if sale_line.company_id.tax_calculation_rounding_method == ( + "round_globally" + ): + price_tax = sum(t.get("amount", 0.0) for t in taxes.get("taxes", [])) + else: + price_tax = taxes["total_included"] - taxes["total_excluded"] + line.update( + { + "sale_tax_description": ", ".join( + t.name or t.description for t in line.sale_tax_id + ), + "sale_price_subtotal": taxes["total_excluded"], + "sale_price_tax": price_tax, + "sale_price_total": taxes["total_included"], + } + ) diff --git a/stock_picking_report_valued/models/stock_picking.py b/stock_picking_report_valued/models/stock_picking.py new file mode 100644 index 0000000..8466c15 --- /dev/null +++ b/stock_picking_report_valued/models/stock_picking.py @@ -0,0 +1,64 @@ +# Copyright 2014-2018 Tecnativa - Pedro M. Baeza +# Copyright 2015 Antonio Espinosa - Tecnativa +# Copyright 2016 Carlos Dauden - Tecnativa +# Copyright 2016 Luis M. Ontalba - Tecnativa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + valued = fields.Boolean(related="partner_id.valued_picking", readonly=True) + currency_id = fields.Many2one( + related="sale_id.currency_id", + readonly=True, + string="Currency", + related_sudo=True, # See explanation for sudo in compute method + ) + amount_untaxed = fields.Monetary( + compute="_compute_amount_all", + string="Untaxed Amount", + compute_sudo=True, # See explanation for sudo in compute method + ) + amount_tax = fields.Monetary( + compute="_compute_amount_all", string="Taxes", compute_sudo=True + ) + amount_total = fields.Monetary( + compute="_compute_amount_all", string="Total", compute_sudo=True + ) + + def _compute_amount_all(self): + """This is computed with sudo for avoiding problems if you don't have + access to sales orders (stricter warehouse users, inter-company + records...). + """ + for pick in self: + round_curr = pick.sale_id.currency_id.round + amount_tax = 0.0 + for tax_group in pick.get_taxes_values().values(): + amount_tax += round_curr(tax_group["amount"]) + amount_untaxed = sum(l.sale_price_subtotal for l in pick.move_line_ids) + pick.update( + { + "amount_untaxed": amount_untaxed, + "amount_tax": amount_tax, + "amount_total": amount_untaxed + amount_tax, + } + ) + + def get_taxes_values(self): + tax_grouped = {} + for line in self.move_line_ids: + for tax in line.sale_line.tax_id: + tax_id = tax.id + if tax_id not in tax_grouped: + tax_grouped[tax_id] = {"base": line.sale_price_subtotal, "tax": tax} + else: + tax_grouped[tax_id]["base"] += line.sale_price_subtotal + for tax_id, tax_group in tax_grouped.items(): + tax_grouped[tax_id]["amount"] = tax_group["tax"].compute_all( + tax_group["base"], self.sale_id.currency_id + )["taxes"][0]["amount"] + return tax_grouped diff --git a/stock_picking_report_valued/readme/CONFIGURE.rst b/stock_picking_report_valued/readme/CONFIGURE.rst new file mode 100644 index 0000000..489332d --- /dev/null +++ b/stock_picking_report_valued/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +#. Go to *Customers > (select one of your choice) > Sales & Purchases*. +#. Set *Valued picking* field on. diff --git a/stock_picking_report_valued/readme/CONTRIBUTORS.rst b/stock_picking_report_valued/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..e88945d --- /dev/null +++ b/stock_picking_report_valued/readme/CONTRIBUTORS.rst @@ -0,0 +1,13 @@ +* `Avanzosc `_: + + * Oihane Crucelaegui + +* `Tecnativa `_: + + * Pedro M. Baeza + * Antonio Espinosa + * Carlos Dauden + * David Vidal + * Luis M. Ontalba + * Ernesto Tejeda + * Sergio Teruel diff --git a/stock_picking_report_valued/readme/DESCRIPTION.rst b/stock_picking_report_valued/readme/DESCRIPTION.rst new file mode 100644 index 0000000..6a0269d --- /dev/null +++ b/stock_picking_report_valued/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +Add amount information to Delivery Slip report. +You can select at partner level if picking list report must be valued or not. +If the picking is done it's valued with quantity done, otherwise the picking +is valued with reserved quantity. diff --git a/stock_picking_report_valued/readme/ROADMAP.rst b/stock_picking_report_valued/readme/ROADMAP.rst new file mode 100644 index 0000000..2ef668b --- /dev/null +++ b/stock_picking_report_valued/readme/ROADMAP.rst @@ -0,0 +1 @@ +* If the picking is not reserved, values aren't computed. diff --git a/stock_picking_report_valued/readme/USAGE.rst b/stock_picking_report_valued/readme/USAGE.rst new file mode 100644 index 0000000..7ee36a2 --- /dev/null +++ b/stock_picking_report_valued/readme/USAGE.rst @@ -0,0 +1,7 @@ +To get the stock picking valued report: + +#. Create a Sale Order with stockable products a *Valued picking* able + customer. +#. Confirm the Sale Order. +#. Click on *Delivery* stat button. +#. Go to *Print > Delivery Slip*. diff --git a/stock_picking_report_valued/report/stock_picking_report_valued.xml b/stock_picking_report_valued/report/stock_picking_report_valued.xml new file mode 100644 index 0000000..ef19b0d --- /dev/null +++ b/stock_picking_report_valued/report/stock_picking_report_valued.xml @@ -0,0 +1,65 @@ + + + + + + diff --git a/stock_picking_report_valued/static/description/icon.png b/stock_picking_report_valued/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/stock_picking_report_valued/static/description/icon.png differ diff --git a/stock_picking_report_valued/static/description/index.html b/stock_picking_report_valued/static/description/index.html new file mode 100644 index 0000000..149dfcf --- /dev/null +++ b/stock_picking_report_valued/static/description/index.html @@ -0,0 +1,462 @@ + + + + + + +Valued Picking Report + + + +
+

Valued Picking Report

+ + +

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

+

Add amount information to Delivery Slip report. +You can select at partner level if picking list report must be valued or not. +If the picking is done it’s valued with quantity done, otherwise the picking +is valued with reserved quantity.

+

Table of contents

+ +
+

Configuration

+
    +
  1. Go to Customers > (select one of your choice) > Sales & Purchases.
  2. +
  3. Set Valued picking field on.
  4. +
+
+
+

Usage

+

To get the stock picking valued report:

+
    +
  1. Create a Sale Order with stockable products a Valued picking able +customer.
  2. +
  3. Confirm the Sale Order.
  4. +
  5. Click on Delivery stat button.
  6. +
  7. Go to Print > Delivery Slip.
  8. +
+
+
+

Known issues / Roadmap

+
    +
  • If the picking is not reserved, values aren’t computed.
  • +
+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Avanzosc:
      +
    • Oihane Crucelaegui
    • +
    +
  • +
  • Tecnativa:
      +
    • Pedro M. Baeza
    • +
    • Antonio Espinosa
    • +
    • Carlos Dauden
    • +
    • David Vidal
    • +
    • Luis M. Ontalba
    • +
    • Ernesto Tejeda
    • +
    • Sergio Teruel
    • +
    +
  • +
+
+
+

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.

+

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_valued/tests/__init__.py b/stock_picking_report_valued/tests/__init__.py new file mode 100644 index 0000000..6a7196b --- /dev/null +++ b/stock_picking_report_valued/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_picking_valued diff --git a/stock_picking_report_valued/tests/test_stock_picking_valued.py b/stock_picking_report_valued/tests/test_stock_picking_valued.py new file mode 100644 index 0000000..bcbbede --- /dev/null +++ b/stock_picking_report_valued/tests/test_stock_picking_valued.py @@ -0,0 +1,131 @@ +# Copyright 2017 Tecnativa - David Vidal +# Copyright 2017 Tecnativa - Luis M. Ontalba +# Copyright 2019 Tecnativa - Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests import common + + +class TestStockPickingValued(common.SavepointCase): + @classmethod + def setUpClass(cls): + super(TestStockPickingValued, cls).setUpClass() + company = cls.env.user.company_id + cls.tax = cls.env["account.tax"].create( + { + "name": "TAX 15%", + "amount_type": "percent", + "type_tax_use": "sale", + "amount": 15.0, + } + ) + cls.tax10 = cls.env["account.tax"].create( + { + "name": "TAX 10%", + "amount_type": "percent", + "type_tax_use": "sale", + "amount": 10.0, + } + ) + cls.product = cls.env["product.product"].create( + { + "name": "Test stuff", + "list_price": 100.0, + "taxes_id": [(6, 0, cls.tax.ids)], + } + ) + cls.partner = cls.env["res.partner"].create({"name": "Mr. Odoo"}) + cls.sale_order = cls.env["sale.order"].create( + { + "partner_id": cls.partner.id, + "order_line": [ + ( + 0, + 0, + { + "product_id": cls.product.id, + "price_unit": 100, + "product_uom_qty": 1, + }, + ) + ], + "company_id": company.id, + } + ) + cls.sale_order2 = cls.env["sale.order"].create( + { + "partner_id": cls.partner.id, + "order_line": [ + ( + 0, + 0, + { + "product_id": cls.product.id, + "price_unit": 100, + "product_uom_qty": 1, + }, + ), + ( + 0, + 0, + { + "product_id": cls.product.id, + "price_unit": 100, + "product_uom_qty": 1, + }, + ), + ( + 0, + 0, + { + "product_id": cls.product.id, + "price_unit": 100, + "product_uom_qty": 1, + "tax_id": [(6, 0, cls.tax10.ids)], + }, + ), + ], + "company_id": company.id, + } + ) + cls.sale_order.company_id.tax_calculation_rounding_method = "round_per_line" + + def test_01_confirm_order(self): + self.assertTrue(self.partner.valued_picking) + self.sale_order.action_confirm() + self.assertTrue(len(self.sale_order.picking_ids)) + for picking in self.sale_order.picking_ids: + picking.action_assign() + self.assertEqual(picking.amount_untaxed, 100.0) + self.assertEqual(picking.amount_tax, 15.0) + self.assertEqual(picking.amount_total, 115.0) + + def test_02_confirm_order(self): + """ Valued picking isn't computed if not reserved """ + self.sale_order.action_confirm() + for picking in self.sale_order.picking_ids: + picking.action_assign() + picking.do_unreserve() + self.assertEqual(picking.amount_untaxed, 0.0) + self.assertEqual(picking.amount_tax, 0.0) + self.assertEqual(picking.amount_total, 0.0) + + def test_03_tax_rounding_method(self): + self.sale_order.company_id.tax_calculation_rounding_method = "round_globally" + self.sale_order.action_confirm() + self.assertTrue(len(self.sale_order.picking_ids)) + for picking in self.sale_order.picking_ids: + picking.action_assign() + self.assertEqual(picking.amount_untaxed, 100.0) + self.assertEqual(picking.amount_tax, 15.0) + self.assertEqual(picking.amount_total, 115.0) + + def test_04_lines_distinct_tax(self): + self.sale_order2.company_id.tax_calculation_rounding_method = "round_globally" + self.sale_order2.action_confirm() + self.assertTrue(len(self.sale_order2.picking_ids)) + for picking in self.sale_order2.picking_ids: + picking.action_assign() + self.assertEqual(picking.amount_untaxed, 300.0) + self.assertEqual(picking.amount_tax, 40.0) + self.assertEqual(picking.amount_total, 340.0) diff --git a/stock_picking_report_valued/views/res_partner_view.xml b/stock_picking_report_valued/views/res_partner_view.xml new file mode 100644 index 0000000..e716dc3 --- /dev/null +++ b/stock_picking_report_valued/views/res_partner_view.xml @@ -0,0 +1,16 @@ + + + + + Partner view (Valued picking) + res.partner + + + + + + + + + +