From deaa77943d7c1487bf46beeafde33a6434d77a4e Mon Sep 17 00:00:00 2001 From: oihane Date: Thu, 18 Sep 2014 10:49:56 +0200 Subject: [PATCH 01/14] --- product_supplierinfo_for_customer/__init__.py | 19 +++ .../__openerp__.py | 41 +++++++ product_supplierinfo_for_customer/i18n/es.po | 57 +++++++++ .../product_supplierinfo_for_customer.pot | 57 +++++++++ .../models/__init__.py | 21 ++++ .../models/product_supplierinfo.py | 36 ++++++ .../models/product_template.py | 32 +++++ .../models/res_partner.py | 34 ++++++ .../views/product_view.xml | 113 ++++++++++++++++++ 9 files changed, 410 insertions(+) create mode 100644 product_supplierinfo_for_customer/__init__.py create mode 100644 product_supplierinfo_for_customer/__openerp__.py create mode 100644 product_supplierinfo_for_customer/i18n/es.po create mode 100644 product_supplierinfo_for_customer/i18n/product_supplierinfo_for_customer.pot create mode 100644 product_supplierinfo_for_customer/models/__init__.py create mode 100644 product_supplierinfo_for_customer/models/product_supplierinfo.py create mode 100644 product_supplierinfo_for_customer/models/product_template.py create mode 100644 product_supplierinfo_for_customer/models/res_partner.py create mode 100644 product_supplierinfo_for_customer/views/product_view.xml diff --git a/product_supplierinfo_for_customer/__init__.py b/product_supplierinfo_for_customer/__init__.py new file mode 100644 index 00000000000..7fc7c09f9b0 --- /dev/null +++ b/product_supplierinfo_for_customer/__init__.py @@ -0,0 +1,19 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## + +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..2fc53288647 --- /dev/null +++ b/product_supplierinfo_for_customer/__openerp__.py @@ -0,0 +1,41 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## + +{ + "name": "Use product supplier info for customers too", + "version": "1.0", + "depends": [ + "base", + "product", + ], + "author": "OdooMRP team", + "contributors": [ + "Oihane Crucelaegui ", + ], + "category": "Sales Management", + "website": "http://www.odoomrp.com", + "summary": "", + "description": """ +This module extends product.supplierinfo object with a combo to allow using +it for sale pricelists + """, + "data": [ + "views/product_view.xml", + ], + "installable": True, +} diff --git a/product_supplierinfo_for_customer/i18n/es.po b/product_supplierinfo_for_customer/i18n/es.po new file mode 100644 index 00000000000..1b8f413639d --- /dev/null +++ b/product_supplierinfo_for_customer/i18n/es.po @@ -0,0 +1,57 @@ +# 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.0rc1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-09-05 11:46+0000\n" +"PO-Revision-Date: 2014-09-05 11:46+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 +#: selection:product.supplierinfo,type: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 +#: 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_product_template +msgid "Product Template" +msgstr "Plantilla de producto" + +#. module: product_supplierinfo_for_customer +#: selection:product.supplierinfo,type:0 +msgid "Supplier" +msgstr "Proveedor" + +#. module: product_supplierinfo_for_customer +#: 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 "[('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'}" +msgstr "{'default_search_type':'supplier','default_type':'supplier'}" + 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..a48ab71467d --- /dev/null +++ b/product_supplierinfo_for_customer/i18n/product_supplierinfo_for_customer.pot @@ -0,0 +1,57 @@ +# 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.0rc1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-09-05 11:46+0000\n" +"PO-Revision-Date: 2014-09-05 11:46+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 +#: selection:product.supplierinfo,type: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 +#: 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_product_template +msgid "Product Template" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: selection:product.supplierinfo,type:0 +msgid "Supplier" +msgstr "" + +#. module: product_supplierinfo_for_customer +#: field:product.supplierinfo,type:0 +msgid "Type" +msgstr "" + +#. 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'}" +msgstr "" + diff --git a/product_supplierinfo_for_customer/models/__init__.py b/product_supplierinfo_for_customer/models/__init__.py new file mode 100644 index 00000000000..67021782557 --- /dev/null +++ b/product_supplierinfo_for_customer/models/__init__.py @@ -0,0 +1,21 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## + +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..8d9f5f6538a --- /dev/null +++ b/product_supplierinfo_for_customer/models/product_supplierinfo.py @@ -0,0 +1,36 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## + +from openerp import models, fields, api + + +class ProductSupplierinfo(models.Model): + _inherit = 'product.supplierinfo' + + type = fields.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': []}} 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..1c9fd3749d1 --- /dev/null +++ b/product_supplierinfo_for_customer/models/product_template.py @@ -0,0 +1,32 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## + +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..97d8bb467a8 --- /dev/null +++ b/product_supplierinfo_for_customer/models/res_partner.py @@ -0,0 +1,34 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +############################################################################## + +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/views/product_view.xml b/product_supplierinfo_for_customer/views/product_view.xml new file mode 100644 index 00000000000..ca1f111fac5 --- /dev/null +++ b/product_supplierinfo_for_customer/views/product_view.xml @@ -0,0 +1,113 @@ + + + + + + product.supplierinfo.extended.form + product.supplierinfo + + + + Partner + {'select_type': type} + + + Partner Product Name + + + Partner Product Code + + + Partner Unit of Measure + + + + + + + + + product.supplierinfo.extended.tree + product.supplierinfo + + + + + + + Partner + + + + + + 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 + ir.actions.act_window + product.supplierinfo + tree,form + form + + [] + { + 'search_default_is_customer_filter': 1 + } + + +

