diff --git a/product_multi_category/README.rst b/product_multi_category/README.rst index fe6afcd1cfc..545762d835e 100644 --- a/product_multi_category/README.rst +++ b/product_multi_category/README.rst @@ -9,10 +9,13 @@ Product - Many Categories This module Extends the existing functionality of Open ERP Products (One product - One Catgory) to One product -> Many Categories -*Note: This module was built generically but in focus of the Magento -Open ERP connector -**Note: The additional categories are only for classification and does -not affect other operations +Note: + +* This module was built generically but in focus of the Magento + Open ERP connector + +* The additional categories are only for classification and does + not affect other operations Usage ===== diff --git a/product_supplierinfo_for_customer/README.rst b/product_supplierinfo_for_customer/README.rst new file mode 100644 index 00000000000..d2b67e6cc19 --- /dev/null +++ b/product_supplierinfo_for_customer/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + :target: http://www.gnu.org/licenses/agpl-3.0.en.html + +============================================ +Use product supplier info also for customers +============================================ + +This modules allows to use supplier info structure, available in +*Inventory* tab of the product form, also for defining customer information, +allowing to define prices per customer and product. + +Usage +===== + +There's a new section on *Sales* tab of the product form called "Customers", +where you can define records for customers with the same structure of the +suppliers. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/188/9.0 + + +The product code / product name specified for the customer can be reflected +on the sale orders using module `product_supplierinfo_for_customer_sale +`_ + +Known issues / Roadmap +====================== + +* In Odoo v9.0, it was removed the option to create pricelist based on supplierinfo prices. + This feature will be added in the v10 of this module. +* Product prices through this method are only guaranteed on the standard sale + order workflow. Other custom flows maybe don't reflect the price. +* The minimum quantity will not also be applied on sale orders. +* Computed fields in product.supplierinfo object won't properly work for + customer type. + +Credits +======= + +Contributors +------------ +* Oihane Crucelaegui +* Tecnativa - Pedro M. Baeza +* Aaron Henriquez diff --git a/product_supplierinfo_for_customer/__init__.py b/product_supplierinfo_for_customer/__init__.py new file mode 100644 index 00000000000..a0fdc10fe11 --- /dev/null +++ b/product_supplierinfo_for_customer/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/product_supplierinfo_for_customer/__openerp__.py b/product_supplierinfo_for_customer/__openerp__.py new file mode 100644 index 00000000000..94d9b5f36dd --- /dev/null +++ b/product_supplierinfo_for_customer/__openerp__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 OdooMRP team +# Copyright 2015 AvanzOSC +# Copyright 2015 Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Use product supplier info for customers too", + "version": "9.0.1.0.0", + "author": "AvanzOSC, " + "Tecnativa, " + "Eficent, " + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/product-attribute", + "category": "Sales Management", + "license": 'AGPL-3', + "depends": [ + "product", + ], + "data": [ + "views/product_view.xml", + ], + "demo": [ + "demo/product_demo.xml", + ], + "installable": True, +} diff --git a/product_supplierinfo_for_customer/demo/product_demo.xml b/product_supplierinfo_for_customer/demo/product_demo.xml new file mode 100644 index 00000000000..6bb7a870411 --- /dev/null +++ b/product_supplierinfo_for_customer/demo/product_demo.xml @@ -0,0 +1,16 @@ + + + + + + + + 1 + 1 + customer + + + diff --git a/product_supplierinfo_for_customer/i18n/de.po b/product_supplierinfo_for_customer/i18n/de.po new file mode 100644 index 00000000000..49246583ecf --- /dev/null +++ b/product_supplierinfo_for_customer/i18n/de.po @@ -0,0 +1,128 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_supplierinfo_for_customer +# +# Translators: +# OCA Transbot , 2016 +# Rudolf Schnapka , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-21 02:49+0000\n" +"PO-Revision-Date: 2017-04-21 02:49+0000\n" +"Last-Translator: Rudolf Schnapka , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_supplierinfo_for_customer +#: model:ir.actions.act_window,help:product_supplierinfo_for_customer.product_supplierinfo_action +msgid "" +"

\n" +" Click to define a new product.supplierinfo.\n" +"

\n" +" " +msgstr "" +"

\n" +" Klicken für neue product.supplierinfo Lieferanteninfo.\n" +"

