diff --git a/sale_purchase_stock_inter_company/README.rst b/sale_purchase_stock_inter_company/README.rst new file mode 100644 index 00000000000..0fd4b8aa415 --- /dev/null +++ b/sale_purchase_stock_inter_company/README.rst @@ -0,0 +1,87 @@ +============================================================== +Inter Company Module for Sale to Purchase Order with warehouse +============================================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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%2Fmulti--company-lightgray.png?logo=github + :target: https://github.com/OCA/multi-company/tree/16.0/sale_purchase_stock_inter_company + :alt: OCA/multi-company +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/multi-company-16-0/multi-company-16-0-sale_purchase_stock_inter_company + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/133/16.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module considers the propagation of the warehouse into the purchase orders. + +This module is a glue module and is auto installed if `sale_purchase_inter_company`, `sale_stock` and `purchase_stock` modules are installed. +Full purpose description can be found in `sale_purchase_inter_company`. + + +Configuration +============= + +To configure this module, you need to: +#. Go to the menu *Settings > General Settings*. +#. Go to the tab *Companies / Inter Company OCA features*, in the group *Purchase/Sale*, check the option *Purchase from sale*. +#. Then, select the *Warehouse for Purchase Orders*, it is the warehouse that will be used to automatically generate the purchase order in the other company. + +**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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Akretion + +Contributors +~~~~~~~~~~~~ + +* `Akretion `: + + * Chafique Delli + +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/multi-company `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_purchase_stock_inter_company/__init__.py b/sale_purchase_stock_inter_company/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/sale_purchase_stock_inter_company/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_purchase_stock_inter_company/__manifest__.py b/sale_purchase_stock_inter_company/__manifest__.py new file mode 100644 index 00000000000..4b422abfde6 --- /dev/null +++ b/sale_purchase_stock_inter_company/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2023 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Inter Company Module for Sale to Purchase Order with warehouse", + "summary": "Intercompany SO/PO rules with warehouse", + "version": "16.0.1.0.0", + "category": "Sale Management", + "website": "https://github.com/OCA/multi-company", + "author": "Akretion, Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "auto_install": True, + "depends": ["sale_purchase_inter_company", "sale_stock", "purchase_stock"], + "data": ["views/res_config_view.xml"], +} diff --git a/sale_purchase_stock_inter_company/i18n/de.po b/sale_purchase_stock_inter_company/i18n/de.po new file mode 100644 index 00000000000..efb3ed87da4 --- /dev/null +++ b/sale_purchase_stock_inter_company/i18n/de.po @@ -0,0 +1,79 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_stock_inter_company +# +# Translators: +# Rudolf Schnapka , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-05 13:15+0000\n" +"PO-Revision-Date: 2017-04-22 02:48+0000\n" +"Last-Translator: Rudolf Schnapka , 2017\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" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_company +msgid "Companies" +msgstr "Unternehmen" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company." +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_stock_picking__intercompany_picking_id +msgid "Intercompany Picking" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: code:addons/purchase_sale_stock_inter_company/models/stock_picking.py:0 +#, python-format +msgid "" +"There's no corresponding line in PO %(po)s for assigning qty from " +"%(pick_name)s for product %(product)s" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "Warehouse For Sale Orders" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "Warehouse for Sale Orders" +msgstr "" + +#~ msgid "Invoice" +#~ msgstr "Rechnung" diff --git a/sale_purchase_stock_inter_company/i18n/es.po b/sale_purchase_stock_inter_company/i18n/es.po new file mode 100644 index 00000000000..3fd2eb3b4c8 --- /dev/null +++ b/sale_purchase_stock_inter_company/i18n/es.po @@ -0,0 +1,161 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_stock_inter_company +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-05 13:15+0000\n" +"PO-Revision-Date: 2021-03-09 10:45+0000\n" +"Last-Translator: Ana Suárez \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: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "Ajustes Configuración" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company" +msgstr "" +"Valor por defecto a establecer en pedidos de venta que serán creados en base " +"a pedidos de compra realizados a esta compañía" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company." +msgstr "" +"Valor por defecto a establecer en pedidos de venta que serán creados en base " +"a pedidos de compra realizados a esta compañía." + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_stock_picking__intercompany_picking_id +msgid "Intercompany Picking" +msgstr "Albarán intercompañía" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "Pedido de compra" + +#. module: purchase_sale_stock_inter_company +#: code:addons/purchase_sale_stock_inter_company/models/stock_picking.py:0 +#, fuzzy, python-format +msgid "" +"There's no corresponding line in PO %(po)s for assigning qty from " +"%(pick_name)s for product %(product)s" +msgstr "" +"No hay una línea correspondiente en el pedido de compra %s para asignar " +"cantidad desde %(pick_name)s para el producto %(product)s" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_stock_picking +msgid "Transfer" +msgstr "Transferir" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "Warehouse For Sale Orders" +msgstr "Almacén para pedidos de venta" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "Warehouse for Sale Orders" +msgstr "Almacén para pedidos de venta" + +#~ msgid "Create Sale Orders when buying to this company" +#~ msgstr "Crear pedido de venta al comprar a esta compañía" + +#~ msgid "" +#~ "Generate a Sale Order when a Purchase Order with this company as supplier " +#~ "is created.\n" +#~ " The intercompany user must at least be Sale User." +#~ msgstr "" +#~ "Generar un pedido de venta cuando se cree un pedido de compra con esta " +#~ "compañía como proveedor.\n" +#~ "El usuario intercompañía debe ser al menos Usuario de Ventas." + +#~ msgid "Intercompany Sale User" +#~ msgstr "Usuario de venta intercompañía" + +#~ msgid "Journal Entries" +#~ msgstr "Asientos contables" + +#~ msgid "Purchase/Sale" +#~ msgstr "Compra/Venta" + +#~ msgid "Sale Orders Auto Validation" +#~ msgstr "Auto confirmar pedidos de venta" + +#~ msgid "Sale from purchase" +#~ msgstr "Venta desde compra" + +#~ msgid "Sales Order" +#~ msgstr "Pedido de venta" + +#~ msgid "Sales Order Line" +#~ msgstr "Línea de pedido de venta" + +#~ msgid "Source Purchase Order" +#~ msgstr "Pedido de compra de origen" + +#~ msgid "Source Purchase Order Line" +#~ msgstr "Línea pedido de compra origen" + +#~ msgid "This vendor bill is related with: {}" +#~ msgstr "Esta factura de proveedor está relacionada con: {}" + +#~ msgid "" +#~ "User used to create the sales order arising from a purchase order in " +#~ "another company." +#~ msgstr "" +#~ "El usuario solía crear los pedidos de venta que surgen de un pedido de " +#~ "compra en otra compañía." + +#~ msgid "" +#~ "When a Sale Order is created by a multi company rule for this company, it " +#~ "will automatically validate it." +#~ msgstr "" +#~ "Cuando un pedido de venta es creado por una regla intercompañía para esta " +#~ "compañía, este sera confirmado automáticamente." + +#~ msgid "You can't cancel an order that is %s" +#~ msgstr "No puede cancelar un pedido que es %s" + +#~ msgid "" +#~ "You cannot create SO from PO because product '%s' is not intercompany" +#~ msgstr "" +#~ "No puede crear pedido de venta desde pedido de compra porque el producto " +#~ "'%s' no es intercompañía" + +#~ msgid "" +#~ "You cannot create SO from PO because sale price list currency is " +#~ "different than purchase price list currency." +#~ msgstr "" +#~ "No puede crear pedido de venta desde pedido de compra porque la moneda de " +#~ "la tarifa de venta es distinta de la moneda de la tarifa de compra." + +#~ msgid "Invoice" +#~ msgstr "Factura" + +#~ msgid "Quotation" +#~ msgstr "Presupuesto" diff --git a/sale_purchase_stock_inter_company/i18n/fr.po b/sale_purchase_stock_inter_company/i18n/fr.po new file mode 100644 index 00000000000..03204d4d5f9 --- /dev/null +++ b/sale_purchase_stock_inter_company/i18n/fr.po @@ -0,0 +1,162 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_stock_inter_company +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-05 13:15+0000\n" +"PO-Revision-Date: 2017-10-19 00: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: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company" +msgstr "" +"Valeur par défaut mise sur les commandes de vente créés à partir des " +"commandes d'achat faite à cette société" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company." +msgstr "" +"Valeur par défaut mise sur les commandes de vente créés à partir des " +"commandes d'achat faite à cette société." + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_stock_picking__intercompany_picking_id +msgid "Intercompany Picking" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "Bon de commande" + +#. module: purchase_sale_stock_inter_company +#: code:addons/purchase_sale_stock_inter_company/models/stock_picking.py:0 +#, python-format +msgid "" +"There's no corresponding line in PO %(po)s for assigning qty from " +"%(pick_name)s for product %(product)s" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "Warehouse For Sale Orders" +msgstr "Entrepôt pour les commandes de vente" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +#, fuzzy +msgid "Warehouse for Sale Orders" +msgstr "Entrepôt pour les commandes de vente" + +#, fuzzy +#~ msgid "Purchase/Sale" +#~ msgstr "Achat vers Vente" + +#~ msgid "Sale Orders Auto Validation" +#~ msgstr "Auto Validation des commandes de vente" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Commande de ventes" + +#~ msgid "Sales Order Line" +#~ msgstr "Ligne de commandes de vente" + +#~ msgid "Source Purchase Order" +#~ msgstr "Commande d'achat source" + +#~ msgid "Source Purchase Order Line" +#~ msgstr "Ligne de commande d'achat source" + +#~ msgid "" +#~ "When a Sale Order is created by a multi company rule for this company, it " +#~ "will automatically validate it." +#~ msgstr "" +#~ "Quand une commande de vente est créé en mode multi-société pour cette " +#~ "société, elle sera automatiquement validé." + +#~ msgid "" +#~ "You cannot create SO from PO because product '%s' is not intercompany" +#~ msgstr "" +#~ "Vous ne pouvez pas créer la SO à partir de la PO car le produit '%s' " +#~ "n'est pas multi-société" + +#, fuzzy +#~ msgid "" +#~ "You cannot create SO from PO because sale price list currency is " +#~ "different than purchase price list currency." +#~ msgstr "" +#~ "Vous ne pouvez pas créer la SO à partir de la PO car la devise sur la " +#~ "liste de prix de vente est différente de la devise sur la liste de prix " +#~ "d'achat." + +#~ msgid "Invoice" +#~ msgstr "Facture" + +#~ msgid "" +#~ "Configure correct warehouse for company (%s) in Menu: Settings/companies/" +#~ "companies" +#~ msgstr "" +#~ "Configurez correctement l'entrepôt pour la société (%s) dans le Menu: " +#~ "Configuration/sociétés/sociétés" + +#~ msgid "Output - A" +#~ msgstr "Output - A" + +#~ msgid "Output - B" +#~ msgstr "Output - B" + +#~ msgid "Sale Auto Validation" +#~ msgstr "Auto Validation de la commande de vente" + +#~ msgid "Stock - A" +#~ msgstr "Stock - A" + +#~ msgid "Stock - B" +#~ msgstr "Stock - B" + +#~ msgid "" +#~ "When a Sale Order is created by a multi company rule for this company, it " +#~ "will automatically validate it" +#~ msgstr "" +#~ "Quand une commande de vente est créé en mode multi-société pour cette " +#~ "société, elle sera automatiquement validé" + +#~ msgid "" +#~ "{'invisible':['|', ('invoice_method','in', ['picking', 'manual', " +#~ "'intercompany']), '|', ('state','!=', 'approved'), ('invoiced','=',True)]}" +#~ msgstr "" +#~ "{'invisible':['|', ('invoice_method','in', ['picking', 'manual', " +#~ "'intercompany']), '|', ('state','!=', 'approved'), ('invoiced','=',True)]}" diff --git a/sale_purchase_stock_inter_company/i18n/fr_FR.po b/sale_purchase_stock_inter_company/i18n/fr_FR.po new file mode 100644 index 00000000000..26132ec15fd --- /dev/null +++ b/sale_purchase_stock_inter_company/i18n/fr_FR.po @@ -0,0 +1,163 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_stock_inter_company +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-05 13:15+0000\n" +"PO-Revision-Date: 2017-10-19 00:51+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/" +"fr_FR/)\n" +"Language: fr_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: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company" +msgstr "" +"Valeur par défaut mise sur les commandes de vente créés à partir des " +"commandes d'achat faite à cette société" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company." +msgstr "" +"Valeur par défaut mise sur les commandes de vente créés à partir des " +"commandes d'achat faite à cette société." + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_stock_picking__intercompany_picking_id +msgid "Intercompany Picking" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "Commande d'achat" + +#. module: purchase_sale_stock_inter_company +#: code:addons/purchase_sale_stock_inter_company/models/stock_picking.py:0 +#, python-format +msgid "" +"There's no corresponding line in PO %(po)s for assigning qty from " +"%(pick_name)s for product %(product)s" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "Warehouse For Sale Orders" +msgstr "Entrepôt pour les commandes de vente" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +#, fuzzy +msgid "Warehouse for Sale Orders" +msgstr "Entrepôt pour les commandes de vente" + +#, fuzzy +#~ msgid "Purchase/Sale" +#~ msgstr "Achat vers Vente" + +#~ msgid "Sale Orders Auto Validation" +#~ msgstr "Auto Validation des commandes de vente" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Commandes de vente" + +#~ msgid "Sales Order Line" +#~ msgstr "Ligne de commandes de vente" + +#~ msgid "Source Purchase Order" +#~ msgstr "Commande d'achat source" + +#~ msgid "Source Purchase Order Line" +#~ msgstr "Ligne de commande d'achat source" + +#~ msgid "" +#~ "When a Sale Order is created by a multi company rule for this company, it " +#~ "will automatically validate it." +#~ msgstr "" +#~ "Quand une commande de vente est créé en mode inter-société pour cette " +#~ "société, elle sera automatiquement validé." + +#~ msgid "" +#~ "You cannot create SO from PO because product '%s' is not intercompany" +#~ msgstr "" +#~ "Vous ne pouvez pas créer la SO à partir de la PO car le produit '%s' " +#~ "n'est pas multi-société" + +#, fuzzy +#~ msgid "" +#~ "You cannot create SO from PO because sale price list currency is " +#~ "different than purchase price list currency." +#~ msgstr "" +#~ "Vous ne pouvez pas créer la SO à partir de la PO car la devise sur la " +#~ "liste de prix de vente est différente de la devise sur la liste de prix " +#~ "d'achat." + +#~ msgid "Invoice" +#~ msgstr "Facture" + +#~ msgid "" +#~ "Configure correct warehouse for company (%s) in Menu: Settings/companies/" +#~ "companies" +#~ msgstr "" +#~ "Configurez correctement l'entrepôt pour la société (%s) dans le Menu: " +#~ "Configuration/sociétés/sociétés" + +#~ msgid "Output - A" +#~ msgstr "Output - A" + +#~ msgid "Output - B" +#~ msgstr "Output - B" + +#~ msgid "Sale Auto Validation" +#~ msgstr "Auto Validation de la commande de vente" + +#~ msgid "Stock - A" +#~ msgstr "Stock - A" + +#~ msgid "Stock - B" +#~ msgstr "Stock - B" + +#~ msgid "" +#~ "When a Sale Order is created by a multi company rule for this company, it " +#~ "will automatically validate it" +#~ msgstr "" +#~ "Quand une commande de vente est créé en mode inter-société pour cette " +#~ "société, elle sera automatiquement validé" + +#~ msgid "" +#~ "{'invisible':['|', ('invoice_method','in', ['picking', 'manual', " +#~ "'intercompany']), '|', ('state','!=', 'approved'), ('invoiced','=',True)]}" +#~ msgstr "" +#~ "{'invisible':['|', ('invoice_method','in', ['picking', 'manual', " +#~ "'intercompany']), '|', ('state','!=', 'approved'), ('invoiced','=',True)]}" diff --git a/sale_purchase_stock_inter_company/i18n/it.po b/sale_purchase_stock_inter_company/i18n/it.po new file mode 100644 index 00000000000..c530d4396cc --- /dev/null +++ b/sale_purchase_stock_inter_company/i18n/it.po @@ -0,0 +1,150 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_stock_inter_company +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-05 13:15+0000\n" +"PO-Revision-Date: 2020-02-20 13:13+0000\n" +"Last-Translator: Lorenzo Battistini \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_company +msgid "Companies" +msgstr "Aziende" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni di configurazione" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company" +msgstr "" +"Valore predefinito da impostare sugli ordini di vendita che verranno creati " +"sulla base degli ordini di acquisto fatti a questa azienda" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company." +msgstr "" +"Valore predefinito da impostare sugli ordini di vendita che verranno creati " +"sulla base degli ordini di acquisto fatti a questa azienda." + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_stock_picking__intercompany_picking_id +msgid "Intercompany Picking" +msgstr "Prelievo interaziendale" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "Ordine d'acquisto" + +#. module: purchase_sale_stock_inter_company +#: code:addons/purchase_sale_stock_inter_company/models/stock_picking.py:0 +#, fuzzy, python-format +msgid "" +"There's no corresponding line in PO %(po)s for assigning qty from " +"%(pick_name)s for product %(product)s" +msgstr "" +"Non c'è una riga corrisponde nell'ordine d'acquisto %s per assegnare la " +"quantità da %(pick_name)s per il prodotto %(product)s" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_stock_picking +msgid "Transfer" +msgstr "Trasferire" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "Warehouse For Sale Orders" +msgstr "Magazzino per gli ordini di vendita" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "Warehouse for Sale Orders" +msgstr "Magazzino per gli ordini di vendita" + +#~ msgid "Create Sale Orders when buying to this company" +#~ msgstr "Creare ordini di vendita quando si acquista da questa azienda" + +#~ msgid "" +#~ "Generate a Sale Order when a Purchase Order with this company as supplier " +#~ "is created.\n" +#~ " The intercompany user must at least be Sale User." +#~ msgstr "" +#~ "Generare un ordine di vendita quando un ordine d'acquisto viene creato " +#~ "con questa azienda come fornitore.\n" +#~ " L'utente interaziendale deve essere almeno un utente vendite." + +#, fuzzy +#~ msgid "Intercompany Sale User" +#~ msgstr "Utente interaziendale" + +#, fuzzy +#~ msgid "Purchase/Sale" +#~ msgstr "Ordine d'acquisto" + +#~ msgid "Sale Orders Auto Validation" +#~ msgstr "Validazione automatica ordini di vendita" + +#~ msgid "Sale from purchase" +#~ msgstr "Vendita da acquisto" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Ordine di vendita" + +#~ msgid "Sales Order Line" +#~ msgstr "Riga ordini di vendita" + +#~ msgid "Source Purchase Order" +#~ msgstr "Ordine d'acquisto di origine" + +#~ msgid "Source Purchase Order Line" +#~ msgstr "Riga ordine d'acquisto di origine" + +#~ msgid "This vendor bill is related with: {}" +#~ msgstr "Questa fattura fornitore è relativa a: {}" + +#~ msgid "" +#~ "When a Sale Order is created by a multi company rule for this company, it " +#~ "will automatically validate it." +#~ msgstr "" +#~ "Quando un ordine di vendita viene creato da una regola multi azienda per " +#~ "questa azienda, verrà automaticamente validato." + +#~ msgid "You can't cancel an order that is %s" +#~ msgstr "Impossibile annullare un ordine che è %s" + +#~ msgid "" +#~ "You cannot create SO from PO because product '%s' is not intercompany" +#~ msgstr "" +#~ "Impossibile creare l'ordine di vendita dall'ordine d'acquisto perchè il " +#~ "prodotto '%s' non è interaziendale" + +#~ msgid "" +#~ "You cannot create SO from PO because sale price list currency is " +#~ "different than purchase price list currency." +#~ msgstr "" +#~ "Impossibile creare l'ordine di vendita dall'ordine d'acquisto perchè la " +#~ "valuta del listino di vendita è diversa dalla valuta del listino " +#~ "d'acquisto." + +#~ msgid "Invoice" +#~ msgstr "Fattura" diff --git a/sale_purchase_stock_inter_company/i18n/purchase_sale_stock_inter_company.pot b/sale_purchase_stock_inter_company/i18n/purchase_sale_stock_inter_company.pot new file mode 100644 index 00000000000..31eb558fb90 --- /dev/null +++ b/sale_purchase_stock_inter_company/i18n/purchase_sale_stock_inter_company.pot @@ -0,0 +1,71 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_stock_inter_company +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.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: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_company +msgid "Companies" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company." +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_stock_picking__intercompany_picking_id +msgid "Intercompany Picking" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: code:addons/purchase_sale_stock_inter_company/models/stock_picking.py:0 +#, python-format +msgid "" +"There's no corresponding line in PO %(po)s for assigning qty from " +"%(pick_name)s for product %(product)s" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "Warehouse For Sale Orders" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "Warehouse for Sale Orders" +msgstr "" diff --git a/sale_purchase_stock_inter_company/i18n/sl.po b/sale_purchase_stock_inter_company/i18n/sl.po new file mode 100644 index 00000000000..707c144f468 --- /dev/null +++ b/sale_purchase_stock_inter_company/i18n/sl.po @@ -0,0 +1,162 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_stock_inter_company +# +# Translators: +# Matjaž Mozetič , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-05 13:15+0000\n" +"PO-Revision-Date: 2017-10-19 00:51+0000\n" +"Last-Translator: Matjaž Mozetič , 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: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_company +msgid "Companies" +msgstr "Družbe" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company" +msgstr "" +"Privzeta vrednost nastavljena na prodajnih nalogih, ki bo ustvarjena na " +"podlagi nabavnih nalogov za to družbo." + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company." +msgstr "" +"Privzeta vrednost nastavljena na prodajnih nalogih, ki bo ustvarjena na " +"podlagi nabavnih nalogov za to družbo." + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_stock_picking__intercompany_picking_id +msgid "Intercompany Picking" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "Nabavni nalog" + +#. module: purchase_sale_stock_inter_company +#: code:addons/purchase_sale_stock_inter_company/models/stock_picking.py:0 +#, python-format +msgid "" +"There's no corresponding line in PO %(po)s for assigning qty from " +"%(pick_name)s for product %(product)s" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "Warehouse For Sale Orders" +msgstr "Skladišče za prodajne naloge" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +#, fuzzy +msgid "Warehouse for Sale Orders" +msgstr "Skladišče za prodajne naloge" + +#, fuzzy +#~ msgid "Purchase/Sale" +#~ msgstr "Nabava v prodajo" + +#~ msgid "Sale Orders Auto Validation" +#~ msgstr "Samodejno overjanje prodajnih nalogov" + +#, fuzzy +#~ msgid "Sales Order" +#~ msgstr "Prodajni nalog" + +#~ msgid "Sales Order Line" +#~ msgstr "Postavka prodajnega naloga" + +#~ msgid "Source Purchase Order" +#~ msgstr "Izvorni nabavni nalog" + +#~ msgid "Source Purchase Order Line" +#~ msgstr "Postavka izvornega prodajnega naloga" + +#~ msgid "" +#~ "When a Sale Order is created by a multi company rule for this company, it " +#~ "will automatically validate it." +#~ msgstr "" +#~ "Ko se ustvari prodajni nalog iz pravila konsolidiranja za to družbo, se " +#~ "le-ta samodejno overi." + +#~ msgid "" +#~ "You cannot create SO from PO because product '%s' is not intercompany" +#~ msgstr "" +#~ "Prodajnega naloga ni mogoče ustvariti na osnovi nabavnega, ker proizvoda " +#~ "'%s' ni v sklopu strukturiranih družb." + +#, fuzzy +#~ msgid "" +#~ "You cannot create SO from PO because sale price list currency is " +#~ "different than purchase price list currency." +#~ msgstr "" +#~ "Prodajnega naloga ni mogoče ustvariti na osnovi nabavnega, ker je valuta " +#~ "prodajnega cenika drugačna od valute nabavnega." + +#~ msgid "Invoice" +#~ msgstr "Račun" + +#~ msgid "" +#~ "Configure correct warehouse for company (%s) in Menu: Settings/companies/" +#~ "companies" +#~ msgstr "" +#~ "Nastavite pravilno skladišče za družbo (%s) v meniju: Nastavitve/Družbe/" +#~ "Družbe" + +#~ msgid "Output - A" +#~ msgstr "Izhod - A" + +#~ msgid "Output - B" +#~ msgstr "Izhod - B" + +#~ msgid "Sale Auto Validation" +#~ msgstr "Samodejno overjanje prodaje" + +#~ msgid "Stock - A" +#~ msgstr "Zaloga - A" + +#~ msgid "Stock - B" +#~ msgstr "Zaloga - B" + +#~ msgid "" +#~ "When a Sale Order is created by a multi company rule for this company, it " +#~ "will automatically validate it" +#~ msgstr "" +#~ "Ko se ustvari prodajni nalog iz pravila konsolidiranja za to družbo, se " +#~ "le-ta samodejno overi" + +#~ msgid "" +#~ "{'invisible':['|', ('invoice_method','in', ['picking', 'manual', " +#~ "'intercompany']), '|', ('state','!=', 'approved'), ('invoiced','=',True)]}" +#~ msgstr "" +#~ "{'invisible':['|', ('invoice_method','in', ['picking', 'manual', " +#~ "'intercompany']), '|', ('state','!=', 'approved'), ('invoiced','=',True)]}" diff --git a/sale_purchase_stock_inter_company/i18n/zh_CN.po b/sale_purchase_stock_inter_company/i18n/zh_CN.po new file mode 100644 index 00000000000..b5c116f3f58 --- /dev/null +++ b/sale_purchase_stock_inter_company/i18n/zh_CN.po @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_stock_inter_company +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-05 13:15+0000\n" +"PO-Revision-Date: 2020-04-07 18:19+0000\n" +"Last-Translator: Dong \n" +"Language-Team: none\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" +"X-Generator: Weblate 3.10\n" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_company +msgid "Companies" +msgstr "公司" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "配置设定" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,help:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "" +"Default value to set on Sale Orders that will be created based on Purchase " +"Orders made to this company." +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_stock_picking__intercompany_picking_id +msgid "Intercompany Picking" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: code:addons/purchase_sale_stock_inter_company/models/stock_picking.py:0 +#, python-format +msgid "" +"There's no corresponding line in PO %(po)s for assigning qty from " +"%(pick_name)s for product %(product)s" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model,name:purchase_sale_stock_inter_company.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_company__warehouse_id +msgid "Warehouse For Sale Orders" +msgstr "" + +#. module: purchase_sale_stock_inter_company +#: model:ir.model.fields,field_description:purchase_sale_stock_inter_company.field_res_config_settings__warehouse_id +msgid "Warehouse for Sale Orders" +msgstr "" + +#~ msgid "Create Sale Orders when buying to this company" +#~ msgstr "当关联公司向该公司采购时自动创建销售订单" + +#~ msgid "Purchase/Sale" +#~ msgstr "公司间交易" diff --git a/sale_purchase_stock_inter_company/models/__init__.py b/sale_purchase_stock_inter_company/models/__init__.py new file mode 100644 index 00000000000..00f0f06311a --- /dev/null +++ b/sale_purchase_stock_inter_company/models/__init__.py @@ -0,0 +1,4 @@ +from . import sale_order +from . import res_company +from . import res_config +from . import stock_picking diff --git a/sale_purchase_stock_inter_company/models/res_company.py b/sale_purchase_stock_inter_company/models/res_company.py new file mode 100644 index 00000000000..976926d4f74 --- /dev/null +++ b/sale_purchase_stock_inter_company/models/res_company.py @@ -0,0 +1,16 @@ +# Copyright 2023 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResCompany(models.Model): + + _inherit = "res.company" + + warehouse_id = fields.Many2one( + "stock.warehouse", + string="Warehouse For Purchase Orders", + help="Default value to set on Purchase Orders that " + "will be created based on Sale Orders made to this company", + ) diff --git a/sale_purchase_stock_inter_company/models/res_config.py b/sale_purchase_stock_inter_company/models/res_config.py new file mode 100644 index 00000000000..a0db988af75 --- /dev/null +++ b/sale_purchase_stock_inter_company/models/res_config.py @@ -0,0 +1,18 @@ +# Copyright 2023 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class InterCompanyRulesConfig(models.TransientModel): + + _inherit = "res.config.settings" + + warehouse_id = fields.Many2one( + comodel_name="stock.warehouse", + related="company_id.warehouse_id", + string="Warehouse for Purchase Orders", + help="Default value to set on Purchase Orders that will be created " + "based on Sale Orders made to this company.", + readonly=False, + ) diff --git a/sale_purchase_stock_inter_company/models/sale_order.py b/sale_purchase_stock_inter_company/models/sale_order.py new file mode 100644 index 00000000000..7ff140a1d1c --- /dev/null +++ b/sale_purchase_stock_inter_company/models/sale_order.py @@ -0,0 +1,19 @@ +# Copyright 2023 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + def _prepare_purchase_order_data(self, name, partner, dest_company): + new_order = super()._prepare_purchase_order_data(name, partner, dest_company) + warehouse = ( + dest_company.warehouse_id.company_id == dest_company + and dest_company.warehouse_id + or False + ) + if warehouse: + new_order.update({"picking_type_id": warehouse.in_type_id.id}) + return new_order diff --git a/sale_purchase_stock_inter_company/models/stock_picking.py b/sale_purchase_stock_inter_company/models/stock_picking.py new file mode 100644 index 00000000000..223022d743c --- /dev/null +++ b/sale_purchase_stock_inter_company/models/stock_picking.py @@ -0,0 +1,56 @@ +# Copyright 2023 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import _, fields, models +from odoo.exceptions import UserError + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + intercompany_picking_id = fields.Many2one(comodel_name="stock.picking") + + def _action_done(self): + # Only DropShip pickings + so_picks = self.browse() + for pick in self.filtered( + lambda x: x.location_dest_id.usage == "customer" + ).sudo(): + sale = pick.purchase_id.auto_sale_order_id + if not sale: + continue + sale.picking_ids.write({"intercompany_picking_id": pick.id}) + for move_line in pick.move_line_ids: + qty_done = move_line.qty_done + purchase_line_id = move_line.move_id.purchase_line_id + so_move_lines = purchase_line_id.auto_sale_line_id.move_ids.mapped( + "move_line_ids" + ) + for so_move_line in so_move_lines: + if so_move_line.reserved_qty >= qty_done: + so_move_line.qty_done = qty_done + qty_done = 0.0 + else: + so_move_line.qty_done = so_move_line.reserved_qty + qty_done -= so_move_line.reserved_qty + so_picks |= so_move_line.picking_id + if qty_done and so_move_lines: + so_move_lines[-1:].qty_done += qty_done + elif not so_move_lines: + raise UserError( + _( + "There's no corresponding line in SO %(so)s for assigning " + "qty from %(pick_name)s for product %(product)s" + ) + % ( + { + "so": sale.name, + "pick_name": pick.name, + "product": move_line.product_id.name, + } + ) + ) + # Transfer dropship pickings + for so_pick in so_picks.sudo(): + so_pick.with_company(so_pick.company_id.id)._action_done() + return super()._action_done() diff --git a/sale_purchase_stock_inter_company/readme/CONFIGURE.rst b/sale_purchase_stock_inter_company/readme/CONFIGURE.rst new file mode 100644 index 00000000000..b26d34476f2 --- /dev/null +++ b/sale_purchase_stock_inter_company/readme/CONFIGURE.rst @@ -0,0 +1,4 @@ +To configure this module, you need to: +#. Go to the menu *Settings > General Settings*. +#. Go to the tab *Companies / Inter Company OCA features*, in the group *Purchase/Sale*, check the option *Purchase from sale*. +#. Then, select the *Warehouse for Purchase Orders*, it is the warehouse that will be used to automatically generate the purchase order in the other company. diff --git a/sale_purchase_stock_inter_company/readme/CONTRIBUTORS.rst b/sale_purchase_stock_inter_company/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..14d122d8286 --- /dev/null +++ b/sale_purchase_stock_inter_company/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Akretion `: + + * Chafique Delli diff --git a/sale_purchase_stock_inter_company/readme/DESCRIPTION.rst b/sale_purchase_stock_inter_company/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..3341acc8cb2 --- /dev/null +++ b/sale_purchase_stock_inter_company/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module considers the propagation of the warehouse into the purchase orders. + +This module is a glue module and is auto installed if `sale_purchase_inter_company`, `sale_stock` and `purchase_stock` modules are installed. +Full purpose description can be found in `sale_purchase_inter_company`. diff --git a/sale_purchase_stock_inter_company/static/description/icon.png b/sale_purchase_stock_inter_company/static/description/icon.png new file mode 100644 index 00000000000..fcefa2755a3 Binary files /dev/null and b/sale_purchase_stock_inter_company/static/description/icon.png differ diff --git a/sale_purchase_stock_inter_company/static/description/index.html b/sale_purchase_stock_inter_company/static/description/index.html new file mode 100644 index 00000000000..223d4dde02f --- /dev/null +++ b/sale_purchase_stock_inter_company/static/description/index.html @@ -0,0 +1,436 @@ + + + + + + +Inter Company Module for Purchase to Sale Order with warehouse + + + +
+