+ Click to define a new product.supplierinfo. +

+
+
+ + + +
+
From 48fda6d4cb69f83dabe9349c38be22503e79a81f Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 5 Feb 2015 17:30:02 +0100 Subject: [PATCH 02/14] product_supplierinfo_for_customer: Views and documentation --- product_supplierinfo_for_customer/README.rst | 19 +++++ .../__openerp__.py | 7 -- product_supplierinfo_for_customer/i18n/es.po | 71 +++++++++++++++---- .../product_supplierinfo_for_customer.pot | 67 +++++++++++++---- .../views/product_view.xml | 31 ++++---- 5 files changed, 147 insertions(+), 48 deletions(-) create mode 100644 product_supplierinfo_for_customer/README.rst diff --git a/product_supplierinfo_for_customer/README.rst b/product_supplierinfo_for_customer/README.rst new file mode 100644 index 00000000000..35c4a20fab6 --- /dev/null +++ b/product_supplierinfo_for_customer/README.rst @@ -0,0 +1,19 @@ +Use product supplier info also for customers +============================================ + +This modules allows to use supplier info, available in _Procurements_ tab +from the product, also for customers, allowing to define prices per +customer and product. + +For these prices to be used in sale prices calculations, you will have +to create a pricelist with a rule with option "Based on" is "Supplier prices +on the product form" (although the text is not clear enough). + +Credits +======= + +Contributors +------------ +* Oihane Crucelaegui +* Pedro M. Baeza + diff --git a/product_supplierinfo_for_customer/__openerp__.py b/product_supplierinfo_for_customer/__openerp__.py index 2fc53288647..33cef3643c3 100644 --- a/product_supplierinfo_for_customer/__openerp__.py +++ b/product_supplierinfo_for_customer/__openerp__.py @@ -24,16 +24,9 @@ "product", ], "author": "OdooMRP team", - "contributors": [ - "Oihane Crucelaegui ", - ], "category": "Sales Management", "website": "http://www.odoomrp.com", "summary": "", - "description": """ -This module extends product.supplierinfo object with a combo to allow using -it for sale pricelists - """, "data": [ "views/product_view.xml", ], diff --git a/product_supplierinfo_for_customer/i18n/es.po b/product_supplierinfo_for_customer/i18n/es.po index 1b8f413639d..df5232cbaa4 100644 --- a/product_supplierinfo_for_customer/i18n/es.po +++ b/product_supplierinfo_for_customer/i18n/es.po @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0rc1\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-09-05 11:46+0000\n" -"PO-Revision-Date: 2014-09-05 11:46+0000\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" @@ -16,7 +16,19 @@ msgstr "" "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 "

