diff --git a/sale_purchase_inter_company/README.rst b/sale_purchase_inter_company/README.rst new file mode 100644 index 00000000000..46906088e5f --- /dev/null +++ b/sale_purchase_inter_company/README.rst @@ -0,0 +1,102 @@ +=============================================== +Inter Company Module for Sale to Purchase Order +=============================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b6699334ceab617b51eb8bff702becd5655d8941de50387405392703b44df99b + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/18.0/sale_purchase_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-18-0/multi-company-18-0-sale_purchase_inter_company + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/multi-company&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module is useful if there are multiple companies in the same Odoo +database and those companies sell goods or services among themselves. It +allows to create a purchase order in company B from a sale order in +company A. + +Imagine you have company A and company B in the same Odoo database: + +- Company A sale goods to company B. +- Company A will create a sale order with company B as customer. +- This module automate the creation of the purchase order in company B + with company A as supplier. + +**Table of contents** + +.. contents:: + :local: + +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*. #. If you check the option *Purchase Auto Validation* in the +configuration of company B, then when you validate a *Sale Order* in +company A with company B as customer, the *Purchase Order* will be +automatically validated in company B with company A as supplier. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Akretion + +Contributors +------------ + +- \`Akretion + <`https://www.akretion.com\\>\\\` \`>`__: + + - Chafique Delli + - Kévin Roche + - Guillaume Masson + +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_inter_company/__init__.py b/sale_purchase_inter_company/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/sale_purchase_inter_company/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_purchase_inter_company/__manifest__.py b/sale_purchase_inter_company/__manifest__.py new file mode 100644 index 00000000000..56eec72f4c5 --- /dev/null +++ b/sale_purchase_inter_company/__manifest__.py @@ -0,0 +1,15 @@ +# 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", + "summary": "Intercompany SO/PO rules", + "version": "18.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, + "depends": ["sale", "purchase", "account_invoice_inter_company"], + "data": ["views/res_config_view.xml"], +} diff --git a/sale_purchase_inter_company/i18n/de.po b/sale_purchase_inter_company/i18n/de.po new file mode 100644 index 00000000000..dfad85dc0ac --- /dev/null +++ b/sale_purchase_inter_company/i18n/de.po @@ -0,0 +1,144 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_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-04 15:47+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: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_company +msgid "Companies" +msgstr "Unternehmen" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "Create Purchase Orders when selling to this company" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "" +"Generate a Purchase Order when a Sale Order with this company as customer is " +"created.\n" +" The intercompany user must at least be Purchase User." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__intercompany_purchase_user_id +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "Intercompany Purchase User" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +msgid "Purchase Orders Auto Validation" +msgstr "" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +msgid "Purchase from sale" +msgstr "" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +msgid "Sale/Purchase" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order__auto_sale_order_id +msgid "Source Sale Order" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order_line__auto_sale_line_id +msgid "Source Sale Order Line" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/account_move.py:0 +#, python-format +msgid "This customer bill is related with: {}" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "" +"User used to create the Purchase order arising from a sale order in another " +"company." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +msgid "" +"When a Purchase Order is created by a multi company rule for this company, " +"it will automatically validate it." +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You can't cancel an order that is %s" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You cannot create PO from SO because product '%s' is not intercompany" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "" +"You cannot create PO from SO because purchase price list currency is " +"different than sale price list currency." +msgstr "" + +#~ msgid "Invoice" +#~ msgstr "Rechnung" diff --git a/sale_purchase_inter_company/i18n/es.po b/sale_purchase_inter_company/i18n/es.po new file mode 100644 index 00000000000..361c6b5242a --- /dev/null +++ b/sale_purchase_inter_company/i18n/es.po @@ -0,0 +1,198 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_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-04 15:47+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: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "Ajustes Configuración" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__po_from_so +#, fuzzy +msgid "Create Purchase Orders when selling to this company" +msgstr "Crear pedido de venta al comprar a esta compañía" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__po_from_so +#, fuzzy +msgid "" +"Generate a Purchase Order when a Sale Order with this company as customer is " +"created.\n" +" The intercompany user must at least be Purchase 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." + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__intercompany_purchase_user_id +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +#, fuzzy +msgid "Intercompany Purchase User" +msgstr "Usuario de venta intercompañía" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_account_move +#, fuzzy +msgid "Journal Entry" +msgstr "Asientos contables" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "Pedido de compra" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order_line +#, fuzzy +msgid "Purchase Order Line" +msgstr "Pedido de compra" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +#, fuzzy +msgid "Purchase Orders Auto Validation" +msgstr "Auto confirmar pedidos de venta" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Purchase from sale" +msgstr "Compra/Venta" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Sale/Purchase" +msgstr "Venta desde compra" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_sale_order +msgid "Sales Order" +msgstr "Pedido de venta" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order__auto_sale_order_id +#, fuzzy +msgid "Source Sale Order" +msgstr "Pedido de compra de origen" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order_line__auto_sale_line_id +#, fuzzy +msgid "Source Sale Order Line" +msgstr "Línea pedido de compra origen" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/account_move.py:0 +#, fuzzy, python-format +msgid "This customer bill is related with: {}" +msgstr "Esta factura de proveedor está relacionada con: %s" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +#, fuzzy +msgid "" +"User used to create the Purchase order arising from a sale 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." + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +#, fuzzy +msgid "" +"When a Purchase 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." + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You can't cancel an order that is %s" +msgstr "No puede cancelar un pedido que es %s" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, fuzzy, python-format +msgid "You cannot create PO from SO 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" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, fuzzy, python-format +msgid "" +"You cannot create PO from SO because purchase price list currency is " +"different than sale 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 "Sales Order Line" +#~ msgstr "Línea de pedido de venta" + +#~ 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" + +#~ 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." + +#~ msgid "" +#~ "There's no corresponding line in PO %s for assigning qty from %s for " +#~ "product %s" +#~ msgstr "" +#~ "No hay una línea correspondiente en el pedido de compra %s para asignar " +#~ "cantidad desde %s para el producto %s" + +#~ msgid "Transfer" +#~ msgstr "Transferir" + +#~ msgid "Invoice" +#~ msgstr "Factura" + +#~ msgid "Quotation" +#~ msgstr "Presupuesto" diff --git a/sale_purchase_inter_company/i18n/fr.po b/sale_purchase_inter_company/i18n/fr.po new file mode 100644 index 00000000000..f0c2bc5eb45 --- /dev/null +++ b/sale_purchase_inter_company/i18n/fr.po @@ -0,0 +1,198 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_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-04 15:47+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: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "Create Purchase Orders when selling to this company" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "" +"Generate a Purchase Order when a Sale Order with this company as customer is " +"created.\n" +" The intercompany user must at least be Purchase User." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__intercompany_purchase_user_id +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "Intercompany Purchase User" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "Bon de commande" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order_line +#, fuzzy +msgid "Purchase Order Line" +msgstr "Bon de commande" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +#, fuzzy +msgid "Purchase Orders Auto Validation" +msgstr "Auto Validation des commandes de vente" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Purchase from sale" +msgstr "Achat vers Vente" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Sale/Purchase" +msgstr "Achat vers Vente" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_sale_order +#, fuzzy +msgid "Sales Order" +msgstr "Commande de ventes" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order__auto_sale_order_id +#, fuzzy +msgid "Source Sale Order" +msgstr "Commande d'achat source" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order_line__auto_sale_line_id +#, fuzzy +msgid "Source Sale Order Line" +msgstr "Ligne de commande d'achat source" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/account_move.py:0 +#, python-format +msgid "This customer bill is related with: {}" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "" +"User used to create the Purchase order arising from a sale order in another " +"company." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +#, fuzzy +msgid "" +"When a Purchase 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é." + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You can't cancel an order that is %s" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, fuzzy, python-format +msgid "You cannot create PO from SO 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é" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, fuzzy, python-format +msgid "" +"You cannot create PO from SO because purchase price list currency is " +"different than sale 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 "Sales Order Line" +#~ msgstr "Ligne de commandes de vente" + +#~ 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é" + +#~ 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é." + +#~ msgid "Invoice" +#~ msgstr "Facture" + +#~ 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 "" +#~ "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_inter_company/i18n/fr_FR.po b/sale_purchase_inter_company/i18n/fr_FR.po new file mode 100644 index 00000000000..4c57561ba73 --- /dev/null +++ b/sale_purchase_inter_company/i18n/fr_FR.po @@ -0,0 +1,199 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_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-04 15:47+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: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "Create Purchase Orders when selling to this company" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "" +"Generate a Purchase Order when a Sale Order with this company as customer is " +"created.\n" +" The intercompany user must at least be Purchase User." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__intercompany_purchase_user_id +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "Intercompany Purchase User" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "Commande d'achat" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order_line +#, fuzzy +msgid "Purchase Order Line" +msgstr "Commande d'achat" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +#, fuzzy +msgid "Purchase Orders Auto Validation" +msgstr "Auto Validation des commandes de vente" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Purchase from sale" +msgstr "Achat vers Vente" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Sale/Purchase" +msgstr "Achat vers Vente" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_sale_order +#, fuzzy +msgid "Sales Order" +msgstr "Commandes de vente" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order__auto_sale_order_id +#, fuzzy +msgid "Source Sale Order" +msgstr "Commande d'achat source" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order_line__auto_sale_line_id +#, fuzzy +msgid "Source Sale Order Line" +msgstr "Ligne de commande d'achat source" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/account_move.py:0 +#, python-format +msgid "This customer bill is related with: {}" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "" +"User used to create the Purchase order arising from a sale order in another " +"company." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +#, fuzzy +msgid "" +"When a Purchase 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é." + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You can't cancel an order that is %s" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, fuzzy, python-format +msgid "You cannot create PO from SO 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é" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, fuzzy, python-format +msgid "" +"You cannot create PO from SO because purchase price list currency is " +"different than sale 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 "Sales Order Line" +#~ msgstr "Ligne de commandes de vente" + +#~ 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é" + +#~ 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é." + +#~ msgid "Invoice" +#~ msgstr "Facture" + +#~ 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 "" +#~ "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_inter_company/i18n/it.po b/sale_purchase_inter_company/i18n/it.po new file mode 100644 index 00000000000..e742e7ced7b --- /dev/null +++ b/sale_purchase_inter_company/i18n/it.po @@ -0,0 +1,193 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_inter_company +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-04 15:47+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: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_company +msgid "Companies" +msgstr "Aziende" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni di configurazione" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__po_from_so +#, fuzzy +msgid "Create Purchase Orders when selling to this company" +msgstr "Creare ordini di vendita quando si acquista da questa azienda" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__po_from_so +#, fuzzy +msgid "" +"Generate a Purchase Order when a Sale Order with this company as customer is " +"created.\n" +" The intercompany user must at least be Purchase 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." + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__intercompany_purchase_user_id +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +#, fuzzy +msgid "Intercompany Purchase User" +msgstr "Utente interaziendale" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "Ordine d'acquisto" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order_line +#, fuzzy +msgid "Purchase Order Line" +msgstr "Ordine d'acquisto" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +#, fuzzy +msgid "Purchase Orders Auto Validation" +msgstr "Validazione automatica ordini di vendita" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Purchase from sale" +msgstr "Ordine d'acquisto" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Sale/Purchase" +msgstr "Vendita da acquisto" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_sale_order +#, fuzzy +msgid "Sales Order" +msgstr "Ordine di vendita" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order__auto_sale_order_id +#, fuzzy +msgid "Source Sale Order" +msgstr "Ordine d'acquisto di origine" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order_line__auto_sale_line_id +#, fuzzy +msgid "Source Sale Order Line" +msgstr "Riga ordine d'acquisto di origine" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/account_move.py:0 +#, fuzzy, python-format +msgid "This customer bill is related with: {}" +msgstr "Questa fattura fornitore è relativa a: %s" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "" +"User used to create the Purchase order arising from a sale order in another " +"company." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +#, fuzzy +msgid "" +"When a Purchase 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." + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You can't cancel an order that is %s" +msgstr "Impossibile annullare un ordine che è %s" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, fuzzy, python-format +msgid "You cannot create PO from SO because product '%s' is not intercompany" +msgstr "" +"Impossibile creare l'ordine di vendita dall'ordine d'acquisto perchè il " +"prodotto '%s' non è interaziendale" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, fuzzy, python-format +msgid "" +"You cannot create PO from SO because purchase price list currency is " +"different than sale 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 "Sales Order Line" +#~ msgstr "Riga ordini di vendita" + +#~ 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" + +#~ 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." + +#~ msgid "Intercompany Picking" +#~ msgstr "Prelievo interaziendale" + +#~ msgid "" +#~ "There's no corresponding line in PO %s for assigning qty from %s for " +#~ "product %s" +#~ msgstr "" +#~ "Non c'è una riga corrisponde nell'ordine d'acquisto %s per assegnare la " +#~ "quantità da %s per il prodotto %s" + +#~ msgid "Transfer" +#~ msgstr "Trasferire" + +#~ msgid "Invoice" +#~ msgstr "Fattura" diff --git a/sale_purchase_inter_company/i18n/sale_purchase_inter_company.pot b/sale_purchase_inter_company/i18n/sale_purchase_inter_company.pot new file mode 100644 index 00000000000..b629384f6c3 --- /dev/null +++ b/sale_purchase_inter_company/i18n/sale_purchase_inter_company.pot @@ -0,0 +1,135 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_purchase_inter_company +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_company +msgid "Companies" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "Create Purchase Orders when selling to this company" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "" +"Generate a Purchase Order when a Sale Order with this company as customer is created.\n" +" The intercompany user must at least be Purchase User." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__intercompany_purchase_user_id +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "Intercompany Purchase User" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +msgid "Purchase Orders Auto Validation" +msgstr "" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +msgid "Purchase from sale" +msgstr "" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +msgid "Sale/Purchase" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order__auto_sale_order_id +msgid "Source Sale Order" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order_line__auto_sale_line_id +msgid "Source Sale Order Line" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/account_move.py:0 +#, python-format +msgid "This customer bill is related with: {}" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "" +"User used to create the Purchase order arising from a sale order in another " +"company." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +msgid "" +"When a Purchase Order is created by a multi company rule for this company, " +"it will automatically validate it." +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You can't cancel an order that is %s" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You cannot create PO from SO because product '%s' is not intercompany" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "" +"You cannot create PO from SO because purchase price list currency is " +"different than sale price list currency." +msgstr "" diff --git a/sale_purchase_inter_company/i18n/sl.po b/sale_purchase_inter_company/i18n/sl.po new file mode 100644 index 00000000000..ae17da55424 --- /dev/null +++ b/sale_purchase_inter_company/i18n/sl.po @@ -0,0 +1,199 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_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-04 15:47+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: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_company +msgid "Companies" +msgstr "Družbe" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "Create Purchase Orders when selling to this company" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "" +"Generate a Purchase Order when a Sale Order with this company as customer is " +"created.\n" +" The intercompany user must at least be Purchase User." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__intercompany_purchase_user_id +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "Intercompany Purchase User" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "Nabavni nalog" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order_line +#, fuzzy +msgid "Purchase Order Line" +msgstr "Nabavni nalog" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +#, fuzzy +msgid "Purchase Orders Auto Validation" +msgstr "Samodejno overjanje prodajnih nalogov" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Purchase from sale" +msgstr "Nabava v prodajo" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Sale/Purchase" +msgstr "Nabava v prodajo" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_sale_order +#, fuzzy +msgid "Sales Order" +msgstr "Prodajni nalog" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order__auto_sale_order_id +#, fuzzy +msgid "Source Sale Order" +msgstr "Izvorni nabavni nalog" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order_line__auto_sale_line_id +#, fuzzy +msgid "Source Sale Order Line" +msgstr "Postavka izvornega prodajnega naloga" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/account_move.py:0 +#, python-format +msgid "This customer bill is related with: {}" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "" +"User used to create the Purchase order arising from a sale order in another " +"company." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +#, fuzzy +msgid "" +"When a Purchase 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." + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You can't cancel an order that is %s" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, fuzzy, python-format +msgid "You cannot create PO from SO 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." + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, fuzzy, python-format +msgid "" +"You cannot create PO from SO because purchase price list currency is " +"different than sale price list currency." +msgstr "" +"Prodajnega naloga ni mogoče ustvariti na osnovi nabavnega, ker je valuta " +"prodajnega cenika drugačna od valute nabavnega." + +#~ msgid "Sales Order Line" +#~ msgstr "Postavka prodajnega naloga" + +#~ 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." + +#~ 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." + +#~ msgid "Invoice" +#~ msgstr "Račun" + +#~ msgid "Output - A" +#~ msgstr "Izhod - A" + +#~ msgid "Output - B" +#~ msgstr "Izhod - B" + +#~ msgid "Sale Auto Validation" +#~ msgstr "Samodejno overjanje prodaje" + +#~ 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_inter_company/i18n/zh_CN.po b/sale_purchase_inter_company/i18n/zh_CN.po new file mode 100644 index 00000000000..580f3d2891a --- /dev/null +++ b/sale_purchase_inter_company/i18n/zh_CN.po @@ -0,0 +1,143 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_sale_inter_company +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-08-04 15:47+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: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_company +msgid "Companies" +msgstr "公司" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_res_config_settings +msgid "Config Settings" +msgstr "配置设定" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__po_from_so +#, fuzzy +msgid "Create Purchase Orders when selling to this company" +msgstr "当关联公司向该公司采购时自动创建销售订单" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__po_from_so +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__po_from_so +msgid "" +"Generate a Purchase Order when a Sale Order with this company as customer is " +"created.\n" +" The intercompany user must at least be Purchase User." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__intercompany_purchase_user_id +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "Intercompany Purchase User" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order +msgid "Purchase Order" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +msgid "Purchase Orders Auto Validation" +msgstr "" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Purchase from sale" +msgstr "公司间交易" + +#. module: sale_purchase_inter_company +#: model_terms:ir.ui.view,arch_db:sale_purchase_inter_company.res_config_settings_view_form +#, fuzzy +msgid "Sale/Purchase" +msgstr "公司间交易" + +#. module: sale_purchase_inter_company +#: model:ir.model,name:sale_purchase_inter_company.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order__auto_sale_order_id +msgid "Source Sale Order" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,field_description:sale_purchase_inter_company.field_purchase_order_line__auto_sale_line_id +msgid "Source Sale Order Line" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/account_move.py:0 +#, python-format +msgid "This customer bill is related with: {}" +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__intercompany_purchase_user_id +msgid "" +"User used to create the Purchase order arising from a sale order in another " +"company." +msgstr "" + +#. module: sale_purchase_inter_company +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_company__purchase_auto_validation +#: model:ir.model.fields,help:sale_purchase_inter_company.field_res_config_settings__purchase_auto_validation +msgid "" +"When a Purchase Order is created by a multi company rule for this company, " +"it will automatically validate it." +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You can't cancel an order that is %s" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "You cannot create PO from SO because product '%s' is not intercompany" +msgstr "" + +#. module: sale_purchase_inter_company +#. odoo-python +#: code:addons/sale_purchase_inter_company/models/sale_order.py:0 +#, python-format +msgid "" +"You cannot create PO from SO because purchase price list currency is " +"different than sale price list currency." +msgstr "" diff --git a/sale_purchase_inter_company/models/__init__.py b/sale_purchase_inter_company/models/__init__.py new file mode 100644 index 00000000000..b03d4b54283 --- /dev/null +++ b/sale_purchase_inter_company/models/__init__.py @@ -0,0 +1,5 @@ +from . import account_move +from . import purchase_order +from . import res_company +from . import res_config +from . import sale_order diff --git a/sale_purchase_inter_company/models/account_move.py b/sale_purchase_inter_company/models/account_move.py new file mode 100644 index 00000000000..757e9ad71ec --- /dev/null +++ b/sale_purchase_inter_company/models/account_move.py @@ -0,0 +1,28 @@ +# Copyright 2023 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class AccountMove(models.Model): + _inherit = "account.move" + + def _inter_company_create_invoice(self, dest_company): + res = super()._inter_company_create_invoice(dest_company) + if res["dest_invoice"].move_type == "out_invoice": + self._link_invoice_sale(res["dest_invoice"]) + return res + + def _link_invoice_sale(self, dest_invoice): + self.ensure_one() + orders = self.env["sale.order"] + for line in dest_invoice.invoice_line_ids: + purchase_line = line.auto_invoice_line_id.purchase_line_id + line.sale_line_ids = [(6, 0, purchase_line.auto_sale_line_id.ids)] + orders = dest_invoice.invoice_line_ids.sale_line_ids.order_id + if orders: + ref = "{}" + message = self.env._("This customer bill is related with: {}").format( + ",".join([ref.format(o.id, o.name) for o in orders]) + ) + dest_invoice.message_post(body=message) diff --git a/sale_purchase_inter_company/models/purchase_order.py b/sale_purchase_inter_company/models/purchase_order.py new file mode 100644 index 00000000000..997aa341236 --- /dev/null +++ b/sale_purchase_inter_company/models/purchase_order.py @@ -0,0 +1,33 @@ +# Copyright 2023 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class PurchaseOrder(models.Model): + _inherit = "purchase.order" + + auto_sale_order_id = fields.Many2one( + comodel_name="sale.order", + string="Source Sale Order", + readonly=True, + copy=False, + ) + + def button_approve(self, force=False): + for order in self.filtered("auto_sale_order_id"): + for line in order.order_line.sudo(): + if line.auto_sale_line_id: + line.price_unit = line.auto_sale_line_id.price_unit + return super().button_approve(force) + + +class PurchaseOrderLine(models.Model): + _inherit = "purchase.order.line" + + auto_sale_line_id = fields.Many2one( + comodel_name="sale.order.line", + string="Source Sale Order Line", + readonly=True, + copy=False, + ) diff --git a/sale_purchase_inter_company/models/res_company.py b/sale_purchase_inter_company/models/res_company.py new file mode 100644 index 00000000000..7d5b33867c3 --- /dev/null +++ b/sale_purchase_inter_company/models/res_company.py @@ -0,0 +1,25 @@ +# 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" + + po_from_so = fields.Boolean( + string="Create Purchase Orders when selling to this company", + help="Generate a Purchase Order when a Sale Order with this company " + "as customer is created.\n The intercompany user must at least be " + "Purchase User.", + ) + purchase_auto_validation = fields.Boolean( + string="Purchase Orders Auto Validation", + default=True, + help="When a Purchase Order is created by a multi company rule for " + "this company, it will automatically validate it.", + ) + intercompany_purchase_user_id = fields.Many2one( + comodel_name="res.users", + string="Intercompany Purchase User", + ) diff --git a/sale_purchase_inter_company/models/res_config.py b/sale_purchase_inter_company/models/res_config.py new file mode 100644 index 00000000000..0979ca63c74 --- /dev/null +++ b/sale_purchase_inter_company/models/res_config.py @@ -0,0 +1,32 @@ +# 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" + + po_from_so = fields.Boolean( + related="company_id.po_from_so", + string="Create Purchase Orders when selling to this company", + help="Generate a Purchase Order when a Sale Order with this company " + "as customer is created.\n The intercompany user must at least be " + "Purchase User.", + readonly=False, + ) + purchase_auto_validation = fields.Boolean( + related="company_id.purchase_auto_validation", + string="Purchase Orders Auto Validation", + help="When a Purchase Order is created by a multi company rule for " + "this company, it will automatically validate it.", + readonly=False, + ) + intercompany_purchase_user_id = fields.Many2one( + comodel_name="res.users", + related="company_id.intercompany_purchase_user_id", + string="Intercompany Purchase User", + help="User used to create the Purchase order arising from a sale " + "order in another company.", + readonly=False, + ) diff --git a/sale_purchase_inter_company/models/sale_order.py b/sale_purchase_inter_company/models/sale_order.py new file mode 100644 index 00000000000..7649c3b90ce --- /dev/null +++ b/sale_purchase_inter_company/models/sale_order.py @@ -0,0 +1,194 @@ +# Copyright 2023 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models +from odoo.exceptions import UserError + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + def action_confirm(self): + """Generate inter company purchase order base on conditions.""" + res = super().action_confirm() + for sale_order in self.sudo(): + # check if 'purchase_sale_inter_company' is installed + # that the sale order is not created from an inter company purchase order + if ( + "auto_purchase_order_id" in self._fields + and sale_order.auto_purchase_order_id + ): + continue + # get the company from partner then trigger action of + # intercompany relation + dest_company = sale_order.partner_id.commercial_partner_id.ref_company_ids + if dest_company and dest_company.po_from_so: + sale_order.with_company( + dest_company.id + )._inter_company_create_purchase_order(dest_company) + return res + + def _get_user_domain(self, dest_company): + self.ensure_one() + group_sale_user = self.env.ref("sales_team.group_sale_salesman") + return [ + ("id", "!=", 1), + ("company_id", "=", dest_company.id), + ("id", "in", group_sale_user.users.ids), + ] + + def _check_intercompany_product(self, dest_company): + domain = self._get_user_domain(dest_company) + dest_user = self.env["res.users"].search(domain, limit=1) + if dest_user: + for sale_line in self.order_line: + if ( + sale_line.product_id.company_id + and sale_line.product_id.company_id not in dest_user.company_ids + ): + raise UserError( + self.env._( + "You cannot create PO from SO because product '%s' " + "is not intercompany" + ) + % sale_line.product_id.name + ) + + def _inter_company_create_purchase_order(self, dest_company): + """Create a Purchase Order from the current SO (self) + Note : In this method, reading the current SO is done as sudo, + and the creation of the derived + PO as intercompany_user, minimizing the access right required + for the trigger user. + :param dest_company : the customer company of the created SO + :rtype dest_company : res.company record + """ + self.ensure_one() + # Check intercompany user + intercompany_user = dest_company.intercompany_purchase_user_id + if not intercompany_user: + intercompany_user = self.env.user + # check intercompany product + self._check_intercompany_product(dest_company) + # Accessing to buying partner with buying user, so data like + # property_account_position can be retrieved + company_partner = self.company_id.partner_id + # check pricelist currency should be same with SO/PO document + if self.pricelist_id.currency_id.id != ( + company_partner.property_purchase_currency_id.id + or self.company_id.currency_id.id + ): + raise UserError( + self.env._( + "You cannot create PO from SO because " + "purchase price list currency is different than " + "sale price list currency." + ) + ) + # create the PO and generate its lines from the SO lines + purchase_order_data = self._prepare_purchase_order_data( + self.name, company_partner, dest_company + ) + purchase_order = ( + self.env["purchase.order"] + .with_user(intercompany_user.id) + .sudo() + .create(purchase_order_data) + ) + for sale_line in self.order_line: + purchase_line_data = self._prepare_purchase_order_line_data( + sale_line, dest_company, purchase_order + ) + purchase_line = ( + self.env["purchase.order.line"] + .with_user(intercompany_user.id) + .sudo() + .create(purchase_line_data) + ) + if sale_line.order_id.commitment_date: + purchase_line.date_planned = sale_line.order_id.commitment_date + # write customer reference field on SO + if not self.client_order_ref: + self.client_order_ref = purchase_order.name + # Validation of purchase order + if dest_company.purchase_auto_validation: + purchase_order.with_user(intercompany_user.id).sudo().button_approve() + + def _prepare_purchase_order_data(self, name, partner, dest_company): + """Generate the Purchase Order values from the SO + :param name : the origin client reference + :rtype name : string + :param partner : the partner reprenseting the company + :rtype partner : res.partner record + :param dest_company : the company of the created PO + :rtype dest_company : res.company record + """ + self.ensure_one() + new_order = self.env["purchase.order"].new( + { + "company_id": dest_company.id, + "partner_ref": name, + "partner_id": partner.id, + "date_approve": self.date_order, + "auto_sale_order_id": self.id, + } + ) + for onchange_method in new_order._onchange_methods["partner_id"]: + onchange_method(new_order) + new_order.user_id = False + if self.note: + new_order.notes = self.note + return new_order._convert_to_write(new_order._cache) + + def _prepare_purchase_order_line_data( + self, sale_line, dest_company, purchase_order + ): + """Generate the Purchase Order Line values from the SO line + :param sale_line : the origin Sale Order Line + :rtype sale_line : sale.order.line record + :param dest_company : the supplier company of the created PO + :rtype dest_company : res.company record + :param purchase_order : the Purchase Order + """ + new_line = self.env["purchase.order.line"].new( + { + "order_id": purchase_order.id, + "product_id": sale_line.product_id.id, + "auto_sale_line_id": sale_line.id, + "display_type": sale_line.display_type, + } + ) + for onchange_method in new_line._onchange_methods["product_id"]: + onchange_method(new_line) + new_line.update( + { + "product_uom": sale_line.product_uom.id, + "product_qty": sale_line.product_uom_qty, + } + ) + if new_line.display_type in ["line_section", "line_note"]: + new_line.update({"name": sale_line.name}) + return new_line._convert_to_write(new_line._cache) + + def action_cancel(self): + for sale_order in self: + # check if 'purchase_sale_inter_company' is installed + # that the sale order is not created from an inter company purchase order + if ( + "auto_purchase_order_id" in self._fields + and sale_order.auto_purchase_order_id + ): + continue + purchase_orders = ( + self.env["purchase.order"] + .sudo() + .search([("auto_sale_order_id", "=", sale_order.id)]) + ) + for po in purchase_orders: + if po.state not in ["draft", "sent", "cancel"]: + raise UserError( + self.env._("You can't cancel an order that is %s") % po.state + ) + purchase_orders.button_cancel() + self.write({"client_order_ref": False}) + return super().action_cancel() diff --git a/sale_purchase_inter_company/pyproject.toml b/sale_purchase_inter_company/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/sale_purchase_inter_company/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/sale_purchase_inter_company/readme/CONFIGURE.md b/sale_purchase_inter_company/readme/CONFIGURE.md new file mode 100644 index 00000000000..d056e7eae3e --- /dev/null +++ b/sale_purchase_inter_company/readme/CONFIGURE.md @@ -0,0 +1,7 @@ +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*. \#. If you check the option *Purchase Auto Validation* in the +configuration of company B, then when you validate a *Sale Order* in +company A with company B as customer, the *Purchase Order* will be +automatically validated in company B with company A as supplier. diff --git a/sale_purchase_inter_company/readme/CONTRIBUTORS.md b/sale_purchase_inter_company/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..68b11b15b32 --- /dev/null +++ b/sale_purchase_inter_company/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- \`Akretion \\`: + - Chafique Delli \ + - Kévin Roche \ + - Guillaume Masson \ diff --git a/sale_purchase_inter_company/readme/DESCRIPTION.md b/sale_purchase_inter_company/readme/DESCRIPTION.md new file mode 100644 index 00000000000..a378b79a49f --- /dev/null +++ b/sale_purchase_inter_company/readme/DESCRIPTION.md @@ -0,0 +1,11 @@ +This module is useful if there are multiple companies in the same Odoo +database and those companies sell goods or services among themselves. It +allows to create a purchase order in company B from a sale order in +company A. + +Imagine you have company A and company B in the same Odoo database: + +- Company A sale goods to company B. +- Company A will create a sale order with company B as customer. +- This module automate the creation of the purchase order in company B + with company A as supplier. diff --git a/sale_purchase_inter_company/static/description/icon.png b/sale_purchase_inter_company/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/sale_purchase_inter_company/static/description/icon.png differ diff --git a/sale_purchase_inter_company/static/description/index.html b/sale_purchase_inter_company/static/description/index.html new file mode 100644 index 00000000000..51dbbc6a0cf --- /dev/null +++ b/sale_purchase_inter_company/static/description/index.html @@ -0,0 +1,450 @@ + + + + + +Inter Company Module for Sale to Purchase Order + + + +
+