Inter Company Module for Sale to Purchase Order with warehouse

+ + +

Beta License: AGPL-3 OCA/multi-company Translate me on Weblate Try me on Runbot

+

This module considers the propagation of the warehouse into the purchase orders.

+

This module is a glue module and is auto installed if sale_purchase_inter_company, sale_stock and purchase_stock modules are installed. +Full purpose description can be found in sale_purchase_inter_company.

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+

#. Go to the menu Settings > General Settings.

+

#. Go to the tab Companies / Inter Company OCA features, in the group Purchase/Sale, check the option Purchase from sale.

+

#. Then, select the Warehouse for Purchase Orders, it is the warehouse that will be used to automatically generate the purchase order in the other company.

+
+
+

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

+
    +
  • Akretion
  • +
+
+
+

Contributors

+ + + + + +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/multi-company project on GitHub.

+

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

+
+
+
+ + diff --git a/sale_purchase_stock_inter_company/tests/__init__.py b/sale_purchase_stock_inter_company/tests/__init__.py new file mode 100644 index 00000000000..c0e7a0667cb --- /dev/null +++ b/sale_purchase_stock_inter_company/tests/__init__.py @@ -0,0 +1 @@ +from . import test_inter_company_sale_purchase_stock diff --git a/sale_purchase_stock_inter_company/tests/test_inter_company_sale_purchase_stock.py b/sale_purchase_stock_inter_company/tests/test_inter_company_sale_purchase_stock.py new file mode 100644 index 00000000000..d623800a1d8 --- /dev/null +++ b/sale_purchase_stock_inter_company/tests/test_inter_company_sale_purchase_stock.py @@ -0,0 +1,20 @@ +# Copyright 2023 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.addons.sale_purchase_inter_company.tests.test_inter_company_sale_purchase import ( + TestSalePurchaseInterCompany, +) + + +class TestSalePurchaseStockInterCompany(TestSalePurchaseInterCompany): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.warehouse_b = cls.env["stock.warehouse"].search( + [("company_id", "=", cls.company_b.id)] + ) + + def test_sale_purchase_stock_inter_company(self): + self.company_b.warehouse_id = self.warehouse_b + purchase = self._confirm_so() + self.assertEqual(purchase.picking_type_id.warehouse_id, self.warehouse_b) diff --git a/sale_purchase_stock_inter_company/views/res_config_view.xml b/sale_purchase_stock_inter_company/views/res_config_view.xml new file mode 100644 index 00000000000..e9b744498fd --- /dev/null +++ b/sale_purchase_stock_inter_company/views/res_config_view.xml @@ -0,0 +1,24 @@ + + + + res.config.settings + + + + + + + diff --git a/setup/sale_purchase_stock_inter_company/odoo/addons/sale_purchase_stock_inter_company b/setup/sale_purchase_stock_inter_company/odoo/addons/sale_purchase_stock_inter_company new file mode 120000 index 00000000000..5e1c72ce2c2 --- /dev/null +++ b/setup/sale_purchase_stock_inter_company/odoo/addons/sale_purchase_stock_inter_company @@ -0,0 +1 @@ +../../../../sale_purchase_stock_inter_company \ No newline at end of file diff --git a/setup/sale_purchase_stock_inter_company/setup.py b/setup/sale_purchase_stock_inter_company/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/sale_purchase_stock_inter_company/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)