\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" @@ -25,33 +37,66 @@ msgstr "Cliente" 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" +msgstr "Información sobre un producto" + #. 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_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 "[('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'}" -msgstr "{'default_search_type':'supplier','default_type':'supplier'}" - diff --git a/product_supplierinfo_for_customer/i18n/product_supplierinfo_for_customer.pot b/product_supplierinfo_for_customer/i18n/product_supplierinfo_for_customer.pot index a48ab71467d..32dbe81b428 100644 --- a/product_supplierinfo_for_customer/i18n/product_supplierinfo_for_customer.pot +++ b/product_supplierinfo_for_customer/i18n/product_supplierinfo_for_customer.pot @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0rc1\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-09-05 11:46+0000\n" -"PO-Revision-Date: 2014-09-05 11:46+0000\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" @@ -16,7 +16,17 @@ msgstr "" "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 "" @@ -25,33 +35,66 @@ msgstr "" 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 -#: field:product.supplierinfo,type:0 -msgid "Type" +#: view:product.supplierinfo:product_supplierinfo_for_customer.product_supplierinfo_search_view +msgid "Supplierinfo search" msgstr "" #. 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'}" +#: 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/views/product_view.xml b/product_supplierinfo_for_customer/views/product_view.xml index ca1f111fac5..9024a2babf3 100644 --- a/product_supplierinfo_for_customer/views/product_view.xml +++ b/product_supplierinfo_for_customer/views/product_view.xml @@ -21,7 +21,7 @@ Partner Unit of Measure - + @@ -31,9 +31,6 @@ product.supplierinfo - - - Partner @@ -51,15 +48,14 @@ 1 - + - + + context="{'default_search_type':'customer','default_type':'customer','default_product_tmpl_id':id}"> @@ -75,13 +71,16 @@ - - + + - + From 8f4c3b10bb5c1b08977cdba0f6317f3daacab6d7 Mon Sep 17 00:00:00 2001 From: oihane Date: Wed, 11 Feb 2015 13:20:42 +0100 Subject: [PATCH 03/14] Related to #638 --- .../views/product_view.xml | 77 +++++++++++++++---- 1 file changed, 60 insertions(+), 17 deletions(-) diff --git a/product_supplierinfo_for_customer/views/product_view.xml b/product_supplierinfo_for_customer/views/product_view.xml index 9024a2babf3..1482579b694 100644 --- a/product_supplierinfo_for_customer/views/product_view.xml +++ b/product_supplierinfo_for_customer/views/product_view.xml @@ -21,7 +21,20 @@ Partner Unit of Measure - + + + + + + + product.supplierinfo.template.form + product.supplierinfo + + primary + + + + @@ -37,6 +50,19 @@ + + product.supplierinfo.template.tree + product.supplierinfo + + primary + + + + + + + + product.template.extended.form product.template @@ -49,13 +75,15 @@ + context="{'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id}" + domain="[('type','=','supplier')]" /> - + + context="{'default_search_type':'customer','default_type':'customer','default_product_tmpl_id':id}"> @@ -68,26 +96,25 @@ - - + + - - + + - + - Information about a product + Information about a product (customer) ir.actions.act_window product.supplierinfo tree,form @@ -105,6 +132,22 @@ + + + form + + + + + + + tree + + + + From 97bd663814b7d24e27683a89050a6af32fb7b77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matja=C5=BE=20Mozeti=C4=8D?= Date: Sat, 15 Aug 2015 18:53:19 +0200 Subject: [PATCH 04/14] Slovene translations of odoomrp modules --- product_supplierinfo_for_customer/i18n/sl.po | 104 +++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 product_supplierinfo_for_customer/i18n/sl.po diff --git a/product_supplierinfo_for_customer/i18n/sl.po b/product_supplierinfo_for_customer/i18n/sl.po new file mode 100644 index 00000000000..e0423baa22e --- /dev/null +++ b/product_supplierinfo_for_customer/i18n/sl.po @@ -0,0 +1,104 @@ +# 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-08-15 13:06+0200\n" +"Last-Translator: Matjaz Mozetic \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"Language: sl\n" +"X-Generator: Poedit 1.8.4\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" +msgstr "Podatki o proizvodu" + +#. 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_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" From 3c3f4e37e54c204110c84098f44fb8d4933faa6c Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 27 Aug 2015 04:00:40 +0200 Subject: [PATCH 05/14] product_supplierinfo_for_customer: Avoid side effects + improve README --- product_supplierinfo_for_customer/README.rst | 37 ++++++++++++++++--- product_supplierinfo_for_customer/__init__.py | 2 +- .../__openerp__.py | 6 ++- .../models/__init__.py | 3 +- .../models/product_pricelist.py | 18 +++++++++ .../models/product_supplierinfo.py | 23 ++++++++++-- .../models/product_template.py | 16 ++++---- .../models/res_partner.py | 2 +- .../views/product_view.xml | 1 + 9 files changed, 85 insertions(+), 23 deletions(-) create mode 100644 product_supplierinfo_for_customer/models/product_pricelist.py diff --git a/product_supplierinfo_for_customer/README.rst b/product_supplierinfo_for_customer/README.rst index 35c4a20fab6..8f1fd69696d 100644 --- a/product_supplierinfo_for_customer/README.rst +++ b/product_supplierinfo_for_customer/README.rst @@ -1,13 +1,40 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +============================================ Use product supplier info also for customers ============================================ -This modules allows to use supplier info, available in _Procurements_ tab -from the product, also for customers, allowing to define prices per -customer and product. +This modules allows to use supplier info structure, available in +*Procurements* tab of the product form, also for defining customer information, +allowing to define prices per customer and product. + +Configuration +============= For these prices to be used in sale prices calculations, you will have -to create a pricelist with a rule with option "Based on" is "Supplier prices -on the product form" (although the text is not clear enough). +to create a pricelist with a rule with option "Based on" with the value +"Supplier prices on the product form" (although the text is not clear enough). + +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/8.0 + +Known issues / Roadmap +====================== + +* Product prices through this method are only guaranteed on the standard sale + order workflow. Other custom flows maybe don't reflect the price. +* The product code / product name specified for the customer will not be + reflected on the sale orders. +* The minimum quantity will not also be applied on sale orders. Credits ======= diff --git a/product_supplierinfo_for_customer/__init__.py b/product_supplierinfo_for_customer/__init__.py index 7fc7c09f9b0..a9609aa0b11 100644 --- a/product_supplierinfo_for_customer/__init__.py +++ b/product_supplierinfo_for_customer/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify diff --git a/product_supplierinfo_for_customer/__openerp__.py b/product_supplierinfo_for_customer/__openerp__.py index 33cef3643c3..b9fc4c5384a 100644 --- a/product_supplierinfo_for_customer/__openerp__.py +++ b/product_supplierinfo_for_customer/__openerp__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify @@ -23,7 +23,9 @@ "base", "product", ], - "author": "OdooMRP team", + "author": "OdooMRP team," + "AvanzOSC," + "Serv. Tecnol. Avanzados - Pedro M. Baeza", "category": "Sales Management", "website": "http://www.odoomrp.com", "summary": "", diff --git a/product_supplierinfo_for_customer/models/__init__.py b/product_supplierinfo_for_customer/models/__init__.py index 67021782557..b60c45a6539 100644 --- a/product_supplierinfo_for_customer/models/__init__.py +++ b/product_supplierinfo_for_customer/models/__init__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify @@ -19,3 +19,4 @@ from . import product_supplierinfo from . import product_template from . import res_partner +from . import product_pricelist diff --git a/product_supplierinfo_for_customer/models/product_pricelist.py b/product_supplierinfo_for_customer/models/product_pricelist.py new file mode 100644 index 00000000000..49ee7421be6 --- /dev/null +++ b/product_supplierinfo_for_customer/models/product_pricelist.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from openerp import models, api + + +class ProductPricelist(models.Model): + _inherit = 'product.pricelist' + + @api.multi + def price_rule_get(self, prod_id, qty, partner=None): + """Pass context if the type of the pricelist is sale for restricting + on the search product.supplierinfo records of type customer.""" + obj = (self.with_context(supplierinfo_type='customer') if + self.type == 'sale' else self) + return super(ProductPricelist, obj).price_rule_get( + prod_id, qty, partner=partner) diff --git a/product_supplierinfo_for_customer/models/product_supplierinfo.py b/product_supplierinfo_for_customer/models/product_supplierinfo.py index 8d9f5f6538a..a957eb839e5 100644 --- a/product_supplierinfo_for_customer/models/product_supplierinfo.py +++ b/product_supplierinfo_for_customer/models/product_supplierinfo.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify @@ -22,9 +22,10 @@ class ProductSupplierinfo(models.Model): _inherit = 'product.supplierinfo' - type = fields.Selection([('customer', 'Customer'), - ('supplier', 'Supplier')], string='Type', - default='supplier') + type = fields.Selection( + selection=[('customer', 'Customer'), + ('supplier', 'Supplier')], string='Type', + default='supplier') @api.multi @api.onchange('type') @@ -34,3 +35,17 @@ def onchange_type(self): 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 index 1c9fd3749d1..8e84ddb61b8 100644 --- a/product_supplierinfo_for_customer/models/product_template.py +++ b/product_supplierinfo_for_customer/models/product_template.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify @@ -22,11 +22,9 @@ 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')]) + 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 index 97d8bb467a8..6c7e0303075 100644 --- a/product_supplierinfo_for_customer/models/res_partner.py +++ b/product_supplierinfo_for_customer/models/res_partner.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify diff --git a/product_supplierinfo_for_customer/views/product_view.xml b/product_supplierinfo_for_customer/views/product_view.xml index 1482579b694..30f841710c1 100644 --- a/product_supplierinfo_for_customer/views/product_view.xml +++ b/product_supplierinfo_for_customer/views/product_view.xml @@ -114,6 +114,7 @@ + Information about a product (customer) Information about a product (customer) ir.actions.act_window product.supplierinfo From 2fb031e7a270d4bf592a95b256b318342d242cef Mon Sep 17 00:00:00 2001 From: oihane Date: Thu, 3 Sep 2015 15:45:54 +0200 Subject: [PATCH 06/14] Create 'customer' type from menu option --- .../views/product_view.xml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/product_supplierinfo_for_customer/views/product_view.xml b/product_supplierinfo_for_customer/views/product_view.xml index 30f841710c1..f6db3069922 100644 --- a/product_supplierinfo_for_customer/views/product_view.xml +++ b/product_supplierinfo_for_customer/views/product_view.xml @@ -21,7 +21,7 @@ Partner Unit of Measure - + @@ -40,7 +40,7 @@ - product.supplierinfo.extended.tree + product.supplierinfo.partner.tree product.supplierinfo @@ -75,15 +75,15 @@ + context="{'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id}" + domain="[('type','=','supplier')]" /> + context="{'default_search_type':'customer','default_type':'customer','default_product_tmpl_id':id}"> @@ -97,33 +97,33 @@ + name="is_customer_filter" /> + name="is_supplier_filter" /> + domain="[]" context="{'group_by':'name'}" /> + context="{'group_by':'product_tmpl_id'}" /> + context="{'group_by':'type'}" /> - Information about a product (customer) Information about a product (customer) ir.actions.act_window product.supplierinfo tree,form form - [] { - 'search_default_is_customer_filter': 1 + 'search_default_is_customer_filter': 1, + 'default_type': 'customer', + 'supplierinfo_type': 'customer', } @@ -134,7 +134,7 @@ + model="ir.actions.act_window.view"> form @@ -142,7 +142,7 @@ + model="ir.actions.act_window.view"> tree @@ -150,7 +150,7 @@ + action="product_supplierinfo_action" /> From 3438b5c6557a4197711dabecdc97aa771ef57d15 Mon Sep 17 00:00:00 2001 From: oihane Date: Fri, 4 Sep 2015 12:57:15 +0200 Subject: [PATCH 07/14] Added know issue with computed fields --- product_supplierinfo_for_customer/README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/product_supplierinfo_for_customer/README.rst b/product_supplierinfo_for_customer/README.rst index 8f1fd69696d..dfacd33ea3f 100644 --- a/product_supplierinfo_for_customer/README.rst +++ b/product_supplierinfo_for_customer/README.rst @@ -35,6 +35,8 @@ Known issues / Roadmap * The product code / product name specified for the customer will not be reflected on the sale orders. * 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 ======= @@ -43,4 +45,3 @@ Contributors ------------ * Oihane Crucelaegui * Pedro M. Baeza - From cc00eca543d5d3dc5d90fbc5a665ebe173f2e000 Mon Sep 17 00:00:00 2001 From: alfredoavanzosc Date: Mon, 28 Sep 2015 16:50:37 +0200 Subject: [PATCH 08/14] product_supplierinfo_for_customer: Create "demo" data, and "tests" folder. --- product_supplierinfo_for_customer/__init__.py | 16 +------- .../__openerp__.py | 18 +++++---- .../demo/product_demo.xml | 15 +++++++ .../models/__init__.py | 16 +------- .../models/product_pricelist.py | 6 +-- .../models/product_supplierinfo.py | 16 +------- .../models/product_template.py | 16 +------- .../models/res_partner.py | 16 +------- .../tests/__init__.py | 5 +++ .../test_product_supplierinfo_for_customer.py | 40 +++++++++++++++++++ 10 files changed, 78 insertions(+), 86 deletions(-) create mode 100644 product_supplierinfo_for_customer/demo/product_demo.xml create mode 100644 product_supplierinfo_for_customer/tests/__init__.py create mode 100644 product_supplierinfo_for_customer/tests/test_product_supplierinfo_for_customer.py diff --git a/product_supplierinfo_for_customer/__init__.py b/product_supplierinfo_for_customer/__init__.py index a9609aa0b11..2bbe2de9996 100644 --- a/product_supplierinfo_for_customer/__init__.py +++ b/product_supplierinfo_for_customer/__init__.py @@ -1,19 +1,5 @@ # -*- coding: utf-8 -*- ############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - from . import models diff --git a/product_supplierinfo_for_customer/__openerp__.py b/product_supplierinfo_for_customer/__openerp__.py index b9fc4c5384a..e0de40d6284 100644 --- a/product_supplierinfo_for_customer/__openerp__.py +++ b/product_supplierinfo_for_customer/__openerp__.py @@ -15,22 +15,24 @@ # along with this program. If not, see http://www.gnu.org/licenses/. # ############################################################################## - { "name": "Use product supplier info for customers too", - "version": "1.0", - "depends": [ - "base", - "product", - ], + "version": "8.0.1.0.0", "author": "OdooMRP team," "AvanzOSC," "Serv. Tecnol. Avanzados - Pedro M. Baeza", - "category": "Sales Management", "website": "http://www.odoomrp.com", - "summary": "", + "category": "Sales Management", + "license": 'AGPL-3', + "depends": [ + "base", + "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..d667cc72421 --- /dev/null +++ b/product_supplierinfo_for_customer/demo/product_demo.xml @@ -0,0 +1,15 @@ + + + + + + + 1 + 1 + customer + + + + diff --git a/product_supplierinfo_for_customer/models/__init__.py b/product_supplierinfo_for_customer/models/__init__.py index b60c45a6539..3e4ccebb841 100644 --- a/product_supplierinfo_for_customer/models/__init__.py +++ b/product_supplierinfo_for_customer/models/__init__.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - from . import product_supplierinfo from . import product_template from . import res_partner diff --git a/product_supplierinfo_for_customer/models/product_pricelist.py b/product_supplierinfo_for_customer/models/product_pricelist.py index 49ee7421be6..cac559a0c09 100644 --- a/product_supplierinfo_for_customer/models/product_pricelist.py +++ b/product_supplierinfo_for_customer/models/product_pricelist.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- -# (c) 2015 Pedro M. Baeza -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## from openerp import models, api diff --git a/product_supplierinfo_for_customer/models/product_supplierinfo.py b/product_supplierinfo_for_customer/models/product_supplierinfo.py index a957eb839e5..635c2ec1887 100644 --- a/product_supplierinfo_for_customer/models/product_supplierinfo.py +++ b/product_supplierinfo_for_customer/models/product_supplierinfo.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - from openerp import models, fields, api diff --git a/product_supplierinfo_for_customer/models/product_template.py b/product_supplierinfo_for_customer/models/product_template.py index 8e84ddb61b8..4fa58d94acd 100644 --- a/product_supplierinfo_for_customer/models/product_template.py +++ b/product_supplierinfo_for_customer/models/product_template.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - from openerp import models, fields diff --git a/product_supplierinfo_for_customer/models/res_partner.py b/product_supplierinfo_for_customer/models/res_partner.py index 6c7e0303075..8e41b79cb5d 100644 --- a/product_supplierinfo_for_customer/models/res_partner.py +++ b/product_supplierinfo_for_customer/models/res_partner.py @@ -1,21 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - from openerp import models, api diff --git a/product_supplierinfo_for_customer/tests/__init__.py b/product_supplierinfo_for_customer/tests/__init__.py new file mode 100644 index 00000000000..bc0476c8174 --- /dev/null +++ b/product_supplierinfo_for_customer/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +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..c2723f1e217 --- /dev/null +++ b/product_supplierinfo_for_customer/tests/test_product_supplierinfo_for_customer.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +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.env.ref('base.res_partner_2') + self.product = self.env.ref('product.product_product_4') + self.pricelist = self.env.ref('product.list0') + self.pricelist_item = self.pricelist_item_model.browse( + self.env.ref('product.item0').id) + self.pricelist_item.write({'base': -2}) + + 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: Supplier not found in Supplierinfo") + price_unit = self.pricelist_model.with_context( + supplierinfo_type='customer').price_rule_get( + self.product.id, 7, partner=self.customer.id) + self.assertTrue( + price_unit.get(self.pricelist.id, False), + "Error: Price unit not found for customer") + price = price_unit.get(self.pricelist.id, False)[0] + self.assertEqual(price, 20.0, + "Error: Price not found for product and customer") From 127abd4bdface527ab4819df547d2fa6c4b5ea4e Mon Sep 17 00:00:00 2001 From: Javier Iniesta Date: Thu, 22 Oct 2015 13:30:50 +0200 Subject: [PATCH 09/14] license target link --- product_supplierinfo_for_customer/README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/product_supplierinfo_for_customer/README.rst b/product_supplierinfo_for_customer/README.rst index dfacd33ea3f..a51a69d4454 100644 --- a/product_supplierinfo_for_customer/README.rst +++ b/product_supplierinfo_for_customer/README.rst @@ -1,5 +1,6 @@ .. 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 From 1a190ca82e1b0f78f787da108d7481ffc49fe366 Mon Sep 17 00:00:00 2001 From: Javier Iniesta Date: Thu, 22 Oct 2015 13:51:45 +0200 Subject: [PATCH 10/14] OCA as author added --- product_supplierinfo_for_customer/__openerp__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/product_supplierinfo_for_customer/__openerp__.py b/product_supplierinfo_for_customer/__openerp__.py index e0de40d6284..dcf3495737c 100644 --- a/product_supplierinfo_for_customer/__openerp__.py +++ b/product_supplierinfo_for_customer/__openerp__.py @@ -20,7 +20,8 @@ "version": "8.0.1.0.0", "author": "OdooMRP team," "AvanzOSC," - "Serv. Tecnol. Avanzados - Pedro M. Baeza", + "Serv. Tecnol. Avanzados - Pedro M. Baeza," + "Odoo Community Association (OCA)", "website": "http://www.odoomrp.com", "category": "Sales Management", "license": 'AGPL-3', From a7f7a66405a0c9e64d90addda092c1e003fb2ad7 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Tue, 29 Nov 2016 09:26:01 -0500 Subject: [PATCH 11/14] OCA Transbot updated translations from Transifex --- product_supplierinfo_for_customer/i18n/de.po | 128 +++++++++++++++++++ product_supplierinfo_for_customer/i18n/es.po | 53 +++++--- product_supplierinfo_for_customer/i18n/fr.po | 123 ++++++++++++++++++ product_supplierinfo_for_customer/i18n/sl.po | 46 +++++-- 4 files changed, 324 insertions(+), 26 deletions(-) create mode 100644 product_supplierinfo_for_customer/i18n/de.po create mode 100644 product_supplierinfo_for_customer/i18n/fr.po 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 index df5232cbaa4..027bca24642 100644 --- a/product_supplierinfo_for_customer/i18n/es.po +++ b/product_supplierinfo_for_customer/i18n/es.po @@ -1,34 +1,38 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * product_supplierinfo_for_customer -# +# * 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: 2015-02-05 14:08+0000\n" -"PO-Revision-Date: 2015-02-05 14:08+0000\n" -"Last-Translator: <>\n" -"Language-Team: \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" -"Plural-Forms: \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" +msgid "" +"

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

