diff --git a/purchase_sale_stock_inter_company/README.rst b/purchase_sale_stock_inter_company/README.rst new file mode 100644 index 00000000000..f9d95fa9afe --- /dev/null +++ b/purchase_sale_stock_inter_company/README.rst @@ -0,0 +1,97 @@ +============================================================== +Inter Company Module for Purchase to Sale 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/purchase_sale_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-purchase_sale_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 sale orders. + +This module is a glue module and is auto installed if `purchase_sale_inter_company`, `sale_stock` and `purchase_stock` modules are installed. +Full purpose description can be found in `purchase_sale_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 *Sale from purchase*. +#. Then, select the *Warehouse for Sale Orders*, it is the warehouse that will be used to automatically generate the sale 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 +~~~~~~~ + +* Odoo SA +* Akretion +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Adria Gil Sorribes +* `Akretion `: + + * Chafique Delli + * Pierrick Brun +* `Tecnativa `: + + * Pedro M. Baeza +* `Camptocamp `: + + * Maksym Yankin + +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/purchase_sale_stock_inter_company/__init__.py b/purchase_sale_stock_inter_company/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/purchase_sale_stock_inter_company/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/purchase_sale_stock_inter_company/__manifest__.py b/purchase_sale_stock_inter_company/__manifest__.py new file mode 100644 index 00000000000..15b28571b3b --- /dev/null +++ b/purchase_sale_stock_inter_company/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2013-Today Odoo SA +# Copyright 2016-2019 Chafique DELLI @ Akretion +# Copyright 2018-2019 Tecnativa - Carlos Dauden +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Inter Company Module for Purchase to Sale Order with warehouse", + "summary": "Intercompany PO/SO rules with warehouse", + "version": "16.0.1.0.0", + "category": "Purchase Management", + "website": "https://github.com/OCA/multi-company", + "author": "Odoo SA, Akretion, Tecnativa, Odoo Community Association (OCA)", + "license": "AGPL-3", + "installable": True, + "auto_install": True, + "depends": ["purchase_sale_inter_company", "sale_stock", "purchase_stock"], + "data": ["views/res_config_view.xml"], +} diff --git a/purchase_sale_stock_inter_company/i18n/de.po b/purchase_sale_stock_inter_company/i18n/de.po new file mode 100644 index 00000000000..efb3ed87da4 --- /dev/null +++ b/purchase_sale_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/purchase_sale_stock_inter_company/i18n/es.po b/purchase_sale_stock_inter_company/i18n/es.po new file mode 100644 index 00000000000..3fd2eb3b4c8 --- /dev/null +++ b/purchase_sale_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/purchase_sale_stock_inter_company/i18n/fr.po b/purchase_sale_stock_inter_company/i18n/fr.po new file mode 100644 index 00000000000..03204d4d5f9 --- /dev/null +++ b/purchase_sale_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/purchase_sale_stock_inter_company/i18n/fr_FR.po b/purchase_sale_stock_inter_company/i18n/fr_FR.po new file mode 100644 index 00000000000..26132ec15fd --- /dev/null +++ b/purchase_sale_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/purchase_sale_stock_inter_company/i18n/it.po b/purchase_sale_stock_inter_company/i18n/it.po new file mode 100644 index 00000000000..c530d4396cc --- /dev/null +++ b/purchase_sale_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/purchase_sale_stock_inter_company/i18n/purchase_sale_stock_inter_company.pot b/purchase_sale_stock_inter_company/i18n/purchase_sale_stock_inter_company.pot new file mode 100644 index 00000000000..31eb558fb90 --- /dev/null +++ b/purchase_sale_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/purchase_sale_stock_inter_company/i18n/sl.po b/purchase_sale_stock_inter_company/i18n/sl.po new file mode 100644 index 00000000000..707c144f468 --- /dev/null +++ b/purchase_sale_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/purchase_sale_stock_inter_company/i18n/zh_CN.po b/purchase_sale_stock_inter_company/i18n/zh_CN.po new file mode 100644 index 00000000000..b5c116f3f58 --- /dev/null +++ b/purchase_sale_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/purchase_sale_stock_inter_company/models/__init__.py b/purchase_sale_stock_inter_company/models/__init__.py new file mode 100644 index 00000000000..fd0b2e801f8 --- /dev/null +++ b/purchase_sale_stock_inter_company/models/__init__.py @@ -0,0 +1,4 @@ +from . import purchase_order +from . import res_company +from . import res_config +from . import stock_picking diff --git a/purchase_sale_stock_inter_company/models/purchase_order.py b/purchase_sale_stock_inter_company/models/purchase_order.py new file mode 100644 index 00000000000..3b8ca05d7eb --- /dev/null +++ b/purchase_sale_stock_inter_company/models/purchase_order.py @@ -0,0 +1,32 @@ +# Copyright 2013-Today Odoo SA +# Copyright 2016-2019 Chafique DELLI @ Akretion +# Copyright 2018-2019 Tecnativa - Carlos Dauden +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class PurchaseOrder(models.Model): + _inherit = "purchase.order" + + def _prepare_sale_order_data( + self, name, partner, dest_company, direct_delivery_address + ): + new_order = super()._prepare_sale_order_data( + name, partner, dest_company, direct_delivery_address + ) + delivery_address = ( + direct_delivery_address + or self.picking_type_id.warehouse_id.partner_id + or False + ) + if delivery_address: + new_order.update({"partner_shipping_id": delivery_address.id}) + warehouse = ( + dest_company.warehouse_id.company_id == dest_company + and dest_company.warehouse_id + or False + ) + if warehouse: + new_order.update({"warehouse_id": warehouse.id}) + return new_order diff --git a/purchase_sale_stock_inter_company/models/res_company.py b/purchase_sale_stock_inter_company/models/res_company.py new file mode 100644 index 00000000000..2ee88f5b1a2 --- /dev/null +++ b/purchase_sale_stock_inter_company/models/res_company.py @@ -0,0 +1,18 @@ +# Copyright 2013-Today Odoo SA +# Copyright 2016-2019 Chafique DELLI @ Akretion +# Copyright 2018-2019 Tecnativa - Carlos Dauden +# 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 Sale Orders", + help="Default value to set on Sale Orders that " + "will be created based on Purchase Orders made to this company", + ) diff --git a/purchase_sale_stock_inter_company/models/res_config.py b/purchase_sale_stock_inter_company/models/res_config.py new file mode 100644 index 00000000000..d1fad81c6a9 --- /dev/null +++ b/purchase_sale_stock_inter_company/models/res_config.py @@ -0,0 +1,20 @@ +# Copyright 2013-Today Odoo SA +# Copyright 2016-2019 Chafique DELLI @ Akretion +# Copyright 2018-2019 Tecnativa - Carlos Dauden +# 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 Sale Orders", + help="Default value to set on Sale Orders that will be created " + "based on Purchase Orders made to this company.", + readonly=False, + ) diff --git a/purchase_sale_stock_inter_company/models/stock_picking.py b/purchase_sale_stock_inter_company/models/stock_picking.py new file mode 100644 index 00000000000..865550f233d --- /dev/null +++ b/purchase_sale_stock_inter_company/models/stock_picking.py @@ -0,0 +1,57 @@ +# Copyright 2018 Tecnativa - Carlos Dauden +# Copyright 2018 Tecnativa - Pedro M. Baeza +# 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 + po_picks = self.browse() + for pick in self.filtered( + lambda x: x.location_dest_id.usage == "customer" + ).sudo(): + purchase = pick.sale_id.auto_purchase_order_id + if not purchase: + continue + purchase.picking_ids.write({"intercompany_picking_id": pick.id}) + for move_line in pick.move_line_ids: + qty_done = move_line.qty_done + sale_line_id = move_line.move_id.sale_line_id + po_move_lines = sale_line_id.auto_purchase_line_id.move_ids.mapped( + "move_line_ids" + ) + for po_move_line in po_move_lines: + if po_move_line.product_qty >= qty_done: + po_move_line.qty_done = qty_done + qty_done = 0.0 + else: + po_move_line.qty_done = po_move_line.product_qty + qty_done -= po_move_line.product_qty + po_picks |= po_move_line.picking_id + if qty_done and po_move_lines: + po_move_lines[-1:].qty_done += qty_done + elif not po_move_lines: + raise UserError( + _( + "There's no corresponding line in PO %(po)s for assigning " + "qty from %(pick_name)s for product %(product)s" + ) + % ( + { + "po": purchase.name, + "pick_name": pick.name, + "product": move_line.product_id.name, + } + ) + ) + # Transfer dropship pickings + for po_pick in po_picks.sudo(): + po_pick.with_company(po_pick.company_id.id)._action_done() + return super()._action_done() diff --git a/purchase_sale_stock_inter_company/readme/CONFIGURE.rst b/purchase_sale_stock_inter_company/readme/CONFIGURE.rst new file mode 100644 index 00000000000..2af5826da5d --- /dev/null +++ b/purchase_sale_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 *Sale from purchase*. +#. Then, select the *Warehouse for Sale Orders*, it is the warehouse that will be used to automatically generate the sale order in the other company. diff --git a/purchase_sale_stock_inter_company/readme/CONTRIBUTORS.rst b/purchase_sale_stock_inter_company/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..ffaa6f9b2d0 --- /dev/null +++ b/purchase_sale_stock_inter_company/readme/CONTRIBUTORS.rst @@ -0,0 +1,11 @@ +* Adria Gil Sorribes +* `Akretion `: + + * Chafique Delli + * Pierrick Brun +* `Tecnativa `: + + * Pedro M. Baeza +* `Camptocamp `: + + * Maksym Yankin diff --git a/purchase_sale_stock_inter_company/readme/DESCRIPTION.rst b/purchase_sale_stock_inter_company/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..45c36685e42 --- /dev/null +++ b/purchase_sale_stock_inter_company/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module considers the propagation of the warehouse into the sale orders. + +This module is a glue module and is auto installed if `purchase_sale_inter_company`, `sale_stock` and `purchase_stock` modules are installed. +Full purpose description can be found in `purchase_sale_inter_company`. diff --git a/purchase_sale_stock_inter_company/static/description/icon.png b/purchase_sale_stock_inter_company/static/description/icon.png new file mode 100644 index 00000000000..b3de330666d Binary files /dev/null and b/purchase_sale_stock_inter_company/static/description/icon.png differ diff --git a/purchase_sale_stock_inter_company/static/description/index.html b/purchase_sale_stock_inter_company/static/description/index.html new file mode 100644 index 00000000000..9ae90a2a9ff --- /dev/null +++ b/purchase_sale_stock_inter_company/static/description/index.html @@ -0,0 +1,444 @@ + + + + + + +Inter Company Module for Purchase to Sale Order with warehouse + + + +
+

Inter Company Module for Purchase to Sale 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 sale orders.

+

This module is a glue module and is auto installed if purchase_sale_inter_company, sale_stock and purchase_stock modules are installed. +Full purpose description can be found in purchase_sale_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 Sale from purchase.

+

#. Then, select the Warehouse for Sale Orders, it is the warehouse that will be used to automatically generate the sale 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

+
    +
  • Odoo SA
  • +
  • Akretion
  • +
  • Tecnativa
  • +
+
+
+

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/purchase_sale_stock_inter_company/tests/__init__.py b/purchase_sale_stock_inter_company/tests/__init__.py new file mode 100644 index 00000000000..5d0b65d96f4 --- /dev/null +++ b/purchase_sale_stock_inter_company/tests/__init__.py @@ -0,0 +1 @@ +from . import test_inter_company_purchase_sale_stock diff --git a/purchase_sale_stock_inter_company/tests/test_inter_company_purchase_sale_stock.py b/purchase_sale_stock_inter_company/tests/test_inter_company_purchase_sale_stock.py new file mode 100644 index 00000000000..5ae0e207565 --- /dev/null +++ b/purchase_sale_stock_inter_company/tests/test_inter_company_purchase_sale_stock.py @@ -0,0 +1,68 @@ +# Copyright 2013-Today Odoo SA +# Copyright 2019-2019 Chafique DELLI @ Akretion +# Copyright 2018-2019 Tecnativa - Carlos Dauden +# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + + +from odoo.addons.purchase_sale_inter_company.tests.test_inter_company_purchase_sale import ( + TestPurchaseSaleInterCompany, +) + + +class TestPurchaseSaleStockInterCompany(TestPurchaseSaleInterCompany): + @classmethod + def _create_warehouse(cls, code, company): + address = cls.env["res.partner"].create({"name": f"{code} address"}) + return cls.env["stock.warehouse"].create( + { + "name": f"Warehouse {code}", + "code": code, + "partner_id": address.id, + "company_id": company.id, + } + ) + + @classmethod + def setUpClass(cls): + super().setUpClass() + # Configure 2 Warehouse per company + cls.warehouse_a = cls.env["stock.warehouse"].search( + [("company_id", "=", cls.company_a.id)] + ) + cls.warehouse_b = cls._create_warehouse("CA-WB", cls.company_a) + + cls.warehouse_c = cls.env["stock.warehouse"].search( + [("company_id", "=", cls.company_b.id)] + ) + cls.warehouse_d = cls._create_warehouse("CB-WD", cls.company_b) + cls.company_b.warehouse_id = cls.warehouse_c + + def test_deliver_to_warehouse_a(self): + self.purchase_company_a.picking_type_id = self.warehouse_a.in_type_id + sale = self._approve_po() + self.assertEqual(self.warehouse_a.partner_id, sale.partner_shipping_id) + + def test_deliver_to_warehouse_b(self): + self.purchase_company_a.picking_type_id = self.warehouse_b.in_type_id + sale = self._approve_po() + self.assertEqual(self.warehouse_b.partner_id, sale.partner_shipping_id) + + def test_send_from_warehouse_c(self): + self.company_b.warehouse_id = self.warehouse_c + sale = self._approve_po() + self.assertEqual(sale.warehouse_id, self.warehouse_c) + + def test_send_from_warehouse_d(self): + self.company_b.warehouse_id = self.warehouse_d + sale = self._approve_po() + self.assertEqual(sale.warehouse_id, self.warehouse_d) + + def test_purchase_sale_stock_inter_company(self): + self.purchase_company_a.notes = "Test note" + sale = self._approve_po() + self.assertEqual( + sale.partner_shipping_id, + self.purchase_company_a.picking_type_id.warehouse_id.partner_id, + ) + self.assertEqual(sale.warehouse_id, self.warehouse_c) diff --git a/purchase_sale_stock_inter_company/views/res_config_view.xml b/purchase_sale_stock_inter_company/views/res_config_view.xml new file mode 100644 index 00000000000..f6445f26df7 --- /dev/null +++ b/purchase_sale_stock_inter_company/views/res_config_view.xml @@ -0,0 +1,21 @@ + + + + res.config.settings + + + + + + + diff --git a/setup/purchase_sale_stock_inter_company/odoo/addons/purchase_sale_stock_inter_company b/setup/purchase_sale_stock_inter_company/odoo/addons/purchase_sale_stock_inter_company new file mode 120000 index 00000000000..a451f889f48 --- /dev/null +++ b/setup/purchase_sale_stock_inter_company/odoo/addons/purchase_sale_stock_inter_company @@ -0,0 +1 @@ +../../../../purchase_sale_stock_inter_company \ No newline at end of file diff --git a/setup/purchase_sale_stock_inter_company/setup.py b/setup/purchase_sale_stock_inter_company/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/purchase_sale_stock_inter_company/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)