Inter Company Module for Sale to Purchase Order

+ + +

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

+

This module is useful if there are multiple companies in the same Odoo +database and those companies sell goods or services among themselves. It +allows to create a purchase order in company B from a sale order in +company A.

+

Imagine you have company A and company B in the same Odoo database:

+
    +
  • Company A sale goods to company B.
  • +
  • Company A will create a sale order with company B as customer.
  • +
  • This module automate the creation of the purchase order in company B +with company A as supplier.
  • +
+

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. #. If you check the option Purchase Auto Validation in the +configuration of company B, then when you validate a Sale Order in +company A with company B as customer, the Purchase Order will be +automatically validated in company B with company A as supplier.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • 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_inter_company/tests/__init__.py b/sale_purchase_inter_company/tests/__init__.py new file mode 100644 index 00000000000..0be803367bf --- /dev/null +++ b/sale_purchase_inter_company/tests/__init__.py @@ -0,0 +1 @@ +from . import test_inter_company_sale_purchase diff --git a/sale_purchase_inter_company/tests/test_inter_company_sale_purchase.py b/sale_purchase_inter_company/tests/test_inter_company_sale_purchase.py new file mode 100644 index 00000000000..58d416e26f5 --- /dev/null +++ b/sale_purchase_inter_company/tests/test_inter_company_sale_purchase.py @@ -0,0 +1,179 @@ +# Copyright 2023 Chafique DELLI @ Akretion +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields +from odoo.exceptions import UserError +from odoo.tests.common import Form + +from odoo.addons.account_invoice_inter_company.tests.test_inter_company_invoice import ( + TestAccountInvoiceInterCompanyBase, +) + + +class TestSalePurchaseInterCompanyBase(TestAccountInvoiceInterCompanyBase): + @classmethod + def _configure_user(cls, user): + for xml in [ + "account.group_account_manager", + "base.group_partner_manager", + "sales_team.group_sale_manager", + "purchase.group_purchase_manager", + ]: + user.groups_id |= cls.env.ref(xml) + + @classmethod + def _create_sale_order(cls, partner): + so = Form(cls.env["sale.order"].with_company(cls.company_a)) + so.partner_id = partner + + cls.product.invoice_policy = "order" + + with so.order_line.new() as line_form: + line_form.product_id = cls.product + line_form.product_uom_qty = 3.0 + line_form.name = "Service Multi Company" + line_form.price_unit = 450.0 + return so.save() + + @classmethod + def setUpClass(cls): + super().setUpClass() + # no job: avoid issue if account_invoice_inter_company_queued is installed + cls.env = cls.env( + context=dict( + cls.env.context, tracking_disable=True, test_queue_job_no_delay=True + ) + ) + + cls.product = cls.env.ref( + "account_invoice_inter_company.product_consultant_multi_company" + ) + cls.product.purchase_method = "purchase" + + if "company_ids" in cls.env["res.partner"]._fields: + # Intercompany contacts should not have a company set + cls.partner_company_a.company_ids = False + cls.partner_company_b.company_ids = False + + # Configure Company B (the customer) + cls.company_b.po_from_so = True + cls.company_b.purchase_auto_validation = 1 + + cls.intercompany_purchase_user_id = cls.user_company_b.copy() + cls.intercompany_purchase_user_id.company_ids |= cls.company_a + cls.company_b.intercompany_purchase_user_id = cls.intercompany_purchase_user_id + + # Configure User + cls._configure_user(cls.user_company_a) + cls._configure_user(cls.user_company_b) + + # Create sale order + cls.sale_company_a = cls._create_sale_order(cls.partner_company_b) + + # Configure pricelist to USD + cls.env["product.pricelist"].sudo().search([]).write( + {"currency_id": cls.env.ref("base.USD").id} + ) + + def _confirm_so(self): + """Confirm the SO in company A and return the related purchase of Company B""" + self.sale_company_a.with_user(self.user_company_a).action_confirm() + return ( + self.env["purchase.order"] + .with_user(self.user_company_b) + .search([("auto_sale_order_id", "=", self.sale_company_a.id)]) + ) + + +class TestSalePurchaseInterCompany(TestSalePurchaseInterCompanyBase): + def test_sale_purchase_inter_company(self): + self.sale_company_a.note = "Test note" + purchase = self._confirm_so() + self.assertEqual(len(purchase), 1) + self.assertEqual(purchase.state, "purchase") + self.assertEqual(purchase.partner_id, self.partner_company_a) + self.assertEqual(len(purchase.order_line), len(self.sale_company_a.order_line)) + self.assertEqual(purchase.order_line.product_id, self.product) + self.assertEqual(str(purchase.notes), "