\n" " " -msgstr "

\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 +#: selection:product.supplierinfo,type:0 field:product.template,customer_ids:0 msgid "Customer" msgstr "Cliente" @@ -45,8 +49,8 @@ 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" -msgstr "Información sobre un producto" +msgid "Information about a product (customer)" +msgstr "" #. module: product_supplierinfo_for_customer #: model:ir.model,name:product_supplierinfo_for_customer.model_product_supplierinfo @@ -76,6 +80,11 @@ msgstr "Nombre de producto para la empresa" 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 @@ -84,8 +93,7 @@ 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 +#: selection:product.supplierinfo,type:0 field:product.template,supplier_ids:0 msgid "Supplier" msgstr "Proveedor" @@ -100,3 +108,18 @@ msgstr "Búsqueda de producto-empresa" 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/sl.po b/product_supplierinfo_for_customer/i18n/sl.po index e0423baa22e..ad5fa16f4dd 100644 --- a/product_supplierinfo_for_customer/i18n/sl.po +++ b/product_supplierinfo_for_customer/i18n/sl.po @@ -1,21 +1,23 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * product_supplierinfo_for_customer -# +# * 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: 2015-02-05 14:08+0000\n" -"PO-Revision-Date: 2015-08-15 13:06+0200\n" -"Last-Translator: Matjaz Mozetic \n" -"Language-Team: \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: 8bit\n" -"Plural-Forms: \n" +"Content-Transfer-Encoding: \n" "Language: sl\n" -"X-Generator: Poedit 1.8.4\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 @@ -49,8 +51,8 @@ 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" -msgstr "Podatki o proizvodu" +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 @@ -80,6 +82,11 @@ msgstr "Partnerjev naziv proizvoda" 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 @@ -102,3 +109,20 @@ msgstr "Iskanje podatkov o dobavitelju" #: 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}" From 9d8146c97be2e9c3cfe729448e37908d4ed7a51f Mon Sep 17 00:00:00 2001 From: Yennifer Santiago Date: Wed, 28 Jun 2017 14:41:57 +0000 Subject: [PATCH 12/14] product_customer_code: New README. [REF] product_supplierinfo_for_customer: Complete README. --- product_supplierinfo_for_customer/README.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/product_supplierinfo_for_customer/README.rst b/product_supplierinfo_for_customer/README.rst index a51a69d4454..0faca127474 100644 --- a/product_supplierinfo_for_customer/README.rst +++ b/product_supplierinfo_for_customer/README.rst @@ -28,13 +28,16 @@ suppliers. :alt: Try me on Runbot :target: https://runbot.odoo-community.org/runbot/188/8.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 ====================== * Product prices through this method are only guaranteed on the standard sale order workflow. Other custom flows maybe don't reflect the price. -* The product code / product name specified for the customer will not be - reflected on the sale orders. * The minimum quantity will not also be applied on sale orders. * Computed fields in product.supplierinfo object won't properly work for customer type From b8e86449fe30c1380a21bcfb1567805f2201c13a Mon Sep 17 00:00:00 2001 From: aheficent Date: Mon, 31 Jul 2017 15:21:58 +0200 Subject: [PATCH 13/14] [MIG]product_supplierinfo_for_customer to v9 --- product_supplierinfo_for_customer/README.rst | 20 ++--- product_supplierinfo_for_customer/__init__.py | 3 - .../__openerp__.py | 31 +++----- .../demo/product_demo.xml | 7 +- .../models/__init__.py | 4 - .../models/product_pricelist.py | 18 ----- .../models/product_supplierinfo.py | 7 +- .../models/product_template.py | 7 +- .../models/res_partner.py | 7 +- .../tests/__init__.py | 3 - .../test_product_supplierinfo_for_customer.py | 78 +++++++++++++++---- .../views/product_view.xml | 27 ++++--- 12 files changed, 110 insertions(+), 102 deletions(-) delete mode 100644 product_supplierinfo_for_customer/models/product_pricelist.py diff --git a/product_supplierinfo_for_customer/README.rst b/product_supplierinfo_for_customer/README.rst index 0faca127474..d2b67e6cc19 100644 --- a/product_supplierinfo_for_customer/README.rst +++ b/product_supplierinfo_for_customer/README.rst @@ -7,16 +7,9 @@ Use product supplier info also for customers ============================================ This modules allows to use supplier info structure, available in -*Procurements* tab of the product form, also for defining customer information, +*Inventory* tab of the product form, also for defining customer information, allowing to define prices per customer and product. -Configuration -============= - -For these prices to be used in sale prices calculations, you will have -to create a pricelist with a rule with option "Based on" with the value -"Supplier prices on the product form" (although the text is not clear enough). - Usage ===== @@ -26,21 +19,23 @@ 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/8.0 + :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 + customer type. Credits ======= @@ -48,4 +43,5 @@ Credits Contributors ------------ * Oihane Crucelaegui -* Pedro M. Baeza +* Tecnativa - Pedro M. Baeza +* Aaron Henriquez diff --git a/product_supplierinfo_for_customer/__init__.py b/product_supplierinfo_for_customer/__init__.py index 2bbe2de9996..a0fdc10fe11 100644 --- a/product_supplierinfo_for_customer/__init__.py +++ b/product_supplierinfo_for_customer/__init__.py @@ -1,5 +1,2 @@ # -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## from . import models diff --git a/product_supplierinfo_for_customer/__openerp__.py b/product_supplierinfo_for_customer/__openerp__.py index dcf3495737c..94d9b5f36dd 100644 --- a/product_supplierinfo_for_customer/__openerp__.py +++ b/product_supplierinfo_for_customer/__openerp__.py @@ -1,32 +1,19 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -############################################################################## +# 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": "8.0.1.0.0", - "author": "OdooMRP team," - "AvanzOSC," - "Serv. Tecnol. Avanzados - Pedro M. Baeza," + "version": "9.0.1.0.0", + "author": "AvanzOSC, " + "Tecnativa, " + "Eficent, " "Odoo Community Association (OCA)", - "website": "http://www.odoomrp.com", + "website": "https://github.com/OCA/product-attribute", "category": "Sales Management", "license": 'AGPL-3', "depends": [ - "base", "product", ], "data": [ diff --git a/product_supplierinfo_for_customer/demo/product_demo.xml b/product_supplierinfo_for_customer/demo/product_demo.xml index d667cc72421..6bb7a870411 100644 --- a/product_supplierinfo_for_customer/demo/product_demo.xml +++ b/product_supplierinfo_for_customer/demo/product_demo.xml @@ -1,5 +1,9 @@ + @@ -7,9 +11,6 @@ 1 1 customer - diff --git a/product_supplierinfo_for_customer/models/__init__.py b/product_supplierinfo_for_customer/models/__init__.py index 3e4ccebb841..fe99cab361e 100644 --- a/product_supplierinfo_for_customer/models/__init__.py +++ b/product_supplierinfo_for_customer/models/__init__.py @@ -1,8 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## from . import product_supplierinfo from . import product_template from . import res_partner -from . import product_pricelist diff --git a/product_supplierinfo_for_customer/models/product_pricelist.py b/product_supplierinfo_for_customer/models/product_pricelist.py deleted file mode 100644 index cac559a0c09..00000000000 --- a/product_supplierinfo_for_customer/models/product_pricelist.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## -from openerp import models, api - - -class ProductPricelist(models.Model): - _inherit = 'product.pricelist' - - @api.multi - def price_rule_get(self, prod_id, qty, partner=None): - """Pass context if the type of the pricelist is sale for restricting - on the search product.supplierinfo records of type customer.""" - obj = (self.with_context(supplierinfo_type='customer') if - self.type == 'sale' else self) - return super(ProductPricelist, obj).price_rule_get( - prod_id, qty, partner=partner) diff --git a/product_supplierinfo_for_customer/models/product_supplierinfo.py b/product_supplierinfo_for_customer/models/product_supplierinfo.py index 635c2ec1887..f24f5eb5c45 100644 --- a/product_supplierinfo_for_customer/models/product_supplierinfo.py +++ b/product_supplierinfo_for_customer/models/product_supplierinfo.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# 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 diff --git a/product_supplierinfo_for_customer/models/product_template.py b/product_supplierinfo_for_customer/models/product_template.py index 4fa58d94acd..d1f28c1e976 100644 --- a/product_supplierinfo_for_customer/models/product_template.py +++ b/product_supplierinfo_for_customer/models/product_template.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# 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 diff --git a/product_supplierinfo_for_customer/models/res_partner.py b/product_supplierinfo_for_customer/models/res_partner.py index 8e41b79cb5d..094dedfdd43 100644 --- a/product_supplierinfo_for_customer/models/res_partner.py +++ b/product_supplierinfo_for_customer/models/res_partner.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# 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 diff --git a/product_supplierinfo_for_customer/tests/__init__.py b/product_supplierinfo_for_customer/tests/__init__.py index bc0476c8174..02b8a718f29 100644 --- a/product_supplierinfo_for_customer/tests/__init__.py +++ b/product_supplierinfo_for_customer/tests/__init__.py @@ -1,5 +1,2 @@ # -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## 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 index c2723f1e217..cbaea4a8a4e 100644 --- a/product_supplierinfo_for_customer/tests/test_product_supplierinfo_for_customer.py +++ b/product_supplierinfo_for_customer/tests/test_product_supplierinfo_for_customer.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# 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 @@ -12,12 +13,62 @@ def setUp(self): 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.env.ref('base.res_partner_2') + self.customer = self._create_customer('customer1') self.product = self.env.ref('product.product_product_4') - self.pricelist = self.env.ref('product.list0') - self.pricelist_item = self.pricelist_item_model.browse( - self.env.ref('product.item0').id) - self.pricelist_item.write({'base': -2}) + 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)] @@ -28,13 +79,12 @@ def test_product_supplierinfo_for_customer(self): customerinfos = self.supplierinfo_model.with_context( supplierinfo_type='customer').search(cond) self.assertNotEqual(len(customerinfos), 0, - "Error: Supplier not found in Supplierinfo") - price_unit = self.pricelist_model.with_context( - supplierinfo_type='customer').price_rule_get( - self.product.id, 7, partner=self.customer.id) + "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: Price unit not found for customer") + "Error: Unit Price not found for customer") price = price_unit.get(self.pricelist.id, False)[0] - self.assertEqual(price, 20.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 index f6db3069922..ddeee2e809e 100644 --- a/product_supplierinfo_for_customer/views/product_view.xml +++ b/product_supplierinfo_for_customer/views/product_view.xml @@ -66,7 +66,7 @@ product.template.extended.form product.template - + {'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id} @@ -78,14 +78,12 @@ context="{'default_search_type':'supplier','default_type':'supplier','default_product_tmpl_id':id}" domain="[('type','=','supplier')]" /> - +
- +
@@ -94,20 +92,21 @@ product.supplierinfo - - + + + name="is_customer_filter"/> - + name="is_supplier_filter"/> + + domain="[]" context="{'group_by':'name'}"/> + name="gb_product_template" + context="{'group_by':'product_tmpl_id'}"/> - + From 39de341a67603418ebe9626062f8791ba96986f0 Mon Sep 17 00:00:00 2001 From: mreficent Date: Thu, 28 Jun 2018 19:39:56 +0200 Subject: [PATCH 14/14] [FIX] product_multi_category: E7901 error pylint in readme --- product_multi_category/README.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 =====