\n" +" " + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: selection:product.supplierinfo,type:0 field:product.template,customer_ids:0 +msgid "Customer" +msgstr "Kunde" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "Customers" +msgstr "Kunden" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Group By" +msgstr "Gruppiere nach" + +#. module: product_supplierinfo_for_customer +#: model:ir.actions.act_window,name:product_supplierinfo_for_customer.product_supplierinfo_action +#: model:ir.ui.menu,name:product_supplierinfo_for_customer.product_supplierinfo_sale_menu +msgid "Information about a product (customer)" +msgstr "Information zu einem (Kunden-) Produkt" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_supplierinfo +msgid "Information about a product supplier" +msgstr "Information zu Produktlieferant" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_res_partner +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_tree_view +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Partner" +msgstr "Partner" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Product Code" +msgstr "Artikelnummer des Partners" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Product Name" +msgstr "Produktbezeichnung des Partners" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Unit of Measure" +msgstr "Mengeneinheit des Partners" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_pricelist +msgid "Pricelist" +msgstr "Preisliste" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_template +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Product Template" +msgstr "Produktvorlage" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: selection:product.supplierinfo,type:0 field:product.template,supplier_ids:0 +msgid "Supplier" +msgstr "Lieferant" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Supplierinfo search" +msgstr "Lieferantenauskunft-Suche" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: field:product.supplierinfo,type:0 +msgid "Type" +msgstr "Art" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "[('type','=','supplier')]" +msgstr "[('type','=','supplier')]" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "" +"{'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id}" +msgstr "" +"{'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id}" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "{'select_type': type}" +msgstr "{'select_type': type}" diff --git a/product_supplierinfo_for_customer/i18n/es.po b/product_supplierinfo_for_customer/i18n/es.po new file mode 100644 index 00000000000..027bca24642 --- /dev/null +++ b/product_supplierinfo_for_customer/i18n/es.po @@ -0,0 +1,125 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_supplierinfo_for_customer +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-03 10:07+0000\n" +"PO-Revision-Date: 2016-11-03 10:07+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_supplierinfo_for_customer +#: model:ir.actions.act_window,help:product_supplierinfo_for_customer.product_supplierinfo_action +msgid "" +"

\n" +" Click to define a new product.supplierinfo.\n" +"

\n" +" " +msgstr "" +"

\n" +"Pulse para definir una nueva definición de producto-empresa.\n" +"

\n" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: selection:product.supplierinfo,type:0 field:product.template,customer_ids:0 +msgid "Customer" +msgstr "Cliente" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "Customers" +msgstr "Clientes" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Group By" +msgstr "Agrupar por" + +#. module: product_supplierinfo_for_customer +#: model:ir.actions.act_window,name:product_supplierinfo_for_customer.product_supplierinfo_action +#: model:ir.ui.menu,name:product_supplierinfo_for_customer.product_supplierinfo_sale_menu +msgid "Information about a product (customer)" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_supplierinfo +msgid "Information about a product supplier" +msgstr "Información de un proveedor de producto" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_res_partner +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_tree_view +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Partner" +msgstr "Empresa" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Product Code" +msgstr "Código de producto para la empresa" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Product Name" +msgstr "Nombre de producto para la empresa" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Unit of Measure" +msgstr "Unidad de medida de empresa" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_pricelist +msgid "Pricelist" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_template +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Product Template" +msgstr "Plantilla de producto" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: selection:product.supplierinfo,type:0 field:product.template,supplier_ids:0 +msgid "Supplier" +msgstr "Proveedor" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Supplierinfo search" +msgstr "Búsqueda de producto-empresa" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: field:product.supplierinfo,type:0 +msgid "Type" +msgstr "Tipo" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "[('type','=','supplier')]" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "" +"{'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id}" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "{'select_type': type}" +msgstr "" diff --git a/product_supplierinfo_for_customer/i18n/fr.po b/product_supplierinfo_for_customer/i18n/fr.po new file mode 100644 index 00000000000..a0c9aad1161 --- /dev/null +++ b/product_supplierinfo_for_customer/i18n/fr.po @@ -0,0 +1,123 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_supplierinfo_for_customer +# +# Translators: +# OCA Transbot , 2016 +# Christophe CHAUVET , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-21 02:49+0000\n" +"PO-Revision-Date: 2017-04-21 02:49+0000\n" +"Last-Translator: Christophe CHAUVET , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: product_supplierinfo_for_customer +#: model:ir.actions.act_window,help:product_supplierinfo_for_customer.product_supplierinfo_action +msgid "" +"

\n" +" Click to define a new product.supplierinfo.\n" +"