Test note

") + self.assertEqual(purchase.partner_ref, self.sale_company_a.name) + + def test_not_auto_validate(self): + self.company_b.purchase_auto_validation = False + purchase = self._confirm_so() + self.assertEqual(purchase.state, "draft") + + def test_date_planned(self): + self.sale_company_a.commitment_date = "2070-12-31" + purchase = self._confirm_so() + self.assertEqual(str(purchase.date_planned.date()), "2070-12-31") + + def test_raise_product_access(self): + product_rule = self.env.ref("product.product_comp_rule") + product_rule.active = True + # if product_multi_company is installed + if "company_ids" in self.env["product.template"]._fields: + self.product.company_ids = [(6, 0, [self.company_a.id])] + self.product.company_id = self.company_a + with self.assertRaises(UserError): + self._confirm_so() + + def test_raise_currency(self): + currency = self.env.ref("base.EUR") + self.sale_company_a.pricelist_id.currency_id = currency + with self.assertRaises(UserError): + self._confirm_so() + + def test_sale_invoice_relation(self): + self.partner_company_a.company_id = False + self.partner_company_b.company_id = False + purchase = self._confirm_so() + purchase.action_create_invoice() + purchase_invoice = purchase.invoice_ids[0] + purchase_invoice.invoice_date = fields.Datetime.now() + purchase_invoice.action_post() + self.assertEqual(len(self.sale_company_a.invoice_ids), 1) + self.assertEqual( + self.sale_company_a.invoice_ids.auto_invoice_id, + purchase_invoice, + ) + self.assertEqual(len(self.sale_company_a.order_line.invoice_lines), 1) + self.assertEqual(self.sale_company_a.order_line.qty_invoiced, 3) + + def test_cancel(self): + self.company_b.purchase_auto_validation = False + purchase = self._confirm_so() + self.assertEqual(self.sale_company_a.client_order_ref, purchase.name) + self.sale_company_a.with_user(self.user_company_a).action_cancel() + self.assertFalse(self.sale_company_a.client_order_ref) + self.assertEqual(purchase.state, "cancel") + + def test_cancel_confirmed_so_po(self): + self.company_b.purchase_auto_validation = True + self._confirm_so() + with self.assertRaises(UserError): + self.sale_company_a.with_user(self.user_company_a).action_cancel() + + def test_so_change_price(self): + self.sale_company_a.order_line.price_unit = 10 + purchase = self._confirm_so() + purchase.button_approve() + self.assertEqual(purchase.order_line.price_unit, 10) + + def test_so_with_contact_as_partner(self): + contact = self.env["res.partner"].create( + {"name": "Test contact", "parent_id": self.partner_company_b.id} + ) + self.sale_company_a = self._create_sale_order(contact) + purchase = self._confirm_so() + self.assertEqual(len(purchase), 1) + self.assertEqual(purchase.state, "purchase") + self.assertEqual(purchase.partner_id, self.partner_company_a) + + def test_sale_purchase_with_purchase_sale_inter_company_installed(self): + # Check no conflict or infinite loop with purchase_sale_inter_company + if hasattr(self.env["sale.order"], "auto_purchase_order_id"): + purchase = self._confirm_so() + so = self.env["sale.order"].search( + [("auto_purchase_order_id", "=", purchase.id)] + ) + self.assertFalse(so) diff --git a/sale_purchase_inter_company/views/res_config_view.xml b/sale_purchase_inter_company/views/res_config_view.xml new file mode 100644 index 00000000000..5d90c0bb222 --- /dev/null +++ b/sale_purchase_inter_company/views/res_config_view.xml @@ -0,0 +1,42 @@ + + + + res.config.settings + + + +
Sale / Purchase
+
+
+
+
+
+
+
+
+
+