-
-
+
diff --git a/addons/product_margin/product_margin.py b/addons/product_margin/product_margin.py
index 1bef9e54047..019e35b965c 100644
--- a/addons/product_margin/product_margin.py
+++ b/addons/product_margin/product_margin.py
@@ -26,9 +26,7 @@ import time
class product_product(osv.osv):
_inherit = "product.product"
-
-
- def _product_margin(self, cr, uid, ids, field_names, arg, context):
+ def _product_margin(self, cr, uid, ids, field_names, arg, context=None):
res = {}
for val in self.browse(cr, uid, ids,context=context):
res[val.id] = {}
@@ -81,7 +79,7 @@ class product_product(osv.osv):
res[val.id]['purchase_gap']=res[val.id]['normal_cost']-res[val.id]['total_cost']
if 'total_margin' in field_names:
- res[val.id]['total_margin']=val.turnover-val.total_cost
+ res[val.id]['total_margin']=val.turnover-val.standard_price
if 'expected_margin' in field_names:
res[val.id]['expected_margin']=val.sale_expected-val.normal_cost
if 'total_margin_rate' in field_names:
@@ -106,7 +104,7 @@ class product_product(osv.osv):
'total_cost' : fields.function(_product_margin, method=True, type='float', string='Total Cost', multi='purchase',help="Sum of Multification of Invoice price and quantity of Supplier Invoices "),
'sale_expected' : fields.function(_product_margin, method=True, type='float', string='Expected Sale', multi='sale',help="Sum of Multification of Sale Catalog price and quantity of Customer Invoices"),
'normal_cost' : fields.function(_product_margin, method=True, type='float', string='Normal Cost', multi='purchase',help="Sum of Multification of Cost price and quantity of Supplier Invoices"),
- 'total_margin' : fields.function(_product_margin, method=True, type='float', string='Total Margin', multi='total',help="Turnorder - Total Cost"),
+ 'total_margin' : fields.function(_product_margin, method=True, type='float', string='Total Margin', multi='total',help="Turnorder - Standard price"),
'expected_margin' : fields.function(_product_margin, method=True, type='float', string='Expected Margin', multi='total',help="Expected Sale - Normal Cost"),
'total_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Total Margin (%)', multi='margin',help="Total margin * 100 / Turnover"),
'expected_margin_rate' : fields.function(_product_margin, method=True, type='float', string='Expected Margin (%)', multi='margin',help="Expected margin * 100 / Expected Sale"),
diff --git a/addons/product_margin/product_margin_view.xml b/addons/product_margin/product_margin_view.xml
index eaf64179015..145ea83858c 100644
--- a/addons/product_margin/product_margin_view.xml
+++ b/addons/product_margin/product_margin_view.xml
@@ -55,7 +55,6 @@
-
@@ -85,5 +84,7 @@
+
+
diff --git a/addons/product_margin/wizard/product_margin.py b/addons/product_margin/wizard/product_margin.py
index 1907c6695c2..a717e54dcdb 100644
--- a/addons/product_margin/wizard/product_margin.py
+++ b/addons/product_margin/wizard/product_margin.py
@@ -26,13 +26,24 @@ import netsvc
import time
from tools.translate import _
class product_margin(osv.osv_memory):
- '''
- Product Margin
- '''
+
_name = 'product.margin'
_description = 'Product Margin'
-
- def action_open_window(self, cr, uid, ids, context):
+ _columns = {
+ 'from_date': fields.date('From'),
+ 'to_date': fields.date('To'),
+ 'invoice_state':fields.selection([
+ ('paid','Paid'),
+ ('open_paid','Open and Paid'),
+ ('draft_open_paid','Draft, Open and Paid'),
+ ],'Invoice State', select=True, required=True),
+ }
+ _defaults = {
+ 'from_date': lambda *a:time.strftime('%Y-01-01'),
+ 'to_date':lambda *a:time.strftime('%Y-12-31'),
+ 'invoice_state': lambda *a:"open_paid",
+ }
+ def action_open_window(self, cr, uid, ids, context=None):
"""
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@@ -65,32 +76,4 @@ class product_margin(osv.osv_memory):
'search_view_id': id['res_id']
}
- def action_cancel(self, cr, uid, ids, context=None):
- """
-
-
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: the ID or list of IDs if we want more than one
-
- @return:
- """
- return {'type':'ir.actions.act_window_close'}
-
- _columns = {
- #TODO : import time required to get currect date
- 'from_date': fields.date('From'),
- #TODO : import time required to get currect date
- 'to_date': fields.date('To'),
- 'invoice_state':fields.selection([
- ('paid','Paid'),
- ('open_paid','Open and Paid'),
- ('draft_open_paid','Draft, Open and Paid'),
- ],'Invoice State', select=True, required=True),
- }
- _defaults = {
- 'from_date': lambda *a:time.strftime('%Y-01-01'),
- 'to_date': lambda *a:time.strftime('%Y-01-01'),
- 'invoice_state': lambda *a:"open_paid",
- }
product_margin()
diff --git a/addons/product_margin/wizard/product_margin_view.xml b/addons/product_margin/wizard/product_margin_view.xml
index 66869e120a5..404022e21fd 100644
--- a/addons/product_margin/wizard/product_margin_view.xml
+++ b/addons/product_margin/wizard/product_margin_view.xml
@@ -11,23 +11,22 @@
+
-
-
+
+
-
-
-
+
\ No newline at end of file
diff --git a/addons/product_visible_discount/__init__.py b/addons/product_visible_discount/__init__.py
new file mode 100644
index 00000000000..425f2bec537
--- /dev/null
+++ b/addons/product_visible_discount/__init__.py
@@ -0,0 +1,22 @@
+##############################################################################
+#
+# 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
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/product_visible_discount/__openerp__.py b/addons/product_visible_discount/__openerp__.py
new file mode 100644
index 00000000000..ae977e633ff
--- /dev/null
+++ b/addons/product_visible_discount/__openerp__.py
@@ -0,0 +1,40 @@
+##############################################################################
+#
+# 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 .
+#
+##############################################################################
+{
+ "name": "Visible Discount",
+ "version": "1.0",
+ "author": "Tiny",
+ "category": "Generic Modules/Sales & Purchases",
+ "description": """
+ This module lets you calculate discounts on Sale Order lines and Invoice lines base on the partner's pricelist.
+ To this end, a new check box named "Visible Discount" is added to the pricelist form.
+ Example:
+ For the product PC1 and the partner "Asustek": if listprice=450, and the price calculated using Asustek's pricelist is 225
+ If the check box is checked, we will have on the sale order line: Unit price=450, Discount=50,00, Net price=225
+ If the check box is unchecked, we will have on Sale Order and Invoice lines: Unit price=225, Discount=0,00, Net price=225
+ """,
+ "depends": ["sale"],
+ "demo_xml": [],
+ "update_xml": ['product_view.xml'],
+ "active": False,
+ "installable": True,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/product_visible_discount/i18n/ca.po b/addons/product_visible_discount/i18n/ca.po
new file mode 100644
index 00000000000..abf326c2f2c
--- /dev/null
+++ b/addons/product_visible_discount/i18n/ca.po
@@ -0,0 +1,47 @@
+# Catalan translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2009-03-25 12:11+0000\n"
+"PO-Revision-Date: 2010-01-04 05:40+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Catalan \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-21 03:45+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: product_visible_discount
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML no vàlid per a la definició de la vista!"
+
+#. module: product_visible_discount
+#: model:ir.module.module,description:product_visible_discount.module_name_translation
+msgid ""
+"\n"
+" This module lets you calculate discounts on Sale Order lines and Invoice "
+"lines base on the partner's pricelist.\n"
+" To this end, a new check box named \"Visible Discount\" is added to the "
+"pricelist form.\n"
+" Example:\n"
+" For the product PC1 and the partner \"Asustek\": if listprice=450, "
+"and the price calculated using Asustek's pricelist is 225\n"
+" If the check box is checked, we will have on the sale order line: "
+"Unit price=450, Discount=50,00, Net price=225\n"
+" If the check box is unchecked, we will have on Sale Order and "
+"Invoice lines: Unit price=225, Discount=0,00, Net price=225\n"
+" "
+msgstr ""
+
+#. module: product_visible_discount
+#: model:ir.module.module,shortdesc:product_visible_discount.module_name_translation
+#: field:product.pricelist,visible_discount:0
+msgid "Visible Discount"
+msgstr "Descompte visible"
diff --git a/addons/product_visible_discount/i18n/es.po b/addons/product_visible_discount/i18n/es.po
new file mode 100644
index 00000000000..8e4ddbabdaf
--- /dev/null
+++ b/addons/product_visible_discount/i18n/es.po
@@ -0,0 +1,62 @@
+# Spanish translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2009-03-25 12:11+0000\n"
+"PO-Revision-Date: 2010-01-10 09:18+0000\n"
+"Last-Translator: AlbertoGago \n"
+"Language-Team: Spanish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-21 03:45+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: product_visible_discount
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "¡XML no válido para la definición de la vista!"
+
+#. module: product_visible_discount
+#: model:ir.module.module,description:product_visible_discount.module_name_translation
+msgid ""
+"\n"
+" This module lets you calculate discounts on Sale Order lines and Invoice "
+"lines base on the partner's pricelist.\n"
+" To this end, a new check box named \"Visible Discount\" is added to the "
+"pricelist form.\n"
+" Example:\n"
+" For the product PC1 and the partner \"Asustek\": if listprice=450, "
+"and the price calculated using Asustek's pricelist is 225\n"
+" If the check box is checked, we will have on the sale order line: "
+"Unit price=450, Discount=50,00, Net price=225\n"
+" If the check box is unchecked, we will have on Sale Order and "
+"Invoice lines: Unit price=225, Discount=0,00, Net price=225\n"
+" "
+msgstr ""
+"\n"
+" Este módulo permite calcular descuentos en las líneas del Pedido de "
+"Ventas y en las de la Factura basados en la lista de precios del proveedor.\n"
+" Para esto, una nueva casilla de selección llamada \"Descuento visible\" "
+"se añade al formulario de la lista de precios.\n"
+" Ejemplo:\n"
+" Para el producto PC1 y el proveedor \"Asustek\": si el precio de "
+"lista es 450 y el precio calculado con la lista de precios de Asustek es "
+"225\n"
+" Si la casilla de selección está activada, en la línea del pedido "
+"aparecerá: precio unicario=450, Descuento=50,00, Precio neto=225\n"
+" Si la casilla de selección está desactivada, en la línea del pedido "
+"y en la factura aparecerá: Precio unitario=225, Descuento=0,00, Precio "
+"neto=225\n"
+" "
+
+#. module: product_visible_discount
+#: model:ir.module.module,shortdesc:product_visible_discount.module_name_translation
+#: field:product.pricelist,visible_discount:0
+msgid "Visible Discount"
+msgstr "Descuento visible"
diff --git a/addons/product_visible_discount/i18n/fr.po b/addons/product_visible_discount/i18n/fr.po
new file mode 100644
index 00000000000..405d8fa00d2
--- /dev/null
+++ b/addons/product_visible_discount/i18n/fr.po
@@ -0,0 +1,62 @@
+# translation of fr_FR.po to Français
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * product_visible_discount
+#
+# Numerigraphe , 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: fr_FR\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-03-25 12:11+0000\n"
+"PO-Revision-Date: 2010-01-19 06:12+0000\n"
+"Last-Translator: Numérigraphe \n"
+"Language-Team: Français\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-21 03:45+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: product_visible_discount
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML non valide pour l'architecture de la vue"
+
+#. module: product_visible_discount
+#: model:ir.module.module,description:product_visible_discount.module_name_translation
+msgid ""
+"\n"
+" This module lets you calculate discounts on Sale Order lines and Invoice "
+"lines base on the partner's pricelist.\n"
+" To this end, a new check box named \"Visible Discount\" is added to the "
+"pricelist form.\n"
+" Example:\n"
+" For the product PC1 and the partner \"Asustek\": if listprice=450, "
+"and the price calculated using Asustek's pricelist is 225\n"
+" If the check box is checked, we will have on the sale order line: "
+"Unit price=450, Discount=50,00, Net price=225\n"
+" If the check box is unchecked, we will have on Sale Order and "
+"Invoice lines: Unit price=225, Discount=0,00, Net price=225\n"
+" "
+msgstr ""
+"\n"
+" Ce module vous permet de calculer les remises sur les lignes de Commande "
+" et de Facture en se basant sur la liste de prix du partenaire.\n"
+" Pour cela, une nouvelle case à cocher \"Remise visible\" est ajoutée au "
+"formulaire \"Liste de prix\".\n"
+" Par exemple :\n"
+" Pour le produit PC1 et le partenaire \"Asustek\" : si le prix "
+"public=450, et le prix prix calculé en utilisant la liste de prix d'Asustek "
+"est 225\n"
+" Si la case est cochée, on aura sur la ligne de commande : Prix "
+"unitaire=450, Remise=50,00, Prix net=225\n"
+" Si la case N'EST PAS est cochée, on aura sur la ligne de commande : "
+"Prix unitaire=225, Remise=0,00, Prix net=225\n"
+" "
+
+#. module: product_visible_discount
+#: model:ir.module.module,shortdesc:product_visible_discount.module_name_translation
+#: field:product.pricelist,visible_discount:0
+msgid "Visible Discount"
+msgstr "Remise visible"
diff --git a/addons/product_visible_discount/i18n/fr_BE.po b/addons/product_visible_discount/i18n/fr_BE.po
new file mode 100644
index 00000000000..983dd588c65
--- /dev/null
+++ b/addons/product_visible_discount/i18n/fr_BE.po
@@ -0,0 +1,52 @@
+# translation of fr_FR.po to Français
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * product_visible_discount
+#
+# Numerigraphe , 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: fr_FR\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-03-25 12:11:15+0000\n"
+"PO-Revision-Date: 2009-03-25 13:17+0100\n"
+"Last-Translator: Numerigraphe \n"
+"Language-Team: Français\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. module: product_visible_discount
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML non valide pour l'architecture de la vue"
+
+#. module: product_visible_discount
+#: model:ir.module.module,description:product_visible_discount.module_name_translation
+msgid ""
+"\n"
+" This module lets you calculate discounts on Sale Order lines and Invoice lines base on the partner's pricelist.\n"
+" To this end, a new check box named \"Visible Discount\" is added to the pricelist form.\n"
+" Example:\n"
+" For the product PC1 and the partner \"Asustek\": if listprice=450, and the price calculated using Asustek's pricelist is 225\n"
+" If the check box is checked, we will have on the sale order line: Unit price=450, Discount=50,00, Net price=225\n"
+" If the check box is unchecked, we will have on Sale Order and Invoice lines: Unit price=225, Discount=0,00, Net price=225\n"
+" "
+msgstr ""
+"\n"
+" Ce module vous permet de calculer les remises sur les lignes de Commande et de Facture en se basant sur la liste de prix du partenaire.\n"
+" Pour cela, une nouvelle case à cocher \"Remise visible\" est ajoutée au formulaire \"Liste de prix\".\n"
+" Par exemple :\n"
+" Pour le produit PC1 et le partenaire \"Asustek\" : si le prix public=450, et le prix prix calculé en utilisant la liste de prix d'Asustek est 225\n"
+" Si la case est cochée, on aura sur la ligne de commande : Prix unitaire=450, Remise=50,00, Prix net=225\n"
+" Si la case N'EST PAS est cochée, on aura sur la ligne de commande : Prix unitaire=225, Remise=0,00, Prix net=225\n"
+" "
+
+#. module: product_visible_discount
+#: model:ir.module.module,shortdesc:product_visible_discount.module_name_translation
+#: field:product.pricelist,visible_discount:0
+msgid "Visible Discount"
+msgstr "Remise visible"
+
diff --git a/addons/product_visible_discount/i18n/fr_FR.po b/addons/product_visible_discount/i18n/fr_FR.po
new file mode 100644
index 00000000000..983dd588c65
--- /dev/null
+++ b/addons/product_visible_discount/i18n/fr_FR.po
@@ -0,0 +1,52 @@
+# translation of fr_FR.po to Français
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * product_visible_discount
+#
+# Numerigraphe , 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: fr_FR\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-03-25 12:11:15+0000\n"
+"PO-Revision-Date: 2009-03-25 13:17+0100\n"
+"Last-Translator: Numerigraphe \n"
+"Language-Team: Français\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. module: product_visible_discount
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML non valide pour l'architecture de la vue"
+
+#. module: product_visible_discount
+#: model:ir.module.module,description:product_visible_discount.module_name_translation
+msgid ""
+"\n"
+" This module lets you calculate discounts on Sale Order lines and Invoice lines base on the partner's pricelist.\n"
+" To this end, a new check box named \"Visible Discount\" is added to the pricelist form.\n"
+" Example:\n"
+" For the product PC1 and the partner \"Asustek\": if listprice=450, and the price calculated using Asustek's pricelist is 225\n"
+" If the check box is checked, we will have on the sale order line: Unit price=450, Discount=50,00, Net price=225\n"
+" If the check box is unchecked, we will have on Sale Order and Invoice lines: Unit price=225, Discount=0,00, Net price=225\n"
+" "
+msgstr ""
+"\n"
+" Ce module vous permet de calculer les remises sur les lignes de Commande et de Facture en se basant sur la liste de prix du partenaire.\n"
+" Pour cela, une nouvelle case à cocher \"Remise visible\" est ajoutée au formulaire \"Liste de prix\".\n"
+" Par exemple :\n"
+" Pour le produit PC1 et le partenaire \"Asustek\" : si le prix public=450, et le prix prix calculé en utilisant la liste de prix d'Asustek est 225\n"
+" Si la case est cochée, on aura sur la ligne de commande : Prix unitaire=450, Remise=50,00, Prix net=225\n"
+" Si la case N'EST PAS est cochée, on aura sur la ligne de commande : Prix unitaire=225, Remise=0,00, Prix net=225\n"
+" "
+
+#. module: product_visible_discount
+#: model:ir.module.module,shortdesc:product_visible_discount.module_name_translation
+#: field:product.pricelist,visible_discount:0
+msgid "Visible Discount"
+msgstr "Remise visible"
+
diff --git a/addons/product_visible_discount/i18n/product_visible_discount.pot b/addons/product_visible_discount/i18n/product_visible_discount.pot
new file mode 100644
index 00000000000..88d0312efdd
--- /dev/null
+++ b/addons/product_visible_discount/i18n/product_visible_discount.pot
@@ -0,0 +1,52 @@
+# translation of fr_FR.po to Français
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * product_visible_discount
+#
+# Numerigraphe , 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: fr_FR\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-03-25 12:11:15+0000\n"
+"PO-Revision-Date: 2009-03-25 13:17+0100\n"
+"Last-Translator: Numerigraphe \n"
+"Language-Team: Français\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: \n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. module: product_visible_discount
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: product_visible_discount
+#: model:ir.module.module,description:product_visible_discount.module_name_translation
+msgid ""
+"\n"
+" This module lets you calculate discounts on Sale Order lines and Invoice lines base on the partner's pricelist.\n"
+" To this end, a new check box named \"Visible Discount\" is added to the pricelist form.\n"
+" Example:\n"
+" For the product PC1 and the partner \"Asustek\": if listprice=450, and the price calculated using Asustek's pricelist is 225\n"
+" If the check box is checked, we will have on the sale order line: Unit price=450, Discount=50,00, Net price=225\n"
+" If the check box is unchecked, we will have on Sale Order and Invoice lines: Unit price=225, Discount=0,00, Net price=225\n"
+" "
+msgstr ""
+"\n"
+" Ce module vous permet de calculer les remises sur les lignes de Commande et de Facture en se basant sur la liste de prix du partenaire.\n"
+" Pour cela, une nouvelle case à cocher \"Remise visible\" est ajoutée au formulaire \"Liste de prix\".\n"
+" Par exemple :\n"
+" Pour le produit PC1 et le partenaire \"Asustek\" : si le prix public=450, et le prix prix calculé en utilisant la liste de prix d'Asustek est 225\n"
+" Si la case est cochée, on aura sur la ligne de commande : Prix unitaire=450, Remise=50,00, Prix net=225\n"
+" Si la case N'EST PAS est cochée, on aura sur la ligne de commande : Prix unitaire=225, Remise=0,00, Prix net=225\n"
+" "
+
+#. module: product_visible_discount
+#: model:ir.module.module,shortdesc:product_visible_discount.module_name_translation
+#: field:product.pricelist,visible_discount:0
+msgid "Visible Discount"
+msgstr ""
+
diff --git a/addons/product_visible_discount/product.py b/addons/product_visible_discount/product.py
new file mode 100644
index 00000000000..e81dac8668e
--- /dev/null
+++ b/addons/product_visible_discount/product.py
@@ -0,0 +1,149 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from osv import fields, osv
+import pooler
+from tools import config
+from osv.osv import except_osv
+from tools.translate import _
+
+class product_pricelist(osv.osv):
+ _name = 'product.pricelist'
+ _inherit = 'product.pricelist'
+
+ _columns ={
+ 'visible_discount':fields.boolean('Visible Discount'),
+ }
+ _defaults = {
+ 'visible_discount': True,
+ }
+
+product_pricelist()
+
+class sale_order_line(osv.osv):
+ _name = "sale.order.line"
+ _inherit = "sale.order.line"
+
+ def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
+ uom=False, qty_uos=0, uos=False, name='', partner_id=False,
+ lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False, flag=False):
+
+ res=super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty,
+ uom, qty_uos, uos, name, partner_id,
+ lang, update_tax,date_order,fiscal_position=fiscal_position,flag=flag)
+
+ context = {'lang': lang, 'partner_id': partner_id}
+ result=res['value']
+ pricelist_obj=self.pool.get('product.pricelist')
+ product_obj = self.pool.get('product.product')
+ product_uom_obj = self.pool.get('product.uom')
+ if product:
+ if result.get('price_unit',False):
+ price=result['price_unit']
+ else:
+ return res
+
+ product = product_obj.browse(cr, uid, product, context)
+# product_tmpl_id = product.product_tmpl_id.id
+# pricetype_id = pricelist_obj.browse(cr, uid, pricelist).version_id[0].items_id[0].base
+# field_name = 'list_price'
+# product_read = self.pool.get('product.template').read(cr, uid, product_tmpl_id, [field_name], context)
+# list_price = product_read[field_name]
+ list_price = pricelist_obj.price_get(cr, uid, [pricelist],
+ product.id, qty or 1.0, partner_id, {'uom': uom,'date': date_order })[pricelist]
+
+ pricelists=pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
+
+ old_uom = product.uos_id or product.uom_id
+ new_list_price = product_uom_obj._compute_price(cr,
+ uid, old_uom.id, list_price, uom)
+ if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price != 0):
+ discount=(new_list_price-price) / new_list_price * 100
+ result['price_unit'] = new_list_price
+ result['discount'] = discount
+ else:
+ result['discount'] = 0.0
+ return res
+
+sale_order_line()
+
+class account_invoice_line(osv.osv):
+ _name = "account.invoice.line"
+ _inherit = "account.invoice.line"
+
+ def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}):
+ res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context)
+
+ def get_real_price(res_dict, product_id, pricelist):
+ item_obj = self.pool.get('product.pricelist.item')
+ price_type_obj = self.pool.get('product.price.type')
+ product_obj = self.pool.get('product.product')
+ template_obj = self.pool.get('product.template')
+ field_name = 'list_price'
+
+ if res_dict.get('item_id',False) and res_dict['item_id'].get(pricelist,False):
+ item = res_dict['item_id'].get(pricelist,False)
+ item_base = item_obj.read(cr, uid, [item], ['base'])[0]['base']
+ if item_base > 0:
+ field_name = price_type_obj.browse(cr, uid, item_base).field
+
+ product_tmpl_id = product_obj.browse(cr, uid, product_id, context).product_tmpl_id.id
+
+ product_read = template_obj.read(cr, uid, product_tmpl_id, [field_name], context)
+ return product_read[field_name]
+
+ if product:
+ pricelist_obj = self.pool.get('product.pricelist')
+ partner_obj = self.pool.get('res.partner')
+ product = self.pool.get('product.product').browse(cr, uid, product, context=context)
+ result = res['value']
+ pricelist = False
+ real_price = 0.00
+ if type in ('in_invoice', 'in_refund'):
+ if not price_unit and partner_id:
+ pricelist =partner_obj.browse(cr, uid, partner_id).property_product_pricelist_purchase.id
+ if not pricelist:
+ raise osv.except_osv(_('No Purchase Pricelist Found !'),_("You must first define a pricelist for Supplier !"))
+ price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})[pricelist]
+ price_unit = price_unit_res[pricelist]
+ real_price = get_real_price(price_unit_res, product.id, pricelist)
+ else:
+ if partner_id:
+ pricelist = partner_obj.browse(cr, uid, partner_id).property_product_pricelist.id
+ if not pricelist:
+ raise osv.except_osv(_('No Sale Pricelist Found '),_("You must first define a pricelist for Customer !"))
+ price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})
+ price_unit = price_unit_res[pricelist]
+
+ real_price = get_real_price(price_unit_res, product.id, pricelist)
+ if pricelist:
+ pricelists=pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
+ if(len(pricelists)>0 and pricelists[0]['visible_discount'] and real_price != 0):
+ discount=(real_price-price_unit) / real_price * 100
+ result['price_unit'] = real_price
+ result['discount'] = discount
+ else:
+ result['discount']=0.0
+ return res
+
+account_invoice_line()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/product_visible_discount/product_view.xml b/addons/product_visible_discount/product_view.xml
new file mode 100644
index 00000000000..76f2d2e43ff
--- /dev/null
+++ b/addons/product_visible_discount/product_view.xml
@@ -0,0 +1,30 @@
+
+
+
+
+ #---------------------------------------------------------
+ # product price list
+ #---------------------------------------------------------
+
+ product.pricelist.tree
+ product.pricelist
+
+
+
+
+
+
+
+
+
+ product.pricelist.form
+ product.pricelist
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/project_mrp/__openerp__.py b/addons/project_mrp/__openerp__.py
index ee5a94208aa..a51a95c5d16 100644
--- a/addons/project_mrp/__openerp__.py
+++ b/addons/project_mrp/__openerp__.py
@@ -47,12 +47,13 @@ automatically created via sale orders.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['project', 'mrp_procurement', 'sale', 'mrp_jit'],
+ 'depends': ['project', 'procurement', 'sale', 'mrp_jit'],
'init_xml': [],
'update_xml': ['project_mrp_workflow.xml',
#'process/project_mrp_process.xml',
],
'demo_xml': [],
+ 'test': ['test/project_task_procurement.yml'],
'installable': True,
'active': False,
'certificate': '0031976495453',
diff --git a/addons/project_mrp/mrp.py b/addons/project_mrp/mrp.py
index 6287ca3ad30..98b05248a66 100644
--- a/addons/project_mrp/mrp.py
+++ b/addons/project_mrp/mrp.py
@@ -22,9 +22,9 @@
from osv import fields, osv, orm
import tools
-class mrp_procurement(osv.osv):
- _name = "mrp.procurement"
- _inherit = "mrp.procurement"
+class procurement_order(osv.osv):
+ _name = "procurement.order"
+ _inherit = "procurement.order"
def action_produce_assign_service(self, cr, uid, ids, context={}):
for procurement in self.browse(cr, uid, ids):
@@ -91,7 +91,7 @@ class mrp_procurement(osv.osv):
'project_id': project_id,
},context=context)
return task_id
-mrp_procurement()
+procurement_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_mrp/project_mrp.py b/addons/project_mrp/project_mrp.py
index 8029327022d..b606bbfe8fa 100644
--- a/addons/project_mrp/project_mrp.py
+++ b/addons/project_mrp/project_mrp.py
@@ -26,7 +26,7 @@ class project_task(osv.osv):
_name = "project.task"
_inherit = "project.task"
_columns = {
- 'procurement_id': fields.many2one('mrp.procurement', 'Procurement', ondelete='set null')
+ 'procurement_id': fields.many2one('procurement.order', 'Procurement', ondelete='set null')
}
def do_close(self, cr, uid, ids, *args):
@@ -35,7 +35,7 @@ class project_task(osv.osv):
for task in tasks:
if task.procurement_id:
wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'mrp.procurement', task.procurement_id.id, 'subflow.done', cr)
+ wf_service.trg_validate(uid, 'procurement.order', task.procurement_id.id, 'subflow.done', cr)
return res
def do_cancel(self, cr, uid, ids, *args):
@@ -44,7 +44,7 @@ class project_task(osv.osv):
for task in tasks:
if task.procurement_id:
wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'mrp.procurement', task.procurement_id.id, 'subflow.cancel', cr)
+ wf_service.trg_validate(uid, 'procurement.order', task.procurement_id.id, 'subflow.cancel', cr)
return True
project_task()
diff --git a/addons/project_mrp/project_mrp_workflow.xml b/addons/project_mrp/project_mrp_workflow.xml
index 43217d69f83..cd242e7f699 100644
--- a/addons/project_mrp/project_mrp_workflow.xml
+++ b/addons/project_mrp/project_mrp_workflow.xml
@@ -1,9 +1,9 @@
-
-
-
+
+
+ subflow.done
diff --git a/addons/project_mrp/security/ir.model.access.csv b/addons/project_mrp/security/ir.model.access.csv
index 407ab3716a0..7c6e2a7a30c 100644
--- a/addons/project_mrp/security/ir.model.access.csv
+++ b/addons/project_mrp/security/ir.model.access.csv
@@ -1,3 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_mrp_procurement_project_user","mrp.procurement project_user","model_mrp_procurement","project.group_project_user",1,1,1,1
-"access_mrp_procurement_project_manager","mrp.procurement project_manager","model_mrp_procurement","project.group_project_manager",1,1,1,1
+"access_procurement_project_user","procurement.order project_user","model_procurement_order","project.group_project_user",1,1,1,1
+"access_procurement_project_manager","procurement.order project_manager","model_procurement_order","project.group_project_manager",1,1,1,1
diff --git a/addons/project_mrp/test/project_task_procurement.yml b/addons/project_mrp/test/project_task_procurement.yml
new file mode 100644
index 00000000000..50bc74f82ae
--- /dev/null
+++ b/addons/project_mrp/test/project_task_procurement.yml
@@ -0,0 +1,75 @@
+-
+ In order to test project_mrp module with OpenERP I want to create sale orders
+ with product type 'service' so when procurement runs one task is created.
+-
+ I create record for a service type product.
+-
+ !record {model: product.product, id: product_product_partnerstraining0}:
+ categ_id: product.product_category_7
+ cost_method: standard
+ mes_type: fixed
+ name: Partners Training
+ procure_method: make_to_order
+ supply_method: produce
+ type: service
+ uom_id: product.uom_day
+ uom_po_id: product.uom_day
+ warranty: 0.0
+-
+ I create a sale order for product Partners Training which has type 'Service'.
+-
+ !record {model: sale.order, id: sale_order_so0}:
+ date_order: '2010-05-21'
+ invoice_quantity: order
+ name: SO006
+ order_policy: manual
+ partner_id: base.res_partner_asus
+ partner_invoice_id: base.res_partner_address_tang
+ partner_order_id: base.res_partner_address_tang
+ partner_shipping_id: base.res_partner_address_tang
+ order_line:
+ - state: draft
+ delay: 7.0
+ name: Partners Training
+ price_unit: 1.0
+ product_id: product_product_partnerstraining0
+ product_uom: product.uom_day
+ product_uom_qty: 5.0
+ th_weight: 0.0
+ type: make_to_order
+ picking_policy: direct
+ pricelist_id: product.list0
+ shop_id: sale.shop
+ user_id: base.user_demo
+-
+ I confirm this sale order.
+-
+ !workflow {model: sale.order, action: order_confirm, ref: sale_order_so0}
+-
+ I check the procurements.
+-
+ !python {model: procurement.order}: |
+ from tools.translate import _
+ orderline_obj = self.pool.get('sale.order.line')
+ line_ids = orderline_obj.search(cr, uid, [('order_id','=', ref('sale_order_so0'))])
+ orders = orderline_obj.browse(cr, uid, line_ids)
+ proc_ids = map(lambda x: x.procurement_id.id, orders)
+ assert proc_ids, _('No Procurements!')
+-
+ The scheduler runs.
+-
+ !function {model: procurement.order, name: run_scheduler}:
+ - model: procurement.order
+ search: "[('state','=','confirmed')]"
+-
+ Now I check the tasks.
+-
+ I see that one task is created for my sale order.
+-
+ !python {model: project.task}: |
+ from tools.translate import _
+ order_obj = self.pool.get('sale.order')
+ order = order_obj.browse(cr, uid, ref('sale_order_so0'))
+ task_id = self.search(cr, uid, [('project_id.name','=', order.name)])
+ assert task_id, _('No Task is created!')
+
\ No newline at end of file
diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py
index 56f9b46dbdf..f557997497b 100644
--- a/addons/purchase/__openerp__.py
+++ b/addons/purchase/__openerp__.py
@@ -35,7 +35,7 @@
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
- 'depends': ['base', 'account', 'stock', 'process', 'mrp_procurement'],
+ 'depends': ['base', 'account', 'stock', 'process', 'procurement'],
'init_xml': [],
'update_xml': [
diff --git a/addons/purchase/i18n/et.po b/addons/purchase/i18n/et.po
index 5123b27b446..072ed95902f 100644
--- a/addons/purchase/i18n/et.po
+++ b/addons/purchase/i18n/et.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.4\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-11-18 06:10+0000\n"
-"Last-Translator: Fabien (Open ERP) \n"
+"PO-Revision-Date: 2010-06-09 22:18+0000\n"
+"Last-Translator: lyyser \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: 2010-04-17 03:58+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase
@@ -606,7 +606,7 @@ msgstr "Kättetoimetamine ja arved"
#. module: purchase
#: field:purchase.order,date_order:0
msgid "Date"
-msgstr ""
+msgstr "Kuupäev"
#. module: purchase
#: help:purchase.order,origin:0
@@ -666,7 +666,7 @@ msgstr "Kui ostukorraldus on heaks kiidetud, loob see pakkimise nimekirja."
#. module: purchase
#: view:purchase.order.line:0
msgid "History"
-msgstr ""
+msgstr "Ajalugu"
#. module: purchase
#: field:purchase.order,state:0
@@ -893,4 +893,4 @@ msgstr "Peale ostukorralduse heaks kiitmist läheb see kliendiarveks"
#. module: purchase
#: view:purchase.order.line:0
msgid "Stock Moves"
-msgstr ""
+msgstr "Lao liikumised"
diff --git a/addons/purchase/i18n/pl.po b/addons/purchase/i18n/pl.po
index 09a529c020e..bc24632a606 100644
--- a/addons/purchase/i18n/pl.po
+++ b/addons/purchase/i18n/pl.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: purchase
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 2cfd4247bcf..08507f9dfac 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -698,8 +698,8 @@ class purchase_order_line(osv.osv):
return True
purchase_order_line()
-class mrp_procurement(osv.osv):
- _inherit = 'mrp.procurement'
+class procurement_order(osv.osv):
+ _inherit = 'procurement.order'
_columns = {
'purchase_id': fields.many2one('purchase.order', 'Latest Requisition'),
}
@@ -779,7 +779,7 @@ class mrp_procurement(osv.osv):
res[procurement.id] = purchase_id
self.write(cr, uid, [procurement.id], {'state': 'running', 'purchase_id': purchase_id})
return res
-mrp_procurement()
+procurement_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml
index 17fd47b7012..502c33bd5f9 100644
--- a/addons/purchase/purchase_view.xml
+++ b/addons/purchase/purchase_view.xml
@@ -21,8 +21,6 @@
parent="base.menu_purchase_root" sequence="4"/>
-
@@ -353,9 +351,9 @@
-->
- mrp.procurement.form.inherit
- mrp.procurement
-
+ procurement.order.form.inherit
+ procurement.order
+ form
diff --git a/addons/purchase/purchase_workflow.xml b/addons/purchase/purchase_workflow.xml
index d7684be1875..d14530e5f48 100644
--- a/addons/purchase/purchase_workflow.xml
+++ b/addons/purchase/purchase_workflow.xml
@@ -180,7 +180,7 @@
-
+ buysubflow
@@ -188,20 +188,20 @@
-
+ check_buy()
-
+ subflow.delivery_done
-
+ subflow.cancel
diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py
index 71f2638d628..ff3d4bdcee8 100644
--- a/addons/purchase/report/purchase_report.py
+++ b/addons/purchase/report/purchase_report.py
@@ -69,7 +69,7 @@ class purchase_report(osv.osv):
'quantity': fields.float('# of Products', readonly=True),
'price_total': fields.float('Total Price', readonly=True),
'price_average': fields.float('Average Price', readonly=True),
- 'nbr': fields.integer('# of Lines', readonly=True),
+ 'nbr': fields.integer('# of Ordered Lines', readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
@@ -106,7 +106,7 @@ class purchase_report(osv.osv):
extract(epoch from age(s.date_approve,s.date_order))/(24*60*60)::decimal(16,2) as delay,
extract(epoch from age(s.minimum_planned_date,s.date_order))/(24*60*60)::decimal(16,2) as delay_pass,
count(*) as nbr,
- sum(l.product_qty*l.price_unit) as price_total,
+ l.price_unit*l.product_qty*u.factor as price_total,
(sum(l.product_qty*l.price_unit)/sum(l.product_qty*u.factor))::decimal(16,2) as price_average
from purchase_order s
left join purchase_order_line l on (s.id=l.order_id)
@@ -118,7 +118,10 @@ class purchase_report(osv.osv):
s.shipped,
l.invoiced,
s.partner_id,
+ l.product_qty,
+ u.factor,
s.location_id,
+ l.price_unit,
s.date_approve,
s.minimum_planned_date,
date_trunc('day',s.minimum_planned_date),
diff --git a/addons/purchase/report/purchase_report_view.xml b/addons/purchase/report/purchase_report_view.xml
index 468f3892a13..db6cc6273de 100644
--- a/addons/purchase/report/purchase_report_view.xml
+++ b/addons/purchase/report/purchase_report_view.xml
@@ -26,7 +26,6 @@
-
@@ -35,9 +34,10 @@
+
-
+
diff --git a/addons/purchase/test/purchase_from_manual.yml b/addons/purchase/test/purchase_from_manual.yml
index e0b1a8b806c..e7a608b7557 100644
--- a/addons/purchase/test/purchase_from_manual.yml
+++ b/addons/purchase/test/purchase_from_manual.yml
@@ -1,5 +1,5 @@
-
- In order to test the purchase flow,I start by creating a new product 'iPod'
+ In order to test the purchase flow,I start by creating a new product 'iPod'
-
!record {model: product.product, id: product_product_ipod0}:
categ_id: 'product.product_category_3'
@@ -22,14 +22,14 @@
weight: 0.0
weight_net: 0.0
-
- In order to test the purchase flow,I create a new record where "invoice_method" is From Manual
+ In order to test the purchase flow,I create a new record where "invoice_method" is From Manual
-
- Creating an purchase.order record
+ I create purchase order for iPod.
-
!record {model: purchase.order, id: purchase_order_po1}:
company_id: base.main_company
date_order: '2010-05-11'
- invoice_method: order
+ invoice_method: manual
location_id: stock.stock_location_stock
name: PO00010
order_line:
@@ -44,26 +44,21 @@
partner_id: base.res_partner_4
pricelist_id: purchase.list0
-
- Initially purchase order is in the draft state
+ Initially purchase order is in the draft state
-
!assert {model: purchase.order, id: purchase_order_po1}:
- state == 'draft'
-
- Then an order is confirmed by clicking on the "Confirm Purchase Order" button
--
- !python {model: purchase.order}: |
- self.wkf_confirm_order(cr, uid, [ref("purchase_order_po1")])
--
- Performing a workflow action purchase_confirm on module purchase.order
+ I confirm the purchase order.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po1}
-
- I check that the order which was initially in the draft state has transit to confirm state.
+ I check that the order which was initially in the draft state has transit to confirm state.
-
!assert {model: purchase.order, id: purchase_order_po1}:
- state == 'confirmed'
-
- I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
+ I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -72,14 +67,14 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ])
assert search_ids, _('Purchase order line is not created!')
-
- To check that wizard "Create Invoices" gets opened
+ To check that wizard "Create Invoices" gets opened
-
- Creating a purchase.order.line_invoice record
+ I create purchase order line invoice entry.
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
{}
-
- Performing an osv_memory action makeInvoices on module purchase.order.line_invoice
+ I create invoice for products in the purchase order.
-
!python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order')
@@ -89,7 +84,7 @@
ids.append(line.id)
self.makeInvoices(cr, uid, [1], context={'active_ids': ids})
-
- I check that invoice gets created
+ I check that invoice gets created.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -98,7 +93,7 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ])
assert search_ids, _('Invoice is not created!')
-
- I check that a record gets created in the Pending Invoices
+ I check that a record gets created in the Pending Invoices.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -107,33 +102,28 @@
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
assert ids, _('Pending Invoice is not created!')
-
- Then an order is approved by clicking on the "Approved by Supplier" button
--
- !python {model: purchase.order}: |
- self.wkf_approve_order(cr, uid, [ref("purchase_order_po1")])
--
- Performing a workflow action purchase_approve on module purchase.order
+ Supplier approve the purchase order.
-
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po1}
-
- I check that the order which was initially in the confirmed state has transit to approved state.
+ I check that the order which was initially in the confirmed state has transit to approved state.
-
!assert {model: purchase.order, id: purchase_order_po1}:
- state == 'approved'
-
- I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved
+ I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po1"))
assert(pur_id.date_approve)
-
- I check that an entry gets created in the stock.picking
+ I check that an entry gets created in the stock pickings.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po1"))
assert(pur_id.picking_ids)
-
- I check that an entry gets created in the stock.move
+ I check that an entry gets created in the stock moves.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -145,4 +135,4 @@
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, _('No Incoming Product!')
-
- I check that Traceability moves are created
+ I check that Traceability moves are created.
diff --git a/addons/purchase/test/purchase_from_order.yml b/addons/purchase/test/purchase_from_order.yml
index 3e83fc7dfda..a13c687c4a5 100644
--- a/addons/purchase/test/purchase_from_order.yml
+++ b/addons/purchase/test/purchase_from_order.yml
@@ -1,5 +1,5 @@
-
- In order to test the purchase flow,I start by creating a new product 'iPod'
+ In order to test the purchase flow,I start by creating a new product 'iPod'
-
!record {model: product.product, id: product_product_ipod0}:
categ_id: 'product.product_category_3'
@@ -22,9 +22,9 @@
weight: 0.0
weight_net: 0.0
-
- In order to test the purchase flow,I create a new record where "invoice_method" is From Order
+ In order to test the purchase flow,I create a new record where "invoice_method" is From Order.
-
- Creating a purchase.order record
+ I create purchase order for iPod.
-
!record {model: purchase.order, id: purchase_order_po0}:
company_id: base.main_company
@@ -44,26 +44,21 @@
partner_id: base.res_partner_4
pricelist_id: purchase.list0
-
- Initially purchase order is in the draft state
+ Initially purchase order is in the draft state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'draft'
-
- Then an order is confirmed by clicking on the "Confirm Purchase Order" button
--
- !python {model: purchase.order}: |
- self.wkf_confirm_order(cr, uid, [ref("purchase_order_po0")])
--
- Performing a workflow action purchase_confirm on module purchase.order
+ I confirm the purchase order for iPod.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po0}
-
- I check that the order which was initially in the draft state has transit to confirm state.
+ I check that the order which was initially in the draft state has transit to confirm state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'confirmed'
-
- I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
+ I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -72,14 +67,14 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ])
assert search_ids, _('Purchase order line is not created!')
-
- To check that wizard "Create Invoices" gets called
+ To check that wizard "Create Invoices" gets called.
-
- Creating a purchase.order.line_invoice record
+ I create purchase order line invoice entry.
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
{}
-
- Performing an osv_memory action makeInvoices on module purchase.order.line_invoice
+ I create invoice for products in the purchase order.
-
!python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order')
@@ -89,7 +84,7 @@
ids.append(line.id)
self.makeInvoices(cr, uid, [1], context={'active_ids': ids})
-
- I check that invoice gets created
+ I check that invoice gets created.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -98,7 +93,7 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ])
assert search_ids, _('Invoice is not created!')
-
- I check that a record gets created in the Pending Invoices
+ I check that a record gets created in the Pending Invoices.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -107,33 +102,28 @@
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
assert ids, _('Pending Invoice is not created!')
-
- Then an order is approved by clicking on the "Approved by Supplier" button
--
- !python {model: purchase.order}: |
- self.wkf_approve_order(cr, uid, [ref("purchase_order_po0")])
--
- Performing a workflow action purchase_approve on module purchase.order
+ Supplier approve the purchase order.
-
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po0}
-
- I check that the order which was initially in the confirmed state has transit to approved state.
+ I check that the order which was initially in the confirmed state has transit to approved state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'approved'
-
- I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved
+ I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po0"))
assert(pur_id.date_approve)
-
- I check that an entry gets created in the stock.picking
+ I check that an entry gets created in the pickings.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po0"))
assert(pur_id.picking_ids)
-
- I check that an entry gets created in the stock.move
+ I check that an entry gets created in the stock moves.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -145,9 +135,9 @@
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, _('No Incoming Product!')
-
- I check that Traceability moves are created
+ I check that Traceability moves are created.
-
- I check that an invoice_id field of Delivery&Invoices gets bind with the value
+ I check that an invoice_id field of Delivery&Invoices gets bind with the value.
-
!python {model: purchase.order}: |
pur_id2=self.browse(cr, uid, ref("purchase_order_po0"))
diff --git a/addons/purchase/test/purchase_from_picking.yml b/addons/purchase/test/purchase_from_picking.yml
index f4e9628985d..6250772a872 100644
--- a/addons/purchase/test/purchase_from_picking.yml
+++ b/addons/purchase/test/purchase_from_picking.yml
@@ -1,5 +1,5 @@
-
- In order to test the purchase flow,I start by creating a new product 'iPod'
+ In order to test the purchase flow,I start by creating a new product 'iPod'
-
!record {model: product.product, id: product_product_ipod0}:
categ_id: 'product.product_category_3'
@@ -22,9 +22,9 @@
weight: 0.0
weight_net: 0.0
-
- In order to test the purchase flow,I create a new record where "invoice_method" is From Picking
+ In order to test the purchase flow,I create a new record where "invoice_method" is From Picking
-
- Creating an purchase.order record
+ I create purchase order for iPod.
-
!record {model: purchase.order, id: purchase_order_po2}:
company_id: base.main_company
@@ -44,17 +44,12 @@
partner_id: base.res_partner_4
pricelist_id: purchase.list0
-
- Initially purchase order is in the draft state
+ Initially purchase order is in the draft state.
-
!assert {model: purchase.order, id: purchase_order_po2}:
- state == 'draft'
-
- Then an order is confirmed by clicking on the "Confirm Purchase Order" button
--
- !python {model: purchase.order}: |
- self.wkf_confirm_order(cr, uid, [ref("purchase_order_po2")])
--
- Performing a workflow action purchase_confirm on module purchase.order
+ I confirm the purchase order for iPod.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po2}
-
@@ -63,7 +58,7 @@
!assert {model: purchase.order, id: purchase_order_po2}:
- state == 'confirmed'
-
- I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
+ I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -72,14 +67,14 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ])
assert search_ids, _('Purchase order line is not created!')
-
- To check that wizard "Create Invoices" gets opened
+ To check that wizard "Create Invoices" gets opened.
-
- Creating a purchase.order.line_invoice record
+ I create purchase order line invoice entry.
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
{}
-
- Performing an osv_memory action makeInvoices on module purchase.order.line_invoice
+ I create invoice for products in the purchase order.
-
!python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order')
@@ -89,7 +84,7 @@
ids.append(line.id)
self.makeInvoices(cr, uid, [1], context={'active_ids': ids})
-
- I check that invoice gets created
+ I check that invoice gets created.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -98,7 +93,7 @@
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ])
assert search_ids, _('Invoice is not created!')
-
- I check that a record gets created in the Pending Invoices
+ I check that a record gets created in the Pending Invoices.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -107,12 +102,7 @@
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
assert ids, _('Pending Invoice is not created!')
-
- Then an order is approved by clicking on the "Approved by Supplier" button
--
- !python {model: purchase.order}: |
- self.wkf_approve_order(cr, uid, [ref("purchase_order_po2")])
--
- Performing a workflow action purchase_approve on module purchase.order
+ Supplier approve the purchase order.
-
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po2}
-
@@ -121,19 +111,19 @@
!assert {model: purchase.order, id: purchase_order_po2}:
- state == 'approved'
-
- I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved
+ I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po2"))
assert(pur_id.date_approve)
-
- I check that an entry gets created in the stock.picking
+ I check that an entry gets created in the stock.picking.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po2"))
assert(pur_id.picking_ids)
-
- I check that an entry gets created in the stock.move
+ I check that an entry gets created related to stock move.
-
!python {model: purchase.order}: |
from tools.translate import _
@@ -145,18 +135,18 @@
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, _('No Incoming Product!')
-
- I check that Traceability moves are created
+ I check that Traceability moves are created.
-
- Then I create an invoice from picking by clicking on "Create Invoice" wizard
+ Then I create an invoice from picking by clicking on "Create Invoice" wizard
-
- Creating a stock.invoice.onshipping record
+ I create stock invoice on shipping entry.
-
!record {model: stock.invoice.onshipping, id: stock_invoice_onshipping_0}:
invoice_date: '2010-05-11'
journal_id: account.bank_journal
type: in_invoice
-
- Performing an osv_memory action create_invoice on module stock.invoice.onshipping
+ I create Invoice.
-
!python {model: stock.invoice.onshipping}: |
pur_obj=self.pool.get('purchase.order')
@@ -167,7 +157,7 @@
"tz": False, "search_default_approved": 1, "active_model": "stock.picking",
"active_ids": ids, "active_id": ids[0], })
-
- I check that an invoice_id field of Delivery&Invoices gets bind with the value
+ I check that an invoice_id field of Delivery&Invoices gets bind with the value.
-
!python {model: purchase.order}: |
pur_id2=self.browse(cr, uid, ref("purchase_order_po2"))
diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py
index 85c35b277c5..5aaf3a995e2 100644
--- a/addons/purchase_requisition/purchase_requisition.py
+++ b/addons/purchase_requisition/purchase_requisition.py
@@ -136,11 +136,11 @@ class product_product(osv.osv):
product_product()
-class mrp_procurement(osv.osv):
- _inherit = 'mrp.procurement'
+class procurement_order(osv.osv):
+ _inherit = 'procurement.order'
def make_po(self, cr, uid, ids, context={}):
sequence_obj=self.pool.get('ir.sequence')
- res = super(mrp_procurement, self).make_po(cr, uid, ids, context)
+ res = super(procurement_order, self).make_po(cr, uid, ids, context)
for proc_id,po_id in res.items():
procurement = self.browse(cr, uid, proc_id)
if procurement.product_id.purchase_requisition:
@@ -157,4 +157,4 @@ class mrp_procurement(osv.osv):
'purchase_ids': [(6,0,[po_id])]
})
return res
-mrp_procurement()
+procurement_order()
diff --git a/addons/purchase_requisition/test/purchase_requisition.yml b/addons/purchase_requisition/test/purchase_requisition.yml
index 8983d238e0e..0ace2312034 100644
--- a/addons/purchase_requisition/test/purchase_requisition.yml
+++ b/addons/purchase_requisition/test/purchase_requisition.yml
@@ -59,8 +59,8 @@
-
I launch he scheduler to compute all procurements, and specify all requisitions orders.
-
- !python {model: mrp.procurement.compute.all}: |
- proc_obj = self.pool.get('mrp.procurement')
+ !python {model: procurement.order.compute.all}: |
+ proc_obj = self.pool.get('procurement.order')
proc_obj._procure_confirm(cr,uid)
-
On the purchase tender, I create a new purchase order for the supplier 'DistriPC' by clicking on
diff --git a/addons/purchase_requisition/test/purchase_requisition_exclusive.yml b/addons/purchase_requisition/test/purchase_requisition_exclusive.yml
index e2cba67fca9..641fd740de3 100644
--- a/addons/purchase_requisition/test/purchase_requisition_exclusive.yml
+++ b/addons/purchase_requisition/test/purchase_requisition_exclusive.yml
@@ -52,8 +52,8 @@
-
I launch he scheduler to compute all procurements, and planify all requisitions orders.
-
- !python {model: mrp.procurement.compute.all}: |
- proc_obj = self.pool.get('mrp.procurement')
+ !python {model: procurement.order.compute.all}: |
+ proc_obj = self.pool.get('procurement.order')
proc_obj._procure_confirm(cr,uid)
-
I should find a purchase requisition with the origin 'TEST/TENDER/0002', that includes a request for
diff --git a/addons/report_account/i18n/hr.po b/addons/report_account/i18n/hr.po
index 62dde41d6fc..cf3556f5c74 100644
--- a/addons/report_account/i18n/hr.po
+++ b/addons/report_account/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_analytic/i18n/hr.po b/addons/report_analytic/i18n/hr.po
index 0f1647f8d06..38a2e3a382a 100644
--- a/addons/report_analytic/i18n/hr.po
+++ b/addons/report_analytic/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_analytic_planning/i18n/hr.po b/addons/report_analytic_planning/i18n/hr.po
index 245730b21cd..e8c68bf5c95 100644
--- a/addons/report_analytic_planning/i18n/hr.po
+++ b/addons/report_analytic_planning/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_document/i18n/hr.po b/addons/report_document/i18n/hr.po
index ac73360d8b3..84ad5969b7f 100644
--- a/addons/report_document/i18n/hr.po
+++ b/addons/report_document/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:36+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_intrastat/i18n/hr.po b/addons/report_intrastat/i18n/hr.po
index c9ecd125a04..94f017514f4 100644
--- a/addons/report_intrastat/i18n/hr.po
+++ b/addons/report_intrastat/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_project/i18n/hr.po b/addons/report_project/i18n/hr.po
index a40056a4f50..3f4f33b86c3 100644
--- a/addons/report_project/i18n/hr.po
+++ b/addons/report_project/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_purchase/i18n/hr.po b/addons/report_purchase/i18n/hr.po
index 0dc383bac14..8d921c1f990 100644
--- a/addons/report_purchase/i18n/hr.po
+++ b/addons/report_purchase/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_sale/i18n/hr.po b/addons/report_sale/i18n/hr.po
index aa5adc5fe71..796a3eccf62 100644
--- a/addons/report_sale/i18n/hr.po
+++ b/addons/report_sale/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/report_task/i18n/es.po b/addons/report_task/i18n/es.po
index 6f70f225324..5e5b4fc41ad 100644
--- a/addons/report_task/i18n/es.po
+++ b/addons/report_task/i18n/es.po
@@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2010-06-04 12:29+0000\n"
+"PO-Revision-Date: 2010-06-09 09:31+0000\n"
"Last-Translator: Jonay \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: 2010-06-09 03:36+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: report_task
@@ -205,7 +205,7 @@ msgstr "Cancelado"
#. module: report_task
#: view:report.timesheet.task.user:0
msgid "Timesheet/Task hours Report Per Month"
-msgstr ""
+msgstr "Horario / Informe de horas de trabajo por mes"
#. module: report_task
#: field:report.task.user.pipeline.open,task_progress:0
@@ -250,7 +250,7 @@ msgstr "Fecha límite"
#. module: report_task
#: field:report.timesheet.task.user,timesheet_hrs:0
msgid "Timesheet Hours"
-msgstr ""
+msgstr "Horas del horario"
#. module: report_task
#: view:report.closed.task:0
@@ -265,4 +265,4 @@ msgstr "Abrir"
#. module: report_task
#: field:report.closed.task,planned_hours:0
msgid "Planned Hours"
-msgstr ""
+msgstr "Horas planeadas"
diff --git a/addons/sale/__init__.py b/addons/sale/__init__.py
index 71f33623c55..3ad30a6233e 100644
--- a/addons/sale/__init__.py
+++ b/addons/sale/__init__.py
@@ -26,7 +26,6 @@
import sale
import stock
import product
-#import mrp
import wizard
import report
import company
diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py
index 2a804db1707..9cac508b1b8 100644
--- a/addons/sale/__openerp__.py
+++ b/addons/sale/__openerp__.py
@@ -44,7 +44,7 @@
* Top 10 sales of the month
* Cases statistics
* Graph of sales by product
- * Graph of cases of the month
+ * Graph of cases of the month
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
@@ -72,6 +72,8 @@
'test/shipping_manual_sale_order.yml',
'test/prepaid_sale_order.yml',
'test/advance_invoice.yml',
+ 'test/so_make_line_invoice.yml',
+ 'test/so_make_invoice.yml',
'test/sale_procurement.yml',
],
'installable': True,
diff --git a/addons/sale/i18n/ca.po b/addons/sale/i18n/ca.po
index a39cac7c03f..ceaf026717a 100644
--- a/addons/sale/i18n/ca.po
+++ b/addons/sale/i18n/ca.po
@@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: sale
diff --git a/addons/sale/i18n/hr.po b/addons/sale/i18n/hr.po
index b947fd04fd9..a00233e6ac7 100644
--- a/addons/sale/i18n/hr.po
+++ b/addons/sale/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/sale/process/sale_process.xml b/addons/sale/process/sale_process.xml
index 58e4be14d84..1ebbc267de7 100644
--- a/addons/sale/process/sale_process.xml
+++ b/addons/sale/process/sale_process.xml
@@ -35,7 +35,7 @@
-
+
@@ -63,12 +63,12 @@
-
-
+
+
-
+
@@ -202,7 +202,7 @@
-
+
diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py
index 68f50068ec0..b47d59e5400 100644
--- a/addons/sale/report/sale_report.py
+++ b/addons/sale/report/sale_report.py
@@ -41,8 +41,12 @@ class sale_report(osv.osv):
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
+
+ 'uom_id': fields.many2one('product.uom', 'Default Unit Of Measure', readonly=True),
+ 'product_qty':fields.float('# of Qty', readonly=True),
'uom_name': fields.char('Default UoM', size=128, readonly=True),
'product_uom_qty':fields.float('# of Qty', readonly=True),
+
'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
'shop_id':fields.many2one('sale.shop', 'Shop', readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 07c66ef91dc..4dd70ac82e1 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -39,6 +39,7 @@ class sale_shop(osv.osv):
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse'),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist'),
'project_id': fields.many2one('account.analytic.account', 'Analytic Account'),
+ 'company_id': fields.many2one('res.company', 'Company'),
}
sale_shop()
@@ -112,7 +113,7 @@ class sale_order(osv.osv):
LEFT JOIN
stock_picking p on (p.id=m.picking_id)
LEFT JOIN
- mrp_procurement mp on (mp.move_id=m.id)
+ procurement_order mp on (mp.move_id=m.id)
WHERE
p.sale_id = ANY(%s) GROUP BY mp.state, p.sale_id''',(ids,))
for oid, nbr, mp_state in cr.fetchall():
@@ -277,7 +278,7 @@ class sale_order(osv.osv):
'invoice_quantity': fields.selection([('order', 'Ordered Quantities'), ('procurement', 'Shipped Quantities')], 'Invoice on', help="The sale order will automatically create the invoice proposition (draft invoice). Ordered and delivered quantities may not be the same. You have to choose if you invoice based on ordered or shipped quantities. If the product is a service, shipped quantities means hours spent on the associated tasks.", required=True),
'payment_term': fields.many2one('account.payment.term', 'Payment Term'),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
- 'company_id': fields.many2one('res.company','Company',select=1),
+ 'company_id': fields.related('shop_id','company_id',type='many2one',relation='res.company',string='Company',store=True)
}
_defaults = {
'company_id': lambda s,cr,uid,c: s.pool.get('res.company')._company_default_get(cr, uid, 'sale.order', context=c),
@@ -422,6 +423,7 @@ class sale_order(osv.osv):
if not journal_ids:
raise osv.except_osv(_('Error !'),
_('There is no sale journal defined for this company: "%s" (id:%d)') % (order.company_id.name, order.company_id.id))
+
inv = {
'name': order.client_order_ref or order.name,
'origin': order.name,
@@ -439,6 +441,7 @@ class sale_order(osv.osv):
'fiscal_position': order.fiscal_position.id or order.partner_id.property_account_position.id,
'date_invoice' : context.get('date_invoice',False),
'company_id' : order.company_id.id,
+ 'user_id':order.user_id and order.user_id.id or False
}
inv_obj = self.pool.get('account.invoice')
inv.update(self._inv_get(cr, uid, order))
@@ -658,7 +661,7 @@ class sale_order(osv.osv):
'note': line.notes,
'company_id': order.company_id.id,
})
- proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
+ proc_id = self.pool.get('procurement.order').create(cr, uid, {
'name': order.name,
'origin': order.name,
'date_planned': date_planned,
@@ -676,10 +679,10 @@ class sale_order(osv.osv):
'company_id': order.company_id.id,
})
wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
+ wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
elif line.product_id and line.product_id.product_tmpl_id.type == 'service':
- proc_id = self.pool.get('mrp.procurement').create(cr, uid, {
+ proc_id = self.pool.get('procurement.order').create(cr, uid, {
'name': line.name,
'origin': order.name,
'date_planned': date_planned,
@@ -693,7 +696,7 @@ class sale_order(osv.osv):
})
self.pool.get('sale.order.line').write(cr, uid, [line.id], {'procurement_id': proc_id})
wf_service = netsvc.LocalService("workflow")
- wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr)
+ wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
else:
#
# No procurement because no product in the sale.order.line.
@@ -807,7 +810,7 @@ class sale_order_line(osv.osv):
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True),
'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True),
'invoiced': fields.boolean('Invoiced', readonly=True),
- 'procurement_id': fields.many2one('mrp.procurement', 'Procurement'),
+ 'procurement_id': fields.many2one('procurement.order', 'Procurement'),
'price_unit': fields.float('Unit Price', required=True, digits_compute= dp.get_precision('Sale Price'), readonly=True, states={'draft':[('readonly',False)]}),
'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits_compute= dp.get_precision('Sale Price')),
'tax_id': fields.many2many('account.tax', 'sale_order_tax', 'order_line_id', 'tax_id', 'Taxes', readonly=True, states={'draft':[('readonly',False)]}),
@@ -856,7 +859,7 @@ class sale_order_line(osv.osv):
return line.product_uos_qty or 0.0
return line.product_uom_qty
else:
- return self.pool.get('mrp.procurement').quantity_get(cr, uid,
+ return self.pool.get('procurement.order').quantity_get(cr, uid,
line.procurement_id.id, context=context)
def _get_line_uom(line):
@@ -865,7 +868,7 @@ class sale_order_line(osv.osv):
return line.product_uos.id
return line.product_uom.id
else:
- return self.pool.get('mrp.procurement').uom_get(cr, uid,
+ return self.pool.get('procurement.order').uom_get(cr, uid,
line.procurement_id.id, context=context)
create_ids = []
diff --git a/addons/sale/sale_data.xml b/addons/sale/sale_data.xml
index 2be5a50ff81..6c8249131e8 100644
--- a/addons/sale/sale_data.xml
+++ b/addons/sale/sale_data.xml
@@ -16,6 +16,7 @@
+
diff --git a/addons/sale/sale_demo.xml b/addons/sale/sale_demo.xml
index d6ab6a7bc0c..0920cdeebb2 100644
--- a/addons/sale/sale_demo.xml
+++ b/addons/sale/sale_demo.xml
@@ -206,7 +206,7 @@
-
+
diff --git a/addons/sale/sale_unit_test.xml b/addons/sale/sale_unit_test.xml
index dc507edb4a0..95a23024412 100644
--- a/addons/sale/sale_unit_test.xml
+++ b/addons/sale/sale_unit_test.xml
@@ -112,7 +112,7 @@
-
+ done
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index c236b669580..6214613c47d 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -14,6 +14,7 @@
+
@@ -105,7 +106,7 @@
-
+
@@ -130,6 +131,7 @@
name="product_uom_qty"
on_change="product_id_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order, product_packaging, parent.fiscal_position, True)"
/>
+
-
@@ -367,6 +368,7 @@
+
diff --git a/addons/sale/sale_workflow.xml b/addons/sale/sale_workflow.xml
index 213605929ba..effe7cb6fff 100644
--- a/addons/sale/sale_workflow.xml
+++ b/addons/sale/sale_workflow.xml
@@ -218,7 +218,7 @@
- mrp.procurement
+ procurement.orderprocurement_lines_get()test_state('finished')
@@ -226,7 +226,7 @@
test_state('canceled')
diff --git a/addons/sale/security/ir.model.access.csv b/addons/sale/security/ir.model.access.csv
index 7af8c1e74a7..de0f55b80b1 100644
--- a/addons/sale/security/ir.model.access.csv
+++ b/addons/sale/security/ir.model.access.csv
@@ -11,7 +11,7 @@
"access_account_analytic_account_salesman","account_analytic_account salesman","analytic.model_account_analytic_account","group_sale_user",1,1,1,1
"access_stock_picking_salesman","stock_picking salesman","stock.model_stock_picking","group_sale_user",1,1,1,1
"access_stock_move_salesman","stock_move salesman","stock.model_stock_move","group_sale_user",1,1,1,0
-"access_mrp_procurement_salesman","mrp.procurement salesman","mrp_procurement.model_mrp_procurement","group_sale_user",1,1,1,1
+"access_procurement_salesman","procurement.order salesman","procurement.model_procurement_order","group_sale_user",1,1,1,1
"access_sale_order_stock_worker","sale.order stock worker","model_sale_order","stock.group_stock_user",1,1,0,0
"access_sale_order_line_stock_worker","sale.order.line stock worker","model_sale_order_line","stock.group_stock_user",1,1,0,0
"access_sale_order_manager","sale.order.manager","model_sale_order","group_sale_manager",1,1,1,1
diff --git a/addons/sale/test/sale_procurement.yml b/addons/sale/test/sale_procurement.yml
index c9d26baec9f..33ba22667ec 100644
--- a/addons/sale/test/sale_procurement.yml
+++ b/addons/sale/test/sale_procurement.yml
@@ -3,6 +3,8 @@
products with different supply method and procurement method.
-
I create two products.
+-
+ I create one product Table.
-
!record {model: product.product, id: product_product_table0}:
categ_id: product.cat1
@@ -12,6 +14,8 @@
type: product
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
+-
+ I create another product Wood.
-
!record {model: product.product, id: product_product_wood0}:
categ_id: product.cat1
@@ -68,21 +72,21 @@
-
I check that one procurement is generated.
-
- !python {model: mrp.procurement}: |
+ !python {model: procurement.order}: |
from tools.translate import _
proc_ids = self.search(cr, uid, [('state','=','confirmed')])
assert proc_ids, _('No Procurements!')
-
The scheduler runs.
-
- !function {model: mrp.procurement, name: run_scheduler}:
- - model: mrp.procurement
+ !function {model: procurement.order, name: run_scheduler}:
+ - model: procurement.order
search: "[('state','=','confirmed')]"
-
I check that the procurement for the product table is in exception state.
As my product's supply method is produce and mrp module is yet not installed.
-
- !python {model: mrp.procurement}: |
+ !python {model: procurement.order}: |
from tools.translate import _
proc_ids = self.search(cr, uid, [('state','=','exception')])
assert proc_ids, _('No Procurements are in exception state!')
diff --git a/addons/sale/test/shipping_manual_sale_order.yml b/addons/sale/test/shipping_manual_sale_order.yml
index 4bbbbb74dc5..c030a80c64a 100644
--- a/addons/sale/test/shipping_manual_sale_order.yml
+++ b/addons/sale/test/shipping_manual_sale_order.yml
@@ -211,7 +211,7 @@
!record {model: product.category, id: product_category_services0}:
name: Mobile Services
-
- I define LG Viewty Smart product template.
+ I define New Chocolate Slider Mobile template.
-
!record {model: product.template, id: product_template_newchocolateslidermobile0}:
categ_id: product_category_allproductssellable0
@@ -226,7 +226,7 @@
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
-
- I define LG Viewty Smart product.
+ I define New Chocolate Slider Mobile.
-
!record {model: product.product, id: product_product_newchocolateslidermobile0}:
categ_id: product_category_allproductssellable0
diff --git a/addons/sale/test/so_make_invoice.yml b/addons/sale/test/so_make_invoice.yml
new file mode 100644
index 00000000000..e34b11ffb2b
--- /dev/null
+++ b/addons/sale/test/so_make_invoice.yml
@@ -0,0 +1,341 @@
+-
+ In order to test the sale module in the Open-ERP, I need to configure details regarding product & customer.
+-
+ I am going to sell my Mobile products to the customer with name Cleartrail
+-
+ I create View Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_view0}:
+ close_method: none
+ code: View
+ name: View
+ sign: 1
+-
+ I create Income Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_income0}:
+ close_method: unreconciled
+ code: Income
+ name: Income
+ sign: 1
+-
+ I create Expense Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_expense0}:
+ close_method: unreconciled
+ code: Expense
+ name: Expense
+ sign: 1
+-
+ I create Cash Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_cash0}:
+ close_method: balance
+ code: Cash
+ name: Cash
+ sign: 1
+-
+ I create Minimal Chart Account.
+-
+ !record {model: account.account, id: account_account_minimalchart0}:
+ code: '0'
+ company_id: base.main_company
+ currency_mode: current
+ name: Minimal Chart
+ parent_left: 1
+ parent_right: 12
+ type: view
+ user_type: account_account_type_view0
+-
+ I create Payable Account.
+-
+ !record {model: account.account, id: account_account_payable1}:
+ code: AP
+ company_id: base.main_company
+ currency_mode: current
+ name: Payable
+ parent_id: account_account_minimalchart0
+ parent_left: 2
+ parent_right: 3
+ reconcile: true
+ type: payable
+ user_type: account_account_type_expense0
+-
+ I create Receivable Account.
+-
+ !record {model: account.account, id: account_account_receivable0}:
+ code: AR
+ company_id: base.main_company
+ currency_mode: current
+ name: Receivable
+ parent_id: account_account_minimalchart0
+ parent_left: 4
+ parent_right: 5
+ reconcile: true
+ type: receivable
+ user_type: account_account_type_income0
+-
+ I create Cash Account.
+-
+ !record {model: account.account, id: account_account_cash0}:
+ code: C
+ company_id: base.main_company
+ currency_mode: current
+ name: Cash
+ parent_id: account_account_minimalchart0
+ parent_left: 6
+ parent_right: 7
+ type: other
+ user_type: account_account_type_cash0
+-
+ I create Purchases Account.
+-
+ !record {model: account.account, id: account_account_purchases0}:
+ code: P
+ company_id: base.main_company
+ currency_mode: current
+ name: Purchases
+ parent_id: account_account_minimalchart0
+ parent_left: 8
+ parent_right: 9
+ type: other
+ user_type: account_account_type_expense0
+-
+ I create Sales Account.
+-
+ !record {model: account.account, id: account_account_sales0}:
+ code: S
+ company_id: base.main_company
+ currency_mode: current
+ name: Sales
+ parent_id: account_account_minimalchart0
+ parent_left: 10
+ parent_right: 11
+ type: other
+ user_type: account_account_type_income0
+-
+ I create Purchase Journal.
+-
+ !record {model: account.journal, id: account_journal_purchasejournal0}:
+ code: PUJ
+ company_id: base.main_company
+ default_credit_account_id: account_account_purchases0
+ default_debit_account_id: account_account_purchases0
+ name: Purchase Journal
+ sequence_id: account.sequence_purchase_journal
+ type: purchase
+ view_id: account.account_journal_view
+-
+ I create Sale Journal.
+-
+ !record {model: account.journal, id: account_journal_salejournal0}:
+ code: SAJ
+ company_id: base.main_company
+ default_credit_account_id: account_account_sales0
+ default_debit_account_id: account_account_sales0
+ name: Sale Journal
+ sequence_id: account.sequence_sale_journal
+ type: sale
+ view_id: account.account_journal_view
+-
+ I create Bank Journal.
+-
+ !record {model: account.journal, id: account_journal_bankjournal0}:
+ code: BNK
+ company_id: base.main_company
+ default_credit_account_id: account_account_cash0
+ default_debit_account_id: account_account_cash0
+ name: Bank Journal
+ sequence_id: account.sequence_journal
+ type: cash
+ view_id: account.account_journal_bank_view
+-
+ I create ir.property for account payable.
+-
+ !record {model: ir.property, id: ir_property_propertyaccountexpensecateg0}:
+ company_id: base.main_company
+ fields_id: account.field_res_partner_property_account_payable
+ name: property_account_expense_categ
+ value_reference: account.account,5
+-
+ I create ir.property for account receivable.
+-
+ !record {model: ir.property, id: ir_property_propertyaccountincomecateg0}:
+ company_id: base.main_company
+ fields_id: account.field_res_partner_property_account_receivable
+ name: property_account_income_categ
+ value_reference: account.account,6
+-
+ I create Partner category Customers.
+-
+ !record {model: res.partner.category, id: res_partner_category_customers0}:
+ name: Customers
+-
+ I create Cleartrail Customer.
+-
+ !record {model: res.partner, id: res_partner_cleartrail0}:
+ category_id:
+ - res_partner_category_customers0
+ name: Cleartrail
+-
+ I create contact address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_1}:
+ partner_id: res_partner_cleartrail0
+ street: onam plaza, 14 B palasia A B Road
+ type: contact
+-
+ I create invoice address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_2}:
+ partner_id: res_partner_cleartrail0
+ street: sarda house 24 B palasia, A B Road
+ type: invoice
+-
+ I create delivery address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_3}:
+ partner_id: res_partner_cleartrail0
+ street: sangam house 15 B palasia, A B Road
+ type: delivery
+-
+ Customer Cleartrail has specific instrument requirement regarding the stockable products.
+-
+ I define product category Mobile Products Sellable.
+-
+ !record {model: product.category, id: product_category_allproductssellable0}:
+ name: Mobile Products Sellable
+-
+ I define product category Mobile Services.
+-
+ !record {model: product.category, id: product_category_services0}:
+ name: Mobile Services
+-
+ I define LG Viewty Smart product template.
+-
+ !record {model: product.template, id: product_template_lgviewtysmart0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 170.0
+ mes_type: fixed
+ name: LG Viewty Smart
+ procure_method: make_to_order
+ standard_price: 160.0
+ supply_method: produce
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define LG Viewty Smart product.
+-
+ !record {model: product.product, id: product_product_lgviewtysmart0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 170.0
+ mes_type: fixed
+ name: LG Viewty Smart
+ pricelist_purchase: 'Default Purchase Pricelist (0.00) : 160.00\n'
+ pricelist_sale: 'Public Pricelist (0.00) : 170.00\n'
+ procure_method: make_to_order
+ property_account_expense: sale.account_account_payable1
+ property_account_income: sale.account_account_receivable0
+ seller_delay: '1'
+ standard_price: 160.0
+ supply_method: produce
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define New Chocolate Slider Mobile template.
+-
+ !record {model: product.template, id: product_template_newchocolateslidermobile0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 200.0
+ mes_type: fixed
+ name: New Chocolate Slider Mobile
+ procure_method: make_to_order
+ standard_price: 189.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define New Chocolate Slider Mobile.
+-
+ !record {model: product.product, id: product_product_newchocolateslidermobile0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 200.0
+ mes_type: fixed
+ name: New Chocolate Slider Mobile
+ pricelist_purchase: 'Default Purchase Pricelist (0.00) : 189.00\n'
+ pricelist_sale: 'Public Pricelist (0.00) : 200.00\n'
+ procure_method: make_to_order
+ property_account_expense: sale.account_account_payable1
+ property_account_income: sale.account_account_receivable0
+ seller_delay: '1'
+ standard_price: 189.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I create a Sale Order for LG Viewty Smart for qty 500 having order_policy manual.
+-
+ !record {model: sale.order, id: sale_order_so4}:
+ date_order: '2010-05-12'
+ invoice_quantity: order
+ name: Test_SO004
+ order_line:
+ - name: New Chocolate Slider Mobile
+ price_unit: 200.0
+ product_uom: product.product_uom_unit
+ product_uom_qty: 500.0
+ state: draft
+ delay: 7.0
+ product_id: sale.product_product_newchocolateslidermobile0
+ product_uos_qty: 500.0
+ type: make_to_order
+ - name: LG Viewty Smart
+ price_unit: 170.0
+ product_uom: product.product_uom_unit
+ product_uom_qty: 500.0
+ state: draft
+ delay: 7.0
+ product_id: sale.product_product_lgviewtysmart0
+ product_uos_qty: 500.0
+ th_weight: 0.0
+ type: make_to_order
+ order_policy: manual
+ partner_id: sale.res_partner_cleartrail0
+ partner_invoice_id: sale.res_partner_address_2
+ partner_order_id: sale.res_partner_address_1
+ partner_shipping_id: sale.res_partner_address_3
+ picking_policy: direct
+ pricelist_id: product.list0
+ shop_id: sale.shop
+-
+ I confirm the Sale Order.
+-
+ !workflow {model: sale.order, action: order_confirm, ref: sale_order_so4}
+-
+ I create an invoice on sale order.
+-
+ !record {model: sale.make.invoice, id: sale_make_invoice_1}:
+ {}
+-
+ Invoice is created for specific sale order.
+-
+ !python {model: sale.make.invoice}: |
+ self.make_invoices(cr, uid, [ref("sale_make_invoice_1")], {"lang": 'en_US', "search_default_user_id":
+ 1, "tz": False, "active_model": 'sale.order', "active_ids": [ref("sale_order_so4")], "active_id":
+ ref("sale_order_so4"), })
+-
+ I verify that invoice regarding sale order has been created.
+-
+ !python {model: sale.order}: |
+ so = self.browse(cr, uid, ref("sale_order_so4"))
+ assert so.invoice_ids, "Invoices has not been generated for sale_order_so0"
+
+
\ No newline at end of file
diff --git a/addons/sale/test/so_make_line_invoice.yml b/addons/sale/test/so_make_line_invoice.yml
new file mode 100644
index 00000000000..de5782c8517
--- /dev/null
+++ b/addons/sale/test/so_make_line_invoice.yml
@@ -0,0 +1,342 @@
+-
+ In order to test the sale module in the Open-ERP, I need to configure details regarding product & customer.
+-
+ I am going to sell my Mobile products to the customer with name Cleartrail
+-
+ I create View Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_view0}:
+ close_method: none
+ code: View
+ name: View
+ sign: 1
+-
+ I create Income Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_income0}:
+ close_method: unreconciled
+ code: Income
+ name: Income
+ sign: 1
+-
+ I create Expense Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_expense0}:
+ close_method: unreconciled
+ code: Expense
+ name: Expense
+ sign: 1
+-
+ I create Cash Account Type.
+-
+ !record {model: account.account.type, id: account_account_type_cash0}:
+ close_method: balance
+ code: Cash
+ name: Cash
+ sign: 1
+-
+ I create Minimal Chart Account.
+-
+ !record {model: account.account, id: account_account_minimalchart0}:
+ code: '0'
+ company_id: base.main_company
+ currency_mode: current
+ name: Minimal Chart
+ parent_left: 1
+ parent_right: 12
+ type: view
+ user_type: account_account_type_view0
+-
+ I create Payable Account.
+-
+ !record {model: account.account, id: account_account_payable1}:
+ code: AP
+ company_id: base.main_company
+ currency_mode: current
+ name: Payable
+ parent_id: account_account_minimalchart0
+ parent_left: 2
+ parent_right: 3
+ reconcile: true
+ type: payable
+ user_type: account_account_type_expense0
+-
+ I create Receivable Account.
+-
+ !record {model: account.account, id: account_account_receivable0}:
+ code: AR
+ company_id: base.main_company
+ currency_mode: current
+ name: Receivable
+ parent_id: account_account_minimalchart0
+ parent_left: 4
+ parent_right: 5
+ reconcile: true
+ type: receivable
+ user_type: account_account_type_income0
+-
+ I create Cash Account.
+-
+ !record {model: account.account, id: account_account_cash0}:
+ code: C
+ company_id: base.main_company
+ currency_mode: current
+ name: Cash
+ parent_id: account_account_minimalchart0
+ parent_left: 6
+ parent_right: 7
+ type: other
+ user_type: account_account_type_cash0
+-
+ I create Purchases Account.
+-
+ !record {model: account.account, id: account_account_purchases0}:
+ code: P
+ company_id: base.main_company
+ currency_mode: current
+ name: Purchases
+ parent_id: account_account_minimalchart0
+ parent_left: 8
+ parent_right: 9
+ type: other
+ user_type: account_account_type_expense0
+-
+ I create Sales Account.
+-
+ !record {model: account.account, id: account_account_sales0}:
+ code: S
+ company_id: base.main_company
+ currency_mode: current
+ name: Sales
+ parent_id: account_account_minimalchart0
+ parent_left: 10
+ parent_right: 11
+ type: other
+ user_type: account_account_type_income0
+-
+ I create Purchase Journal.
+-
+ !record {model: account.journal, id: account_journal_purchasejournal0}:
+ code: PUJ
+ company_id: base.main_company
+ default_credit_account_id: account_account_purchases0
+ default_debit_account_id: account_account_purchases0
+ name: Purchase Journal
+ sequence_id: account.sequence_purchase_journal
+ type: purchase
+ view_id: account.account_journal_view
+-
+ I create Sale Journal.
+-
+ !record {model: account.journal, id: account_journal_salejournal0}:
+ code: SAJ
+ company_id: base.main_company
+ default_credit_account_id: account_account_sales0
+ default_debit_account_id: account_account_sales0
+ name: Sale Journal
+ sequence_id: account.sequence_sale_journal
+ type: sale
+ view_id: account.account_journal_view
+-
+ I create Bank Journal.
+-
+ !record {model: account.journal, id: account_journal_bankjournal0}:
+ code: BNK
+ company_id: base.main_company
+ default_credit_account_id: account_account_cash0
+ default_debit_account_id: account_account_cash0
+ name: Bank Journal
+ sequence_id: account.sequence_journal
+ type: cash
+ view_id: account.account_journal_bank_view
+-
+ I create ir.property for account payable.
+-
+ !record {model: ir.property, id: ir_property_propertyaccountexpensecateg0}:
+ company_id: base.main_company
+ fields_id: account.field_res_partner_property_account_payable
+ name: property_account_expense_categ
+ value_reference: account.account,5
+-
+ I create ir.property for account receivable.
+-
+ !record {model: ir.property, id: ir_property_propertyaccountincomecateg0}:
+ company_id: base.main_company
+ fields_id: account.field_res_partner_property_account_receivable
+ name: property_account_income_categ
+ value_reference: account.account,6
+-
+ I create Partner category Customers.
+-
+ !record {model: res.partner.category, id: res_partner_category_customers0}:
+ name: Customers
+-
+ I create Cleartrail Customer.
+-
+ !record {model: res.partner, id: res_partner_cleartrail0}:
+ category_id:
+ - res_partner_category_customers0
+ name: Cleartrail
+-
+ I create contact address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_1}:
+ partner_id: res_partner_cleartrail0
+ street: onam plaza, 14 B palasia A B Road
+ type: contact
+-
+ I create invoice address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_2}:
+ partner_id: res_partner_cleartrail0
+ street: sarda house 24 B palasia, A B Road
+ type: invoice
+-
+ I create delivery address for Cleartrail.
+-
+ !record {model: res.partner.address, id: res_partner_address_3}:
+ partner_id: res_partner_cleartrail0
+ street: sangam house 15 B palasia, A B Road
+ type: delivery
+-
+ Customer Cleartrail has specific instrument requirement regarding the stockable products.
+-
+ I define product category Mobile Products Sellable.
+-
+ !record {model: product.category, id: product_category_allproductssellable0}:
+ name: Mobile Products Sellable
+-
+ I define product category Mobile Services.
+-
+ !record {model: product.category, id: product_category_services0}:
+ name: Mobile Services
+-
+ I define LG Viewty Smart product template.
+-
+ !record {model: product.template, id: product_template_lgviewtysmart0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 170.0
+ mes_type: fixed
+ name: LG Viewty Smart
+ procure_method: make_to_order
+ standard_price: 160.0
+ supply_method: produce
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define LG Viewty Smart product.
+-
+ !record {model: product.product, id: product_product_lgviewtysmart0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 170.0
+ mes_type: fixed
+ name: LG Viewty Smart
+ pricelist_purchase: 'Default Purchase Pricelist (0.00) : 160.00\n'
+ pricelist_sale: 'Public Pricelist (0.00) : 170.00\n'
+ procure_method: make_to_order
+ property_account_expense: sale.account_account_payable1
+ property_account_income: sale.account_account_receivable0
+ seller_delay: '1'
+ standard_price: 160.0
+ supply_method: produce
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define New Chocolate Slider Mobile template.
+-
+ !record {model: product.template, id: product_template_newchocolateslidermobile0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 200.0
+ mes_type: fixed
+ name: New Chocolate Slider Mobile
+ procure_method: make_to_order
+ standard_price: 189.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I define New Chocolate Slider Mobile.
+-
+ !record {model: product.product, id: product_product_newchocolateslidermobile0}:
+ categ_id: product_category_allproductssellable0
+ cost_method: standard
+ list_price: 200.0
+ mes_type: fixed
+ name: New Chocolate Slider Mobile
+ pricelist_purchase: 'Default Purchase Pricelist (0.00) : 189.00\n'
+ pricelist_sale: 'Public Pricelist (0.00) : 200.00\n'
+ procure_method: make_to_order
+ property_account_expense: sale.account_account_payable1
+ property_account_income: sale.account_account_receivable0
+ seller_delay: '1'
+ standard_price: 189.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+-
+ I create a Sale Order for LG Viewty Smart for qty 500 having order_policy manual.
+-
+ !record {model: sale.order, id: sale_order_so3}:
+ date_order: '2010-05-12'
+ invoice_quantity: order
+ name: Test_SO003
+ order_line:
+ - name: New Chocolate Slider Mobile
+ price_unit: 200.0
+ product_uom: product.product_uom_unit
+ product_uom_qty: 500.0
+ state: draft
+ delay: 7.0
+ product_id: sale.product_product_newchocolateslidermobile0
+ product_uos_qty: 500.0
+ type: make_to_order
+ - name: LG Viewty Smart
+ price_unit: 170.0
+ product_uom: product.product_uom_unit
+ product_uom_qty: 500.0
+ state: draft
+ delay: 7.0
+ product_id: sale.product_product_lgviewtysmart0
+ product_uos_qty: 500.0
+ th_weight: 0.0
+ type: make_to_order
+ order_policy: manual
+ partner_id: sale.res_partner_cleartrail0
+ partner_invoice_id: sale.res_partner_address_2
+ partner_order_id: sale.res_partner_address_1
+ partner_shipping_id: sale.res_partner_address_3
+ picking_policy: direct
+ pricelist_id: product.list0
+ shop_id: sale.shop
+-
+ I confirm the Sale Order.
+-
+ !workflow {model: sale.order, action: order_confirm, ref: sale_order_so3}
+-
+ I create an invoice on sale order line.
+-
+ !record {model: sale.order.line.make.invoice, id: sale_order_line_make_invoice_0}:
+ {}
+-
+ invoice is created for specific sale order line.
+-
+ !python {model: sale.order.line.make.invoice}: |
+ sale_order_obj = self.pool.get('sale.order')
+ so = sale_order_obj.browse(cr, uid, ref("sale_order_so3"))
+ sol = so.order_line[0]
+ self.make_invoices(cr, uid, [ref("sale_order_line_make_invoice_0")], {"lang":
+ 'en_US', "active_model": "sale.order.line", "active_ids": [ref(sol.id)], "tz":
+ False, "active_id": ref(sol.id), })
+-
+ I verify that invoice regarding sale order line has been created.
+-
+ !python {model: sale.order}: |
+ so = self.browse(cr, uid, ref("sale_order_so3"))
+ assert so.invoice_ids, "Invoices has not been generated for sale_order_so0"
diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py
index 2861a046205..34e996973d2 100644
--- a/addons/sale/wizard/sale_make_invoice_advance.py
+++ b/addons/sale/wizard/sale_make_invoice_advance.py
@@ -35,23 +35,23 @@ class sale_advance_payment_inv(osv.osv_memory):
'qtty' : lambda *a: 1
}
def create_invoices(self, cr, uid, ids, context={}):
- """
+ """
To create invoices.
-
+
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
- """
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
list_inv = []
obj_sale = self.pool.get('sale.order')
obj_lines = self.pool.get('account.invoice.line')
inv_obj = self.pool.get('account.invoice')
-
+
for sale_adv_obj in self.browse(cr, uid, ids):
for sale in obj_sale.browse(cr, uid, context['active_ids']):
address_contact = False
@@ -93,7 +93,7 @@ class sale_advance_payment_inv(osv.osv_memory):
'payment_term':sale.payment_term.id,
'fiscal_position': sale.fiscal_position.id or sale.partner_id.property_account_position.id
}
-
+
inv_id = inv_obj.create(cr, uid, inv)
for inv in sale.invoice_ids:
@@ -119,6 +119,8 @@ class sale_advance_payment_inv(osv.osv_memory):
'tax_id': [(6, 0, val['value']['invoice_line_tax_id'])],
}, context)
+ context.update({'invoice_id':list_inv})
+
return {#'invoice_ids':list_inv,
'name': 'Open Invoice',
'view_type': 'form',
@@ -126,7 +128,7 @@ class sale_advance_payment_inv(osv.osv_memory):
'res_model': 'sale.open.invoice',
'type': 'ir.actions.act_window',
'target': 'new',
- 'context': "{'invoice_ids'=%s}" % (list_inv)
+ 'context':context
}
sale_advance_payment_inv()
@@ -138,39 +140,49 @@ class sale_open_invoice(osv.osv_memory):
}
def open_invoice(self, cr, uid, ids, context):
- """
+
+ """
To open invoice.
-
+
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
- """
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+
+ @return:
+
+ """
+ record_id = context and context.get('active_id', False) or False
+
mod_obj = self.pool.get('ir.model.data')
+ obj_inv = self.pool.get('account.invoice')
invoices = []
- #TODO: Can not get invoice ids here
+ invoice = obj_inv.browse(cr, uid, record_id, context=context)
+
for advance_pay in self.browse(cr, uid, ids):
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
id = mod_obj.read(cr, uid, result, ['res_id'])
- model_data_ids = mod_obj.search(cr, uid,
- [('model', '=', 'ir.ui.view'), ('name', '=', 'invoice_form')])
- resource_id = mod_obj.read(cr, uid, model_data_ids,
- fields=['res_id'])[0]['res_id']
+ form_id = mod_obj._get_id(cr, uid, 'account', 'invoice_form')
+ form_res = mod_obj.browse(cr, uid, form_id, context=context).res_id
+ tree_id = mod_obj._get_id(cr, uid, 'account', 'invoice_tree')
+ tree_res = mod_obj.browse(cr, uid, tree_id, context=context).res_id
return {
# 'domain': "[('id','in', ["+','.join(map(str, invoices))+"])]", # TODO
'name': 'Invoices',
'view_type': 'form',
- 'view_mode': 'tree,form',
+ 'view_mode': 'form,tree',
'res_model': 'account.invoice',
- 'views': [(False, 'tree'), (resource_id, 'form')],
+ 'res_id': int(context['invoice_id'][0]),
+ 'view_id': False,
+ 'views': [(form_res, 'form'), (tree_res, 'tree')],
'context': "{'type':'out_invoice'}",
'type': 'ir.actions.act_window',
- 'search_view_id': id['res_id']
}
+
+
+
+
sale_open_invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_crm/i18n/hr.po b/addons/sale_crm/i18n/hr.po
index e20aa353017..b1614749563 100644
--- a/addons/sale_crm/i18n/hr.po
+++ b/addons/sale_crm/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:42+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/sale_journal/i18n/hr.po b/addons/sale_journal/i18n/hr.po
index 2e1aacbfce7..3fa941778b0 100644
--- a/addons/sale_journal/i18n/hr.po
+++ b/addons/sale_journal/i18n/hr.po
@@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-06-09 03:35+0000\n"
+"X-Launchpad-Export-Date: 2010-06-11 03:43+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
"Language: hr\n"
diff --git a/addons/sale_margin/__init__.py b/addons/sale_margin/__init__.py
new file mode 100644
index 00000000000..ff24fd198d9
--- /dev/null
+++ b/addons/sale_margin/__init__.py
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# 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 invoice_margin
+import report
+import sale_margin
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/sale_margin/__openerp__.py b/addons/sale_margin/__openerp__.py
new file mode 100644
index 00000000000..4b4c2f62b5c
--- /dev/null
+++ b/addons/sale_margin/__openerp__.py
@@ -0,0 +1,33 @@
+##############################################################################
+#
+# 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 .
+#
+##############################################################################
+
+{
+ "name":"Margins in Sale Orders",
+ "version":"1.0",
+ "author":"Tiny",
+ "category" : "Generic Modules/Sales & Purchases",
+ "depends":["sale"],
+ "demo_xml":[],
+ "update_xml":["security/ir.model.access.csv","sale_margin_view.xml","report/report_margin_view.xml"],
+ "active": False,
+ "installable": True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/sale_margin/i18n/ca.po b/addons/sale_margin/i18n/ca.po
new file mode 100644
index 00000000000..ee0d944fb1b
--- /dev/null
+++ b/addons/sale_margin/i18n/ca.po
@@ -0,0 +1,371 @@
+# Catalan translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2009-11-25 14:28+0000\n"
+"PO-Revision-Date: 2010-01-04 06:00+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: Catalan \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-21 03:45+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Customer Refund"
+msgstr "Factura d'abonament de client"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_product
+msgid "report.account.invoice.product"
+msgstr "informe.comptabilitat.factura.producte"
+
+#. module: sale_margin
+#: constraint:ir.model:0
+msgid ""
+"The Object name must start with x_ and not contain any special character !"
+msgstr ""
+"El nom de l'objecte ha de començar amb x_ i no contenir cap caràcter "
+"especial!"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_product
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_product
+msgid "Invoices by Product"
+msgstr "Factures per producte"
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Customer Invoice"
+msgstr "Factura de client"
+
+#. module: sale_margin
+#: wizard_view:stock.invoice_onshipping,init:0
+msgid "Create invoices"
+msgstr "Crea factures"
+
+#. module: sale_margin
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML invàlid per a la definició de la vista!"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_partner_product
+msgid "report.account.invoice.partner.product"
+msgstr "informe.comptabilitat.factura.empresa.producte"
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Supplier Invoice"
+msgstr "Factura de proveïdor"
+
+#. module: sale_margin
+#: field:report.account.invoice,state:0
+#: field:report.account.invoice.category,state:0
+#: field:report.account.invoice.partner,state:0
+#: field:report.account.invoice.partner.product,state:0
+#: field:report.account.invoice.product,state:0
+msgid "State"
+msgstr "Estat"
+
+#. module: sale_margin
+#: view:stock.picking:0
+msgid "Create Invoice"
+msgstr "Crea factura"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Draft"
+msgstr "Esborrany"
+
+#. module: sale_margin
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "Nom de model no vàlid en la definició de l'acció."
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_month_product
+msgid "All Months"
+msgstr "Tots els mesos"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_product_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_product_tree_all
+msgid "report.account.invoice.partner.product.tree"
+msgstr "informe.comptabilitat.factura.empresa.producte.arbre"
+
+#. module: sale_margin
+#: field:report.account.invoice,type:0
+#: field:report.account.invoice.category,type:0
+#: field:report.account.invoice.partner,type:0
+#: field:report.account.invoice.partner.product,type:0
+#: field:report.account.invoice.product,type:0
+#: wizard_field:stock.invoice_onshipping,init,type:0
+msgid "Type"
+msgstr "Tipus"
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,journal_id:0
+msgid "Destination Journal"
+msgstr "Diari de destí"
+
+#. module: sale_margin
+#: view:stock.picking:0
+msgid "Supplier Invoices"
+msgstr "Factures de proveïdor"
+
+#. module: sale_margin
+#: field:report.account.invoice.partner.product,product_id:0
+#: field:report.account.invoice.product,product_id:0
+msgid "Product"
+msgstr "Producte"
+
+#. module: sale_margin
+#: view:report.account.invoice.partner:0
+msgid "Invoices by partner"
+msgstr "Factures per empresa"
+
+#. module: sale_margin
+#: view:report.account.invoice.category:0
+msgid "Invoices by category"
+msgstr "Factures per categoria"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Paid"
+msgstr "Pagat"
+
+#. module: sale_margin
+#: model:ir.actions.wizard,name:sale_margin.wizard_picking_invoice_create
+#: wizard_button:stock.invoice_onshipping,init,create_invoice:0
+msgid "Create invoice"
+msgstr "Crea factura"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_category_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_category_tree_all
+msgid "report.account.invoice.category.tree"
+msgstr "informe.comptabilitat.factura.categoria.arbre"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_partner_product
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_partner_product
+msgid "Invoices by Partner and Product"
+msgstr "Factures per empresa i producte"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_category
+msgid "report.account.invoice.category"
+msgstr "informe.comptabilitat.factura.categoria"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_this_month_product
+msgid "This Month"
+msgstr "Aquest mes"
+
+#. module: sale_margin
+#: field:report.account.invoice.category,categ_id:0
+msgid "Categories"
+msgstr "Categories"
+
+#. module: sale_margin
+#: field:account.invoice.line,cost_price:0
+#: field:report.account.invoice,cost_price:0
+#: field:report.account.invoice.category,cost_price:0
+#: field:report.account.invoice.partner,cost_price:0
+#: field:report.account.invoice.partner.product,cost_price:0
+#: field:report.account.invoice.product,cost_price:0
+#: field:sale.order.line,purchase_price:0
+msgid "Cost Price"
+msgstr "Preu cost"
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,group:0
+msgid "Group by partner"
+msgstr "Agrupa per empresa"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_partner
+msgid "report.account.invoice.partner"
+msgstr "informe.comptabilitat.factura.empresa"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_partner
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_partner
+msgid "Invoices by Partner"
+msgstr "Factures per empresa"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_category
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_category
+msgid "Invoices by Category"
+msgstr "Factures per categoria"
+
+#. module: sale_margin
+#: view:report.account.invoice.partner.product:0
+msgid "Invoices by partner and product"
+msgstr "Factures per empresa i producte"
+
+#. module: sale_margin
+#: field:report.account.invoice,amount:0
+#: field:report.account.invoice.category,amount:0
+#: field:report.account.invoice.partner,amount:0
+#: field:report.account.invoice.partner.product,amount:0
+#: field:report.account.invoice.product,amount:0
+msgid "Amount"
+msgstr "Quantitat"
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,invoice_date:0
+msgid "Invoiced date"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Supplier Refund"
+msgstr "Factura d'abonament de proveïdor"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_tree_all
+msgid "report.account.invoice.partner.tree"
+msgstr "informe.comptabilitat.factura.empresa.arbre"
+
+#. module: sale_margin
+#: field:report.account.invoice,margin:0
+#: field:report.account.invoice.category,margin:0
+#: field:report.account.invoice.partner,margin:0
+#: field:report.account.invoice.partner.product,margin:0
+#: field:report.account.invoice.product,margin:0
+#: field:sale.order,margin:0
+#: field:sale.order.line,margin:0
+msgid "Margin"
+msgstr "Marge"
+
+#. module: sale_margin
+#: field:report.account.invoice,quantity:0
+#: field:report.account.invoice.category,quantity:0
+#: field:report.account.invoice.partner,quantity:0
+#: field:report.account.invoice.partner.product,quantity:0
+#: field:report.account.invoice.product,quantity:0
+msgid "Quantity"
+msgstr "Quantitat"
+
+#. module: sale_margin
+#: view:report.account.invoice.product:0
+msgid "Invoices by product"
+msgstr "Factures per producte"
+
+#. module: sale_margin
+#: model:ir.module.module,shortdesc:sale_margin.module_meta_information
+msgid "Margins in Sale Orders"
+msgstr "Marges en comandes de venda"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice
+msgid "report.account.invoice"
+msgstr "informe.comptabilitat.factura"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_invoices
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_invoices
+#: view:report.account.invoice:0
+#: view:stock.picking:0
+#: field:stock.picking,invoice_ids:0
+msgid "Invoices"
+msgstr "Factures"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Pro-forma"
+msgstr "Pro-forma"
+
+#. module: sale_margin
+#: field:report.account.invoice,name:0
+#: field:report.account.invoice.category,name:0
+#: field:report.account.invoice.partner,name:0
+#: field:report.account.invoice.partner.product,name:0
+#: field:report.account.invoice.product,name:0
+msgid "Month"
+msgstr "Mes"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Canceled"
+msgstr "Cancel·lada"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_product
+msgid "Invoice"
+msgstr "Factura"
+
+#. module: sale_margin
+#: wizard_button:stock.invoice_onshipping,init,end:0
+msgid "Cancel"
+msgstr "Cancel·la"
+
+#. module: sale_margin
+#: field:report.account.invoice.partner,partner_id:0
+#: field:report.account.invoice.partner.product,partner_id:0
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_tree_all
+msgid "report.account.invoice.tree"
+msgstr "informe.comptabilitat.factura.arbre"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Open"
+msgstr "Oberta"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_product_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_product_tree_all
+msgid "report.account.invoice.product.tree"
+msgstr "informe.comptabilitat.factura.producte.arbre"
diff --git a/addons/sale_margin/i18n/es.po b/addons/sale_margin/i18n/es.po
new file mode 100644
index 00000000000..8f81f6659b3
--- /dev/null
+++ b/addons/sale_margin/i18n/es.po
@@ -0,0 +1,371 @@
+# Spanish translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2009-11-25 14:28+0000\n"
+"PO-Revision-Date: 2010-04-08 08:04+0000\n"
+"Last-Translator: OpenERP Administrators \n"
+"Language-Team: Spanish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-21 03:45+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Customer Refund"
+msgstr "Factura de abono de cliente"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_product
+msgid "report.account.invoice.product"
+msgstr "informe.contabilidad.factura.producto"
+
+#. module: sale_margin
+#: constraint:ir.model:0
+msgid ""
+"The Object name must start with x_ and not contain any special character !"
+msgstr ""
+"¡El nombre del objeto debe empezar con x_ y no contener ningún carácter "
+"especial!"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_product
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_product
+msgid "Invoices by Product"
+msgstr "Facturas por producto"
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Customer Invoice"
+msgstr "Factura de cliente"
+
+#. module: sale_margin
+#: wizard_view:stock.invoice_onshipping,init:0
+msgid "Create invoices"
+msgstr "Crear facturas"
+
+#. module: sale_margin
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "¡XML inválido para la definición de la vista!"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_partner_product
+msgid "report.account.invoice.partner.product"
+msgstr "informe.contabilidad.factura.empresa.producto"
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Supplier Invoice"
+msgstr "Factura de proveedor"
+
+#. module: sale_margin
+#: field:report.account.invoice,state:0
+#: field:report.account.invoice.category,state:0
+#: field:report.account.invoice.partner,state:0
+#: field:report.account.invoice.partner.product,state:0
+#: field:report.account.invoice.product,state:0
+msgid "State"
+msgstr "Estado"
+
+#. module: sale_margin
+#: view:stock.picking:0
+msgid "Create Invoice"
+msgstr "Crear factura"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Draft"
+msgstr "Borrador"
+
+#. module: sale_margin
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr "Nombre de modelo no válido en la definición de la acción."
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_month_product
+msgid "All Months"
+msgstr "Todos los meses"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_product_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_product_tree_all
+msgid "report.account.invoice.partner.product.tree"
+msgstr "informe.contabilidad.factura.empresa.producto.árbol"
+
+#. module: sale_margin
+#: field:report.account.invoice,type:0
+#: field:report.account.invoice.category,type:0
+#: field:report.account.invoice.partner,type:0
+#: field:report.account.invoice.partner.product,type:0
+#: field:report.account.invoice.product,type:0
+#: wizard_field:stock.invoice_onshipping,init,type:0
+msgid "Type"
+msgstr "Tipo"
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,journal_id:0
+msgid "Destination Journal"
+msgstr "Diario de destino"
+
+#. module: sale_margin
+#: view:stock.picking:0
+msgid "Supplier Invoices"
+msgstr "Facturas de proveedor"
+
+#. module: sale_margin
+#: field:report.account.invoice.partner.product,product_id:0
+#: field:report.account.invoice.product,product_id:0
+msgid "Product"
+msgstr "Producto"
+
+#. module: sale_margin
+#: view:report.account.invoice.partner:0
+msgid "Invoices by partner"
+msgstr "Facturas por empresa"
+
+#. module: sale_margin
+#: view:report.account.invoice.category:0
+msgid "Invoices by category"
+msgstr "Facturas por categoría"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Paid"
+msgstr "Pagado"
+
+#. module: sale_margin
+#: model:ir.actions.wizard,name:sale_margin.wizard_picking_invoice_create
+#: wizard_button:stock.invoice_onshipping,init,create_invoice:0
+msgid "Create invoice"
+msgstr "Crear factura"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_category_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_category_tree_all
+msgid "report.account.invoice.category.tree"
+msgstr "informe.contabilidad.factura.categoría.árbol"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_partner_product
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_partner_product
+msgid "Invoices by Partner and Product"
+msgstr "Facturas por empresa y producto"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_category
+msgid "report.account.invoice.category"
+msgstr "informe.contabilidad.factura.categoría"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_this_month_product
+msgid "This Month"
+msgstr "Este Mes"
+
+#. module: sale_margin
+#: field:report.account.invoice.category,categ_id:0
+msgid "Categories"
+msgstr "Categorías"
+
+#. module: sale_margin
+#: field:account.invoice.line,cost_price:0
+#: field:report.account.invoice,cost_price:0
+#: field:report.account.invoice.category,cost_price:0
+#: field:report.account.invoice.partner,cost_price:0
+#: field:report.account.invoice.partner.product,cost_price:0
+#: field:report.account.invoice.product,cost_price:0
+#: field:sale.order.line,purchase_price:0
+msgid "Cost Price"
+msgstr "Precio coste"
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,group:0
+msgid "Group by partner"
+msgstr "Agrupar por empresa"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_partner
+msgid "report.account.invoice.partner"
+msgstr "informe.contabilidad.factura.empresa"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_partner
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_partner
+msgid "Invoices by Partner"
+msgstr "Facturas por empresa"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_category
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_category
+msgid "Invoices by Category"
+msgstr "Facturas por categoría"
+
+#. module: sale_margin
+#: view:report.account.invoice.partner.product:0
+msgid "Invoices by partner and product"
+msgstr "Facturas por empresa y producto"
+
+#. module: sale_margin
+#: field:report.account.invoice,amount:0
+#: field:report.account.invoice.category,amount:0
+#: field:report.account.invoice.partner,amount:0
+#: field:report.account.invoice.partner.product,amount:0
+#: field:report.account.invoice.product,amount:0
+msgid "Amount"
+msgstr "Importe"
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,invoice_date:0
+msgid "Invoiced date"
+msgstr "fecha facturada"
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Supplier Refund"
+msgstr "Factura de abono de proveedor"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_tree_all
+msgid "report.account.invoice.partner.tree"
+msgstr "informe.contabilidad.factura.empresa.árbol"
+
+#. module: sale_margin
+#: field:report.account.invoice,margin:0
+#: field:report.account.invoice.category,margin:0
+#: field:report.account.invoice.partner,margin:0
+#: field:report.account.invoice.partner.product,margin:0
+#: field:report.account.invoice.product,margin:0
+#: field:sale.order,margin:0
+#: field:sale.order.line,margin:0
+msgid "Margin"
+msgstr "Margen"
+
+#. module: sale_margin
+#: field:report.account.invoice,quantity:0
+#: field:report.account.invoice.category,quantity:0
+#: field:report.account.invoice.partner,quantity:0
+#: field:report.account.invoice.partner.product,quantity:0
+#: field:report.account.invoice.product,quantity:0
+msgid "Quantity"
+msgstr "Cantidad"
+
+#. module: sale_margin
+#: view:report.account.invoice.product:0
+msgid "Invoices by product"
+msgstr "Facturas por producto"
+
+#. module: sale_margin
+#: model:ir.module.module,shortdesc:sale_margin.module_meta_information
+msgid "Margins in Sale Orders"
+msgstr "Márgenes en pedidos de venta"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice
+msgid "report.account.invoice"
+msgstr "informe.contabilidad.factura"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_invoices
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_invoices
+#: view:report.account.invoice:0
+#: view:stock.picking:0
+#: field:stock.picking,invoice_ids:0
+msgid "Invoices"
+msgstr "Facturas"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Pro-forma"
+msgstr "Pro-forma"
+
+#. module: sale_margin
+#: field:report.account.invoice,name:0
+#: field:report.account.invoice.category,name:0
+#: field:report.account.invoice.partner,name:0
+#: field:report.account.invoice.partner.product,name:0
+#: field:report.account.invoice.product,name:0
+msgid "Month"
+msgstr "Mes"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Canceled"
+msgstr "Cancelada"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_product
+msgid "Invoice"
+msgstr "Factura"
+
+#. module: sale_margin
+#: wizard_button:stock.invoice_onshipping,init,end:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: sale_margin
+#: field:report.account.invoice.partner,partner_id:0
+#: field:report.account.invoice.partner.product,partner_id:0
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_tree_all
+msgid "report.account.invoice.tree"
+msgstr "informe.contabilidad.factura.árbol"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Open"
+msgstr "Abierta"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_product_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_product_tree_all
+msgid "report.account.invoice.product.tree"
+msgstr "informe.contabilidad.factura.producto.árbol"
diff --git a/addons/sale_margin/i18n/fr.po b/addons/sale_margin/i18n/fr.po
new file mode 100644
index 00000000000..84d26ac0dfd
--- /dev/null
+++ b/addons/sale_margin/i18n/fr.po
@@ -0,0 +1,371 @@
+# French translation for openobject-addons
+# Copyright (c) 2010 Rosetta Contributors and Canonical Ltd 2010
+# This file is distributed under the same license as the openobject-addons package.
+# FIRST AUTHOR , 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: openobject-addons\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2009-11-25 14:28+0000\n"
+"PO-Revision-Date: 2010-01-04 06:00+0000\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: French \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2010-05-21 03:45+0000\n"
+"X-Generator: Launchpad (build Unknown)\n"
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Customer Refund"
+msgstr "Note de Crédit Client"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_product
+msgid "report.account.invoice.product"
+msgstr ""
+
+#. module: sale_margin
+#: constraint:ir.model:0
+msgid ""
+"The Object name must start with x_ and not contain any special character !"
+msgstr ""
+"Le nom de l'objet doit commencer avec x_ et ne pas contenir de charactères "
+"spéciaux !"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_product
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_product
+msgid "Invoices by Product"
+msgstr "Factures par produit"
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Customer Invoice"
+msgstr "Facture client"
+
+#. module: sale_margin
+#: wizard_view:stock.invoice_onshipping,init:0
+msgid "Create invoices"
+msgstr "Créer les factures"
+
+#. module: sale_margin
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr "XML non valide pour l'architecture de la vue"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_partner_product
+msgid "report.account.invoice.partner.product"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Supplier Invoice"
+msgstr "Facture fournisseur"
+
+#. module: sale_margin
+#: field:report.account.invoice,state:0
+#: field:report.account.invoice.category,state:0
+#: field:report.account.invoice.partner,state:0
+#: field:report.account.invoice.partner.product,state:0
+#: field:report.account.invoice.product,state:0
+msgid "State"
+msgstr "État"
+
+#. module: sale_margin
+#: view:stock.picking:0
+msgid "Create Invoice"
+msgstr "Créer la facture"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Draft"
+msgstr "Brouillon"
+
+#. module: sale_margin
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_month_product
+msgid "All Months"
+msgstr "Tous les mois"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_product_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_product_tree_all
+msgid "report.account.invoice.partner.product.tree"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,type:0
+#: field:report.account.invoice.category,type:0
+#: field:report.account.invoice.partner,type:0
+#: field:report.account.invoice.partner.product,type:0
+#: field:report.account.invoice.product,type:0
+#: wizard_field:stock.invoice_onshipping,init,type:0
+msgid "Type"
+msgstr "Type"
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,journal_id:0
+msgid "Destination Journal"
+msgstr "Journal de Destination"
+
+#. module: sale_margin
+#: view:stock.picking:0
+msgid "Supplier Invoices"
+msgstr "Factures fournisseur"
+
+#. module: sale_margin
+#: field:report.account.invoice.partner.product,product_id:0
+#: field:report.account.invoice.product,product_id:0
+msgid "Product"
+msgstr "Produit"
+
+#. module: sale_margin
+#: view:report.account.invoice.partner:0
+msgid "Invoices by partner"
+msgstr "Factures par partenaire"
+
+#. module: sale_margin
+#: view:report.account.invoice.category:0
+msgid "Invoices by category"
+msgstr "Factures par catégorie"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Paid"
+msgstr "Payé"
+
+#. module: sale_margin
+#: model:ir.actions.wizard,name:sale_margin.wizard_picking_invoice_create
+#: wizard_button:stock.invoice_onshipping,init,create_invoice:0
+msgid "Create invoice"
+msgstr "Créer une facture"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_category_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_category_tree_all
+msgid "report.account.invoice.category.tree"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_partner_product
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_partner_product
+msgid "Invoices by Partner and Product"
+msgstr "Factures par partenaire et produit"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_category
+msgid "report.account.invoice.category"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_this_month_product
+msgid "This Month"
+msgstr "Ce mois"
+
+#. module: sale_margin
+#: field:report.account.invoice.category,categ_id:0
+msgid "Categories"
+msgstr "Catégories"
+
+#. module: sale_margin
+#: field:account.invoice.line,cost_price:0
+#: field:report.account.invoice,cost_price:0
+#: field:report.account.invoice.category,cost_price:0
+#: field:report.account.invoice.partner,cost_price:0
+#: field:report.account.invoice.partner.product,cost_price:0
+#: field:report.account.invoice.product,cost_price:0
+#: field:sale.order.line,purchase_price:0
+msgid "Cost Price"
+msgstr "Prix standard"
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,group:0
+msgid "Group by partner"
+msgstr "Grouper par partenaire"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_partner
+msgid "report.account.invoice.partner"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_partner
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_partner
+msgid "Invoices by Partner"
+msgstr "Factures par partenaire"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_category
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_category
+msgid "Invoices by Category"
+msgstr "Factures par catégorie"
+
+#. module: sale_margin
+#: view:report.account.invoice.partner.product:0
+msgid "Invoices by partner and product"
+msgstr "Factures par partenaire et produit"
+
+#. module: sale_margin
+#: field:report.account.invoice,amount:0
+#: field:report.account.invoice.category,amount:0
+#: field:report.account.invoice.partner,amount:0
+#: field:report.account.invoice.partner.product,amount:0
+#: field:report.account.invoice.product,amount:0
+msgid "Amount"
+msgstr "Total"
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,invoice_date:0
+msgid "Invoiced date"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Supplier Refund"
+msgstr "Note de crédit fournisseur"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_tree_all
+msgid "report.account.invoice.partner.tree"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,margin:0
+#: field:report.account.invoice.category,margin:0
+#: field:report.account.invoice.partner,margin:0
+#: field:report.account.invoice.partner.product,margin:0
+#: field:report.account.invoice.product,margin:0
+#: field:sale.order,margin:0
+#: field:sale.order.line,margin:0
+msgid "Margin"
+msgstr "Marge"
+
+#. module: sale_margin
+#: field:report.account.invoice,quantity:0
+#: field:report.account.invoice.category,quantity:0
+#: field:report.account.invoice.partner,quantity:0
+#: field:report.account.invoice.partner.product,quantity:0
+#: field:report.account.invoice.product,quantity:0
+msgid "Quantity"
+msgstr "Quantité"
+
+#. module: sale_margin
+#: view:report.account.invoice.product:0
+msgid "Invoices by product"
+msgstr "Factures par produit"
+
+#. module: sale_margin
+#: model:ir.module.module,shortdesc:sale_margin.module_meta_information
+msgid "Margins in Sale Orders"
+msgstr "Marges des ventes"
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice
+msgid "report.account.invoice"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_invoices
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_invoices
+#: view:report.account.invoice:0
+#: view:stock.picking:0
+#: field:stock.picking,invoice_ids:0
+msgid "Invoices"
+msgstr "Factures"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Pro-forma"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,name:0
+#: field:report.account.invoice.category,name:0
+#: field:report.account.invoice.partner,name:0
+#: field:report.account.invoice.partner.product,name:0
+#: field:report.account.invoice.product,name:0
+msgid "Month"
+msgstr "Mois"
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Canceled"
+msgstr "Annulé"
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_product
+msgid "Invoice"
+msgstr "Facture"
+
+#. module: sale_margin
+#: wizard_button:stock.invoice_onshipping,init,end:0
+msgid "Cancel"
+msgstr "Annuler"
+
+#. module: sale_margin
+#: field:report.account.invoice.partner,partner_id:0
+#: field:report.account.invoice.partner.product,partner_id:0
+msgid "Partner"
+msgstr "Partenaire"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_tree_all
+msgid "report.account.invoice.tree"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Open"
+msgstr "Ouvert"
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_product_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_product_tree_all
+msgid "report.account.invoice.product.tree"
+msgstr ""
diff --git a/addons/sale_margin/i18n/fr_BE.po b/addons/sale_margin/i18n/fr_BE.po
new file mode 100644
index 00000000000..424a1c74b3f
--- /dev/null
+++ b/addons/sale_margin/i18n/fr_BE.po
@@ -0,0 +1,367 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * sale_margin
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.6\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-11-25 14:28:11+0000\n"
+"PO-Revision-Date: 2009-11-25 14:28:11+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: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Customer Refund"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_product
+msgid "report.account.invoice.product"
+msgstr ""
+
+#. module: sale_margin
+#: constraint:ir.model:0
+msgid "The Object name must start with x_ and not contain any special character !"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_product
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_product
+msgid "Invoices by Product"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Customer Invoice"
+msgstr ""
+
+#. module: sale_margin
+#: wizard_view:stock.invoice_onshipping,init:0
+msgid "Create invoices"
+msgstr ""
+
+#. module: sale_margin
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_partner_product
+msgid "report.account.invoice.partner.product"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Supplier Invoice"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,state:0
+#: field:report.account.invoice.category,state:0
+#: field:report.account.invoice.partner,state:0
+#: field:report.account.invoice.partner.product,state:0
+#: field:report.account.invoice.product,state:0
+msgid "State"
+msgstr ""
+
+#. module: sale_margin
+#: view:stock.picking:0
+msgid "Create Invoice"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: sale_margin
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_month_product
+msgid "All Months"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_product_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_product_tree_all
+msgid "report.account.invoice.partner.product.tree"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,type:0
+#: field:report.account.invoice.category,type:0
+#: field:report.account.invoice.partner,type:0
+#: field:report.account.invoice.partner.product,type:0
+#: field:report.account.invoice.product,type:0
+#: wizard_field:stock.invoice_onshipping,init,type:0
+msgid "Type"
+msgstr ""
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,journal_id:0
+msgid "Destination Journal"
+msgstr ""
+
+#. module: sale_margin
+#: view:stock.picking:0
+msgid "Supplier Invoices"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice.partner.product,product_id:0
+#: field:report.account.invoice.product,product_id:0
+msgid "Product"
+msgstr ""
+
+#. module: sale_margin
+#: view:report.account.invoice.partner:0
+msgid "Invoices by partner"
+msgstr ""
+
+#. module: sale_margin
+#: view:report.account.invoice.category:0
+msgid "Invoices by category"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Paid"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.wizard,name:sale_margin.wizard_picking_invoice_create
+#: wizard_button:stock.invoice_onshipping,init,create_invoice:0
+msgid "Create invoice"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_category_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_category_tree_all
+msgid "report.account.invoice.category.tree"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_partner_product
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_partner_product
+msgid "Invoices by Partner and Product"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_category
+msgid "report.account.invoice.category"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_this_month_product
+msgid "This Month"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice.category,categ_id:0
+msgid "Categories"
+msgstr ""
+
+#. module: sale_margin
+#: field:account.invoice.line,cost_price:0
+#: field:report.account.invoice,cost_price:0
+#: field:report.account.invoice.category,cost_price:0
+#: field:report.account.invoice.partner,cost_price:0
+#: field:report.account.invoice.partner.product,cost_price:0
+#: field:report.account.invoice.product,cost_price:0
+#: field:sale.order.line,purchase_price:0
+msgid "Cost Price"
+msgstr ""
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,group:0
+msgid "Group by partner"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_partner
+msgid "report.account.invoice.partner"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_partner
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_partner
+msgid "Invoices by Partner"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_category
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_category
+msgid "Invoices by Category"
+msgstr ""
+
+#. module: sale_margin
+#: view:report.account.invoice.partner.product:0
+msgid "Invoices by partner and product"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,amount:0
+#: field:report.account.invoice.category,amount:0
+#: field:report.account.invoice.partner,amount:0
+#: field:report.account.invoice.partner.product,amount:0
+#: field:report.account.invoice.product,amount:0
+msgid "Amount"
+msgstr ""
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,invoice_date:0
+msgid "Invoiced date"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Supplier Refund"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_tree_all
+msgid "report.account.invoice.partner.tree"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,margin:0
+#: field:report.account.invoice.category,margin:0
+#: field:report.account.invoice.partner,margin:0
+#: field:report.account.invoice.partner.product,margin:0
+#: field:report.account.invoice.product,margin:0
+#: field:sale.order,margin:0
+#: field:sale.order.line,margin:0
+msgid "Margin"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,quantity:0
+#: field:report.account.invoice.category,quantity:0
+#: field:report.account.invoice.partner,quantity:0
+#: field:report.account.invoice.partner.product,quantity:0
+#: field:report.account.invoice.product,quantity:0
+msgid "Quantity"
+msgstr ""
+
+#. module: sale_margin
+#: view:report.account.invoice.product:0
+msgid "Invoices by product"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.module.module,shortdesc:sale_margin.module_meta_information
+msgid "Margins in Sale Orders"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice
+msgid "report.account.invoice"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_invoices
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_invoices
+#: view:report.account.invoice:0
+#: view:stock.picking:0
+#: field:stock.picking,invoice_ids:0
+msgid "Invoices"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Pro-forma"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,name:0
+#: field:report.account.invoice.category,name:0
+#: field:report.account.invoice.partner,name:0
+#: field:report.account.invoice.partner.product,name:0
+#: field:report.account.invoice.product,name:0
+msgid "Month"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Canceled"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_product
+msgid "Invoice"
+msgstr ""
+
+#. module: sale_margin
+#: wizard_button:stock.invoice_onshipping,init,end:0
+msgid "Cancel"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice.partner,partner_id:0
+#: field:report.account.invoice.partner.product,partner_id:0
+msgid "Partner"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_tree_all
+msgid "report.account.invoice.tree"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Open"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_product_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_product_tree_all
+msgid "report.account.invoice.product.tree"
+msgstr ""
+
diff --git a/addons/sale_margin/i18n/sale_margin.pot b/addons/sale_margin/i18n/sale_margin.pot
new file mode 100644
index 00000000000..424a1c74b3f
--- /dev/null
+++ b/addons/sale_margin/i18n/sale_margin.pot
@@ -0,0 +1,367 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * sale_margin
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 5.0.6\n"
+"Report-Msgid-Bugs-To: support@openerp.com\n"
+"POT-Creation-Date: 2009-11-25 14:28:11+0000\n"
+"PO-Revision-Date: 2009-11-25 14:28:11+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: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Customer Refund"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_product
+msgid "report.account.invoice.product"
+msgstr ""
+
+#. module: sale_margin
+#: constraint:ir.model:0
+msgid "The Object name must start with x_ and not contain any special character !"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_product
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_product
+msgid "Invoices by Product"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Customer Invoice"
+msgstr ""
+
+#. module: sale_margin
+#: wizard_view:stock.invoice_onshipping,init:0
+msgid "Create invoices"
+msgstr ""
+
+#. module: sale_margin
+#: constraint:ir.ui.view:0
+msgid "Invalid XML for View Architecture!"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_partner_product
+msgid "report.account.invoice.partner.product"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Supplier Invoice"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,state:0
+#: field:report.account.invoice.category,state:0
+#: field:report.account.invoice.partner,state:0
+#: field:report.account.invoice.partner.product,state:0
+#: field:report.account.invoice.product,state:0
+msgid "State"
+msgstr ""
+
+#. module: sale_margin
+#: view:stock.picking:0
+msgid "Create Invoice"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Draft"
+msgstr ""
+
+#. module: sale_margin
+#: constraint:ir.actions.act_window:0
+msgid "Invalid model name in the action definition."
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_month_product
+msgid "All Months"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_product_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_product_tree_all
+msgid "report.account.invoice.partner.product.tree"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,type:0
+#: field:report.account.invoice.category,type:0
+#: field:report.account.invoice.partner,type:0
+#: field:report.account.invoice.partner.product,type:0
+#: field:report.account.invoice.product,type:0
+#: wizard_field:stock.invoice_onshipping,init,type:0
+msgid "Type"
+msgstr ""
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,journal_id:0
+msgid "Destination Journal"
+msgstr ""
+
+#. module: sale_margin
+#: view:stock.picking:0
+msgid "Supplier Invoices"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice.partner.product,product_id:0
+#: field:report.account.invoice.product,product_id:0
+msgid "Product"
+msgstr ""
+
+#. module: sale_margin
+#: view:report.account.invoice.partner:0
+msgid "Invoices by partner"
+msgstr ""
+
+#. module: sale_margin
+#: view:report.account.invoice.category:0
+msgid "Invoices by category"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Paid"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.wizard,name:sale_margin.wizard_picking_invoice_create
+#: wizard_button:stock.invoice_onshipping,init,create_invoice:0
+msgid "Create invoice"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_category_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_category_tree_all
+msgid "report.account.invoice.category.tree"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_partner_product
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_partner_product
+msgid "Invoices by Partner and Product"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_category
+msgid "report.account.invoice.category"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_this_month_product
+msgid "This Month"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice.category,categ_id:0
+msgid "Categories"
+msgstr ""
+
+#. module: sale_margin
+#: field:account.invoice.line,cost_price:0
+#: field:report.account.invoice,cost_price:0
+#: field:report.account.invoice.category,cost_price:0
+#: field:report.account.invoice.partner,cost_price:0
+#: field:report.account.invoice.partner.product,cost_price:0
+#: field:report.account.invoice.product,cost_price:0
+#: field:sale.order.line,purchase_price:0
+msgid "Cost Price"
+msgstr ""
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,group:0
+msgid "Group by partner"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice_partner
+msgid "report.account.invoice.partner"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_partner
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_partner
+msgid "Invoices by Partner"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_category
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_category
+msgid "Invoices by Category"
+msgstr ""
+
+#. module: sale_margin
+#: view:report.account.invoice.partner.product:0
+msgid "Invoices by partner and product"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,amount:0
+#: field:report.account.invoice.category,amount:0
+#: field:report.account.invoice.partner,amount:0
+#: field:report.account.invoice.partner.product,amount:0
+#: field:report.account.invoice.product,amount:0
+msgid "Amount"
+msgstr ""
+
+#. module: sale_margin
+#: wizard_field:stock.invoice_onshipping,init,invoice_date:0
+msgid "Invoiced date"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,type:0
+#: selection:report.account.invoice.category,type:0
+#: selection:report.account.invoice.partner,type:0
+#: selection:report.account.invoice.partner.product,type:0
+#: selection:report.account.invoice.product,type:0
+msgid "Supplier Refund"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_partner_tree_all
+msgid "report.account.invoice.partner.tree"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,margin:0
+#: field:report.account.invoice.category,margin:0
+#: field:report.account.invoice.partner,margin:0
+#: field:report.account.invoice.partner.product,margin:0
+#: field:report.account.invoice.product,margin:0
+#: field:sale.order,margin:0
+#: field:sale.order.line,margin:0
+msgid "Margin"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,quantity:0
+#: field:report.account.invoice.category,quantity:0
+#: field:report.account.invoice.partner,quantity:0
+#: field:report.account.invoice.partner.product,quantity:0
+#: field:report.account.invoice.product,quantity:0
+msgid "Quantity"
+msgstr ""
+
+#. module: sale_margin
+#: view:report.account.invoice.product:0
+msgid "Invoices by product"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.module.module,shortdesc:sale_margin.module_meta_information
+msgid "Margins in Sale Orders"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.model,name:sale_margin.model_report_account_invoice
+msgid "report.account.invoice"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_all_invoice_by_invoices
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_by_invoices
+#: view:report.account.invoice:0
+#: view:stock.picking:0
+#: field:stock.picking,invoice_ids:0
+msgid "Invoices"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Pro-forma"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice,name:0
+#: field:report.account.invoice.category,name:0
+#: field:report.account.invoice.partner,name:0
+#: field:report.account.invoice.partner.product,name:0
+#: field:report.account.invoice.product,name:0
+msgid "Month"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Canceled"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.ui.menu,name:sale_margin.menu_report_account_invoice_product
+msgid "Invoice"
+msgstr ""
+
+#. module: sale_margin
+#: wizard_button:stock.invoice_onshipping,init,end:0
+msgid "Cancel"
+msgstr ""
+
+#. module: sale_margin
+#: field:report.account.invoice.partner,partner_id:0
+#: field:report.account.invoice.partner.product,partner_id:0
+msgid "Partner"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_tree_all
+msgid "report.account.invoice.tree"
+msgstr ""
+
+#. module: sale_margin
+#: selection:report.account.invoice,state:0
+#: selection:report.account.invoice.category,state:0
+#: selection:report.account.invoice.partner,state:0
+#: selection:report.account.invoice.partner.product,state:0
+#: selection:report.account.invoice.product,state:0
+msgid "Open"
+msgstr ""
+
+#. module: sale_margin
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_product_tree
+#: model:ir.actions.act_window,name:sale_margin.action_report_account_invoice_product_tree_all
+msgid "report.account.invoice.product.tree"
+msgstr ""
+
diff --git a/addons/sale_margin/invoice_margin.py b/addons/sale_margin/invoice_margin.py
new file mode 100644
index 00000000000..a00311cbd7d
--- /dev/null
+++ b/addons/sale_margin/invoice_margin.py
@@ -0,0 +1,44 @@
+##############################################################################
+#
+# 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 .
+#
+##############################################################################
+
+from osv import fields,osv
+import pooler
+from tools import config
+
+class account_invoice_line(osv.osv):
+ _name = "account.invoice.line"
+ _inherit = "account.invoice.line"
+ _columns = {
+ 'cost_price': fields.float('Cost Price', digits=(16, 2)),
+ }
+ def write(self, cr, uid, ids, vals, context={}):
+ if vals.get('product_id' , False):
+ res=self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
+ vals['cost_price']=res[0]['standard_price']
+ return super(account_invoice_line, self).write(cr, uid, ids, vals, context)
+
+ def create(self, cr, uid, vals, context={}):
+ if vals.get('product_id',False):
+ res=self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
+ vals['cost_price']=res[0]['standard_price']
+ return super(account_invoice_line, self).create(cr, uid, vals, context)
+account_invoice_line()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/sale_margin/report/__init__.py b/addons/sale_margin/report/__init__.py
new file mode 100644
index 00000000000..2ec61a1e939
--- /dev/null
+++ b/addons/sale_margin/report/__init__.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 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 report_margin
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_margin/report/report_margin.py b/addons/sale_margin/report/report_margin.py
new file mode 100644
index 00000000000..a318a6c17b8
--- /dev/null
+++ b/addons/sale_margin/report/report_margin.py
@@ -0,0 +1,90 @@
+##############################################################################
+#
+# 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 .
+#
+##############################################################################
+
+from osv import fields,osv
+import pooler
+from tools import config
+import time
+import tools
+
+
+
+class report_account_invoice_product(osv.osv):
+ _name = 'report.account.invoice.product'
+ _auto = False
+ _description = "Invoice Statistics"
+ _columns = {
+ 'date': fields.date('Date', readonly=True),
+ 'year': fields.char('Year', size=4, readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
+ ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
+ ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
+ 'type': fields.selection([
+ ('out_invoice','Customer Invoice'),
+ ('in_invoice','Supplier Invoice'),
+ ('out_refund','Customer Refund'),
+ ('in_refund','Supplier Refund'),
+ ],'Type', readonly=True),
+ 'state': fields.selection([
+ ('draft','Draft'),
+ ('proforma','Pro-forma'),
+ ('open','Open'),
+ ('paid','Paid'),
+ ('cancel','Canceled')
+ ],'State', readonly=True),
+ 'product_id': fields.many2one('product.product', 'Product', readonly=True),
+ 'amount': fields.float('Amount', readonly=True),
+ 'cost_price': fields.float('Cost Price', readonly=True),
+ 'margin': fields.float('Margin', readonly=True),
+ 'categ_id': fields.many2one('product.category', 'Categories', readonly=True),
+ 'quantity': fields.float('Quantity', readonly=True),
+ 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
+ }
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'report_account_invoice_product')
+ cr.execute("""
+ create or replace view report_account_invoice_product as (
+ select
+ min(l.id) as id,
+ i.create_date as date,
+ to_char(date_trunc('day',i.date_invoice), 'YYYY') as year,
+ to_char(date_trunc('day',i.date_invoice), 'MM') as month,
+ to_char(date_trunc('day',i.date_invoice), 'YYYY-MM-DD') as day,
+ i.type,
+ i.state,
+ l.product_id,
+ t.categ_id,
+ i.partner_id,
+ sum(l.quantity * l.price_unit * (1.0 - l.discount/100.0)) as amount,
+ sum(l.quantity * l.cost_price) as cost_price,
+ sum((l.quantity * l.price_unit * (1.0 - l.discount/100.0) - (l.quantity * l.cost_price))) as margin,
+ sum(l.quantity) as quantity
+ from account_invoice i
+ left join account_invoice_line l on (i.id = l.invoice_id)
+ left join product_product p on (p.id = l.product_id)
+ left join product_template t on (t.id = p.product_tmpl_id)
+ group by t.categ_id,i.partner_id,l.product_id, i.date_invoice, i.type, i.state,i.create_date
+ )
+ """)
+report_account_invoice_product()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
diff --git a/addons/sale_margin/report/report_margin_view.xml b/addons/sale_margin/report/report_margin_view.xml
new file mode 100644
index 00000000000..b22c2e28801
--- /dev/null
+++ b/addons/sale_margin/report/report_margin_view.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+ report.account.invoice.product.tree
+ report.account.invoice.product
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ account.invoice.product.filter
+ report.account.invoice.product
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.account.invoice.product.graph
+ report.account.invoice.product
+ graph
+
+
+
+
+
+
+
+
+
+
+ Invoice Analysis
+ report.account.invoice.product
+ form
+ tree,graph
+ {"search_default_At Date":1,'group_by_no_leaf':1,'group_by':[]}
+
+
+
+
+
+
+
+
diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py
new file mode 100644
index 00000000000..77f7be55342
--- /dev/null
+++ b/addons/sale_margin/sale_margin.py
@@ -0,0 +1,83 @@
+##############################################################################
+#
+# 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 .
+#
+##############################################################################
+
+from osv import fields,osv
+import pooler
+from tools import config
+
+class sale_order_line(osv.osv):
+ _name = "sale.order.line"
+ _inherit = "sale.order.line"
+ def _product_margin(self, cr, uid, ids, field_name, arg, context):
+ res = {}
+ for line in self.browse(cr, uid, ids):
+ res[line.id] = 0
+ if line.product_id:
+ if line.purchase_price:
+ res[line.id] = round((line.price_unit*line.product_uos_qty*(100.0-line.discount)/100.0) -(line.purchase_price*line.product_uos_qty),2)
+ else:
+ res[line.id] = round((line.price_unit*line.product_uos_qty*(100.0-line.discount)/100.0) -(line.product_id.standard_price*line.product_uos_qty),2)
+ return res
+
+ _columns = {
+ 'margin': fields.function(_product_margin, method=True, string='Margin', store=True),
+ 'purchase_price': fields.float('Cost Price', digits=(16,2))
+ }
+
+sale_order_line()
+
+class sale_order(osv.osv):
+ _inherit = "sale.order"
+
+ def _product_margin(self, cr, uid, ids, field_name, arg, context):
+ result = {}
+ for sale in self.browse(cr, uid, ids, context=context):
+ result[sale.id] = 0.0
+ for line in sale.order_line:
+ result[sale.id] += line.margin or 0.0
+ return result
+
+ _columns = {
+ 'margin': fields.function(_product_margin, method=True, string='Margin', store=True),
+ }
+
+sale_order()
+
+class stock_picking(osv.osv):
+ _inherit = 'stock.picking'
+
+ _columns = {
+ 'invoice_ids': fields.many2many('account.invoice', 'picking_invoice_rel', 'picking_id', 'invoice_id', 'Invoices', domain=[('type','=','in_invoice')]),
+ }
+
+ def create_invoice(self, cr, uid, ids, *args):
+ # need to carify with new requirement
+ res = False
+ invoice_ids = []
+ margin_deduce = 0.0
+ picking_obj = self.pool.get('stock.picking')
+ picking_obj.write(cr, uid, ids, {'invoice_state' : '2binvoiced'})
+ res = picking_obj.action_invoice_create(cr, uid, ids, type='out_invoice', context={})
+ invoice_ids = res.values()
+ picking_obj.write(cr, uid, ids,{'invoice_ids':[[6,0,invoice_ids]]})
+ return True
+
+stock_picking()
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/sale_margin/sale_margin_view.xml b/addons/sale_margin/sale_margin_view.xml
new file mode 100644
index 00000000000..1b46a850df8
--- /dev/null
+++ b/addons/sale_margin/sale_margin_view.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+ sale.order.margin.view.form
+ form
+ sale.order
+
+
+
+
+
+
+
+
+ sale.order.margin.view.tree
+ tree
+ sale.order
+
+
+
+
+
+
+
+
+
+ sale.order.margin.line.view.tree
+ tree
+ sale.order.line
+
+
+
+
+
+
+
+
+
+
+ picking.margin.view.form
+ form
+ stock.picking
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/sale_margin/security/ir.model.access.csv b/addons/sale_margin/security/ir.model.access.csv
new file mode 100644
index 00000000000..6cab8a4c33d
--- /dev/null
+++ b/addons/sale_margin/security/ir.model.access.csv
@@ -0,0 +1,2 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_report_account_invoice_product","report.account.invoice.product","model_report_account_invoice_product","account.group_account_invoice",1,1,1,1
diff --git a/addons/sale_mrp/__init__.py b/addons/sale_mrp/__init__.py
new file mode 100644
index 00000000000..c47eb12b3f3
--- /dev/null
+++ b/addons/sale_mrp/__init__.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 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 sale_mrp
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_mrp/__openerp__.py b/addons/sale_mrp/__openerp__.py
new file mode 100644
index 00000000000..9ac55911983
--- /dev/null
+++ b/addons/sale_mrp/__openerp__.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 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 .
+#
+##############################################################################
+
+
+{
+ 'name': 'Sales and MRP Management',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Sales & MRP',
+ 'description': """
+ This module provides facility to the user to install mrp and sale modules
+ at a time. It is basically used when we want to keep track of production
+ orders generated from sale orders.
+ """,
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['mrp', 'sale'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'sale_mrp_view.xml',
+ ],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '',
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale/mrp.py b/addons/sale_mrp/sale_mrp.py
similarity index 81%
rename from addons/sale/mrp.py
rename to addons/sale_mrp/sale_mrp.py
index bb16a65425a..4f52cb7dd9b 100644
--- a/addons/sale/mrp.py
+++ b/addons/sale_mrp/sale_mrp.py
@@ -23,10 +23,14 @@
from osv import osv, fields
class mrp_production(osv.osv):
-
_inherit = 'mrp.production'
def _ref_calc(self, cr, uid, ids, field_names=None, arg=False, context={}):
+ """ Finds reference of sale order for production order.
+ @param field_names: Names of fields.
+ @param arg: User defined arguments
+ @return: Dictionary of values.
+ """
if not field_names:
field_names=[]
res = {}
@@ -65,4 +69,11 @@ class mrp_production(osv.osv):
res[production['id']] = move.sale_line_id and move.sale_line_id.order_id.client_order_ref or False
return res
-mrp_production()
\ No newline at end of file
+ _columns = {
+ 'sale_name': fields.function(_ref_calc, method=True, multi='sale_name', type='char', string='Sale Name', help='Indicate the name of sale order.'),
+ 'sale_ref': fields.function(_ref_calc, method=True, multi='sale_ref', type='char', string='Sale Reference', help='Indicate the Customer Reference from sale order.'),
+ }
+
+mrp_production()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/sale_mrp/sale_mrp_view.xml b/addons/sale_mrp/sale_mrp_view.xml
new file mode 100644
index 00000000000..a595e9471be
--- /dev/null
+++ b/addons/sale_mrp/sale_mrp_view.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ mrp.production.form
+ mrp.production
+
+ form
+
+
+
+
+
+
+
+
+
diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py
index c5e2aef2ff6..722fa9809b0 100644
--- a/addons/share/wizard/share_wizard.py
+++ b/addons/share/wizard/share_wizard.py
@@ -76,7 +76,7 @@ class share_create(osv.osv_memory):
'user_type': fields.selection( [ ('existing','Existing'),('new','New')],'User Type'),
'user_ids': fields.many2many('res.users', 'share_user_rel', 'share_id','user_id', 'Share Users'),
'new_user': fields.text("New user"),
- 'access_mode': fields.selection( [ ('readonly','READ ONLY'),('readwrite','READ & WRITE')],'Access Mode'),
+ 'access_mode': fields.selection([('readwrite','READ & WRITE'),('readonly','READ ONLY')],'Access Mode'),
'write_access': fields.function(_access, method=True, string='Write Access',type='boolean', multi='write_access'),
'read_access': fields.function(_access, method=True, string='Write Access',type='boolean', multi='read_access'),
}
@@ -84,6 +84,7 @@ class share_create(osv.osv_memory):
'user_type' : 'existing',
'domain': '[]',
'access_mode': 'readonly'
+
}
def default_get(self, cr, uid, fields, context=None):
@@ -124,7 +125,8 @@ class share_create(osv.osv_memory):
vals ={
'domain': this.domain,
'action_id': this.action_id and this.action_id.id or False,
- }
+ }
+ step1_id = this.id
context.update(vals)
value = {
@@ -132,7 +134,8 @@ class share_create(osv.osv_memory):
'view_type': 'form',
'view_mode': 'form',
'res_model': 'share.create',
- 'view_id': False,
+ 'view_id': False,
+ 'res_id': step1_id,
'views': [(step1_form_view_id, 'form'), (False, 'tree'), (False, 'calendar'), (False, 'graph')],
'type': 'ir.actions.act_window',
'context': context,
@@ -162,9 +165,6 @@ class share_create(osv.osv_memory):
'user_type': this.user_type,
'existing_user_ids': map(lambda x:x.id, this.user_ids),
'new_user': this.new_user,
- 'domain': this.domain,
- 'access_mode': this.access_mode,
- 'action_id': this.action_id and this.action_id.id or False
}
context.update(vals)
@@ -189,6 +189,13 @@ class share_create(osv.osv_memory):
"""
if not context:
context = {}
+
+ for this in self.browse(cr, uid, ids, context=context):
+ vals ={
+ 'access_mode': this.access_mode,
+ }
+
+ context.update(vals)
group_obj = self.pool.get('res.groups')
user_obj = self.pool.get('res.users')
@@ -248,7 +255,7 @@ class share_create(osv.osv_memory):
#ACCESS RIGHTS / IR.RULES COMPUTATION
- #TODO: TO Resolve Recurrent Problems
+
active_model_ids = model_obj.search(cr, uid, [('model','=',active_model)])
active_model_id = active_model_ids and active_model_ids[0] or False
@@ -268,14 +275,36 @@ class share_create(osv.osv_memory):
return obj
- obj0 = model_obj.browse(cr, uid, active_model_id, context=context)
+ active_model = model_obj.browse(cr, uid, active_model_id, context=context)
+ obj0 = [(None, active_model)]
obj1 = _get_relation(active_model_id, ['one2many'])
obj2 = _get_relation(active_model_id, ['one2many', 'many2many'])
obj3 = _get_relation(active_model_id, ['many2one'])
for rel_field, model in obj1:
obj3 += _get_relation(model.id, ['many2one'])
+
+ current_user = user_obj.browse(cr, uid, uid, context=context)
if access_mode == 'readonly':
- for rel_field, model in obj1+obj2+obj3:
+ res = []
+ # intersect with read access rights of user running the
+ # wizard, to avoid adding more access than current
+ for group in current_user.groups_id:
+ for access_control in group.model_access:
+ if access_control.model_id.id in res:
+ continue
+ if access_control.perm_read:
+ res.append(access_control.model_id.id)
+ model_access_obj.create(cr, uid, {
+ 'name': 'Read Access of group %s on %s model'%(share_group_name, access_control.model_id.name),
+ 'model_id' : access_control.model_id.id,
+ 'group_id' : group_id,
+ 'perm_read' : True
+ })
+ res = []
+ for rel_field, model in obj0+obj1+obj2+obj3:
+ if model.id in res:
+ continue
+ res.append(model.id)
model_access_obj.create(cr, uid, {
'name': 'Read Access of group %s on %s model'%(share_group_name, model.name),
'model_id' : model.id,
@@ -283,27 +312,68 @@ class share_create(osv.osv_memory):
'perm_read' : True
})
if access_mode == 'readwrite':
- for rel_field, model in obj1+obj2+obj3:
+ res = []
+ for rel_field, model in obj0+obj1:
+ if model.id in res:
+ continue
+ res.append(model.id)
model_access_obj.create(cr, uid, {
- 'name': 'Read Access of group %s on %s model'%(share_group_name, model.name),
+ 'name': 'Write Access of group %s on %s model'%(share_group_name, model.name),
'model_id' : model.id,
'group_id' : group_id,
'perm_read' : True,
- 'perm_write' : True
+ 'perm_write' : True,
+ 'perm_unlink' : True,
+ 'perm_create' : True,
+ })
+ # intersect with access rights of user
+ # running the wizard, to avoid adding more access than current
+
+ for group in current_user.groups_id:
+ for access_control in group.model_access:
+ if access_control.model_id.id in res:
+ continue
+ if access_control.perm_read:
+ res.append(access_control.model_id.id)
+ model_access_obj.create(cr, uid, {
+ 'name': 'Read Access of group %s on %s model'%(share_group_name, access_control.model_id.name),
+ 'model_id' : access_control.model_id.id,
+ 'group_id' : group_id,
+ 'perm_read' : True
})
for rel_field, model in obj2+obj3:
+ if model.id in res:
+ continue
+ res.append(model.id)
model_access_obj.create(cr, uid, {
'name': 'Read Access of group %s on %s model'%(share_group_name, model.name),
'model_id' : model.id,
'group_id' : group_id,
'perm_read' : True
})
+ #
+ # And on OBJ0, OBJ1, OBJ2, OBJ3: add all rules from groups of the user
+ # that is sharing in the many2many of the rules on the new group
+ # (rule must be copied instead of adding it if it contains a reference to uid
+ # or user.xxx so it can be replaced correctly)
+
+ for group in current_user.groups_id:
+ res = []
+ for rel_field, model in obj0+obj1+obj2+obj3:
+ if model.id in res:
+ continue
+ res.append(model.id)
+ for rule in group.rule_groups:
+ if rule.model_id == model.id:
+ rule_obj.copy(cr, uid, rule.id, default={
+ 'name': '%s-%s'%(share_group_name, model.model),
+ 'groups': [(6,0,[group_id])]}, context=context)
rule_obj.create(cr, uid, {
- 'name': '%s-%s'%(share_group_name, obj0.model),
- 'model_id': obj0.id,
- 'domain': domain,
- 'group_ids': [(6,0,[group_id])]
+ 'name': '%s-%s'%(share_group_name, active_model.model),
+ 'model_id': active_model.id,
+ 'domain_force': domain,
+ 'groups': [(6,0,[group_id])]
})
for rel_field, model in obj1:
obj1_domain = []
@@ -314,15 +384,10 @@ class share_create(osv.osv_memory):
rule_obj.create(cr, uid, {
'name': '%s-%s'%(share_group_name, model.model),
'model_id': model.id,
- 'domain': obj1_domain,
+ 'domain_force': obj1_domain,
'groups': [(6,0,[group_id])]
})
- # TODO:
- # And on OBJ0, OBJ1, OBJ2, OBJ3: add all rules from groups of the user
- # that is sharing in the many2many of the rules on the new group
- # (rule must be copied instead of adding it if it contains a reference to uid
- # or user.xxx so it can be replaced correctly)
- context['share_model'] = active_model
+ context['share_model'] = active_model.model
context['share_rec_id'] = active_id
diff --git a/addons/share/wizard/share_wizard_view.xml b/addons/share/wizard/share_wizard_view.xml
index 9e9b23f7f43..159583eecbb 100644
--- a/addons/share/wizard/share_wizard_view.xml
+++ b/addons/share/wizard/share_wizard_view.xml
@@ -39,8 +39,7 @@
-
-
+
+
diff --git a/addons/stock/product.py b/addons/stock/product.py
index dc300994232..16db5f4e1f2 100644
--- a/addons/stock/product.py
+++ b/addons/stock/product.py
@@ -25,15 +25,38 @@ from tools.translate import _
class product_product(osv.osv):
_inherit = "product.product"
+
+
+ def get_product_accounts(self, cr, uid, product_id, context=None):
+ """ To get the stock input account, stock output account and stock journal related to product.
+ @param product_id: product id
+ @return: dictionary which contains information regarding stock input account, stock output account and stock journal
+ """
+ product_obj = self.pool.get('product.product').browse(cr, uid, product_id, context)
+
+ stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False
+ if not stock_input_acc:
+ stock_input_acc = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id or False
+
+ stock_output_acc = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id or False
+ if not stock_output_acc:
+ stock_output_acc = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id or False
+
+ journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False
+ account_variation = product_obj.categ_id.property_stock_variation and product_obj.categ_id.property_stock_variation.id or False
+
+ return {
+ 'stock_account_input': stock_input_acc,
+ 'stock_account_output': stock_output_acc,
+ 'stock_journal': journal_id,
+ 'property_stock_variation': account_variation
+ }
def do_change_standard_price(self, cr, uid, ids, datas, context={}):
- """
- Changes the Standard Price of Product and creates an account move accordingly.
-
- @param datas : dict. contain default datas like new_price, stock_output_account, stock_input_account, stock_journal
- @param context: A standard dictionary
-
- @return:
+ """ Changes the Standard Price of Product and creates an account move accordingly.
+ @param datas : dict. contain default datas like new_price, stock_output_account, stock_input_account, stock_journal
+ @param context: A standard dictionary
+ @return:
"""
location_obj = self.pool.get('stock.location')
@@ -44,10 +67,12 @@ class product_product(osv.osv):
stock_output_acc = datas.get('stock_output_account', False)
stock_input_acc = datas.get('stock_input_account', False)
journal_id = datas.get('stock_journal', False)
-
+ property_obj=self.pool.get('ir.property')
+ product_obj=self.browse(cr,uid,ids)[0]
+ account_variation = product_obj.categ_id.property_stock_variation
move_ids = []
for rec_id in ids:
- loc_ids = location_obj.search(cr, uid, [('account_id','<>',False),('usage','=','internal')])
+ loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
for location in location_obj.browse(cr, uid, loc_ids):
c = context.copy()
c.update({
@@ -60,7 +85,8 @@ class product_product(osv.osv):
diff = product.standard_price - new_price
assert diff, _("Could not find any difference between standard price and new price!")
if qty:
- location_account = location.account_id and location.account_id.id or False
+ location_account = account_variation and account_variation.id or False
+
company_id = location.company_id and location.company_id.id or False
assert location_account, _('Inventory Account is not specified for Location: %s' % (location.name))
assert company_id, _('Company is not specified in Location')
@@ -147,7 +173,10 @@ class product_product(osv.osv):
return _('Products: ')+self.pool.get('stock.location').browse(cr, user, context['location'], context).name
return res
- def get_product_available(self,cr,uid,ids,context=None):
+ def get_product_available(self, cr, uid, ids, context=None):
+ """ Finds whether product is available or not in particular warehouse.
+ @return: Dictionary of values
+ """
if context is None:
context = {}
states = context.get('states',[])
@@ -252,22 +281,25 @@ class product_product(osv.osv):
return res
def _product_available(self, cr, uid, ids, field_names=None, arg=False, context={}):
+ """ Finds the incoming and outgoing quantity of product.
+ @return: Dictionary of values
+ """
if not field_names:
- field_names=[]
+ field_names = []
res = {}
for id in ids:
res[id] = {}.fromkeys(field_names, 0.0)
for f in field_names:
c = context.copy()
- if f=='qty_available':
- c.update({ 'states':('done',), 'what':('in', 'out') })
- if f=='virtual_available':
- c.update({ 'states':('confirmed','waiting','assigned','done'), 'what':('in', 'out') })
- if f=='incoming_qty':
- c.update({ 'states':('confirmed','waiting','assigned'), 'what':('in',) })
- if f=='outgoing_qty':
- c.update({ 'states':('confirmed','waiting','assigned'), 'what':('out',) })
- stock=self.get_product_available(cr,uid,ids,context=c)
+ if f == 'qty_available':
+ c.update({ 'states': ('done',), 'what': ('in', 'out') })
+ if f == 'virtual_available':
+ c.update({ 'states': ('confirmed','waiting','assigned','done'), 'what': ('in', 'out') })
+ if f == 'incoming_qty':
+ c.update({ 'states': ('confirmed','waiting','assigned'), 'what': ('in',) })
+ if f == 'outgoing_qty':
+ c.update({ 'states': ('confirmed','waiting','assigned'), 'what': ('out',) })
+ stock = self.get_product_available(cr, uid, ids, context=c)
for id in ids:
res[id][f] = stock.get(id, 0.0)
return res
@@ -281,7 +313,14 @@ class product_product(osv.osv):
'track_incoming': fields.boolean('Track Incoming Lots', help="Forces to use a tracking lot during receptions"),
'track_outgoing': fields.boolean('Track Outgoing Lots', help="Forces to use a tracking lot during deliveries"),
'location_id': fields.dummy(string='Location', relation='stock.location', type='many2one', domain=[('usage','=','internal')]),
+ 'valuation':fields.selection([('manual_periodic', 'Periodic (manual)'),
+ ('real_time','Real Time (automatized)'),], 'Stock Valuation', help="Decide if the system must automatically creates account moves based on stock moves", required=True),
}
+
+ _defaults = {
+ 'valuation': lambda *a: 'manual_periodic',
+ }
+
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
res = super(product_product,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
if context == None:
@@ -367,7 +406,6 @@ class product_template(osv.osv):
string='Stock Output Account', method=True, view_load=True,
help='This account will be used, instead of the default one, to value output stock'),
}
-
product_template()
@@ -386,8 +424,13 @@ class product_category(osv.osv):
type='many2one', relation='account.account',
string='Stock Output Account', method=True, view_load=True,
help='This account will be used to value the output stock'),
+ 'property_stock_variation': fields.property('account.account',
+ type='many2one',
+ relation='account.account',
+ string="Stock variation Account",
+ method=True, view_load=True,
+ help="This account will be used in product when valuation type is real-time valuation ",),
}
-
product_category()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml
index 02c60968e04..4f6ede6c460 100644
--- a/addons/stock/product_view.xml
+++ b/addons/stock/product_view.xml
@@ -123,6 +123,18 @@
+
+ product.valuation.stock.form.inherit
+ product.product
+ form
+
+
+
+
+
+
+
+
diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml
index a3771b4a480..458fc250091 100755
--- a/addons/stock/report/report_stock_move_view.xml
+++ b/addons/stock/report/report_stock_move_view.xml
@@ -10,6 +10,7 @@
+
@@ -18,9 +19,7 @@
-
-
@@ -60,15 +59,10 @@
help="Stock Moves of today"/>
-
-
-
+ domain="[('state','in',('assigned','done','waiting','confirmed'))]"
+ help = "Future Stock-Moves"/>
+
-
-
+
+
-
+
@@ -112,7 +107,7 @@
formtree,graph
- {'search_default_product':1, 'search_default_src_location':1,'search_default_done':1,'group_by':[]}
+ {'search_default_product':1, 'search_default_src_location':1,'search_default_done':1,'group_by':[], 'group_by_no_leaf':1}
@@ -1551,7 +1554,7 @@
- Incoming Products
+ Incoming Packingsstock.moveir.actions.act_windowform
@@ -1761,5 +1764,33 @@
calendar
+
+
+ Outcoming Packings
+ stock.move
+ ir.actions.act_window
+ form
+ tree,form
+ [('picking_id','!=',False),('picking_id.type','=','out')]
+
+ {"search_default_receive":1}
+
+
+
+
+
+ tree
+
+
+
+
+
+ form
+
+
+
+
+
+
diff --git a/addons/stock/test/stock_test.yml b/addons/stock/test/stock_test.yml
index 6a9bf3ff9f3..38ecddffb91 100644
--- a/addons/stock/test/stock_test.yml
+++ b/addons/stock/test/stock_test.yml
@@ -288,6 +288,7 @@
In Order to test the picking I create picking with move lines.
-
!record {model: stock.picking, id: stock_picking_0}:
+ name: test_picking
address_id: res_partner_address_0
company_id: base.main_company
date: '2010-05-11 15:18:52'
diff --git a/addons/stock/wizard/stock_change_standard_price.py b/addons/stock/wizard/stock_change_standard_price.py
index d83b2c1d140..149b0b04e84 100644
--- a/addons/stock/wizard/stock_change_standard_price.py
+++ b/addons/stock/wizard/stock_change_standard_price.py
@@ -34,17 +34,13 @@ class change_standard_price(osv.osv_memory):
}
def default_get(self, cr, uid, fields, context):
- """
- To get default values for the object.
-
+ """ To get default values for the object.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param fields: List of fields for which we want default values
@param context: A standard dictionary
-
@return: A dictionary which of fields with values.
-
"""
product_pool = self.pool.get('product.product')
product_obj = product_pool.browse(cr, uid, context.get('active_id', False))
@@ -68,6 +64,16 @@ class change_standard_price(osv.osv_memory):
return res
def onchange_price(self, cr, uid, ids, new_price, context = {}):
+ """ Sets stock input and output account according to the difference
+ of old price and new price.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param new_price: Changed price
+ @param context: A standard dictionary
+ @return: Dictionary of values
+ """
product_obj = self.pool.get('product.product').browse(cr, uid, context.get('active_id', False))
price = product_obj.standard_price
diff = price - new_price
@@ -77,18 +83,14 @@ class change_standard_price(osv.osv_memory):
return {'value' : {'enable_stock_in_out_acc':False}}
def change_price(self, cr, uid, ids, context):
- """
- Changes the Standard Price of Product.
- And creates an account move accordingly.
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: List of IDs selected
- @param context: A standard dictionary
-
- @return:
-
+ """ Changes the Standard Price of Product.
+ And creates an account move accordingly.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ @return:
"""
rec_id = context and context.get('active_id', False)
assert rec_id, _('Active ID is not set in Context')
diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py
index 3247628657a..3742349425c 100644
--- a/addons/stock/wizard/stock_fill_inventory.py
+++ b/addons/stock/wizard/stock_fill_inventory.py
@@ -34,21 +34,17 @@ class stock_fill_inventory(osv.osv_memory):
_description = "Fill Inventory"
_columns = {
'location_id': fields.many2one('stock.location', 'Location', required=True),
- 'recursive': fields.boolean("Include all childs for the location"),
- }
+ 'recursive': fields.boolean("Include all children for the location"),
+ }
def fill_inventory(self, cr, uid, ids, context):
- """
- To fill stock inventory according to products available in the selected locations..
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To fill stock inventory according to products available in the selected locations.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
inventory_line_obj = self.pool.get('stock.inventory.line')
location_obj = self.pool.get('stock.location')
diff --git a/addons/stock/wizard/stock_inventory_line_split.py b/addons/stock/wizard/stock_inventory_line_split.py
index 9fe71582c7f..9f91a47c9a5 100644
--- a/addons/stock/wizard/stock_inventory_line_split.py
+++ b/addons/stock/wizard/stock_inventory_line_split.py
@@ -35,17 +35,13 @@ class stock_inventory_line_split(osv.osv_memory):
def default_get(self, cr, uid, fields, context):
- """
- To check the availability of production lot.
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for which we want default values
- @param context: A standard dictionary
-
- @return: A dictionary which of fields with values.
-
+ """ To check the availability of production lot.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for which we want default values
+ @param context: A standard dictionary
+ @return: A dictionary which of fields with values.
"""
record_id = context and context.get('active_id',False)
res = super(stock_inventory_line_split, self).default_get(cr, uid, fields, context=context)
@@ -55,18 +51,14 @@ class stock_inventory_line_split(osv.osv_memory):
return res
def split(self, cr, uid, ids, line_ids, context=None):
- """
- To split stock inventory lines according to production lot
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param line_ids: the ID or list of IDs of inventory lines we want to split
- @param context: A standard dictionary
-
- @return:
-
+ """ To split stock inventory lines according to production lot.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param line_ids: the ID or list of IDs of inventory lines we want to split
+ @param context: A standard dictionary
+ @return:
"""
prodlot_obj = self.pool.get('stock.production.lot')
ir_sequence_obj = self.pool.get('ir.sequence')
diff --git a/addons/stock/wizard/stock_inventory_merge.py b/addons/stock/wizard/stock_inventory_merge.py
index 1c11ad8e2ad..30450e4d253 100644
--- a/addons/stock/wizard/stock_inventory_merge.py
+++ b/addons/stock/wizard/stock_inventory_merge.py
@@ -31,22 +31,15 @@ import wizard
class stock_inventory_merge(osv.osv_memory):
_name = "stock.inventory.merge"
_description = "Merge Inventory"
- _columns = {
-
- }
def do_merge(self, cr, uid, ids, context):
- """
- To merge selected Inventories.
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: List of IDs selected
- @param context: A standard dictionary
-
- @return:
-
+ """ To merge selected Inventories.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
+ @return:
"""
invent_obj = self.pool.get('stock.inventory')
invent_line_obj = self.pool.get('stock.inventory.line')
diff --git a/addons/stock/wizard/stock_inventory_set_stock_zero.py b/addons/stock/wizard/stock_inventory_set_stock_zero.py
index 63296b69875..f72e4f088b0 100644
--- a/addons/stock/wizard/stock_inventory_set_stock_zero.py
+++ b/addons/stock/wizard/stock_inventory_set_stock_zero.py
@@ -32,22 +32,19 @@ import wizard
class inventory_set_stock_zero(osv.osv_memory):
_name = "stock.inventory.set.stock.zero"
_description = "Set Stock to 0"
+
_columns = {
'location_id': fields.many2one('stock.location', 'Location', required=True),
- }
+ }
def do_merge(self, cr, uid, ids, context):
- """
- To set stock to Zero
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To set stock to Zero
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
invent_obj = pooler.get_pool(cr.dbname).get('stock.inventory')
invent_line_obj = pooler.get_pool(cr.dbname).get('stock.inventory.line')
diff --git a/addons/stock/wizard/stock_invoice_onshipping.py b/addons/stock/wizard/stock_invoice_onshipping.py
index d2b671e9571..377a40f3cb9 100644
--- a/addons/stock/wizard/stock_invoice_onshipping.py
+++ b/addons/stock/wizard/stock_invoice_onshipping.py
@@ -39,20 +39,16 @@ class stock_invoice_onshipping(osv.osv_memory):
('out_refund', 'Customer Refund'),
('in_refund', 'Supplier Refund')] , 'Type', required=True),
'invoice_date': fields.date('Invoiced date'),
- }
+ }
def _get_type(self, cr, uid, context=None):
- """
- To get invoice type
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return: invoice type
-
+ """ To get invoice type.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: The ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return: Invoice type
"""
if context is None:
context = {}
@@ -80,20 +76,16 @@ class stock_invoice_onshipping(osv.osv_memory):
_defaults = {
'type': _get_type,
- }
+ }
def create_invoice(self, cr, uid, ids, context):
- """
- To create invoice
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return: invoice ids
-
+ """ To create invoice
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return: Invoice ids
"""
result = []
picking_obj = self.pool.get('stock.picking')
diff --git a/addons/stock/wizard/stock_location_product.py b/addons/stock/wizard/stock_location_product.py
index b41809b67bd..9fe800bb0fe 100644
--- a/addons/stock/wizard/stock_location_product.py
+++ b/addons/stock/wizard/stock_location_product.py
@@ -30,16 +30,13 @@ class stock_location_product(osv.osv_memory):
}
def action_open_window(self, cr, uid, ids, context):
- """
- To open location wise product information specific to given duration
-
+ """ To open location wise product information specific to given duration
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
+ @param ids: An ID or list of IDs if we want more than one
@param context: A standard dictionary
-
- @return: invoice type
+ @return: Invoice type
"""
mod_obj = self.pool.get('ir.model.data')
for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date']):
diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py
index aa7bb42cf8b..bce550e74ff 100644
--- a/addons/stock/wizard/stock_move.py
+++ b/addons/stock/wizard/stock_move.py
@@ -29,24 +29,20 @@ class stock_move_track(osv.osv_memory):
_columns = {
'tracking_prefix': fields.char('Tracking prefix', size=64),
'quantity': fields.float("Quantity per lot")
- }
+ }
_defaults = {
'quantity': lambda *x: 1
- }
+ }
def track_lines(self, cr, uid, ids, context={}):
- """
- To track stock moves lines
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To track stock moves lines
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: An ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
datas = self.read(cr, uid, ids)[0]
move_obj = self.pool.get('stock.move')
@@ -67,17 +63,13 @@ class stock_move_consume(osv.osv_memory):
}
def default_get(self, cr, uid, fields, context=None):
- """
- Get default values
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for default value
- @param context: A standard dictionary
-
- @return: default values of fields
-
+ """ Get default values
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
+ @return: default values of fields
"""
res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
@@ -93,17 +85,13 @@ class stock_move_consume(osv.osv_memory):
return res
def do_move_consume(self, cr, uid, ids, context={}):
- """
- To move consumed products
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To move consumed products
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
move_obj = self.pool.get('stock.move')
move_ids = context['active_ids']
@@ -126,17 +114,13 @@ class stock_move_scrap(osv.osv_memory):
}
def default_get(self, cr, uid, fields, context=None):
- """
- Get default values
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for default value
- @param context: A standard dictionary
-
- @return: default values of fields
-
+ """ Get default values
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
+ @return: default values of fields
"""
res = super(stock_move_consume, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
@@ -158,17 +142,13 @@ class stock_move_scrap(osv.osv_memory):
return res
def move_scrap(self, cr, uid, ids, context={}):
- """
- To move scraped products
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To move scraped products
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
move_obj = self.pool.get('stock.move')
move_ids = context['active_ids']
@@ -186,58 +166,52 @@ class split_in_production_lot(osv.osv_memory):
_description = "Split in Production lots"
def default_get(self, cr, uid, fields, context=None):
- """
- Get default values
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param fields: List of fields for default value
- @param context: A standard dictionary
-
- @return: default values of fields
-
+ """ Get default values
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param fields: List of fields for default value
+ @param context: A standard dictionary
+ @return: Default values of fields
"""
res = super(split_in_production_lot, self).default_get(cr, uid, fields, context=context)
move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
if 'product_id' in fields:
res.update({'product_id': move.product_id.id})
+ if 'qty' in fields:
+ res.update({'qty': move.product_qty})
return res
_columns = {
+ 'qty': fields.integer('Quantity'),
'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
- 'line_ids': fields.one2many('stock.move.split.lines', 'lot_id', 'Lots Number')
+ 'line_ids': fields.one2many('stock.move.split.lines', 'lot_id', 'Lots Number'),
+ 'line_exist_ids': fields.one2many('stock.move.split.lines.exist', 'lot_id', 'Lots Existing Numbers'),
+ 'use_exist' : fields.boolean('Use Exist'),
}
+
def split_lot(self, cr, uid, ids, context=None):
- """
- To split a lot
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
-
- @return:
-
+ """ To split a lot
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: An ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return:
"""
self.split(cr, uid, ids, context.get('active_ids'), context=context)
return {}
def split(self, cr, uid, ids, move_ids, context=None):
- """
- To split stock moves into production lot
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param move_ids: the ID or list of IDs of stock move we want to split
- @param context: A standard dictionary
-
- @return:
-
+ """ To split stock moves into production lot
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: the ID or list of IDs if we want more than one
+ @param move_ids: the ID or list of IDs of stock move we want to split
+ @param context: A standard dictionary
+ @return:
"""
prodlot_obj = self.pool.get('stock.production.lot')
ir_sequence_obj = self.pool.get('ir.sequence')
@@ -249,10 +223,12 @@ class split_in_production_lot(osv.osv_memory):
quantity_rest = move.product_qty
uos_qty_rest = move.product_uos_qty
new_move = []
- for line in data.line_ids:
+ if data.use_exist:
+ lines = [l for l in data.line_exist_ids if l]
+ else:
+ lines = [l for l in data.line_ids if l]
+ for line in lines:
quantity = line.quantity
-
-
if quantity <= 0 or move_qty == 0:
continue
quantity_rest -= quantity
@@ -272,20 +248,21 @@ class split_in_production_lot(osv.osv_memory):
if quantity_rest == 0:
current_move = move.id
prodlot_id = False
- if line.use_exist and line.name:
- prodlot_id = prodlot_obj.search(cr, uid, [('prefix','=',line.name),('product_id','=',data.product_id.id)])
+ if data.use_exist and line.prodlot_id:
+ prodlot_id = prodlot_obj.search(cr, uid, [('id','=',line.prodlot_id.id)])
if prodlot_id:
- prodlot_id = prodlot_id[0]
+ prodlot_id = prodlot_id[0]
if not prodlot_id:
- sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
- prodlot_id = prodlot_obj.create(cr, uid, {'name': sequence, 'prefix' : line.name},
+ # sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
+ prodlot_id = prodlot_obj.create(cr, uid, {'name': line.name},
+ # 'prefix' : line.name},
{'product_id': move.product_id.id})
move_obj.write(cr, uid, [current_move], {'prodlot_id': prodlot_id})
prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
- ref = '%d' % (move.id)
- if prodlot.ref:
- ref = '%s, %s' % (prodlot.ref, ref)
- prodlot_obj.write(cr, uid, [prodlot_id], {'ref': ref})
+ # ref = '%d' % (move.id)
+ # if prodlot.ref:
+ # ref = '%s, %s' % (prodlot.ref, ref)
+ # prodlot_obj.write(cr, uid, [prodlot_id], {'ref': ref})
update_val = {}
if quantity_rest > 0:
@@ -295,10 +272,24 @@ class split_in_production_lot(osv.osv_memory):
return new_move
split_in_production_lot()
+class stock_move_split_lines_exist(osv.osv_memory):
+ _name = "stock.move.split.lines.exist"
+ _description = "Exist Split lines"
+ _columns = {
+ 'name': fields.char('Tracking serial', size=64),
+ 'quantity': fields.integer('Quantity'),
+ 'lot_id': fields.many2one('stock.move.split', 'Lot'),
+ 'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot'),
+ }
+ _defaults = {
+ 'quantity': lambda *x: 1,
+ }
+
+stock_move_split_lines_exist()
+
class stock_move_split_lines(osv.osv_memory):
_name = "stock.move.split.lines"
_description = "Split lines"
-
_columns = {
'name': fields.char('Tracking serial', size=64),
'quantity': fields.integer('Quantity'),
@@ -306,6 +297,7 @@ class stock_move_split_lines(osv.osv_memory):
'lot_id': fields.many2one('stock.move.split', 'Lot'),
'action': fields.selection([('split','Split'),('keepinone','Keep in one lot')],'Action'),
}
+
_defaults = {
'quantity': lambda *x: 1,
'action' : lambda *x: 'split',
diff --git a/addons/stock/wizard/stock_move_view.xml b/addons/stock/wizard/stock_move_view.xml
index 5f58072f17a..bba27bfe9c7 100644
--- a/addons/stock/wizard/stock_move_view.xml
+++ b/addons/stock/wizard/stock_move_view.xml
@@ -106,18 +106,32 @@