\n" +" " +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: selection:product.supplierinfo,type:0 field:product.template,customer_ids:0 +msgid "Customer" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "Customers" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Group By" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: model:ir.actions.act_window,name:product_supplierinfo_for_customer.product_supplierinfo_action +#: model:ir.ui.menu,name:product_supplierinfo_for_customer.product_supplierinfo_sale_menu +msgid "Information about a product (customer)" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_supplierinfo +msgid "Information about a product supplier" +msgstr "Information à propos du fournisseur du produit" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_res_partner +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_tree_view +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Partner" +msgstr "Partenaire" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Product Code" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Product Name" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Unit of Measure" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_pricelist +msgid "Pricelist" +msgstr "Liste de prix" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_template +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Product Template" +msgstr "Modèle d'article" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: selection:product.supplierinfo,type:0 field:product.template,supplier_ids:0 +msgid "Supplier" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Supplierinfo search" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: field:product.supplierinfo,type:0 +msgid "Type" +msgstr "Type" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "[('type','=','supplier')]" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "" +"{'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id}" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "{'select_type': type}" +msgstr "" diff --git a/product_supplierinfo_for_customer/i18n/product_supplierinfo_for_customer.pot b/product_supplierinfo_for_customer/i18n/product_supplierinfo_for_customer.pot new file mode 100644 index 00000000000..32dbe81b428 --- /dev/null +++ b/product_supplierinfo_for_customer/i18n/product_supplierinfo_for_customer.pot @@ -0,0 +1,100 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_supplierinfo_for_customer +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-02-05 14:08+0000\n" +"PO-Revision-Date: 2015-02-05 14:08+0000\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: product_supplierinfo_for_customer +#: model:ir.actions.act_window,help:product_supplierinfo_for_customer.product_supplierinfo_action +msgid "

\n" +" Click to define a new product.supplierinfo.\n" +"

\n" +" " +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: selection:product.supplierinfo,type:0 +#: field:product.template,customer_ids:0 +msgid "Customer" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "Customers" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Group By" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: model:ir.actions.act_window,name:product_supplierinfo_for_customer.product_supplierinfo_action +#: model:ir.ui.menu,name:product_supplierinfo_for_customer.product_supplierinfo_sale_menu +msgid "Information about a product" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_supplierinfo +msgid "Information about a product supplier" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_res_partner +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_tree_view +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Partner" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Product Code" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Product Name" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Unit of Measure" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_template +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Product Template" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: selection:product.supplierinfo,type:0 +#: field:product.template,supplier_ids:0 +msgid "Supplier" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Supplierinfo search" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: field:product.supplierinfo,type:0 +msgid "Type" +msgstr "" + diff --git a/product_supplierinfo_for_customer/i18n/sl.po b/product_supplierinfo_for_customer/i18n/sl.po new file mode 100644 index 00000000000..ad5fa16f4dd --- /dev/null +++ b/product_supplierinfo_for_customer/i18n/sl.po @@ -0,0 +1,128 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_supplierinfo_for_customer +# +# Translators: +# OCA Transbot , 2016 +# Matjaž Mozetič , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-03 10:07+0000\n" +"PO-Revision-Date: 2016-11-03 10:07+0000\n" +"Last-Translator: Matjaž Mozetič , 2016\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: product_supplierinfo_for_customer +#: model:ir.actions.act_window,help:product_supplierinfo_for_customer.product_supplierinfo_action +msgid "" +"

\n" +" Click to define a new product.supplierinfo.\n" +"

\n" +" " +msgstr "" +"

\n" +" Kliknite za nov product.supplierinfo.\n" +"

