From 9f9023b1399bd79b627a16a954bae829cbbd95a7 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Wed, 5 Jun 2013 10:56:26 +0200 Subject: [PATCH] [ADD] Product margin UoM + product_extended bzr revid: jco@openerp.com-20130605085626-6g4kvnrfgoxf3y2k --- addons/product_extended/__init__.py | 23 ++++ addons/product_extended/__openerp__.py | 41 +++++++ addons/product_extended/i18n/ca.po | 62 +++++++++++ addons/product_extended/i18n/ca_ES.po | 81 ++++++++++++++ addons/product_extended/i18n/de.po | 63 +++++++++++ addons/product_extended/i18n/es.po | 62 +++++++++++ addons/product_extended/i18n/es_ES.po | 84 +++++++++++++++ addons/product_extended/i18n/fr_BE.po | 75 +++++++++++++ addons/product_extended/i18n/nl.po | 63 +++++++++++ .../i18n/product_extended.pot | 62 +++++++++++ addons/product_extended/i18n/sv.po | 62 +++++++++++ addons/product_extended/mrp_view.xml | 29 +++++ addons/product_extended/product_extended.py | 102 ++++++++++++++++++ .../product_extended_view.xml | 31 ++++++ .../product_extended_wizard.xml | 11 ++ addons/product_extended/wizard/__init__.py | 25 +++++ .../product_extended/wizard/wizard_price.py | 49 +++++++++ addons/product_margin/product_margin.py | 2 +- addons/purchase/test/fifo_price.yml | 21 +++- addons/stock/report/report_stock_move.py | 2 +- .../stock/report/report_stock_move_view.xml | 3 +- 21 files changed, 949 insertions(+), 4 deletions(-) create mode 100644 addons/product_extended/__init__.py create mode 100644 addons/product_extended/__openerp__.py create mode 100644 addons/product_extended/i18n/ca.po create mode 100644 addons/product_extended/i18n/ca_ES.po create mode 100644 addons/product_extended/i18n/de.po create mode 100644 addons/product_extended/i18n/es.po create mode 100644 addons/product_extended/i18n/es_ES.po create mode 100644 addons/product_extended/i18n/fr_BE.po create mode 100644 addons/product_extended/i18n/nl.po create mode 100644 addons/product_extended/i18n/product_extended.pot create mode 100644 addons/product_extended/i18n/sv.po create mode 100644 addons/product_extended/mrp_view.xml create mode 100644 addons/product_extended/product_extended.py create mode 100644 addons/product_extended/product_extended_view.xml create mode 100644 addons/product_extended/product_extended_wizard.xml create mode 100644 addons/product_extended/wizard/__init__.py create mode 100644 addons/product_extended/wizard/wizard_price.py diff --git a/addons/product_extended/__init__.py b/addons/product_extended/__init__.py new file mode 100644 index 00000000000..c7762d541a9 --- /dev/null +++ b/addons/product_extended/__init__.py @@ -0,0 +1,23 @@ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). +# +# 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 Affero 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 . +# +############################################################################## +import product_extended +import wizard +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/product_extended/__openerp__.py b/addons/product_extended/__openerp__.py new file mode 100644 index 00000000000..83e8f9f8d5b --- /dev/null +++ b/addons/product_extended/__openerp__.py @@ -0,0 +1,41 @@ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# Copyright (C) 2010-2011 OpenERP S.A. (). +# +# 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 Affero 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 . +# +############################################################################## +{ + "name" : "Product extension to track sales and purchases", + "version" : "1.0", + "author" : "OpenERP S.A.", + "depends" : ["product", "purchase", "sale", "mrp"], + "category" : "Generic Modules/Inventory Control", + "description": """ +Product extension. This module adds: + * Last purchase order for each product supplier + * New functional field: Available stock (real+outgoing stock) + * Computes standard price from the BoM of the product (optional for each product) + * Standard price is shown in the BoM and it can be computed with a wizard +""", + "init_xml" : [], + "demo_xml" : [], + "update_xml" : ["product_extended_view.xml","product_extended_wizard.xml","mrp_view.xml"], + "active": False, + "installable": True +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/product_extended/i18n/ca.po b/addons/product_extended/i18n/ca.po new file mode 100644 index 00000000000..db71b797dde --- /dev/null +++ b/addons/product_extended/i18n/ca.po @@ -0,0 +1,62 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_extended +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-07-08 18:00+0000\n" +"PO-Revision-Date: 2011-02-15 15:23+0000\n" +"Last-Translator: Benjamí Borràs Delgado \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2013-04-20 05:38+0000\n" +"X-Generator: Launchpad (build 16567)\n" + +#. module: product_extended +#: model:ir.module.module,shortdesc:product_extended.module_name_translation +msgid "Product extension to track sales and purchases" +msgstr "Extensió de producte pel seguiment de compres i vendes" + +#. module: product_extended +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invàlid per a la definició de la vista!" + +#. module: product_extended +#: field:mrp.bom,standard_price:0 +msgid "Standard Price" +msgstr "Preu cost" + +#. module: product_extended +#: field:product.supplierinfo,last_order_date:0 +msgid "Last Order date" +msgstr "Data de l'última comanda" + +#. module: product_extended +#: field:product.product,qty_dispo:0 +msgid "Stock available" +msgstr "Estoc disponible" + +#. module: product_extended +#: field:product.product,calculate_price:0 +msgid "Compute price" +msgstr "Calcula preu" + +#. module: product_extended +#: field:product.supplierinfo,last_order:0 +msgid "Last Order" +msgstr "Última comanda" + +#. module: product_extended +#: view:product.product:0 +msgid "Compute standard price" +msgstr "Calcular preu cost" + +#. module: product_extended +#: field:product.product,orderpoint_ids:0 +msgid "Orderpoints" +msgstr "Punts de comandes" diff --git a/addons/product_extended/i18n/ca_ES.po b/addons/product_extended/i18n/ca_ES.po new file mode 100644 index 00000000000..1f21e447ac7 --- /dev/null +++ b/addons/product_extended/i18n/ca_ES.po @@ -0,0 +1,81 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_extended +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-07-16 19:42:46+0000\n" +"PO-Revision-Date: 2009-07-16 22:03+0100\n" +"Last-Translator: Benjamí Borràs Delgado \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" + +#. module: product_extended +#: model:ir.module.module,description:product_extended.module_meta_information +msgid "" +"\n" +"Product extension. This module adds:\n" +" * Last purchase order for each product supplier \n" +" * New functional field: Available stock (real+outgoing stock)\n" +" * Computes standard price from the BoM of the product (optional for each product)\n" +" * Standard price is shown in the BoM and it can be computed with a wizard \n" +msgstr "" +"\n" +"Extensió de producte. Aquest mòdul afegeix:\n" +" * Última comanda de compra per cada proveïdor del producte\n" +" * Nou camp funcional: Estoc disponible (estoc real+sortint)\n" +" * Calcula preu de cost a partir de la LdM del producte (opcional per cada producte)\n" +" * Preu de cost es mostra en la LdM i pot ser calculat amb un assistent\n" + +#. module: product_extended +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "XML invàlid per a la definició de la vista!" + +#. module: product_extended +#: field:mrp.bom,standard_price:0 +msgid "Standard Price" +msgstr "Preu cost" + +#. module: product_extended +#: model:ir.module.module,shortdesc:product_extended.module_meta_information +msgid "Product extension to track sales and purchases" +msgstr "Extensió de producte pel seguiment de compres i vendes" + +#. module: product_extended +#: help:product.product,calculate_price:0 +msgid "Check this box if the standard price must be computed from the BoM." +msgstr "Marqueu aquesta opció si el preu de cost s'ha de calcular a partir de la Llista de Materials." + +#. module: product_extended +#: field:product.supplierinfo,last_order_date:0 +msgid "Last Order date" +msgstr "Data de l'última comanda" + +#. module: product_extended +#: field:product.product,qty_dispo:0 +msgid "Stock available" +msgstr "Estoc disponible" + +#. module: product_extended +#: field:product.supplierinfo,last_order:0 +msgid "Last Order" +msgstr "Última comanda" + +#. module: product_extended +#: model:ir.actions.wizard,name:product_extended.id_compute_price +#: view:product.product:0 +#: field:product.product,calculate_price:0 +msgid "Compute standard price" +msgstr "Calcular preu cost" + +#. module: product_extended +#: field:product.product,orderpoint_ids:0 +msgid "Orderpoints" +msgstr "Punts de comandes" + diff --git a/addons/product_extended/i18n/de.po b/addons/product_extended/i18n/de.po new file mode 100644 index 00000000000..7b7942b7bde --- /dev/null +++ b/addons/product_extended/i18n/de.po @@ -0,0 +1,63 @@ +# German translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-07-08 18:00+0000\n" +"PO-Revision-Date: 2012-09-11 11:15+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2013-04-20 05:38+0000\n" +"X-Generator: Launchpad (build 16567)\n" + +#. module: product_extended +#: model:ir.module.module,shortdesc:product_extended.module_name_translation +msgid "Product extension to track sales and purchases" +msgstr "" + +#. module: product_extended +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: product_extended +#: field:mrp.bom,standard_price:0 +msgid "Standard Price" +msgstr "" + +#. module: product_extended +#: field:product.supplierinfo,last_order_date:0 +msgid "Last Order date" +msgstr "" + +#. module: product_extended +#: field:product.product,qty_dispo:0 +msgid "Stock available" +msgstr "" + +#. module: product_extended +#: field:product.product,calculate_price:0 +msgid "Compute price" +msgstr "" + +#. module: product_extended +#: field:product.supplierinfo,last_order:0 +msgid "Last Order" +msgstr "" + +#. module: product_extended +#: view:product.product:0 +msgid "Compute standard price" +msgstr "" + +#. module: product_extended +#: field:product.product,orderpoint_ids:0 +msgid "Orderpoints" +msgstr "" diff --git a/addons/product_extended/i18n/es.po b/addons/product_extended/i18n/es.po new file mode 100644 index 00000000000..9df9cdfe54a --- /dev/null +++ b/addons/product_extended/i18n/es.po @@ -0,0 +1,62 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_extended +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-07-08 18:00+0000\n" +"PO-Revision-Date: 2011-02-15 15:23+0000\n" +"Last-Translator: Benjamí Borràs Delgado \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2013-04-20 05:38+0000\n" +"X-Generator: Launchpad (build 16567)\n" + +#. module: product_extended +#: model:ir.module.module,shortdesc:product_extended.module_name_translation +msgid "Product extension to track sales and purchases" +msgstr "Extensión de producto para el seguimiento de compras y ventas" + +#. module: product_extended +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "¡XML inválido para la definición de la vista!" + +#. module: product_extended +#: field:mrp.bom,standard_price:0 +msgid "Standard Price" +msgstr "Precio de coste" + +#. module: product_extended +#: field:product.supplierinfo,last_order_date:0 +msgid "Last Order date" +msgstr "Fecha del último pedido" + +#. module: product_extended +#: field:product.product,qty_dispo:0 +msgid "Stock available" +msgstr "Stock disponible" + +#. module: product_extended +#: field:product.product,calculate_price:0 +msgid "Compute price" +msgstr "Calcular precio" + +#. module: product_extended +#: field:product.supplierinfo,last_order:0 +msgid "Last Order" +msgstr "Último pedido" + +#. module: product_extended +#: view:product.product:0 +msgid "Compute standard price" +msgstr "Calcular precio de coste" + +#. module: product_extended +#: field:product.product,orderpoint_ids:0 +msgid "Orderpoints" +msgstr "Puntos de pedidos" diff --git a/addons/product_extended/i18n/es_ES.po b/addons/product_extended/i18n/es_ES.po new file mode 100644 index 00000000000..b176226fc20 --- /dev/null +++ b/addons/product_extended/i18n/es_ES.po @@ -0,0 +1,84 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_extended +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-07-16 19:42:46+0000\n" +"PO-Revision-Date: 2009-07-16 21:58+0100\n" +"Last-Translator: Benjamí Borràs Delgado \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" + +#. module: product_extended +#: model:ir.module.module,description:product_extended.module_meta_information +msgid "" +"\n" +"Product extension. This module adds:\n" +" * Last purchase order for each product supplier \n" +" * New functional field: Available stock (real+outgoing stock)\n" +" * Computes standard price from the BoM of the product (optional for each product)\n" +" * Standard price is shown in the BoM and it can be computed with a wizard \n" +msgstr "" +"\n" +"Extensión de producto. Este módulo añade:\n" +" * Último pedido de compra por cada proveedor del producto\n" +" * Nuevo campo funcional: Stock disponible (stock real + saliente)\n" +" * Calcula precio de coste a partir de la LdM del producto (opcional para cada producto)\n" +" * Precio de coste se muestra en la LdM y puede ser calculado con un asistente\n" + +#. module: product_extended +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "¡XML inválido para la definición de la vista!" + +#. module: product_extended +#: field:mrp.bom,standard_price:0 +msgid "Standard Price" +msgstr "Precio de coste" + +#. module: product_extended +#: model:ir.module.module,shortdesc:product_extended.module_meta_information +msgid "Product extension to track sales and purchases" +msgstr "Extensión de producto para el seguimiento de compras y ventas" + +#. module: product_extended +#: help:product.product,calculate_price:0 +msgid "Check this box if the standard price must be computed from the BoM." +msgstr "Marque esta opción si el precio de coste se calculará a partir de la Lista de Materiales." + +#. module: product_extended +#: field:product.supplierinfo,last_order_date:0 +msgid "Last Order date" +msgstr "Fecha del último pedido" + +#. module: product_extended +#: field:product.product,qty_dispo:0 +msgid "Stock available" +msgstr "Stock disponible" + +#. module: product_extended +#: field:product.supplierinfo,last_order:0 +msgid "Last Order" +msgstr "Último pedido" + +#. module: product_extended +#: model:ir.actions.wizard,name:product_extended.id_compute_price +#: view:product.product:0 +#: field:product.product,calculate_price:0 +msgid "Compute standard price" +msgstr "Calcular precio de coste" + +#. module: product_extended +#: field:product.product,orderpoint_ids:0 +msgid "Orderpoints" +msgstr "Puntos de pedidos" + +#~ msgid "Compute price" +#~ msgstr "Calcular precio" + diff --git a/addons/product_extended/i18n/fr_BE.po b/addons/product_extended/i18n/fr_BE.po new file mode 100644 index 00000000000..8165e67d908 --- /dev/null +++ b/addons/product_extended/i18n/fr_BE.po @@ -0,0 +1,75 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_extended +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.6\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-11-26 08:13:54+0000\n" +"PO-Revision-Date: 2009-11-26 08:13:54+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_extended +#: model:ir.module.module,description:product_extended.module_meta_information +msgid "\n" +"Product extension. This module adds:\n" +" * Last purchase order for each product supplier \n" +" * New functional field: Available stock (real+outgoing stock)\n" +" * Computes standard price from the BoM of the product (optional for each product)\n" +" * Standard price is shown in the BoM and it can be computed with a wizard \n" +"" +msgstr "" + +#. module: product_extended +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: product_extended +#: field:mrp.bom,standard_price:0 +msgid "Standard Price" +msgstr "" + +#. module: product_extended +#: model:ir.module.module,shortdesc:product_extended.module_meta_information +msgid "Product extension to track sales and purchases" +msgstr "" + +#. module: product_extended +#: help:product.product,calculate_price:0 +msgid "Check this box if the standard price must be computed from the BoM." +msgstr "" + +#. module: product_extended +#: field:product.supplierinfo,last_order_date:0 +msgid "Last Order date" +msgstr "" + +#. module: product_extended +#: field:product.product,qty_dispo:0 +msgid "Stock available" +msgstr "" + +#. module: product_extended +#: field:product.supplierinfo,last_order:0 +msgid "Last Order" +msgstr "" + +#. module: product_extended +#: model:ir.actions.wizard,name:product_extended.id_compute_price +#: view:product.product:0 +#: field:product.product,calculate_price:0 +msgid "Compute standard price" +msgstr "" + +#. module: product_extended +#: field:product.product,orderpoint_ids:0 +msgid "Orderpoints" +msgstr "" + diff --git a/addons/product_extended/i18n/nl.po b/addons/product_extended/i18n/nl.po new file mode 100644 index 00000000000..78c42f8d87d --- /dev/null +++ b/addons/product_extended/i18n/nl.po @@ -0,0 +1,63 @@ +# Dutch translation for openobject-addons +# Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2012. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2009-07-08 18:00+0000\n" +"PO-Revision-Date: 2012-04-05 10:22+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2013-04-20 05:38+0000\n" +"X-Generator: Launchpad (build 16567)\n" + +#. module: product_extended +#: model:ir.module.module,shortdesc:product_extended.module_name_translation +msgid "Product extension to track sales and purchases" +msgstr "Productgegevens uitbreiding" + +#. module: product_extended +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "Ongeldige XML voor weergave opbouw!" + +#. module: product_extended +#: field:mrp.bom,standard_price:0 +msgid "Standard Price" +msgstr "Standaardprijs" + +#. module: product_extended +#: field:product.supplierinfo,last_order_date:0 +msgid "Last Order date" +msgstr "Laatste orderdatum" + +#. module: product_extended +#: field:product.product,qty_dispo:0 +msgid "Stock available" +msgstr "Voorraad beschikbaar" + +#. module: product_extended +#: field:product.product,calculate_price:0 +msgid "Compute price" +msgstr "Bereken kostprijs" + +#. module: product_extended +#: field:product.supplierinfo,last_order:0 +msgid "Last Order" +msgstr "Laatste order" + +#. module: product_extended +#: view:product.product:0 +msgid "Compute standard price" +msgstr "Bereken standaard prijs" + +#. module: product_extended +#: field:product.product,orderpoint_ids:0 +msgid "Orderpoints" +msgstr "Orderpunten" diff --git a/addons/product_extended/i18n/product_extended.pot b/addons/product_extended/i18n/product_extended.pot new file mode 100644 index 00000000000..dfb047eb7e7 --- /dev/null +++ b/addons/product_extended/i18n/product_extended.pot @@ -0,0 +1,62 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_extended +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.1\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-07-08 18:00:36+0000\n" +"PO-Revision-Date: 2009-07-08 18:00:36+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_extended +#: model:ir.module.module,shortdesc:product_extended.module_name_translation +msgid "Product extension to track sales and purchases" +msgstr "" + +#. module: product_extended +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: product_extended +#: field:mrp.bom,standard_price:0 +msgid "Standard Price" +msgstr "" + +#. module: product_extended +#: field:product.supplierinfo,last_order_date:0 +msgid "Last Order date" +msgstr "" + +#. module: product_extended +#: field:product.product,qty_dispo:0 +msgid "Stock available" +msgstr "" + +#. module: product_extended +#: field:product.product,calculate_price:0 +msgid "Compute price" +msgstr "" + +#. module: product_extended +#: field:product.supplierinfo,last_order:0 +msgid "Last Order" +msgstr "" + +#. module: product_extended +#: view:product.product:0 +msgid "Compute standard price" +msgstr "" + +#. module: product_extended +#: field:product.product,orderpoint_ids:0 +msgid "Orderpoints" +msgstr "" + diff --git a/addons/product_extended/i18n/sv.po b/addons/product_extended/i18n/sv.po new file mode 100644 index 00000000000..542043c127f --- /dev/null +++ b/addons/product_extended/i18n/sv.po @@ -0,0 +1,62 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_extended +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.14\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-07-08 18:00+0000\n" +"PO-Revision-Date: 2011-02-15 15:23+0000\n" +"Last-Translator: Olivier Dony (OpenERP) \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2013-04-20 05:38+0000\n" +"X-Generator: Launchpad (build 16567)\n" + +#. module: product_extended +#: model:ir.module.module,shortdesc:product_extended.module_name_translation +msgid "Product extension to track sales and purchases" +msgstr "Product extension to track sales and purchases" + +#. module: product_extended +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: product_extended +#: field:mrp.bom,standard_price:0 +msgid "Standard Price" +msgstr "" + +#. module: product_extended +#: field:product.supplierinfo,last_order_date:0 +msgid "Last Order date" +msgstr "" + +#. module: product_extended +#: field:product.product,qty_dispo:0 +msgid "Stock available" +msgstr "" + +#. module: product_extended +#: field:product.product,calculate_price:0 +msgid "Compute price" +msgstr "" + +#. module: product_extended +#: field:product.supplierinfo,last_order:0 +msgid "Last Order" +msgstr "" + +#. module: product_extended +#: view:product.product:0 +msgid "Compute standard price" +msgstr "" + +#. module: product_extended +#: field:product.product,orderpoint_ids:0 +msgid "Orderpoints" +msgstr "" diff --git a/addons/product_extended/mrp_view.xml b/addons/product_extended/mrp_view.xml new file mode 100644 index 00000000000..ca408727a5b --- /dev/null +++ b/addons/product_extended/mrp_view.xml @@ -0,0 +1,29 @@ + + + + + mrp.bom.form.product_extended + mrp.bom + form + + + + + + + + + + + mrp.bom.tree.product_extended + mrp.bom + tree + + + + + + + + + diff --git a/addons/product_extended/product_extended.py b/addons/product_extended/product_extended.py new file mode 100644 index 00000000000..d2ed69db9da --- /dev/null +++ b/addons/product_extended/product_extended.py @@ -0,0 +1,102 @@ +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2010 Tiny SPRL (). +# Copyright (C) 2010-2011 OpenERP S.A. (). +# +# 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 Affero 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 . +# +############################################################################## + +from openerp.osv import fields +from openerp.osv import osv + + + + +class product_product(osv.osv): + _name = 'product.product' + _inherit = 'product.product' + + + + _columns = { + 'calculate_price': fields.boolean('Compute standard price', help="Check this box if the standard price must be computed from the BoM."), + } + + _defaults = { + 'calculate_price': lambda w,x,y,z: False, + } + + def compute_price(self, cr, uid, ids, *args): + proxy = self.pool.get('mrp.bom') + for prod_id in ids: + bom_ids = proxy.search(cr, uid, [('product_id', '=', prod_id)]) + if bom_ids: + for bom in proxy.browse(cr, uid, bom_ids): + self._calc_price(cr, uid, bom) + return True + + def _calc_price(self, cr, uid, bom): + if not bom.product_id.calculate_price: + return bom.product_id.standard_price + else: + price = 0 + if bom.bom_lines: + for sbom in bom.bom_lines: + my_qty = sbom.bom_lines and 1.0 or sbom.product_qty + price += self._calc_price(cr, uid, sbom) * my_qty + else: + bom_obj = self.pool.get('mrp.bom') + no_child_bom = bom_obj.search(cr, uid, [('product_id', '=', bom.product_id.id), ('bom_id', '=', False)]) + if no_child_bom and bom.id not in no_child_bom: + other_bom = bom_obj.browse(cr, uid, no_child_bom)[0] #TODO zero before? + if not other_bom.product_id.calculate_price: + price += self._calc_price(cr, uid, other_bom) * other_bom.product_qty + else: +# price += other_bom.product_qty * other_bom.product_id.standard_price + price += other_bom.product_id.standard_price + else: +# price += bom.product_qty * bom.product_id.standard_price + price += bom.product_id.standard_price +# if no_child_bom: +# other_bom = bom_obj.browse(cr, uid, no_child_bom)[0] +# price += bom.product_qty * self._calc_price(cr, uid, other_bom) +# else: +# price += bom.product_qty * bom.product_id.standard_price + + if bom.routing_id: + for wline in bom.routing_id.workcenter_lines: + wc = wline.workcenter_id + cycle = wline.cycle_nbr + hour = (wc.time_start + wc.time_stop + cycle * wc.time_cycle) * (wc.time_efficiency or 1.0) + price += wc.costs_cycle * cycle + wc.costs_hour * hour + price = self.pool.get('product.uom')._compute_price(cr,uid,bom.product_uom.id,price,bom.product_id.uom_id.id) + if bom.bom_lines: + self.write(cr, uid, [bom.product_id.id], {'standard_price' : price/bom.product_qty}) + if bom.product_uom.id != bom.product_id.uom_id.id: + price = self.pool.get('product.uom')._compute_price(cr,uid,bom.product_uom.id,price,bom.product_id.uom_id.id) + return price +product_product() + +class product_bom(osv.osv): + _inherit = 'mrp.bom' + + _columns = { + 'standard_price': fields.related('product_id','standard_price',type="float",relation="product.product",string="Standard Price",store=False) + } + +product_bom() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/product_extended/product_extended_view.xml b/addons/product_extended/product_extended_view.xml new file mode 100644 index 00000000000..275e748c082 --- /dev/null +++ b/addons/product_extended/product_extended_view.xml @@ -0,0 +1,31 @@ + + + + + + product_extended.product.form.view + product.product + form + 3 + + + + +