diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 51a020b9b75..6c031955cc9 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -220,7 +220,8 @@
-
+
+
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 086db98b211..84dd2c90e7c 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -585,9 +585,9 @@ class account_move_line(osv.osv):
company_list = []
for line in self.browse(cr, uid, ids, context=context):
- if not line.company_id in company_list:
+ if company_list and not line.company_id.id in company_list:
raise osv.except_osv(_('Warning !'), _('To reconcile the entries company should be the same for all entries'))
- company_list.append(line.company_id)
+ company_list.append(line.company_id.id)
for line in self.browse(cr, uid, ids, context):
if line.reconcile_id:
@@ -623,9 +623,9 @@ class account_move_line(osv.osv):
company_list = []
for line in self.browse(cr, uid, ids, context=context):
- if not line.company_id in company_list:
+ if company_list and not line.company_id.id in company_list:
raise osv.except_osv(_('Warning !'), _('To reconcile the entries company should be the same for all entries'))
- company_list.append(line.company_id)
+ company_list.append(line.company_id.id)
for line in unrec_lines:
if line.state <> 'valid':
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/sale/sale.py b/addons/sale/sale.py
index 11c04319263..ba92bad2ad4 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -423,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,
@@ -440,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))
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 8c790b3edb3..ad39f7f1cf1 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -106,7 +106,7 @@
-
+
@@ -186,7 +186,6 @@
-
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/stock/stock.py b/addons/stock/stock.py
index 87d8acf05f3..ecf09f4ae53 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -786,7 +786,8 @@ class stock_picking(osv.osv):
'name': (invoice.name or '') + ', ' + (picking.name or ''),
'origin': (invoice.origin or '') + ', ' + (picking.name or '') + (picking.origin and (':' + picking.origin) or ''),
'comment': (comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''),
- 'date_invoice':context.get('date_inv',False)
+ 'date_invoice':context.get('date_inv',False),
+ 'user_id':picking.sale_id.user_id and picking.sale_id.user_id.id or False
}
invoice_obj.write(cr, uid, [invoice_id], invoice_vals, context=context)
else:
@@ -803,6 +804,7 @@ class stock_picking(osv.osv):
'fiscal_position': partner.property_account_position.id,
'date_invoice': context.get('date_inv',False),
'company_id': picking.company_id.id,
+ 'user_id':picking.sale_id.user_id and picking.sale_id.user_id.id or False
}
cur_id = self.get_currency_id(cr, uid, picking)
if cur_id:
diff --git a/addons/stock_planning/stock_planning_view.xml b/addons/stock_planning/stock_planning_view.xml
index 1bfb1d0f1aa..1e9876060ce 100644
--- a/addons/stock_planning/stock_planning_view.xml
+++ b/addons/stock_planning/stock_planning_view.xml
@@ -18,9 +18,9 @@
-
-
-
+
+
+