\n" +" " + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: selection:product.supplierinfo,type:0 field:product.template,customer_ids:0 +msgid "Customer" +msgstr "Kupec" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "Customers" +msgstr "Kupci" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Group By" +msgstr "Združi po" + +#. module: product_supplierinfo_for_customer +#: model:ir.actions.act_window,name:product_supplierinfo_for_customer.product_supplierinfo_action +#: model:ir.ui.menu,name:product_supplierinfo_for_customer.product_supplierinfo_sale_menu +msgid "Information about a product (customer)" +msgstr "Podatki o proizvodu (kupec)" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_supplierinfo +msgid "Information about a product supplier" +msgstr "Podatki o dobavitelju proizvoda" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_res_partner +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_tree_view +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Partner" +msgstr "Partner" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Product Code" +msgstr "Partnerjeva koda proizvoda" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Product Name" +msgstr "Partnerjev naziv proizvoda" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "Partner Unit of Measure" +msgstr "Partnerjeva EM" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_pricelist +msgid "Pricelist" +msgstr "Cenik" + +#. module: product_supplierinfo_for_customer +#: model:ir.model,name:product_supplierinfo_for_customer.model_product_template +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Product Template" +msgstr "Predloga proizvoda" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: selection:product.supplierinfo,type:0 field:product.template,supplier_ids:0 +msgid "Supplier" +msgstr "Dobavitelj" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Supplierinfo search" +msgstr "Iskanje podatkov o dobavitelju" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +#: field:product.supplierinfo,type:0 +msgid "Type" +msgstr "Tip" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "[('type','=','supplier')]" +msgstr "[('type','=','supplier')]" + +#. module: product_supplierinfo_for_customer +#: view:product.template:product_supplierinfo_for_customer.product_template_extended_form_view +msgid "" +"{'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id}" +msgstr "" +"{'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id}" + +#. module: product_supplierinfo_for_customer +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_extended_form_view +msgid "{'select_type': type}" +msgstr "{'select_type': type}" diff --git a/product_supplierinfo_for_customer/models/__init__.py b/product_supplierinfo_for_customer/models/__init__.py new file mode 100644 index 00000000000..fe99cab361e --- /dev/null +++ b/product_supplierinfo_for_customer/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +from . import product_supplierinfo +from . import product_template +from . import res_partner diff --git a/product_supplierinfo_for_customer/models/product_supplierinfo.py b/product_supplierinfo_for_customer/models/product_supplierinfo.py new file mode 100644 index 00000000000..f24f5eb5c45 --- /dev/null +++ b/product_supplierinfo_for_customer/models/product_supplierinfo.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 OdooMRP team +# Copyright 2015 AvanzOSC +# Copyright 2015 Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from openerp import models, fields, api + + +class ProductSupplierinfo(models.Model): + _inherit = 'product.supplierinfo' + + type = fields.Selection( + selection=[('customer', 'Customer'), + ('supplier', 'Supplier')], string='Type', + default='supplier') + + @api.multi + @api.onchange('type') + def onchange_type(self): + if self.type == 'supplier': + return {'domain': {'name': [('supplier', '=', True)]}} + elif self.type == 'customer': + return {'domain': {'name': [('customer', '=', True)]}} + return {'domain': {'name': []}} + + def search(self, cr, uid, args, offset=0, limit=None, order=None, + context=None, count=False): + """Add search argument for field type if the context says so. This + should be in old API because context argument is not the last one. + """ + if context is None: + context = {} + if not any(arg[0] == 'type' for arg in args): + args += [('type', '=', + context.get('supplierinfo_type', 'supplier'))] + return super(ProductSupplierinfo, self).search( + cr, uid, args, offset=offset, limit=limit, order=order, + context=context, count=count) diff --git a/product_supplierinfo_for_customer/models/product_template.py b/product_supplierinfo_for_customer/models/product_template.py new file mode 100644 index 00000000000..d1f28c1e976 --- /dev/null +++ b/product_supplierinfo_for_customer/models/product_template.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 OdooMRP team +# Copyright 2015 AvanzOSC +# Copyright 2015 Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from openerp import models, fields + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + customer_ids = fields.One2many( + comodel_name='product.supplierinfo', inverse_name='product_tmpl_id', + string='Customer', domain=[('type', '=', 'customer')]) + supplier_ids = fields.One2many( + comodel_name='product.supplierinfo', inverse_name='product_tmpl_id', + string='Supplier', domain=[('type', '=', 'supplier')]) diff --git a/product_supplierinfo_for_customer/models/res_partner.py b/product_supplierinfo_for_customer/models/res_partner.py new file mode 100644 index 00000000000..094dedfdd43 --- /dev/null +++ b/product_supplierinfo_for_customer/models/res_partner.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 OdooMRP team +# Copyright 2015 AvanzOSC +# Copyright 2015 Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from openerp import models, api + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + @api.model + def default_get(self, fields): + res = super(ResPartner, self).default_get(fields) + select_type = self.env.context.get('select_type', False) + if select_type: + res.update({ + 'customer': select_type == 'customer', + 'supplier': select_type == 'supplier', + }) + return res diff --git a/product_supplierinfo_for_customer/tests/__init__.py b/product_supplierinfo_for_customer/tests/__init__.py new file mode 100644 index 00000000000..02b8a718f29 --- /dev/null +++ b/product_supplierinfo_for_customer/tests/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import test_product_supplierinfo_for_customer diff --git a/product_supplierinfo_for_customer/tests/test_product_supplierinfo_for_customer.py b/product_supplierinfo_for_customer/tests/test_product_supplierinfo_for_customer.py new file mode 100644 index 00000000000..cbaea4a8a4e --- /dev/null +++ b/product_supplierinfo_for_customer/tests/test_product_supplierinfo_for_customer.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 OdooMRP team +# Copyright 2015 AvanzOSC +# Copyright 2015 Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +import openerp.tests.common as common + + +class TestProductSupplierinfoForCustomer(common.TransactionCase): + + def setUp(self): + super(TestProductSupplierinfoForCustomer, self).setUp() + self.supplierinfo_model = self.env['product.supplierinfo'] + self.pricelist_item_model = self.env['product.pricelist.item'] + self.pricelist_model = self.env['product.pricelist'] + self.customer = self._create_customer('customer1') + self.product = self.env.ref('product.product_product_4') + self.supplierinfo = self._create_supplierinfo( + 'customer', self.customer, self.product) + self.pricelist = self.env['product.pricelist'].create({ + 'name': 'Test Pricelist', + 'currency_id': self.env.ref('base.USD').id, + }) + self.pricelist_item = self.env['product.pricelist.item'].create({ + 'applied_on': '1_product', + 'base': 'list_price', + 'name': 'Test Pricelist Item', + 'pricelist_id': self.pricelist.id, + 'compute_price': 'fixed', + 'fixed_price': 100.0, + 'product_tmpl_id': self.product.id, + 'sequence': 5, + }) + + def _create_customer(self, name): + """Create a Partner.""" + return self.env['res.partner'].create({ + 'name': name, + 'email': 'example@yourcompany.com', + 'customer': True, + 'phone': 123456, + }) + + def _create_supplierinfo(self, type, partner, product): + return self.env['product.supplierinfo'].create({ + 'name': partner.id, + 'product_id': product.id, + 'product_code': '00001', + 'type': type, + 'price': 100.0, + }) + + def test_default_get(self): + """ checking values returned by default_get() """ + fields = ['name'] + values = self.customer.with_context( + select_type=True).default_get(fields) + self.assertEqual(values['customer'], False, "Incorrect default") + + def test_onchange_type(self): + sup_info = self._create_supplierinfo( + 'supplier', self.customer, self.product) + res = sup_info.onchange_type() + domain = res.get('domain', False) + name_dom = domain.get('name', False) + self.assertEqual(name_dom, [('supplier', '=', True)]) + sup_info.write({'type': 'customer'}) + res = sup_info.onchange_type() + domain = res.get('domain', False) + name_dom = domain.get('name', False) + self.assertEqual(name_dom, [('customer', '=', True)]) + + def test_product_supplierinfo_for_customer(self): + cond = [('name', '=', self.customer.id)] + supplierinfos = self.supplierinfo_model.search(cond) + self.assertEqual(len(supplierinfos), 0, + "Error: Supplier found in Supplierinfo") + cond = [('name', '=', self.customer.id)] + customerinfos = self.supplierinfo_model.with_context( + supplierinfo_type='customer').search(cond) + self.assertNotEqual(len(customerinfos), 0, + "Error: Customer not found in Supplierinfo") + price_unit = self.pricelist_model.price_rule_get( + self.product.id, 1, partner=self.customer.id) + self.assertTrue( + price_unit.get(self.pricelist.id, False), + "Error: Unit Price not found for customer") + price = price_unit.get(self.pricelist.id, False)[0] + self.assertEqual(price, 100.0, + "Error: Price not found for product and customer") diff --git a/product_supplierinfo_for_customer/views/product_view.xml b/product_supplierinfo_for_customer/views/product_view.xml new file mode 100644 index 00000000000..ddeee2e809e --- /dev/null +++ b/product_supplierinfo_for_customer/views/product_view.xml @@ -0,0 +1,155 @@ + + + + + + product.supplierinfo.extended.form + product.supplierinfo + + + + Partner + {'select_type': type} + + + Partner Product Name + + + Partner Product Code + + + Partner Unit of Measure + + + + + + + + + product.supplierinfo.template.form + product.supplierinfo + + primary + + + + + + + + + + product.supplierinfo.partner.tree + product.supplierinfo + + + + Partner + + + + + + product.supplierinfo.template.tree + product.supplierinfo + + primary + + + + + + + + + + product.template.extended.form + product.template + + + + {'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id} + [('type','=','supplier')] + 1 + + + + +
+ + + +
+
+
+ + + product.supplierinfo.search + product.supplierinfo + + + + + + + + + + + + + + + + + + Information about a product (customer) + ir.actions.act_window + product.supplierinfo + tree,form + form + + { + 'search_default_is_customer_filter': 1, + 'default_type': 'customer', + 'supplierinfo_type': 'customer', + } + + +

+ Click to define a new product.supplierinfo. +

+
+
+ + + + form + + + + + + + tree + + + + + + +
+