diff --git a/sale_stock_reference_by_line/README.rst b/sale_stock_reference_by_line/README.rst new file mode 100644 index 00000000000..27de24decf8 --- /dev/null +++ b/sale_stock_reference_by_line/README.rst @@ -0,0 +1,102 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================ +Sale Stock Reference by Line +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:3422322fe14e454647825eae76770bf4bea1d86e11d8398210ce21917badbde1 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |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%2Fsale--workflow-lightgray.png?logo=github + :target: https://github.com/OCA/sale-workflow/tree/19.0/sale_stock_reference_by_line + :alt: OCA/sale-workflow +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/sale-workflow-19-0/sale-workflow-19-0-sale_stock_reference_by_line + :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/sale-workflow&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module was written to extend the functionality of stock references +(previously: procurement groups) created from a sale order + +On itself, this module does nothing. It is a requirement for modules +that need to create a stock reference for each individual sale order +line. + +This module was previously known as "Sale Procurement Group by Line" +(``sale_procurement_group_by_line``) + +**Table of contents** + +.. contents:: + :local: + +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 +------- + +* Camptocamp +* ForgeFlow +* Serpent Consulting Services Pvt. Ltd. +* SprintIT Ltd. + +Contributors +------------ + +- Guewen Baconnier +- Yannick Vaucher +- Jordi Ballester +- Serpent Consulting Services Pvt. Ltd. +- Carmen Rondon Regalado +- Tatiana Deribina + +Other credits +------------- + +The migration of this module from 18.0 to 19.0 was financially supported +by SprintIT Ltd. + +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/sale-workflow `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_stock_reference_by_line/__init__.py b/sale_stock_reference_by_line/__init__.py new file mode 100644 index 00000000000..c8748f360d6 --- /dev/null +++ b/sale_stock_reference_by_line/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import model diff --git a/sale_stock_reference_by_line/__manifest__.py b/sale_stock_reference_by_line/__manifest__.py new file mode 100644 index 00000000000..6297c6ae066 --- /dev/null +++ b/sale_stock_reference_by_line/__manifest__.py @@ -0,0 +1,25 @@ +# Copyright 2013-2014 Camptocamp SA - Guewen Baconnier +# © 2016-20 ForgeFlow S.L. (https://www.forgeflow.com) +# © 2016 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Sale Stock Reference by Line", + "summary": ( + "Base module for definition of stock references creation rules for Sale order" + ), + "version": "19.0.1.0.0", + "author": ( + "Camptocamp," + "ForgeFlow," + "Serpent Consulting Services Pvt. Ltd.," + "Odoo Community Association (OCA)" + ", SprintIT Ltd." + ), + "category": "Warehouse", + "license": "AGPL-3", + "development_status": "Production/Stable", + "website": "https://github.com/OCA/sale-workflow", + "depends": ["sale_stock"], + "installable": True, +} diff --git a/sale_stock_reference_by_line/i18n/ca.po b/sale_stock_reference_by_line/i18n/ca.po new file mode 100644 index 00000000000..e4fa25bd267 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/ca.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: sale-workflow (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-14 06:38+0000\n" +"PO-Revision-Date: 2022-03-21 14:17+0000\n" +"Last-Translator: Noel estudillo \n" +"Language-Team: Catalan (http://www.transifex.com/oca/OCA-sale-workflow-8-0/" +"language/ca/)\n" +"Language: ca\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 4.3.2\n" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "Grup de contractació" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Línia de comanda de vendes" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#~ msgid "Sales Order" +#~ msgstr "Comandes de venda" + +#~ msgid "Display Name" +#~ msgstr "Nom de visualització" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificació el" diff --git a/sale_stock_reference_by_line/i18n/de.po b/sale_stock_reference_by_line/i18n/de.po new file mode 100644 index 00000000000..b54816ba9b1 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/de.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 01:51+0000\n" +"PO-Revision-Date: 2023-10-11 11:38+0000\n" +"Last-Translator: David Brühlmeier \n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\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 4.17\n" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "Einkaufsgruppe" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Auftragsposition" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "Lagerbuchung" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Verkaufsauftrag" + +#~ msgid "Quotation" +#~ msgstr "Angebot" diff --git a/sale_stock_reference_by_line/i18n/el_GR.po b/sale_stock_reference_by_line/i18n/el_GR.po new file mode 100644 index 00000000000..1dcbf921653 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/el_GR.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# Kostas Goutoudis , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-28 03:43+0000\n" +"PO-Revision-Date: 2017-02-28 03:43+0000\n" +"Last-Translator: Kostas Goutoudis , 2017\n" +"Language-Team: Greek (Greece) (https://www.transifex.com/oca/teams/23907/" +"el_GR/)\n" +"Language: el_GR\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Εντολή Πώλησης" diff --git a/sale_stock_reference_by_line/i18n/es.po b/sale_stock_reference_by_line/i18n/es.po new file mode 100644 index 00000000000..6a4de68db46 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/es.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 01:51+0000\n" +"PO-Revision-Date: 2023-07-25 12:10+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\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 4.17\n" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "Grupo de adquisiciones" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Línea de pedido de venta" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "movimiento de existencias" + +#~ msgid "Sales Order" +#~ msgstr "Órdenes de venta" diff --git a/sale_stock_reference_by_line/i18n/es_ES.po b/sale_stock_reference_by_line/i18n/es_ES.po new file mode 100644 index 00000000000..da8b0985bbc --- /dev/null +++ b/sale_stock_reference_by_line/i18n/es_ES.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: sale-workflow (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-10-04 13:41+0000\n" +"PO-Revision-Date: 2015-09-03 07:09+0000\n" +"Last-Translator: <>\n" +"Language-Team: Spanish (Spain) (http://www.transifex.com/oca/OCA-sale-" +"workflow-8-0/language/es_ES/)\n" +"Language: es_ES\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Pedido de venta" diff --git a/sale_stock_reference_by_line/i18n/es_VE.po b/sale_stock_reference_by_line/i18n/es_VE.po new file mode 100644 index 00000000000..e6fd5561048 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/es_VE.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-28 03:43+0000\n" +"PO-Revision-Date: 2017-02-28 03:43+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (Venezuela) (https://www.transifex.com/oca/" +"teams/23907/es_VE/)\n" +"Language: es_VE\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Línea de pedido de venta" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Pedidos de venta" diff --git a/sale_stock_reference_by_line/i18n/fi.po b/sale_stock_reference_by_line/i18n/fi.po new file mode 100644 index 00000000000..2f3cd146455 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/fi.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 01:51+0000\n" +"PO-Revision-Date: 2017-11-23 01:51+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Myyntitilaus" diff --git a/sale_stock_reference_by_line/i18n/fr.po b/sale_stock_reference_by_line/i18n/fr.po new file mode 100644 index 00000000000..0fa654531e0 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/fr.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 01:51+0000\n" +"PO-Revision-Date: 2017-11-23 01:51+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Sales Order Line" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Bon de commande" diff --git a/sale_stock_reference_by_line/i18n/hr.po b/sale_stock_reference_by_line/i18n/hr.po new file mode 100644 index 00000000000..46dff7fb62c --- /dev/null +++ b/sale_stock_reference_by_line/i18n/hr.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 01:51+0000\n" +"PO-Revision-Date: 2017-11-23 01:51+0000\n" +"Last-Translator: Bole , 2017\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: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Stavka ponude" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Prodajni nalog" diff --git a/sale_stock_reference_by_line/i18n/hr_HR.po b/sale_stock_reference_by_line/i18n/hr_HR.po new file mode 100644 index 00000000000..b88d8ea9bdc --- /dev/null +++ b/sale_stock_reference_by_line/i18n/hr_HR.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-28 03:43+0000\n" +"PO-Revision-Date: 2017-02-28 03:43+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/" +"hr_HR/)\n" +"Language: hr_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: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Prodjani nalog" diff --git a/sale_stock_reference_by_line/i18n/hu.po b/sale_stock_reference_by_line/i18n/hu.po new file mode 100644 index 00000000000..45f03c908fd --- /dev/null +++ b/sale_stock_reference_by_line/i18n/hu.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: sale-workflow (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-12-10 05:55+0000\n" +"PO-Revision-Date: 2015-09-03 07:09+0000\n" +"Last-Translator: <>\n" +"Language-Team: Hungarian (http://www.transifex.com/oca/OCA-sale-workflow-8-0/" +"language/hu/)\n" +"Language: hu\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Vevői megrendelés" diff --git a/sale_stock_reference_by_line/i18n/it.po b/sale_stock_reference_by_line/i18n/it.po new file mode 100644 index 00000000000..c4782b781b9 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/it.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: sale-workflow (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-02 17:59+0000\n" +"PO-Revision-Date: 2023-10-09 07:41+0000\n" +"Last-Translator: mymage \n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-sale-workflow-8-0/" +"language/it/)\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 4.17\n" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "Gruppo di approvvigionamento" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Riga ordine di vendita" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "Movimento di magazzino" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Ordini vendita" diff --git a/sale_stock_reference_by_line/i18n/nl.po b/sale_stock_reference_by_line/i18n/nl.po new file mode 100644 index 00000000000..5e677d8b0b6 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/nl.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 01:51+0000\n" +"PO-Revision-Date: 2017-11-23 01:51+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: nl\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Verkooporder" diff --git a/sale_stock_reference_by_line/i18n/nl_NL.po b/sale_stock_reference_by_line/i18n/nl_NL.po new file mode 100644 index 00000000000..d262b87bbe1 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/nl_NL.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 01:51+0000\n" +"PO-Revision-Date: 2017-11-23 01:51+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Verkooporderregel" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Verkooporder" diff --git a/sale_stock_reference_by_line/i18n/pt.po b/sale_stock_reference_by_line/i18n/pt.po new file mode 100644 index 00000000000..3bbd9c5487b --- /dev/null +++ b/sale_stock_reference_by_line/i18n/pt.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# Daniel Reis , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-28 03:43+0000\n" +"PO-Revision-Date: 2017-02-28 03:43+0000\n" +"Last-Translator: Daniel Reis , 2017\n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"Language: pt\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Ordem de Venda" diff --git a/sale_stock_reference_by_line/i18n/pt_BR.po b/sale_stock_reference_by_line/i18n/pt_BR.po new file mode 100644 index 00000000000..54ae90e91f9 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/pt_BR.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +# Paulo Ricardo , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-28 03:43+0000\n" +"PO-Revision-Date: 2017-02-28 03:43+0000\n" +"Last-Translator: Paulo Ricardo , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Linha Pedido de Venda" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Pedido de Venda" diff --git a/sale_stock_reference_by_line/i18n/ro.po b/sale_stock_reference_by_line/i18n/ro.po new file mode 100644 index 00000000000..af509b6bbb6 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/ro.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# Dorin Hongu , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-28 03:43+0000\n" +"PO-Revision-Date: 2017-02-28 03:43+0000\n" +"Last-Translator: Dorin Hongu , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" +"2:1));\n" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Linie comandă vânzare" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Comandă vânzare" diff --git a/sale_stock_reference_by_line/i18n/sk.po b/sale_stock_reference_by_line/i18n/sk.po new file mode 100644 index 00000000000..eb6bbd834ad --- /dev/null +++ b/sale_stock_reference_by_line/i18n/sk.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-27 03:53+0000\n" +"PO-Revision-Date: 2018-01-27 03:53+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Slovak (https://www.transifex.com/oca/teams/23907/sk/)\n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Objednávka predaja" diff --git a/sale_stock_reference_by_line/i18n/sl.po b/sale_stock_reference_by_line/i18n/sl.po new file mode 100644 index 00000000000..37ee9353a24 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/sl.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 01:51+0000\n" +"PO-Revision-Date: 2017-11-23 01:51+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3);\n" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Postavka prodajnega naloga" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Prodajni nalog" diff --git a/sale_stock_reference_by_line/i18n/tr.po b/sale_stock_reference_by_line/i18n/tr.po new file mode 100644 index 00000000000..1c837afdc66 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/tr.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 01:51+0000\n" +"PO-Revision-Date: 2017-11-23 01:51+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\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" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Satış Siparişi Hattı" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Sipariş Emri" diff --git a/sale_stock_reference_by_line/i18n/tr_TR.po b/sale_stock_reference_by_line/i18n/tr_TR.po new file mode 100644 index 00000000000..38e1f41ce8c --- /dev/null +++ b/sale_stock_reference_by_line/i18n/tr_TR.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-23 01:51+0000\n" +"PO-Revision-Date: 2017-11-23 01:51+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/" +"tr_TR/)\n" +"Language: tr_TR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "Sipariş emri satırı " + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Satış emri" diff --git a/sale_stock_reference_by_line/i18n/vi_VN.po b/sale_stock_reference_by_line/i18n/vi_VN.po new file mode 100644 index 00000000000..1447756331e --- /dev/null +++ b/sale_stock_reference_by_line/i18n/vi_VN.po @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-02-28 03:43+0000\n" +"PO-Revision-Date: 2017-02-28 03:43+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/" +"teams/23907/vi_VN/)\n" +"Language: vi_VN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Đơn hàng Bán" diff --git a/sale_stock_reference_by_line/i18n/zh_CN.po b/sale_stock_reference_by_line/i18n/zh_CN.po new file mode 100644 index 00000000000..ae23d416917 --- /dev/null +++ b/sale_stock_reference_by_line/i18n/zh_CN.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_stock_reference_by_line +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: sale-workflow (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-09-09 12:27+0000\n" +"PO-Revision-Date: 2015-09-03 07:09+0000\n" +"Last-Translator: <>\n" +"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-sale-" +"workflow-8-0/language/zh_CN/)\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: sale_stock_reference_by_line +#: model:ir.model.fields,field_description:sale_stock_reference_by_line.field_sale_order_line__stock_reference_id +msgid "Procurement Reference" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_sale_order_line +msgid "Sales Order Line" +msgstr "" + +#. module: sale_stock_reference_by_line +#: model:ir.model,name:sale_stock_reference_by_line.model_stock_move +msgid "Stock Move" +msgstr "" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "销售订单" diff --git a/sale_stock_reference_by_line/model/__init__.py b/sale_stock_reference_by_line/model/__init__.py new file mode 100644 index 00000000000..8d632c02319 --- /dev/null +++ b/sale_stock_reference_by_line/model/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import sale +from . import stock_move diff --git a/sale_stock_reference_by_line/model/sale.py b/sale_stock_reference_by_line/model/sale.py new file mode 100644 index 00000000000..0a68e7f6184 --- /dev/null +++ b/sale_stock_reference_by_line/model/sale.py @@ -0,0 +1,104 @@ +# Copyright 2013-2014 Camptocamp SA - Guewen Baconnier +# © 2016-20 ForgeFlow S.L. (https://www.forgeflow.com) +# © 2016 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models +from odoo.tools.float_utils import float_compare + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + stock_reference_id = fields.Many2one( + "stock.reference", "Procurement Reference", copy=False + ) + + def _get_stock_reference(self): + return self.stock_reference_id or False + + def _get_stock_reference_key(self): + """Return a key with priority to be used to regroup lines in multiple + procurement groups + + """ + return 8, self.order_id.id + + def _prepare_procurement_values(self): + # Overload core method to modify stock references to the line specific + values = super()._prepare_procurement_values() + values["reference_ids"] = self.stock_reference_id + return values + + def _action_launch_stock_rule(self, *, previous_product_uom_qty=False): + """ + Launch procurement group run method. + """ + if self.env.context.get("skip_procurement"): + return True + precision = self.env["decimal.precision"].precision_get("Product Unit") + procurements = [] + groups = {} + if not previous_product_uom_qty: + previous_product_uom_qty = {} + for line in self: + line = line.with_company(line.company_id) + if ( + line.state != "sale" + or line.order_id.locked + or line.product_id.type != "consu" + ): + continue + qty = line._get_qty_procurement(previous_product_uom_qty) + if ( + float_compare(qty, line.product_uom_qty, precision_digits=precision) + == 0 + ): + continue + + group = line._get_stock_reference() + + # Group the sales order lines with same procurement group + # according to the group key + for order_line in line.order_id.order_line: + line_group = order_line.stock_reference_id or False + if line_group: + groups[order_line._get_stock_reference_key()] = line_group + if not group: + group = groups.get(line._get_stock_reference_key()) + + if not group: + vals = line._prepare_reference_vals() + group = self.env["stock.reference"].create(vals) + + line.stock_reference_id = group + + values = line._prepare_procurement_values() + product_qty = line.product_uom_qty - qty + + line_uom = line.product_uom_id + quant_uom = line.product_id.uom_id + product_qty, procurement_uom = line_uom._adjust_uom_quantities( + product_qty, quant_uom + ) + procurements += line._create_procurements( + product_qty, procurement_uom, values + ) + # We store the procured quantity in the UoM of the line to avoid + # duplicated procurements, specially for dropshipping and kits. + previous_product_uom_qty[line.id] = line.product_uom_qty + if procurements: + self.env["stock.rule"].run(procurements) + # This next block is currently needed only because the scheduler trigger is done + # by picking confirmation rather than stock.move confirmation + orders = self.mapped("order_id") + for order in orders: + pickings_to_confirm = order.picking_ids.filtered( + lambda p: p.state not in ["cancel", "done"] + ) + if pickings_to_confirm: + # Trigger the Scheduler for Pickings + pickings_to_confirm.action_confirm() + return super( + SaleOrderLine, self.with_context(sale_group_by_line=True) + )._action_launch_stock_rule(previous_product_uom_qty=previous_product_uom_qty) diff --git a/sale_stock_reference_by_line/model/stock_move.py b/sale_stock_reference_by_line/model/stock_move.py new file mode 100644 index 00000000000..cb5de1bc641 --- /dev/null +++ b/sale_stock_reference_by_line/model/stock_move.py @@ -0,0 +1,17 @@ +# Copyright 2022 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class StockMove(models.Model): + _inherit = "stock.move" + + def _update_candidate_moves_list(self, candidate_moves_set): + """ + We want to merge stock moves within the stock reference only + """ + res = super()._update_candidate_moves_list(candidate_moves_set) + if self.env.context.get("sale_group_by_line"): + candidate_moves_set.add(self.sale_line_id.stock_reference_id.move_ids) + return res diff --git a/sale_stock_reference_by_line/pyproject.toml b/sale_stock_reference_by_line/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/sale_stock_reference_by_line/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/sale_stock_reference_by_line/readme/CONTRIBUTORS.md b/sale_stock_reference_by_line/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..235cf324fd1 --- /dev/null +++ b/sale_stock_reference_by_line/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- Guewen Baconnier \<\> +- Yannick Vaucher \<\> +- Jordi Ballester \<\> +- Serpent Consulting Services Pvt. Ltd. \<\> +- Carmen Rondon Regalado \<\> +- Tatiana Deribina \<\> diff --git a/sale_stock_reference_by_line/readme/CREDITS.md b/sale_stock_reference_by_line/readme/CREDITS.md new file mode 100644 index 00000000000..47e2d463523 --- /dev/null +++ b/sale_stock_reference_by_line/readme/CREDITS.md @@ -0,0 +1,2 @@ +The migration of this module from 18.0 to 19.0 was financially supported +by SprintIT Ltd. diff --git a/sale_stock_reference_by_line/readme/DESCRIPTION.md b/sale_stock_reference_by_line/readme/DESCRIPTION.md new file mode 100644 index 00000000000..7b4cf3518fc --- /dev/null +++ b/sale_stock_reference_by_line/readme/DESCRIPTION.md @@ -0,0 +1,9 @@ +This module was written to extend the functionality of stock references +(previously: procurement groups) created from a sale order + +On itself, this module does nothing. It is a requirement for modules +that need to create a stock reference for each individual sale order +line. + +This module was previously known as "Sale Procurement Group by Line" +(``sale_procurement_group_by_line``) diff --git a/sale_stock_reference_by_line/static/description/icon.png b/sale_stock_reference_by_line/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/sale_stock_reference_by_line/static/description/icon.png differ diff --git a/sale_stock_reference_by_line/static/description/index.html b/sale_stock_reference_by_line/static/description/index.html new file mode 100644 index 00000000000..b2a26624e6c --- /dev/null +++ b/sale_stock_reference_by_line/static/description/index.html @@ -0,0 +1,449 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Sale Stock Reference by Line

+ +

Production/Stable License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runboat

+

This module was written to extend the functionality of stock references +(previously: procurement groups) created from a sale order

+

On itself, this module does nothing. It is a requirement for modules +that need to create a stock reference for each individual sale order +line.

+

This module was previously known as “Sale Procurement Group by Line” +(sale_procurement_group_by_line)

+

Table of contents

+ +
+

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

+
    +
  • Camptocamp
  • +
  • ForgeFlow
  • +
  • Serpent Consulting Services Pvt. Ltd.
  • +
  • SprintIT Ltd.
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 18.0 to 19.0 was financially supported +by SprintIT Ltd.

+
+
+

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/sale-workflow project on GitHub.

+

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

+
+
+
+
+ + diff --git a/sale_stock_reference_by_line/tests/__init__.py b/sale_stock_reference_by_line/tests/__init__.py new file mode 100644 index 00000000000..d12557c34b4 --- /dev/null +++ b/sale_stock_reference_by_line/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_sale_stock_reference_by_line diff --git a/sale_stock_reference_by_line/tests/test_sale_stock_reference_by_line.py b/sale_stock_reference_by_line/tests/test_sale_stock_reference_by_line.py new file mode 100644 index 00000000000..e2d06e34900 --- /dev/null +++ b/sale_stock_reference_by_line/tests/test_sale_stock_reference_by_line.py @@ -0,0 +1,149 @@ +# Copyright 2013-2014 Camptocamp SA - Guewen Baconnier +# © 2016-20 ForgeFlow S.L. (https://www.forgeflow.com) +# © 2016 Serpent Consulting Services Pvt. Ltd. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests import Form + +from odoo.addons.sale_stock.tests.common import TestSaleStockCommon + + +class TestSaleStockReferenceByLine(TestSaleStockCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + # Required Models + cls.product_model = cls.env["product.product"] + cls.product_ctg_model = cls.env["product.category"] + cls.proc_group_model = cls.env["stock.reference"] + cls.sale_model = cls.env["sale.order"] + cls.order_line_model = cls.env["sale.order.line"] + # Warehouse + cls.warehouse_id = cls.env.ref("stock.warehouse0") + # Create product category + cls.product_ctg = cls._create_product_category() + # Create Products + cls.new_product1 = cls._create_product( + name="test_product1", + categ_id=cls.product_ctg.id, + is_storable=True, + ) + cls.new_product2 = cls._create_product( + name="test_product2", + categ_id=cls.product_ctg.id, + is_storable=True, + ) + cls.sale = cls._create_sale_order() + + @classmethod + def _create_product_category(cls): + product_ctg = cls.product_ctg_model.create({"name": "test_product_ctg"}) + return product_ctg + + @classmethod + def _create_sale_order(cls): + """Create a Sale Order.""" + cls.sale = cls.sale_model.create( + { + "partner_id": cls.partner_a.id, + "warehouse_id": cls.warehouse_id.id, + "picking_policy": "direct", + } + ) + cls.line1 = cls.order_line_model.create( + { + "order_id": cls.sale.id, + "product_id": cls.new_product1.id, + "product_uom_qty": 10.0, + "name": "Sale Order Line Demo1", + } + ) + cls.line2 = cls.order_line_model.create( + { + "order_id": cls.sale.id, + "product_id": cls.new_product2.id, + "product_uom_qty": 5.0, + "name": "Sale Order Line Demo2", + } + ) + return cls.sale + + def test_01_stock_reference_by_line(self): + self.sale.action_confirm() + self.assertEqual( + self.line2.stock_reference_id, + self.line1.stock_reference_id, + """Both Sale Order line should belong + to Stock Reference""", + ) + self.picking_ids = self.env["stock.picking"].search( + [("reference_ids", "in", self.line2.stock_reference_id.ids)] + ) + self.picking_ids.move_ids.write({"quantity": 5}) + wiz_act = self.picking_ids.button_validate() + wiz = Form( + self.env[wiz_act["res_model"]].with_context(**wiz_act["context"]) + ).save() + wiz.process() + self.assertTrue(self.picking_ids, "Stock reference should have picking") + + def test_02_action_launch_procurement_rule_1(self): + stock_ref = self.proc_group_model.create( + { + "sale_ids": [(6, 0, self.sale.ids)], + "name": self.sale.name, + }, + ) + self.line1.stock_reference_id = stock_ref + self.line2.stock_reference_id = stock_ref + self.sale.action_confirm() + self.assertEqual(self.sale.state, "sale") + self.assertEqual(len(self.line1.move_ids), 1) + self.assertEqual(len(self.line2.move_ids), 1) + + def test_03_action_launch_procurement_rule_2(self): + stock_ref = self.proc_group_model.create( + { + "sale_ids": [(6, 0, self.sale.ids)], + "name": self.sale.name, + }, + ) + self.line1.stock_reference_id = stock_ref + self.line2.stock_reference_id = False + self.sale.action_confirm() + self.assertEqual(self.line2.stock_reference_id, stock_ref) + + def test_04_action_launch_procurement_rule_3(self): + stock_ref = self.proc_group_model.create( + { + "sale_ids": [(6, 0, self.sale.ids)], + "name": self.sale.name, + }, + ) + self.line1.stock_reference_id = False + self.line2.stock_reference_id = False + self.sale.action_confirm() + self.assertNotEqual(self.line1.stock_reference_id, stock_ref) + self.assertEqual(self.line1.stock_reference_id, self.line2.stock_reference_id) + + def test_05_merged_stock_moves_from_same_procurement(self): + """ + Reduce the qty in the sale order and check no extra picking is created + """ + self.sale.action_confirm() + self.sale.order_line[1].product_uom_qty = 0.0 + self.assertEqual( + len(self.sale.picking_ids), 1, "Negative stock move should me merged" + ) + + def test_06_update_sale_order_line_respect_stock_reference(self): + """ + When launching the stock rule again, + use maintain same stock reference in lines + """ + self.sale.action_confirm() + stock_ref = self.sale.order_line[1].stock_reference_id + self.assertEqual(len(self.line1.move_ids), 1) + self.sale.order_line[1].product_uom_qty += 1 + self.assertEqual(self.sale.order_line[1].stock_reference_id, stock_ref) + self.assertEqual(len(self.line1.move_ids), 1)