[tryton-debian-vcs] tryton-modules-analytic-invoice branch debian created. 13d49e341fcf39224aea64825d9a08d02bb05107

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Wed Nov 27 16:58:15 UTC 2013


The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-analytic-invoice.git;a=commitdiff;h=13d49e341fcf39224aea64825d9a08d02bb05107
commit 13d49e341fcf39224aea64825d9a08d02bb05107
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Nov 25 20:30:06 2013 +0100

    Releasing debian version 3.0.0-1.

diff --git a/debian/changelog b/debian/changelog
index a6d8cd2..79c93c8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+tryton-modules-analytic-invoice (1:3.0.0-1) unstable; urgency=low
+
+  * Merging upstream version 3.0.0.
+  * Updating to standards version 3.9.5, no changes needed.
+  * Changing to buildsystem pybuild.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Mon, 25 Nov 2013 18:02:57 +0100
+
 tryton-modules-analytic-invoice (1:2.8.0-3) unstable; urgency=low
 
   * Adapting the rules file to work also with git-buildpackage.
commit 9c4d559edc94ca0fd1f8e06a61a171bf1127040f
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Nov 24 19:51:51 2013 +0100

    Changing to buildsystem pybuild.

diff --git a/debian/control b/debian/control
index 998b5c1..d722ec4 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,8 @@ Section: python
 Priority: optional
 Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Mathias Behrle <mathiasb at m9s.biz>
-Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
+Build-Depends:
+ debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools, dh-python
 Standards-Version: 3.9.5
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-modules-analytic-invoice.git
diff --git a/debian/rules b/debian/rules
index 30074ad..5b8c326 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,24 +1,17 @@
 #!/usr/bin/make -f
 
-MAJOR := $(shell python setup.py --version | awk -F "." '{print $$1 "." $$2}')
-PACKAGE_NAME := $(shell python setup.py --name)
-
-%:
-	dh ${@} --with python2
+# needed for pbuilder
+export LC_ALL=C.UTF-8
 
-override_dh_auto_clean:
-	dh_auto_clean
+MAJOR := $(shell python setup.py --version | awk -F "." '{print $$1 "." $$2}')
+PACKAGE_NAME := tryton-modules-$(shell python setup.py --name | sed s/^trytond_// | sed s/_/-/g)
+export PYBUILD_DESTDIR_python2=debian/${PACKAGE_NAME}
 
-override_dh_auto_build:
-	mv $(PACKAGE_NAME).egg-info $(PACKAGE_NAME).hen-info
-	mv PKG-INFO PKG-INFO.hen
-	dh_auto_build
+# Don't run tests for Tryton modules, they try to download dependencies from pypi
+export PYBUILD_DISABLE_python2.7=test
 
-override_dh_auto_install:
-	dh_auto_install
-	rm -rf *.egg-info
-	mv $(PACKAGE_NAME).hen-info $(PACKAGE_NAME).egg-info
-	mv PKG-INFO.hen PKG-INFO
+%:
+	dh ${@} --with python2 --buildsystem=pybuild
 
 override_dh_gencontrol:
 	dh_gencontrol -- -Vversion:major="$(MAJOR)"
commit e383400b74de09894a61b86198e535e5b2e40058
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Nov 24 19:14:20 2013 +0100

    Updating to standards version 3.9.5, no changes needed.

diff --git a/debian/control b/debian/control
index e231b87..998b5c1 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Mathias Behrle <mathiasb at m9s.biz>
 Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
-Standards-Version: 3.9.4
+Standards-Version: 3.9.5
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-modules-analytic-invoice.git
 Vcs-Git: git://debian.tryton.org/packages/tryton-modules-analytic-invoice.git
commit 57ff0efcb120abf04c1036df112778916d575eb5
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Nov 24 17:26:31 2013 +0100

    Merging upstream version 3.0.0.

diff --git a/CHANGELOG b/CHANGELOG
index 034335d..09d92d7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.0.0 - 2013-10-21
+* Bug fixes (see mercurial logs for details)
+
 Version 2.8.0 - 2013-04-22
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 4e6697b..ab4271e 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_analytic_invoice
-Version: 2.8.0
+Version: 3.0.0
 Summary: Tryton module to add analytic accounting on invoice
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: UNKNOWN
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.8/
+Download-URL: http://downloads.tryton.org/3.0/
 Description: trytond_analytic_invoice
         ========================
         
@@ -58,6 +58,7 @@ Classifier: Natural Language :: English
 Classifier: Natural Language :: French
 Classifier: Natural Language :: German
 Classifier: Natural Language :: Russian
+Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.6
diff --git a/invoice.py b/invoice.py
index 5beaa8f..4ce6714 100644
--- a/invoice.py
+++ b/invoice.py
@@ -35,7 +35,9 @@ class InvoiceLine:
                 ['analytic_accounts'])['analytic_accounts']
 
         fields.update(AnalyticAccount.analytic_accounts_fields_get(
-                analytic_accounts_field, fields_names))
+                analytic_accounts_field, fields_names,
+                states=cls.analytic_accounts.states,
+                required_states=Eval('type') == 'line'))
         return fields
 
     @classmethod
@@ -193,7 +195,7 @@ class InvoiceLine:
                     vals['credit'] = value['credit']
                     vals['account'] = account.id
                     vals['journal'] = self.invoice.journal.id
-                    vals['date'] = (self.invoice.accounting_date 
+                    vals['date'] = (self.invoice.accounting_date
                         or self.invoice.invoice_date)
                     vals['reference'] = self.invoice.reference
                     vals['party'] = self.invoice.party.id
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
new file mode 100644
index 0000000..e17f67e
--- /dev/null
+++ b/locale/sl_SI.po
@@ -0,0 +1,7 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.invoice.line,analytic_accounts:"
+msgid "Analytic Accounts"
+msgstr "Analitični konti"
diff --git a/setup.py b/setup.py
index a888e75..f4323c7 100644
--- a/setup.py
+++ b/setup.py
@@ -62,6 +62,7 @@ setup(name='trytond_analytic_invoice',
         'Natural Language :: French',
         'Natural Language :: German',
         'Natural Language :: Russian',
+        'Natural Language :: Slovenian',
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
         'Programming Language :: Python :: 2.6',
diff --git a/tests/__init__.py b/tests/__init__.py
index caca5e3..52b39ea 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -2,3 +2,5 @@
 #this repository contains the full copyright notices and license terms.
 
 from .test_analytic_invoice import suite
+
+__all__ = ['suite']
diff --git a/tryton.cfg b/tryton.cfg
index 5776759..fe818bf 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=2.8.0
+version=3.0.0
 depends:
     account_invoice
     analytic_account
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index abda859..c838dfd 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-analytic-invoice
-Version: 2.8.0
+Version: 3.0.0
 Summary: Tryton module to add analytic accounting on invoice
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: UNKNOWN
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.8/
+Download-URL: http://downloads.tryton.org/3.0/
 Description: trytond_analytic_invoice
         ========================
         
@@ -58,6 +58,7 @@ Classifier: Natural Language :: English
 Classifier: Natural Language :: French
 Classifier: Natural Language :: German
 Classifier: Natural Language :: Russian
+Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.6
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
index 0dd8031..300cc7f 100644
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -21,6 +21,7 @@ locale/es_ES.po
 locale/fr_FR.po
 locale/nl_NL.po
 locale/ru_RU.po
+locale/sl_SI.po
 trytond_analytic_invoice.egg-info/PKG-INFO
 trytond_analytic_invoice.egg-info/SOURCES.txt
 trytond_analytic_invoice.egg-info/dependency_links.txt
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
index 300d62e..901d602 100644
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -1,3 +1,3 @@
-trytond_account_invoice >= 2.8, < 2.9
-trytond_analytic_account >= 2.8, < 2.9
-trytond >= 2.8, < 2.9
\ No newline at end of file
+trytond_account_invoice >= 3.0, < 3.1
+trytond_analytic_account >= 3.0, < 3.1
+trytond >= 3.0, < 3.1
\ No newline at end of file
commit 1f17bedd9dab42f7617754d561e92fc9bd69e9f6
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Aug 6 16:20:44 2013 +0200

    Releasing debian version 2.8.0-3.

diff --git a/debian/changelog b/debian/changelog
index 6b799c6..a6d8cd2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-modules-analytic-invoice (1:2.8.0-3) unstable; urgency=low
+
+  * Adapting the rules file to work also with git-buildpackage.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Tue, 06 Aug 2013 13:32:24 +0200
+
 tryton-modules-analytic-invoice (1:2.8.0-2) unstable; urgency=low
 
   * Removing needless empty line in rules.
commit 85ed0c9710e7362bcc5fa751456861465931f6d6
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Aug 5 18:06:36 2013 +0200

    Adapting the rules file to work also with git-buildpackage.

diff --git a/debian/rules b/debian/rules
index a6a1fb8..30074ad 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,13 +1,24 @@
 #!/usr/bin/make -f
 
 MAJOR := $(shell python setup.py --version | awk -F "." '{print $$1 "." $$2}')
+PACKAGE_NAME := $(shell python setup.py --name)
 
 %:
 	dh ${@} --with python2
 
 override_dh_auto_clean:
 	dh_auto_clean
+
+override_dh_auto_build:
+	mv $(PACKAGE_NAME).egg-info $(PACKAGE_NAME).hen-info
+	mv PKG-INFO PKG-INFO.hen
+	dh_auto_build
+
+override_dh_auto_install:
+	dh_auto_install
 	rm -rf *.egg-info
+	mv $(PACKAGE_NAME).hen-info $(PACKAGE_NAME).egg-info
+	mv PKG-INFO.hen PKG-INFO
 
 override_dh_gencontrol:
 	dh_gencontrol -- -Vversion:major="$(MAJOR)"
commit 02dc11ea56441f5d01e7f6372ec98b10b3802f01
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri May 31 19:57:24 2013 +0200

    Releasing debian version 2.8.0-2.

diff --git a/debian/changelog b/debian/changelog
index ee025b1..6b799c6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-modules-analytic-invoice (1:2.8.0-2) unstable; urgency=low
+
+  * Removing needless empty line in rules.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Fri, 31 May 2013 17:26:09 +0200
+
 tryton-modules-analytic-invoice (1:2.8.0-1) experimental; urgency=low
 
   * Merging upstream version 2.8.0.
commit 70523d7c87c743cc84a2566a08e80b797fcc33af
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed May 29 17:19:29 2013 +0200

    Removing needless empty line in rules.

diff --git a/debian/rules b/debian/rules
index 0f63ab4..a6a1fb8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,7 +7,6 @@ MAJOR := $(shell python setup.py --version | awk -F "." '{print $$1 "." $$2}')
 
 override_dh_auto_clean:
 	dh_auto_clean
-
 	rm -rf *.egg-info
 
 override_dh_gencontrol:
commit fa3907c7d86722e36ea8885cc28ada11bc8a1a76
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu May 2 17:27:02 2013 +0200

    Releasing debian version 2.8.0-1.

diff --git a/debian/changelog b/debian/changelog
index f6da1e3..ee025b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-modules-analytic-invoice (1:2.8.0-1) experimental; urgency=low
+
+  * Merging upstream version 2.8.0.
+  * Updating copyright.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Thu, 02 May 2013 15:24:29 +0200
+
 tryton-modules-analytic-invoice (1:2.6.1-3) experimental; urgency=low
 
   * Removing Daniel from Uploaders. Thanks for your work! (Closes: #704370).
commit d73ca0e6dcd80dae5e4cbe676d7c22d7ea17e631
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu May 2 14:13:10 2013 +0200

    Updating copyright.

diff --git a/debian/copyright b/debian/copyright
index 660df10..e71ba51 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,9 +1,9 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
 Files: *
-Copyright: 2008-2012 Cédric Krier
+Copyright: 2008-2013 Cédric Krier
            2008-2012 Bertrand Chenal
-           2008-2012 B2CK SPRL
+           2008-2013 B2CK SPRL
 License: GPL-3+
 
 Files: debian/*
commit e690ea753d4cdafd7d57cdc45da807d86c3da07a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu May 2 00:35:18 2013 +0200

    Merging upstream version 2.8.0.

diff --git a/CHANGELOG b/CHANGELOG
index 39c1db7..034335d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,4 @@
-Version 2.6.1 - 2012-12-23
+Version 2.8.0 - 2013-04-22
 * Bug fixes (see mercurial logs for details)
 
 Version 2.6.0 - 2012-10-22
diff --git a/COPYRIGHT b/COPYRIGHT
index 2057c72..d7165c7 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2008-2012 Cédric Krier.
+Copyright (C) 2008-2013 Cédric Krier.
 Copyright (C) 2008-2012 Bertrand Chenal.
-Copyright (C) 2008-2012 B2CK SPRL.
+Copyright (C) 2008-2013 B2CK SPRL.
 
 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
diff --git a/MANIFEST.in b/MANIFEST.in
index 44969c7..18ce53c 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -6,5 +6,6 @@ include CHANGELOG
 include LICENSE
 include tryton.cfg
 include *.xml
+include view/*.xml
 include *.odt
 include locale/*.po
diff --git a/PKG-INFO b/PKG-INFO
index 34f802f..4e6697b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_analytic_invoice
-Version: 2.6.1
+Version: 2.8.0
 Summary: Tryton module to add analytic accounting on invoice
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: UNKNOWN
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.6/
+Download-URL: http://downloads.tryton.org/2.8/
 Description: trytond_analytic_invoice
         ========================
         
diff --git a/invoice.py b/invoice.py
index ff38301..5beaa8f 100644
--- a/invoice.py
+++ b/invoice.py
@@ -55,8 +55,7 @@ class InvoiceLine:
         res = super(InvoiceLine, cls).read(ids, fields_names=fields_names2)
 
         if not fields_names:
-            fields_names = list(set(cls._fields.keys() \
-                    + cls._inherit_fields.keys()))
+            fields_names = cls._fields.keys()
 
         root_ids = []
         for field in fields_names:
@@ -69,41 +68,43 @@ class InvoiceLine:
             lines = cls.browse(ids)
             for line in lines:
                 for root_id in root_ids:
-                    id2record[line.id]['analytic_account_' \
-                            + str(root_id)] = None
+                    id2record[line.id]['analytic_account_'
+                        + str(root_id)] = None
                 if line.type != 'line':
                     continue
                 if not line.analytic_accounts:
                     continue
                 for account in line.analytic_accounts.accounts:
                     if account.root.id in root_ids:
-                        id2record[line.id]['analytic_account_' \
-                                + str(account.root.id)] = account.id
+                        id2record[line.id]['analytic_account_'
+                            + str(account.root.id)] = account.id
                         for field in fields_names:
-                            if field.startswith('analytic_account_' + \
-                                    str(account.root.id) + '.'):
+                            if field.startswith('analytic_account_'
+                                    + str(account.root.id) + '.'):
                                 ham, field2 = field.split('.', 1)
                                 id2record[line.id][field] = account[field2]
         return res
 
     @classmethod
-    def create(cls, vals):
+    def create(cls, vlist):
         Selection = Pool().get('analytic_account.account.selection')
-        vals = vals.copy()
-        selection_vals = {}
-        for field in vals.keys():
-            if field.startswith('analytic_account_'):
-                if vals[field]:
-                    selection_vals.setdefault('accounts', [])
-                    selection_vals['accounts'].append(('add', [vals[field]]))
-                del vals[field]
-        if vals.get('analytic_accounts'):
-            Selection.write([Selection(vals['analytic_accounts'])],
-                selection_vals)
-        elif vals.get('type', 'line') == 'line':
-            selection = Selection.create(selection_vals)
-            vals['analytic_accounts'] = selection.id
-        return super(InvoiceLine, cls).create(vals)
+        vlist = [x.copy() for x in vlist]
+        for vals in vlist:
+            selection_vals = {}
+            for field in vals.keys():
+                if field.startswith('analytic_account_'):
+                    if vals[field]:
+                        selection_vals.setdefault('accounts', [])
+                        selection_vals['accounts'].append(('add',
+                                [vals[field]]))
+                    del vals[field]
+            if vals.get('analytic_accounts'):
+                Selection.write([Selection(vals['analytic_accounts'])],
+                    selection_vals)
+            elif vals.get('type', 'line') == 'line':
+                selection, = Selection.create([selection_vals])
+                vals['analytic_accounts'] = selection.id
+        return super(InvoiceLine, cls).create(vlist)
 
     @classmethod
     def write(cls, lines, vals):
@@ -123,7 +124,7 @@ class InvoiceLine:
                 if not line.analytic_accounts:
                     # Create missing selection
                     with Transaction().set_user(0):
-                            selection = Selection.create({})
+                            selection, = Selection.create([{}])
                     cls.write([line], {
                             'analytic_accounts': selection.id,
                             })
@@ -184,6 +185,7 @@ class InvoiceLine:
         if self.analytic_accounts and self.analytic_accounts.accounts:
             for value in values:
                 value['analytic_lines'] = []
+                to_create = []
                 for account in self.analytic_accounts.accounts:
                     vals = {}
                     vals['name'] = self.description
@@ -191,10 +193,13 @@ class InvoiceLine:
                     vals['credit'] = value['credit']
                     vals['account'] = account.id
                     vals['journal'] = self.invoice.journal.id
-                    vals['date'] = self.invoice.invoice_date
+                    vals['date'] = (self.invoice.accounting_date 
+                        or self.invoice.invoice_date)
                     vals['reference'] = self.invoice.reference
                     vals['party'] = self.invoice.party.id
-                    value['analytic_lines'].append(('create', vals))
+                    to_create.append(vals)
+                if to_create:
+                    value['analytic_lines'] = [('create', to_create)]
         return values
 
 
@@ -210,13 +215,13 @@ class Account(ModelSQL, ModelView):
         InvoiceLine._fields_view_get_cache.clear()
 
     @classmethod
-    def create(cls, vals):
+    def create(cls, vlist):
         InvoiceLine = Pool().get('account.invoice.line')
-        account = super(Account, cls).create(vals)
+        accounts = super(Account, cls).create(vlist)
         # Restart the cache on the fields_view_get method of
         # account.invoice.line
         InvoiceLine._fields_view_get_cache.clear()
-        return account
+        return accounts
 
     @classmethod
     def write(cls, accounts, vals):
diff --git a/invoice.xml b/invoice.xml
index 7509e7f..0fff583 100644
--- a/invoice.xml
+++ b/invoice.xml
@@ -6,19 +6,7 @@ this repository contains the full copyright notices and license terms. -->
         <record model="ir.ui.view" id="invoice_line_view_form">
             <field name="model">account.invoice.line</field>
             <field name="inherit" ref="account_invoice.invoice_line_view_form"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/form/notebook/page/field[@name="taxes"]"
-                        position="before">
-                        <group col="4" colspan="4" name="analytic_accounts">
-                            <field name="analytic_accounts"/>
-                        </group>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
+            <field name="name">invoice_line_form</field>
         </record>
     </data>
 </tryton>
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index 1d3bd89..054e2aa 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -4,4 +4,4 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 
 msgctxt "field:account.invoice.line,analytic_accounts:"
 msgid "Analytic Accounts"
-msgstr ""
+msgstr "Счета аналитики"
diff --git a/setup.py b/setup.py
index 49dc191..a888e75 100644
--- a/setup.py
+++ b/setup.py
@@ -25,10 +25,10 @@ requires = []
 for dep in info.get('depends', []):
     if not re.match(r'(ir|res|webdav)(\W|$)', dep):
         requires.append('trytond_%s >= %s.%s, < %s.%s' %
-                (dep, major_version, minor_version, major_version,
-                    minor_version + 1))
+            (dep, major_version, minor_version, major_version,
+                minor_version + 1))
 requires.append('trytond >= %s.%s, < %s.%s' %
-        (major_version, minor_version, major_version, minor_version + 1))
+    (major_version, minor_version, major_version, minor_version + 1))
 
 setup(name='trytond_analytic_invoice',
     version=info.get('version', '0.0.1'),
@@ -36,16 +36,16 @@ setup(name='trytond_analytic_invoice',
     long_description=read('README'),
     author='Tryton',
     url='http://www.tryton.org/',
-    download_url="http://downloads.tryton.org/" + \
-        info.get('version', '0.0.1').rsplit('.', 1)[0] + '/',
+    download_url=("http://downloads.tryton.org/" +
+        info.get('version', '0.0.1').rsplit('.', 1)[0] + '/'),
     package_dir={'trytond.modules.analytic_invoice': '.'},
     packages=[
         'trytond.modules.analytic_invoice',
         'trytond.modules.analytic_invoice.tests',
         ],
     package_data={
-        'trytond.modules.analytic_invoice': info.get('xml', []) \
-            + ['tryton.cfg', 'locale/*.po'],
+        'trytond.modules.analytic_invoice': (info.get('xml', [])
+            + ['tryton.cfg', 'view/*.xml', 'locale/*.po']),
         },
     classifiers=[
         'Development Status :: 5 - Production/Stable',
diff --git a/tryton.cfg b/tryton.cfg
index b14d8fc..5776759 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=2.6.1
+version=2.8.0
 depends:
     account_invoice
     analytic_account
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index bd291ea..abda859 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-analytic-invoice
-Version: 2.6.1
+Version: 2.8.0
 Summary: Tryton module to add analytic accounting on invoice
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: UNKNOWN
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.6/
+Download-URL: http://downloads.tryton.org/2.8/
 Description: trytond_analytic_invoice
         ========================
         
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
index a534036..0dd8031 100644
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -27,4 +27,5 @@ trytond_analytic_invoice.egg-info/dependency_links.txt
 trytond_analytic_invoice.egg-info/entry_points.txt
 trytond_analytic_invoice.egg-info/not-zip-safe
 trytond_analytic_invoice.egg-info/requires.txt
-trytond_analytic_invoice.egg-info/top_level.txt
\ No newline at end of file
+trytond_analytic_invoice.egg-info/top_level.txt
+view/invoice_line_form.xml
\ No newline at end of file
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
index 287b990..300d62e 100644
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -1,3 +1,3 @@
-trytond_account_invoice >= 2.6, < 2.7
-trytond_analytic_account >= 2.6, < 2.7
-trytond >= 2.6, < 2.7
\ No newline at end of file
+trytond_account_invoice >= 2.8, < 2.9
+trytond_analytic_account >= 2.8, < 2.9
+trytond >= 2.8, < 2.9
\ No newline at end of file
diff --git a/view/invoice_line_form.xml b/view/invoice_line_form.xml
new file mode 100644
index 0000000..b0fa414
--- /dev/null
+++ b/view/invoice_line_form.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<data>
+    <xpath
+        expr="/form/notebook/page/field[@name='taxes']"
+        position="before">
+        <group col="4" colspan="4" name="analytic_accounts">
+            <field name="analytic_accounts"/>
+        </group>
+    </xpath>
+</data>
commit 3391a7db2ea1218a427c99269298f376314a7c51
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Apr 27 18:44:41 2013 +0200

    Releasing debian version 2.6.1-3.

diff --git a/debian/changelog b/debian/changelog
index 1eaf255..f6da1e3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-modules-analytic-invoice (1:2.6.1-3) experimental; urgency=low
+
+  * Removing Daniel from Uploaders. Thanks for your work! (Closes: #704370).
+  * Improving update of major version in Depends.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Sat, 27 Apr 2013 15:05:52 +0200
+
 tryton-modules-analytic-invoice (1:2.6.1-2) experimental; urgency=low
 
   * Updating Vcs-Git to correct address.
commit b36216849a54670e101cec1c0ceb908d3b2ae62a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Apr 27 14:54:47 2013 +0200

    Improving update of major version in Depends.
    
    Pulling the major version for Depends directly from the package version.
    Thanks to Ilya Melnikov for pushing the idea.

diff --git a/debian/control b/debian/control
index 16a5aac..e231b87 100644
--- a/debian/control
+++ b/debian/control
@@ -13,9 +13,9 @@ X-Python-Version: >= 2.6
 Package: tryton-modules-analytic-invoice
 Architecture: all
 Depends:
- ${misc:Depends}, ${python:Depends}, tryton-server (>= 2.6),
- tryton-modules-account-invoice (>= 2.6),
- tryton-modules-analytic-account (>= 2.6), python-pkg-resources
+ ${misc:Depends}, ${python:Depends}, tryton-server (>= ${version:major}),
+ tryton-modules-account-invoice (>= ${version:major}),
+ tryton-modules-analytic-account (>= ${version:major}), python-pkg-resources
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
  and using PostgreSQL as database engine. It is the core base of a complete
diff --git a/debian/rules b/debian/rules
index 1ae0776..0f63ab4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,7 @@
 #!/usr/bin/make -f
 
+MAJOR := $(shell python setup.py --version | awk -F "." '{print $$1 "." $$2}')
+
 %:
 	dh ${@} --with python2
 
@@ -8,5 +10,8 @@ override_dh_auto_clean:
 
 	rm -rf *.egg-info
 
+override_dh_gencontrol:
+	dh_gencontrol -- -Vversion:major="$(MAJOR)"
+
 override_dh_builddeb:
 	dh_builddeb -- -Zxz -z9
commit 9216e644ba27b720f49c3880e71fd7702b013115
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Apr 21 23:27:31 2013 +0200

    Removing Daniel from Uploaders. Thanks for your work! (Closes: #704370).

diff --git a/debian/control b/debian/control
index 79914f0..16a5aac 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: tryton-modules-analytic-invoice
 Section: python
 Priority: optional
 Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
-Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
+Uploaders: Mathias Behrle <mathiasb at m9s.biz>
 Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
 Standards-Version: 3.9.4
 Homepage: http://www.tryton.org/
commit 5c8d46977bed13045b4ba86a59a37d602e1a119c
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Mar 23 15:03:59 2013 +0100

    Releasing debian version 2.6.1-2.

diff --git a/debian/changelog b/debian/changelog
index 074370d..1eaf255 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-modules-analytic-invoice (1:2.6.1-2) experimental; urgency=low
+
+  * Updating Vcs-Git to correct address.
+  * Adding watch file. Thanks to Bart Martens <bartm at debian.org>.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Sat, 23 Mar 2013 14:00:17 +0100
+
 tryton-modules-analytic-invoice (1:2.6.1-1) experimental; urgency=low
 
   * Removing obsolete Dm-Upload-Allowed
commit 1dab795a359e4d59128861b781f1bd5a3100f137
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Mar 23 13:52:32 2013 +0100

    Adding watch file. Thanks to Bart Martens <bartm at debian.org>.

diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..ab86490
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://downloads.tryton.org/current/ .*trytond_analytic_invoice-(\d.*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz))
commit 556abfd3fef0cde5c16b5ea6f5b67076522129bc
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Feb 23 20:08:08 2013 +0100

    Updating Vcs-Git to correct address.

diff --git a/debian/control b/debian/control
index aa30117..79914f0 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
 Standards-Version: 3.9.4
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-modules-analytic-invoice.git
-Vcs-Git: git://debian.tryton.org/git/packages/tryton-modules-analytic-invoice.git
+Vcs-Git: git://debian.tryton.org/packages/tryton-modules-analytic-invoice.git
 X-Python-Version: >= 2.6
 
 Package: tryton-modules-analytic-invoice
commit 8f3d9c469e2fa289c7181600e75aee1d9db7dd02
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Feb 17 13:50:38 2013 +0100

    Releasing debian version 2.6.1-1.

diff --git a/debian/changelog b/debian/changelog
index 6e0e972..074370d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+tryton-modules-analytic-invoice (1:2.6.1-1) experimental; urgency=low
+
+  * Removing obsolete Dm-Upload-Allowed
+  * Updating to Standards-Version: 3.9.4, no changes needed.
+  * Merging upstream version 2.6.1.
+  * Updating copyright.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Sat, 16 Feb 2013 21:36:08 +0100
+
 tryton-modules-analytic-invoice (1:2.6.0-1) experimental; urgency=low
 
   * Merging upstream version 2.6.0.
commit cc9fc7594d1d46589500761603fa32dcf719fd2b
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Feb 16 21:29:18 2013 +0100

    Updating copyright.

diff --git a/debian/copyright b/debian/copyright
index 9473f61..660df10 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,14 +1,14 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
 Files: *
-Copyright: 2008-2012 Cedric Krier
+Copyright: 2008-2012 Cédric Krier
            2008-2012 Bertrand Chenal
            2008-2012 B2CK SPRL
 License: GPL-3+
 
 Files: debian/*
 Copyright: 2009-2012 Daniel Baumann <daniel at debian.org>
-           2012 Mathias Behrle <mathiasb at m9s.biz>
+           2012-2013 Mathias Behrle <mathiasb at m9s.biz>
 License: GPL-3+
 
 License: GPL-3+
commit c8f6d1520254aa796288fc58cd033b5e5019fa7a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Feb 15 20:50:34 2013 +0100

    Merging upstream version 2.6.1.

diff --git a/CHANGELOG b/CHANGELOG
index e70af61..39c1db7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.6.1 - 2012-12-23
+* Bug fixes (see mercurial logs for details)
+
 Version 2.6.0 - 2012-10-22
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index a96550f..34f802f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
 Name: trytond_analytic_invoice
-Version: 2.6.0
+Version: 2.6.1
 Summary: Tryton module to add analytic accounting on invoice
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/invoice.py b/invoice.py
index 8a631fe..ff38301 100644
--- a/invoice.py
+++ b/invoice.py
@@ -95,7 +95,7 @@ class InvoiceLine:
             if field.startswith('analytic_account_'):
                 if vals[field]:
                     selection_vals.setdefault('accounts', [])
-                    selection_vals['accounts'].append(('add', vals[field]))
+                    selection_vals['accounts'].append(('add', [vals[field]]))
                 del vals[field]
         if vals.get('analytic_accounts'):
             Selection.write([Selection(vals['analytic_accounts'])],
diff --git a/tryton.cfg b/tryton.cfg
index db9947d..b14d8fc 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=2.6.0
+version=2.6.1
 depends:
     account_invoice
     analytic_account
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index db0bf80..bd291ea 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
 Name: trytond-analytic-invoice
-Version: 2.6.0
+Version: 2.6.1
 Summary: Tryton module to add analytic accounting on invoice
 Home-page: http://www.tryton.org/
 Author: Tryton
commit 96ab054f6dc9800262982e58b5d8aa35972524a4
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Feb 15 19:28:26 2013 +0100

    Updating to Standards-Version: 3.9.4, no changes needed.

diff --git a/debian/control b/debian/control
index c483b70..aa30117 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
 Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
-Standards-Version: 3.9.3
+Standards-Version: 3.9.4
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-modules-analytic-invoice.git
 Vcs-Git: git://debian.tryton.org/git/packages/tryton-modules-analytic-invoice.git
commit ec1506b62cfd30f161a2892eaa684b3730365b3c
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Feb 13 21:37:13 2013 +0100

    Removing obsolete Dm-Upload-Allowed

diff --git a/debian/control b/debian/control
index dcaa217..c483b70 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,6 @@ Section: python
 Priority: optional
 Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
-Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
 Standards-Version: 3.9.3
 Homepage: http://www.tryton.org/
commit 1ef4bf4a39575cdf99cb72b9d63bee9d6fd01f20
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Oct 24 22:01:50 2012 +0200

    Releasing debian version 2.6.0-1.

diff --git a/debian/changelog b/debian/changelog
index 8ce41d8..6e0e972 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+tryton-modules-analytic-invoice (1:2.6.0-1) experimental; urgency=low
+
+  * Merging upstream version 2.6.0.
+  * Bumping versioned tryton depends to 2.6.
+  * Adding xz compression to source/options.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Wed, 24 Oct 2012 14:27:45 +0200
+
 tryton-modules-analytic-invoice (1:2.4.1-2) experimental; urgency=low
 
   [ Daniel Baumann ]
commit 1984af52f94af1505600639f9f86b91db5d9c6ce
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Oct 24 14:21:49 2012 +0200

    Adding xz compression to source/options.

diff --git a/debian/source/options b/debian/source/options
index d053b65..22a4de9 100644
--- a/debian/source/options
+++ b/debian/source/options
@@ -1,2 +1,2 @@
-compression = gzip
+compression = xz
 compression-level = 9
commit 23095b96039cd31edef441df4befe9e8a11c785c
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Oct 23 19:59:46 2012 +0200

    Bumping versioned tryton depends to 2.6.

diff --git a/debian/control b/debian/control
index 426186b..dcaa217 100644
--- a/debian/control
+++ b/debian/control
@@ -14,9 +14,9 @@ X-Python-Version: >= 2.6
 Package: tryton-modules-analytic-invoice
 Architecture: all
 Depends:
- ${misc:Depends}, ${python:Depends}, tryton-server (>= 2.4),
- tryton-modules-account-invoice (>= 2.4),
- tryton-modules-analytic-account (>= 2.4), python-pkg-resources
+ ${misc:Depends}, ${python:Depends}, tryton-server (>= 2.6),
+ tryton-modules-account-invoice (>= 2.6),
+ tryton-modules-analytic-account (>= 2.6), python-pkg-resources
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
  and using PostgreSQL as database engine. It is the core base of a complete
commit f7e5d00518529f5f90a93b01284a278120eb46e8
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Oct 23 19:53:28 2012 +0200

    Merging upstream version 2.6.0.

diff --git a/CHANGELOG b/CHANGELOG
index dc330ba..e70af61 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,5 @@
-Version 2.4.1 - 2012-04-24
-* Restore es_AR translation
+Version 2.6.0 - 2012-10-22
+* Bug fixes (see mercurial logs for details)
 
 Version 2.4.0 - 2012-04-23
 * Bug fixes (see mercurial logs for details)
diff --git a/MANIFEST.in b/MANIFEST.in
index 7f5d5fd..44969c7 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -4,6 +4,7 @@ include TODO
 include COPYRIGHT
 include CHANGELOG
 include LICENSE
+include tryton.cfg
 include *.xml
 include *.odt
 include locale/*.po
diff --git a/PKG-INFO b/PKG-INFO
index 070a6cb..a96550f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,14 +1,48 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 2.4.1
-Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
-
+Version: 2.6.0
+Summary: Tryton module to add analytic accounting on invoice
 Home-page: http://www.tryton.org/
-Author: B2CK
-Author-email: info at b2ck.com
+Author: Tryton
+Author-email: UNKNOWN
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.4/
-Description: UNKNOWN
+Download-URL: http://downloads.tryton.org/2.6/
+Description: trytond_analytic_invoice
+        ========================
+        
+        The analytic_invoice module of the Tryton application platform.
+        
+        Installing
+        ----------
+        
+        See INSTALL
+        
+        Support
+        -------
+        
+        If you encounter any problems with Tryton, please don't hesitate to ask
+        questions on the Tryton bug tracker, mailing list, wiki or IRC channel:
+        
+          http://bugs.tryton.org/
+          http://groups.tryton.org/
+          http://wiki.tryton.org/
+          irc://irc.freenode.net/tryton
+        
+        License
+        -------
+        
+        See LICENSE
+        
+        Copyright
+        ---------
+        
+        See COPYRIGHT
+        
+        
+        For more information please visit the Tryton web site:
+        
+          http://www.tryton.org/
+        
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
diff --git a/README b/README
index 27ef5eb..ffafa6b 100644
--- a/README
+++ b/README
@@ -2,7 +2,6 @@ trytond_analytic_invoice
 ========================
 
 The analytic_invoice module of the Tryton application platform.
-See __tryton__.py
 
 Installing
 ----------
diff --git a/__init__.py b/__init__.py
index ef5b670..f71cffd 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,4 +1,12 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 
+from trytond.pool import Pool
 from .invoice import *
+
+
+def register():
+    Pool.register(
+        InvoiceLine,
+        Account,
+        module='analytic_invoice', type_='model')
diff --git a/__tryton__.py b/__tryton__.py
deleted file mode 100644
index 14f71ae..0000000
--- a/__tryton__.py
+++ /dev/null
@@ -1,57 +0,0 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
-{
-    'name': 'Analytic Invoice',
-    'name_bg_BG': 'Аналитична фактура',
-    'name_ca_ES': 'Facturació analítica',
-    'name_de_DE': 'Kostenstellen Rechnungsstellung',
-    'name_es_AR': 'Facturación Analítica',
-    'name_es_CO': 'Facturación Analítica',
-    'name_es_ES': 'Facturación analítica',
-    'name_fr_FR': 'Facturation analytique',
-    'version': '2.4.1',
-    'author': 'B2CK',
-    'email': 'info at b2ck.com',
-    'website': 'http://www.tryton.org/',
-    'description': '''Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
-''',
-    'description_bg_BG': ''' - Добавя аналитична сметна за редове на фактури и генерира аналитични редове за движения от фактура
-''',
-    'description_ca_ES': '''Afegeix un compte analític a les línies de factura
-i genera línies analítiques pels assentaments de la factura.
-''',
-    'description_de_DE': ''' - Fügt Kostenstellen zu Rechnungszeilen hinzu
- - Erstellt Positionen für Kostenstellen bei Buchung von Rechnungen
-''',
-    'description_es_AR': '''Añade contabilidad analítica en las líneas de
-factura y genera líneas analíticas en los asientos de la factura.''',
-    'description_es_CO': ''' - Adición de contabilidad analítica a las líneas de facturación
- -  Generación de líneas analíticas en la factura.
-''',
-    'description_es_ES': '''Añade una cuenta analítica en las líneas de
-factura y genera líneas analíticas por los asientos de la factura.
-''',
-    'description_fr_FR': '''Ajoute la comptabilité analytique sur les lignes '''
-    '''de facture et génère les lignes analytiques sur les mouvements de la '''
-    '''facture.''',
-
-    'depends': [
-        'account_invoice',
-        'analytic_account',
-    ],
-    'xml': [
-        'invoice.xml',
-    ],
-    'translation': [
-        'locale/bg_BG.po',
-        'locale/ca_ES.po',
-        'locale/cs_CZ.po',
-        'locale/de_DE.po',
-        'locale/es_AR.po',
-        'locale/es_CO.po',
-        'locale/es_ES.po',
-        'locale/fr_FR.po',
-        'locale/nl_NL.po',
-        'locale/ru_RU.po',
-    ],
-}
diff --git a/invoice.py b/invoice.py
index dba287c..8a631fe 100644
--- a/invoice.py
+++ b/invoice.py
@@ -3,12 +3,14 @@
 from trytond.model import ModelView, ModelSQL, fields
 from trytond.pyson import Eval
 from trytond.transaction import Transaction
-from trytond.pool import Pool
+from trytond.pool import Pool, PoolMeta
 
+__all__ = ['InvoiceLine', 'Account']
+__metaclass__ = PoolMeta
 
-class InvoiceLine(ModelSQL, ModelView):
-    _name = 'account.invoice.line'
 
+class InvoiceLine:
+    __name__ = 'account.invoice.line'
     analytic_accounts = fields.Many2One('analytic_account.account.selection',
         'Analytic Accounts',
         states={
@@ -16,47 +18,45 @@ class InvoiceLine(ModelSQL, ModelView):
             },
         depends=['type'])
 
-    def _view_look_dom_arch(self, tree, type, field_children=None):
-        analytic_account_obj = Pool().get('analytic_account.account')
-        analytic_account_obj.convert_view(tree)
-        arch, fields = super(InvoiceLine, self)._view_look_dom_arch(tree, type,
+    @classmethod
+    def _view_look_dom_arch(cls, tree, type, field_children=None):
+        AnalyticAccount = Pool().get('analytic_account.account')
+        AnalyticAccount.convert_view(tree)
+        return super(InvoiceLine, cls)._view_look_dom_arch(tree, type,
             field_children=field_children)
-        return arch, fields
 
-    def fields_get(self, fields_names=None):
-        analytic_account_obj = Pool().get('analytic_account.account')
+    @classmethod
+    def fields_get(cls, fields_names=None):
+        AnalyticAccount = Pool().get('analytic_account.account')
 
-        res = super(InvoiceLine, self).fields_get(fields_names)
+        fields = super(InvoiceLine, cls).fields_get(fields_names)
 
-        analytic_accounts_field = super(InvoiceLine, self).fields_get(
+        analytic_accounts_field = super(InvoiceLine, cls).fields_get(
                 ['analytic_accounts'])['analytic_accounts']
 
-        res.update(analytic_account_obj.analytic_accounts_fields_get(
-            analytic_accounts_field, fields_names))
-        return res
+        fields.update(AnalyticAccount.analytic_accounts_fields_get(
+                analytic_accounts_field, fields_names))
+        return fields
 
-    def default_get(self, fields, with_rec_name=True):
+    @classmethod
+    def default_get(cls, fields, with_rec_name=True):
         fields = [x for x in fields if not x.startswith('analytic_account_')]
-        return super(InvoiceLine, self).default_get(fields,
+        return super(InvoiceLine, cls).default_get(fields,
             with_rec_name=with_rec_name)
 
-    def read(self, ids, fields_names=None):
-        int_id = False
-        if isinstance(ids, (int, long)):
-            int_id = True
-            ids = [ids]
-
+    @classmethod
+    def read(cls, ids, fields_names=None):
         if fields_names:
             fields_names2 = [x for x in fields_names
                     if not x.startswith('analytic_account_')]
         else:
             fields_names2 = fields_names
 
-        res = super(InvoiceLine, self).read(ids, fields_names=fields_names2)
+        res = super(InvoiceLine, cls).read(ids, fields_names=fields_names2)
 
         if not fields_names:
-            fields_names = list(set(self._columns.keys() \
-                    + self._inherit_fields.keys()))
+            fields_names = list(set(cls._fields.keys() \
+                    + cls._inherit_fields.keys()))
 
         root_ids = []
         for field in fields_names:
@@ -66,7 +66,7 @@ class InvoiceLine(ModelSQL, ModelView):
             id2record = {}
             for record in res:
                 id2record[record['id']] = record
-            lines = self.browse(ids)
+            lines = cls.browse(ids)
             for line in lines:
                 for root_id in root_ids:
                     id2record[line.id]['analytic_account_' \
@@ -84,12 +84,11 @@ class InvoiceLine(ModelSQL, ModelView):
                                     str(account.root.id) + '.'):
                                 ham, field2 = field.split('.', 1)
                                 id2record[line.id][field] = account[field2]
-        if int_id:
-            return res[0]
         return res
 
-    def create(self, vals):
-        selection_obj = Pool().get('analytic_account.account.selection')
+    @classmethod
+    def create(cls, vals):
+        Selection = Pool().get('analytic_account.account.selection')
         vals = vals.copy()
         selection_vals = {}
         for field in vals.keys():
@@ -99,17 +98,17 @@ class InvoiceLine(ModelSQL, ModelView):
                     selection_vals['accounts'].append(('add', vals[field]))
                 del vals[field]
         if vals.get('analytic_accounts'):
-            selection_obj.write(vals['analytic_accounts'], selection_vals)
+            Selection.write([Selection(vals['analytic_accounts'])],
+                selection_vals)
         elif vals.get('type', 'line') == 'line':
-            selection_id = selection_obj.create(selection_vals)
-            vals['analytic_accounts'] = selection_id
-        return super(InvoiceLine, self).create(vals)
+            selection = Selection.create(selection_vals)
+            vals['analytic_accounts'] = selection.id
+        return super(InvoiceLine, cls).create(vals)
 
-    def write(self, ids, vals):
-        selection_obj = Pool().get('analytic_account.account.selection')
+    @classmethod
+    def write(cls, lines, vals):
+        Selection = Pool().get('analytic_account.account.selection')
         vals = vals.copy()
-        if isinstance(ids, (int, long)):
-            ids = [ids]
         selection_vals = {}
         for field in vals.keys():
             if field.startswith('analytic_account_'):
@@ -117,7 +116,6 @@ class InvoiceLine(ModelSQL, ModelView):
                 selection_vals[root_id] = vals[field]
                 del vals[field]
         if selection_vals:
-            lines = self.browse(ids)
             for line in lines:
                 if line.type != 'line':
                     continue
@@ -125,11 +123,10 @@ class InvoiceLine(ModelSQL, ModelView):
                 if not line.analytic_accounts:
                     # Create missing selection
                     with Transaction().set_user(0):
-                            selection_id = selection_obj.create({})
-                    self.write(line.id, {
-                        'analytic_accounts': selection_id,
-                        })
-                    line = self.browse(line.id)
+                            selection = Selection.create({})
+                    cls.write([line], {
+                            'analytic_accounts': selection.id,
+                            })
                 for account in line.analytic_accounts.accounts:
                     if account.root.id in selection_vals:
                         value = selection_vals[account.root.id]
@@ -141,103 +138,90 @@ class InvoiceLine(ModelSQL, ModelView):
                     if account_id \
                             and account_id not in accounts:
                         accounts.append(account_id)
-                selection_obj.write(line.analytic_accounts.id, {
-                    'accounts': [('set', accounts)],
-                    })
-        return super(InvoiceLine, self).write(ids, vals)
+                Selection.write([line.analytic_accounts], {
+                        'accounts': [('set', accounts)],
+                        })
+        super(InvoiceLine, cls).write(lines, vals)
 
-    def delete(self, ids):
-        selection_obj = Pool().get('analytic_account.account.selection')
+    @classmethod
+    def delete(cls, lines):
+        Selection = Pool().get('analytic_account.account.selection')
 
-        if isinstance(ids, (int, long)):
-            ids = [ids]
         selection_ids = []
-        lines = self.browse(ids)
         for line in lines:
             if line.analytic_accounts:
                 selection_ids.append(line.analytic_accounts.id)
 
-        res = super(InvoiceLine, self).delete(ids)
-        selection_obj.delete(selection_ids)
-        return res
-
-    def copy(self, ids, default=None):
-        selection_obj = Pool().get('analytic_account.account.selection')
+        super(InvoiceLine, cls).delete(lines)
+        Selection.delete(Selection.browse(selection_ids))
 
-        new_ids = super(InvoiceLine, self).copy(ids, default=default)
+    @classmethod
+    def copy(cls, lines, default=None):
+        Selection = Pool().get('analytic_account.account.selection')
 
-        int_id = False
-        if isinstance(new_ids, (int, long)):
-            int_id = True
-            new_ids = [new_ids]
+        new_lines = super(InvoiceLine, cls).copy(lines, default=default)
 
-        for line in self.browse(new_ids):
+        for line in new_lines:
             if line.analytic_accounts:
-                selection_id = selection_obj.copy(line.analytic_accounts.id)
-                self.write(line.id, {
-                    'analytic_accounts': selection_id,
-                    })
-
-        if int_id:
-            return new_ids[0]
-        return new_ids
+                selection, = Selection.copy([line.analytic_accounts])
+                cls.write([line], {
+                        'analytic_accounts': selection.id,
+                        })
+        return new_lines
 
-    def _credit(self, line):
-        selection_obj = Pool().get('analytic_account.account.selection')
+    def _credit(self):
+        Selection = Pool().get('analytic_account.account.selection')
 
-        result = super(InvoiceLine, self)._credit(line)
+        result = super(InvoiceLine, self)._credit()
 
-        if line.analytic_accounts:
-            selection_id = selection_obj.copy(line.analytic_accounts.id)
-            result['analytic_accounts'] = selection_id
+        if self.analytic_accounts:
+            selection, = Selection.copy([self.analytic_accounts])
+            result['analytic_accounts'] = selection.id
         return result
 
-    def get_move_line(self, line):
-        values = super(InvoiceLine, self).get_move_line(line)
-        if line.analytic_accounts and line.analytic_accounts.accounts:
+    def get_move_line(self):
+        values = super(InvoiceLine, self).get_move_line()
+        if self.analytic_accounts and self.analytic_accounts.accounts:
             for value in values:
                 value['analytic_lines'] = []
-                for account in line.analytic_accounts.accounts:
+                for account in self.analytic_accounts.accounts:
                     vals = {}
-                    vals['name'] = line.description
+                    vals['name'] = self.description
                     vals['debit'] = value['debit']
                     vals['credit'] = value['credit']
                     vals['account'] = account.id
-                    vals['journal'] = line.invoice.journal.id
-                    vals['date'] = line.invoice.invoice_date
-                    vals['reference'] = line.invoice.reference
-                    vals['party'] = line.invoice.party.id
+                    vals['journal'] = self.invoice.journal.id
+                    vals['date'] = self.invoice.invoice_date
+                    vals['reference'] = self.invoice.reference
+                    vals['party'] = self.invoice.party.id
                     value['analytic_lines'].append(('create', vals))
         return values
 
-InvoiceLine()
-
 
 class Account(ModelSQL, ModelView):
-    _name = 'analytic_account.account'
+    __name__ = 'analytic_account.account'
 
-    def delete(self, ids):
-        account_invoice_line_obj = Pool().get('account.invoice.line')
-        res = super(Account, self).delete(ids)
+    @classmethod
+    def delete(cls, accounts):
+        InvoiceLine = Pool().get('account.invoice.line')
+        super(Account, cls).delete(accounts)
         # Restart the cache on the fields_view_get method of
         # account.invoice.line
-        account_invoice_line_obj.fields_view_get.reset()
-        return res
+        InvoiceLine._fields_view_get_cache.clear()
 
-    def create(self, vals):
-        account_invoice_line_obj = Pool().get('account.invoice.line')
-        res = super(Account, self).create(vals)
+    @classmethod
+    def create(cls, vals):
+        InvoiceLine = Pool().get('account.invoice.line')
+        account = super(Account, cls).create(vals)
         # Restart the cache on the fields_view_get method of
         # account.invoice.line
-        account_invoice_line_obj.fields_view_get.reset()
-        return res
+        InvoiceLine._fields_view_get_cache.clear()
+        return account
 
-    def write(self, ids, vals):
-        account_invoice_line_obj = Pool().get('account.invoice.line')
-        res = super(Account, self).write(ids, vals)
+    @classmethod
+    def write(cls, accounts, vals):
+        InvoiceLine = Pool().get('account.invoice.line')
+        super(Account, cls).write(accounts, vals)
         # Restart the cache on the fields_view_get method of
         # account.invoice.line
-        account_invoice_line_obj.fields_view_get.reset()
-        return res
-
-Account()
+        InvoiceLine._fields_view_get_cache.clear()
diff --git a/setup.py b/setup.py
index 9e77b5d..49dc191 100644
--- a/setup.py
+++ b/setup.py
@@ -4,8 +4,19 @@
 
 from setuptools import setup
 import re
+import os
+import ConfigParser
 
-info = eval(open('__tryton__.py').read())
+
+def read(fname):
+    return open(os.path.join(os.path.dirname(__file__), fname)).read()
+
+config = ConfigParser.ConfigParser()
+config.readfp(open('tryton.cfg'))
+info = dict(config.items('tryton'))
+for key in ('depends', 'extras_depend', 'xml'):
+    if key in info:
+        info[key] = info[key].strip().splitlines()
 major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
 major_version = int(major_version)
 minor_version = int(minor_version)
@@ -21,21 +32,21 @@ requires.append('trytond >= %s.%s, < %s.%s' %
 
 setup(name='trytond_analytic_invoice',
     version=info.get('version', '0.0.1'),
-    description=info.get('description', ''),
-    author=info.get('author', ''),
-    author_email=info.get('email', ''),
-    url=info.get('website', ''),
+    description='Tryton module to add analytic accounting on invoice',
+    long_description=read('README'),
+    author='Tryton',
+    url='http://www.tryton.org/',
     download_url="http://downloads.tryton.org/" + \
-            info.get('version', '0.0.1').rsplit('.', 1)[0] + '/',
+        info.get('version', '0.0.1').rsplit('.', 1)[0] + '/',
     package_dir={'trytond.modules.analytic_invoice': '.'},
     packages=[
         'trytond.modules.analytic_invoice',
         'trytond.modules.analytic_invoice.tests',
-    ],
+        ],
     package_data={
         'trytond.modules.analytic_invoice': info.get('xml', []) \
-                + info.get('translation', []),
-    },
+            + ['tryton.cfg', 'locale/*.po'],
+        },
     classifiers=[
         'Development Status :: 5 - Production/Stable',
         'Environment :: Plugins',
@@ -57,7 +68,7 @@ setup(name='trytond_analytic_invoice',
         'Programming Language :: Python :: 2.7',
         'Topic :: Office/Business',
         'Topic :: Office/Business :: Financial :: Accounting',
-    ],
+        ],
     license='GPL-3',
     install_requires=requires,
     zip_safe=False,
@@ -67,4 +78,4 @@ setup(name='trytond_analytic_invoice',
     """,
     test_suite='tests',
     test_loader='trytond.test_loader:Loader',
-)
+    )
diff --git a/tryton.cfg b/tryton.cfg
new file mode 100644
index 0000000..db9947d
--- /dev/null
+++ b/tryton.cfg
@@ -0,0 +1,7 @@
+[tryton]
+version=2.6.0
+depends:
+    account_invoice
+    analytic_account
+xml:
+    invoice.xml
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index 0630177..db0bf80 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,14 +1,48 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 2.4.1
-Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
-
+Version: 2.6.0
+Summary: Tryton module to add analytic accounting on invoice
 Home-page: http://www.tryton.org/
-Author: B2CK
-Author-email: info at b2ck.com
+Author: Tryton
+Author-email: UNKNOWN
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.4/
-Description: UNKNOWN
+Download-URL: http://downloads.tryton.org/2.6/
+Description: trytond_analytic_invoice
+        ========================
+        
+        The analytic_invoice module of the Tryton application platform.
+        
+        Installing
+        ----------
+        
+        See INSTALL
+        
+        Support
+        -------
+        
+        If you encounter any problems with Tryton, please don't hesitate to ask
+        questions on the Tryton bug tracker, mailing list, wiki or IRC channel:
+        
+          http://bugs.tryton.org/
+          http://groups.tryton.org/
+          http://wiki.tryton.org/
+          irc://irc.freenode.net/tryton
+        
+        License
+        -------
+        
+        See LICENSE
+        
+        Copyright
+        ---------
+        
+        See COPYRIGHT
+        
+        
+        For more information please visit the Tryton web site:
+        
+          http://www.tryton.org/
+        
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
index 7f3919e..a534036 100644
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -6,8 +6,8 @@ MANIFEST.in
 README
 invoice.xml
 setup.py
+tryton.cfg
 ./__init__.py
-./__tryton__.py
 ./invoice.py
 ./tests/__init__.py
 ./tests/test_analytic_invoice.py
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
index cddd009..287b990 100644
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -1,3 +1,3 @@
-trytond_account_invoice >= 2.4, < 2.5
-trytond_analytic_account >= 2.4, < 2.5
-trytond >= 2.4, < 2.5
\ No newline at end of file
+trytond_account_invoice >= 2.6, < 2.7
+trytond_analytic_account >= 2.6, < 2.7
+trytond >= 2.6, < 2.7
\ No newline at end of file
commit 3196d2959c64333dfbf3d751aa2e1abd7a30a3fc
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Sep 18 16:07:17 2012 +0200

    Releasing debian version 2.4.1-2.

diff --git a/debian/changelog b/debian/changelog
index f5c93b7..8ce41d8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+tryton-modules-analytic-invoice (1:2.4.1-2) experimental; urgency=low
+
+  [ Daniel Baumann ]
+  * Updating maintainers field.
+  * Updating vcs fields.
+  * Correcting copyright file to match format version 1.0.
+  * Switching to xz compression.
+  * Updating to debhelper version 9.
+
+  [ Mathias Behrle ]
+  * Merging branch debian-wheezy-2.2.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Tue, 18 Sep 2012 13:32:37 +0200
+
 tryton-modules-analytic-invoice (1:2.4.1-1) experimental; urgency=low
 
   * Updating to Standards-Version: 3.9.3, no changes needed.
commit 9d531c91e5d0ad94159d521a6dd0aafe3343b37e
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Jun 30 18:02:28 2012 +0200

    Updating to debhelper version 9.

diff --git a/debian/compat b/debian/compat
index 45a4fb7..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-8
+9
diff --git a/debian/control b/debian/control
index 5a7ab17..426186b 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
 Dm-Upload-Allowed: yes
-Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
+Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
 Standards-Version: 3.9.3
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-modules-analytic-invoice.git
commit d0a4d7423f1bfac63667ff9a7f340a9a0bc3b326
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Jun 30 17:53:50 2012 +0200

    Switching to xz compression.

diff --git a/debian/rules b/debian/rules
index e32b791..1ae0776 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,3 +7,6 @@ override_dh_auto_clean:
 	dh_auto_clean
 
 	rm -rf *.egg-info
+
+override_dh_builddeb:
+	dh_builddeb -- -Zxz -z9
commit e2b8e4644be0b23b78b7c71cb3fe098a7e21f0e9
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Jun 30 17:50:23 2012 +0200

    Correcting copyright file to match format version 1.0.

diff --git a/debian/copyright b/debian/copyright
index acea21e..9473f61 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,16 +1,14 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
 Files: *
-Copyright:
- (C) 2008-2012 Cedric Krier
- (C) 2008-2012 Bertrand Chenal
- (C) 2008-2012 B2CK SPRL
+Copyright: 2008-2012 Cedric Krier
+           2008-2012 Bertrand Chenal
+           2008-2012 B2CK SPRL
 License: GPL-3+
 
 Files: debian/*
-Copyright:
- (C) 2009-2012 Daniel Baumann <daniel at debian.org>
- (C) 2012 Mathias Behrle <mathiasb at m9s.biz>
+Copyright: 2009-2012 Daniel Baumann <daniel at debian.org>
+           2012 Mathias Behrle <mathiasb at m9s.biz>
 License: GPL-3+
 
 License: GPL-3+
commit e3e9fcc1c1bc672e3953ed2a646076e9d5604fc6
Author: Daniel Baumann <daniel at 127011.net>
Date:   Sat Jun 30 16:55:03 2012 +0200

    Updating vcs fields.

diff --git a/debian/control b/debian/control
index 284fc67..5a7ab17 100644
--- a/debian/control
+++ b/debian/control
@@ -7,8 +7,8 @@ Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
 Standards-Version: 3.9.3
 Homepage: http://www.tryton.org/
-Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
-Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
+Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-modules-analytic-invoice.git
+Vcs-Git: git://debian.tryton.org/git/packages/tryton-modules-analytic-invoice.git
 X-Python-Version: >= 2.6
 
 Package: tryton-modules-analytic-invoice
commit aa3491cc3faa1b33d5c99ab25e0e16f3c93b9cad
Author: Daniel Baumann <daniel at 127011.net>
Date:   Sat Jun 30 16:52:30 2012 +0200

    Updating maintainers field.

diff --git a/debian/control b/debian/control
index 6e3ffaf..284fc67 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,7 @@
 Source: tryton-modules-analytic-invoice
 Section: python
 Priority: optional
-Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
+Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
 Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
commit 1fa19a1f39edb527d5082f34eeb3d0c559bbf666
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Apr 28 12:43:14 2012 +0200

    Releasing debian version 2.4.1-1.

diff --git a/debian/changelog b/debian/changelog
index 15b568c..f5c93b7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+tryton-modules-analytic-invoice (1:2.4.1-1) experimental; urgency=low
+
+  * Updating to Standards-Version: 3.9.3, no changes needed.
+  * Updating year in copyright.
+  * Adding myself to copyright.
+  * Adding Format header for DEP5.
+  * Merging upstream version 2.4.0.
+  * Merging upstream version 2.4.1.
+  * Updating Copyright.
+  * Bumping versioned tryton depends to 2.4.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Thu, 26 Apr 2012 19:37:57 +0200
+
 tryton-modules-analytic-invoice (1:2.2.0-1) unstable; urgency=low
 
   * Bumping X-Python-Version to >=2.6.
commit e7d4d6290baa32605012f032ea623b9faf2a24d9
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Apr 26 19:10:55 2012 +0200

    Bumping versioned tryton depends to 2.4.

diff --git a/debian/control b/debian/control
index bc90a38..6e3ffaf 100644
--- a/debian/control
+++ b/debian/control
@@ -14,9 +14,9 @@ X-Python-Version: >= 2.6
 Package: tryton-modules-analytic-invoice
 Architecture: all
 Depends:
- ${misc:Depends}, ${python:Depends}, tryton-server (>= 2.2),
- tryton-modules-account-invoice (>= 2.2),
- tryton-modules-analytic-account (>= 2.2), python-pkg-resources
+ ${misc:Depends}, ${python:Depends}, tryton-server (>= 2.4),
+ tryton-modules-account-invoice (>= 2.4),
+ tryton-modules-analytic-account (>= 2.4), python-pkg-resources
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
  and using PostgreSQL as database engine. It is the core base of a complete
commit cbd833fee162bf2222bde020a480688b45a7a644
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Apr 25 20:08:32 2012 +0200

    Updating Copyright.

diff --git a/debian/copyright b/debian/copyright
index d2ad74d..acea21e 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -2,9 +2,9 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
 Files: *
 Copyright:
- (C) 2008-2011 Cedric Krier
- (C) 2008-2011 Bertrand Chenal
- (C) 2008-2011 B2CK SPRL
+ (C) 2008-2012 Cedric Krier
+ (C) 2008-2012 Bertrand Chenal
+ (C) 2008-2012 B2CK SPRL
 License: GPL-3+
 
 Files: debian/*
commit 2ff90e61d7062a2c32219eab75a9a6e6a0c1cd7f
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Apr 25 11:03:29 2012 +0200

    Merging upstream version 2.4.1.

diff --git a/CHANGELOG b/CHANGELOG
index 875c8bf..dc330ba 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.4.1 - 2012-04-24
+* Restore es_AR translation
+
 Version 2.4.0 - 2012-04-23
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index db0483c..070a6cb 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 2.4.0
+Version: 2.4.1
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
diff --git a/__tryton__.py b/__tryton__.py
index 004ef9b..14f71ae 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -9,7 +9,7 @@
     'name_es_CO': 'Facturación Analítica',
     'name_es_ES': 'Facturación analítica',
     'name_fr_FR': 'Facturation analytique',
-    'version': '2.4.0',
+    'version': '2.4.1',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
diff --git a/locale/es_AR.po b/locale/es_AR.po
index 542f292..825e4f5 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -1,3 +1,7 @@
 # 
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.invoice.line,analytic_accounts:"
+msgid "Analytic Accounts"
+msgstr "Cuentas analíticas"
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index e76698d..0630177 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 2.4.0
+Version: 2.4.1
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
commit 01cc743222effe4a6de9ebe0c4bc479e0b629c7e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 24 19:30:38 2012 +0200

    Merging upstream version 2.4.0.

diff --git a/CHANGELOG b/CHANGELOG
index 905eea5..875c8bf 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.4.0 - 2012-04-23
+* Bug fixes (see mercurial logs for details)
+
 Version 2.2.0 - 2011-10-24
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index 3d2324b..2057c72 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2008-2011 Cédric Krier.
-Copyright (C) 2008-2011 Bertrand Chenal.
-Copyright (C) 2008-2011 B2CK SPRL.
+Copyright (C) 2008-2012 Cédric Krier.
+Copyright (C) 2008-2012 Bertrand Chenal.
+Copyright (C) 2008-2012 B2CK SPRL.
 
 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
diff --git a/INSTALL b/INSTALL
index 53bd980..4c54706 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_analytic_invoice
 Prerequisites
 -------------
 
- * Python 2.5 or later (http://www.python.org/)
+ * Python 2.6 or later (http://www.python.org/)
  * trytond (http://www.tryton.org/)
  * trytond_account_invoice (http://www.tryton.org/)
  * trytond_analytic_account (http://www.tryton.org/)
diff --git a/PKG-INFO b/PKG-INFO
index dc946a1..db0483c 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 2.2.0
+Version: 2.4.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.2/
+Download-URL: http://downloads.tryton.org/2.4/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/__init__.py b/__init__.py
index d415f1d..ef5b670 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,4 +1,4 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 
-from invoice import *
+from .invoice import *
diff --git a/__tryton__.py b/__tryton__.py
index a04c27f..004ef9b 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -3,11 +3,13 @@
 {
     'name': 'Analytic Invoice',
     'name_bg_BG': 'Аналитична фактура',
+    'name_ca_ES': 'Facturació analítica',
     'name_de_DE': 'Kostenstellen Rechnungsstellung',
+    'name_es_AR': 'Facturación Analítica',
     'name_es_CO': 'Facturación Analítica',
     'name_es_ES': 'Facturación analítica',
     'name_fr_FR': 'Facturation analytique',
-    'version': '2.2.0',
+    'version': '2.4.0',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
@@ -15,14 +17,20 @@
 ''',
     'description_bg_BG': ''' - Добавя аналитична сметна за редове на фактури и генерира аналитични редове за движения от фактура
 ''',
+    'description_ca_ES': '''Afegeix un compte analític a les línies de factura
+i genera línies analítiques pels assentaments de la factura.
+''',
     'description_de_DE': ''' - Fügt Kostenstellen zu Rechnungszeilen hinzu
  - Erstellt Positionen für Kostenstellen bei Buchung von Rechnungen
 ''',
+    'description_es_AR': '''Añade contabilidad analítica en las líneas de
+factura y genera líneas analíticas en los asientos de la factura.''',
     'description_es_CO': ''' - Adición de contabilidad analítica a las líneas de facturación
  -  Generación de líneas analíticas en la factura.
 ''',
-    'description_es_ES': '''Añade una cuenta analítica en las líneas de '''
-    '''factura y genera líneas analíticas en los asientos de la factura.''',
+    'description_es_ES': '''Añade una cuenta analítica en las líneas de
+factura y genera líneas analíticas por los asientos de la factura.
+''',
     'description_fr_FR': '''Ajoute la comptabilité analytique sur les lignes '''
     '''de facture et génère les lignes analytiques sur les mouvements de la '''
     '''facture.''',
@@ -36,8 +44,10 @@
     ],
     'translation': [
         'locale/bg_BG.po',
+        'locale/ca_ES.po',
         'locale/cs_CZ.po',
         'locale/de_DE.po',
+        'locale/es_AR.po',
         'locale/es_CO.po',
         'locale/es_ES.po',
         'locale/fr_FR.po',
diff --git a/invoice.py b/invoice.py
index 17fa67c..dba287c 100644
--- a/invoice.py
+++ b/invoice.py
@@ -41,8 +41,6 @@ class InvoiceLine(ModelSQL, ModelView):
             with_rec_name=with_rec_name)
 
     def read(self, ids, fields_names=None):
-        selection_obj = Pool().get('analytic_account.account.selection')
-
         int_id = False
         if isinstance(ids, (int, long)):
             int_id = True
@@ -72,7 +70,7 @@ class InvoiceLine(ModelSQL, ModelView):
             for line in lines:
                 for root_id in root_ids:
                     id2record[line.id]['analytic_account_' \
-                            + str(root_id)] = False
+                            + str(root_id)] = None
                 if line.type != 'line':
                     continue
                 if not line.analytic_accounts:
@@ -221,21 +219,24 @@ class Account(ModelSQL, ModelView):
     def delete(self, ids):
         account_invoice_line_obj = Pool().get('account.invoice.line')
         res = super(Account, self).delete(ids)
-        # Restart the cache on the fields_view_get method of account.invoice.line
+        # Restart the cache on the fields_view_get method of
+        # account.invoice.line
         account_invoice_line_obj.fields_view_get.reset()
         return res
 
     def create(self, vals):
         account_invoice_line_obj = Pool().get('account.invoice.line')
         res = super(Account, self).create(vals)
-        # Restart the cache on the fields_view_get method of account.invoice.line
+        # Restart the cache on the fields_view_get method of
+        # account.invoice.line
         account_invoice_line_obj.fields_view_get.reset()
         return res
 
     def write(self, ids, vals):
         account_invoice_line_obj = Pool().get('account.invoice.line')
         res = super(Account, self).write(ids, vals)
-        # Restart the cache on the fields_view_get method of account.invoice.line
+        # Restart the cache on the fields_view_get method of
+        # account.invoice.line
         account_invoice_line_obj.fields_view_get.reset()
         return res
 
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index a6a5434..5716284 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -2,6 +2,6 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
-msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgctxt "field:account.invoice.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Аналитични сметки"
diff --git a/locale/nl_NL.po b/locale/ca_ES.po
similarity index 51%
copy from locale/nl_NL.po
copy to locale/ca_ES.po
index f73e5cf..6943cd3 100644
--- a/locale/nl_NL.po
+++ b/locale/ca_ES.po
@@ -2,6 +2,6 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
-msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgctxt "field:account.invoice.line,analytic_accounts:"
 msgid "Analytic Accounts"
-msgstr ""
+msgstr "Comptes analítics"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
index f73e5cf..1d3bd89 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs_CZ.po
@@ -2,6 +2,6 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
-msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgctxt "field:account.invoice.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr ""
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 63e1de1..7ac1f90 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -2,6 +2,6 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
-msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgctxt "field:account.invoice.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Kostenstellen"
diff --git a/locale/es_AR.po b/locale/es_AR.po
new file mode 100644
index 0000000..542f292
--- /dev/null
+++ b/locale/es_AR.po
@@ -0,0 +1,3 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 1fb0f97..c2fb3e2 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -2,6 +2,6 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
-msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgctxt "field:account.invoice.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Cuentas Analíticas"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index 28ec000..825e4f5 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -2,6 +2,6 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
-msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgctxt "field:account.invoice.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Cuentas analíticas"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index 0aaed0b..d24b295 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -2,6 +2,6 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
-msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgctxt "field:account.invoice.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr "Comptes analytiques"
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
index f73e5cf..1d3bd89 100644
--- a/locale/nl_NL.po
+++ b/locale/nl_NL.po
@@ -2,6 +2,6 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
-msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgctxt "field:account.invoice.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr ""
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index f73e5cf..1d3bd89 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -2,6 +2,6 @@
 msgid ""
 msgstr "Content-Type: text/plain; charset=utf-8\n"
 
-msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgctxt "field:account.invoice.line,analytic_accounts:"
 msgid "Analytic Accounts"
 msgstr ""
diff --git a/setup.py b/setup.py
index c4f6693..9e77b5d 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ minor_version = int(minor_version)
 
 requires = []
 for dep in info.get('depends', []):
-    if not re.match(r'(ir|res|workflow|webdav)(\W|$)', dep):
+    if not re.match(r'(ir|res|webdav)(\W|$)', dep):
         requires.append('trytond_%s >= %s.%s, < %s.%s' %
                 (dep, major_version, minor_version, major_version,
                     minor_version + 1))
diff --git a/tests/__init__.py b/tests/__init__.py
index f977db0..caca5e3 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,4 +1,4 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 
-from test_analytic_invoice import suite
+from .test_analytic_invoice import suite
diff --git a/tests/test_analytic_invoice.py b/tests/test_analytic_invoice.py
index b2c088f..f5929c5 100644
--- a/tests/test_analytic_invoice.py
+++ b/tests/test_analytic_invoice.py
@@ -2,7 +2,8 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 
-import sys, os
+import sys
+import os
 DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
     '..', '..', '..', '..', '..', 'trytond')))
 if os.path.isdir(DIR):
@@ -33,6 +34,7 @@ class AnalyticInvoiceTestCase(unittest.TestCase):
         '''
         test_depends()
 
+
 def suite():
     suite = trytond.tests.test_tryton.suite()
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index 70f8ed4..e76698d 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 2.2.0
+Version: 2.4.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.2/
+Download-URL: http://downloads.tryton.org/2.4/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
index bfd16bf..7f3919e 100644
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -12,8 +12,10 @@ setup.py
 ./tests/__init__.py
 ./tests/test_analytic_invoice.py
 locale/bg_BG.po
+locale/ca_ES.po
 locale/cs_CZ.po
 locale/de_DE.po
+locale/es_AR.po
 locale/es_CO.po
 locale/es_ES.po
 locale/fr_FR.po
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
index 8853fbc..cddd009 100644
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -1,3 +1,3 @@
-trytond_account_invoice >= 2.2, < 2.3
-trytond_analytic_account >= 2.2, < 2.3
-trytond >= 2.2, < 2.3
\ No newline at end of file
+trytond_account_invoice >= 2.4, < 2.5
+trytond_analytic_account >= 2.4, < 2.5
+trytond >= 2.4, < 2.5
\ No newline at end of file
commit 41202a8b7a60e983e927e13b027a84745b1db22a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Mar 25 15:28:17 2012 +0200

    Adding Format header for DEP5.

diff --git a/debian/copyright b/debian/copyright
index 290eff7..d2ad74d 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,3 +1,5 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+
 Files: *
 Copyright:
  (C) 2008-2011 Cedric Krier
commit 3fd04eb54a4d0e0ed274eb39ddecab5fb50d33dd
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Feb 24 14:09:12 2012 +0100

    Adding myself to copyright.

diff --git a/debian/copyright b/debian/copyright
index ddd8e8e..290eff7 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -6,7 +6,9 @@ Copyright:
 License: GPL-3+
 
 Files: debian/*
-Copyright: (C) 2009-2012 Daniel Baumann <daniel at debian.org>
+Copyright:
+ (C) 2009-2012 Daniel Baumann <daniel at debian.org>
+ (C) 2012 Mathias Behrle <mathiasb at m9s.biz>
 License: GPL-3+
 
 License: GPL-3+
commit 511cfec62659d01846ff02453409a6d7a7234e2c
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Feb 24 14:01:03 2012 +0100

    Updating year in copyright.

diff --git a/debian/copyright b/debian/copyright
index 753c790..ddd8e8e 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -6,7 +6,7 @@ Copyright:
 License: GPL-3+
 
 Files: debian/*
-Copyright: (C) 2009-2011 Daniel Baumann <daniel at debian.org>
+Copyright: (C) 2009-2012 Daniel Baumann <daniel at debian.org>
 License: GPL-3+
 
 License: GPL-3+
commit 1dc293c6c091ab690591ac9c362113824cd0d5e5
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Feb 24 13:47:01 2012 +0100

    Updating to Standards-Version: 3.9.3, no changes needed.

diff --git a/debian/control b/debian/control
index 8bf673d..bc90a38 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
 Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
 Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
-Standards-Version: 3.9.2
+Standards-Version: 3.9.3
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
commit ea53a1718df40a9c8e312a314733c29184cb440e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Dec 26 18:09:28 2011 +0100

    Releasing debian version 2.2.0-1.

diff --git a/debian/changelog b/debian/changelog
index ea95e8c..15b568c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+tryton-modules-analytic-invoice (1:2.2.0-1) unstable; urgency=low
+
+  * Bumping X-Python-Version to >=2.6.
+  * Updating versioned tryton depends to 2.2.
+  * Merging upstream version 2.2.0.
+  * Removing deprecated XB-Python-Version for dh_python2.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Mon, 26 Dec 2011 14:06:06 +0100
+
 tryton-modules-analytic-invoice (1:2.0.0-2) unstable; urgency=low
 
   [ Daniel Baumann ]
commit bd3eadac69b2cff5bc9ff624497d2a830be09bb8
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Dec 17 13:59:41 2011 +0100

    Bumping X-Python-Version to >=2.6.

diff --git a/debian/control b/debian/control
index 22c13d4..8bf673d 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Standards-Version: 3.9.2
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
-X-Python-Version: >= 2.5
+X-Python-Version: >= 2.6
 
 Package: tryton-modules-analytic-invoice
 Architecture: all
commit fcb1c34a4f49f95446e9bb735bb33d52efffd558
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Nov 1 15:19:31 2011 +0100

    Updating versioned tryton depends to 2.2.

diff --git a/debian/control b/debian/control
index 0069889..22c13d4 100644
--- a/debian/control
+++ b/debian/control
@@ -14,9 +14,9 @@ X-Python-Version: >= 2.5
 Package: tryton-modules-analytic-invoice
 Architecture: all
 Depends:
- ${misc:Depends}, ${python:Depends}, tryton-server (>= 2.0),
- tryton-modules-account-invoice (>= 2.0),
- tryton-modules-analytic-account (>= 2.0), python-pkg-resources
+ ${misc:Depends}, ${python:Depends}, tryton-server (>= 2.2),
+ tryton-modules-account-invoice (>= 2.2),
+ tryton-modules-analytic-account (>= 2.2), python-pkg-resources
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
  and using PostgreSQL as database engine. It is the core base of a complete
commit 4b7b4d436a2843f6739a1a95c7480733f60e3b55
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Oct 31 16:20:32 2011 +0100

    Merging upstream version 2.2.0.

diff --git a/CHANGELOG b/CHANGELOG
index f74f0b3..905eea5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.2.0 - 2011-10-24
+* Bug fixes (see mercurial logs for details)
+
 Version 2.0.0 - 2011-04-27
 * Bug fixes (see mercurial logs for details)
 
diff --git a/MANIFEST.in b/MANIFEST.in
index 5343ad8..7f5d5fd 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -6,4 +6,4 @@ include CHANGELOG
 include LICENSE
 include *.xml
 include *.odt
-include *.csv
+include locale/*.po
diff --git a/PKG-INFO b/PKG-INFO
index 0741569..dc946a1 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,28 +1,31 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 2.0.0
+Version: 2.2.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.0/
+Download-URL: http://downloads.tryton.org/2.2/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
+Classifier: Framework :: Tryton
 Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Financial and Insurance Industry
 Classifier: Intended Audience :: Legal Industry
 Classifier: License :: OSI Approved :: GNU General Public License (GPL)
 Classifier: Natural Language :: Bulgarian
+Classifier: Natural Language :: Czech
+Classifier: Natural Language :: Dutch
 Classifier: Natural Language :: English
 Classifier: Natural Language :: French
 Classifier: Natural Language :: German
+Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.5
 Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Topic :: Office/Business
diff --git a/__tryton__.py b/__tryton__.py
index f37bd0f..a04c27f 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -7,7 +7,7 @@
     'name_es_CO': 'Facturación Analítica',
     'name_es_ES': 'Facturación analítica',
     'name_fr_FR': 'Facturation analytique',
-    'version': '2.0.0',
+    'version': '2.2.0',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
@@ -18,7 +18,7 @@
     'description_de_DE': ''' - Fügt Kostenstellen zu Rechnungszeilen hinzu
  - Erstellt Positionen für Kostenstellen bei Buchung von Rechnungen
 ''',
-    'description_es_CO': ''' - Adición de contabilidad analítica a las líneas de facturación 
+    'description_es_CO': ''' - Adición de contabilidad analítica a las líneas de facturación
  -  Generación de líneas analíticas en la factura.
 ''',
     'description_es_ES': '''Añade una cuenta analítica en las líneas de '''
@@ -35,10 +35,13 @@
         'invoice.xml',
     ],
     'translation': [
-        'bg_BG.csv',
-        'de_DE.csv',
-        'es_CO.csv',
-        'es_ES.csv',
-        'fr_FR.csv',
+        'locale/bg_BG.po',
+        'locale/cs_CZ.po',
+        'locale/de_DE.po',
+        'locale/es_CO.po',
+        'locale/es_ES.po',
+        'locale/fr_FR.po',
+        'locale/nl_NL.po',
+        'locale/ru_RU.po',
     ],
 }
diff --git a/bg_BG.csv b/bg_BG.csv
deleted file mode 100644
index 6108a14..0000000
--- a/bg_BG.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-type,name,res_id,src,value,fuzzy
-field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Аналитични сметки,0
diff --git a/de_DE.csv b/de_DE.csv
deleted file mode 100644
index 3de2537..0000000
--- a/de_DE.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-type,name,res_id,src,value,fuzzy
-field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Kostenstellen,0
diff --git a/es_CO.csv b/es_CO.csv
deleted file mode 100644
index 0e71661..0000000
--- a/es_CO.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-type,name,res_id,src,value,fuzzy
-field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Cuentas Analíticas,0
diff --git a/es_ES.csv b/es_ES.csv
deleted file mode 100644
index 8750e2e..0000000
--- a/es_ES.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-type,name,res_id,src,value,fuzzy
-field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Cuentas analíticas,0
diff --git a/fr_FR.csv b/fr_FR.csv
deleted file mode 100644
index a64dce4..0000000
--- a/fr_FR.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-type,name,res_id,src,value,fuzzy
-field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Comptes analytiques,0
diff --git a/invoice.py b/invoice.py
index b85c5f3..17fa67c 100644
--- a/invoice.py
+++ b/invoice.py
@@ -1,29 +1,30 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
-from __future__ import with_statement
 from trytond.model import ModelView, ModelSQL, fields
-from trytond.pyson import Not, Equal, Eval
+from trytond.pyson import Eval
 from trytond.transaction import Transaction
+from trytond.pool import Pool
 
 
 class InvoiceLine(ModelSQL, ModelView):
     _name = 'account.invoice.line'
 
     analytic_accounts = fields.Many2One('analytic_account.account.selection',
-            'Analytic Accounts',
-            states={
-                'invisible': Not(Equal(Eval('type'), 'line')),
-            })
+        'Analytic Accounts',
+        states={
+            'invisible': Eval('type') != 'line',
+            },
+        depends=['type'])
 
     def _view_look_dom_arch(self, tree, type, field_children=None):
-        analytic_account_obj = self.pool.get('analytic_account.account')
+        analytic_account_obj = Pool().get('analytic_account.account')
         analytic_account_obj.convert_view(tree)
         arch, fields = super(InvoiceLine, self)._view_look_dom_arch(tree, type,
             field_children=field_children)
         return arch, fields
 
     def fields_get(self, fields_names=None):
-        analytic_account_obj = self.pool.get('analytic_account.account')
+        analytic_account_obj = Pool().get('analytic_account.account')
 
         res = super(InvoiceLine, self).fields_get(fields_names)
 
@@ -34,8 +35,13 @@ class InvoiceLine(ModelSQL, ModelView):
             analytic_accounts_field, fields_names))
         return res
 
+    def default_get(self, fields, with_rec_name=True):
+        fields = [x for x in fields if not x.startswith('analytic_account_')]
+        return super(InvoiceLine, self).default_get(fields,
+            with_rec_name=with_rec_name)
+
     def read(self, ids, fields_names=None):
-        selection_obj = self.pool.get('analytic_account.account.selection')
+        selection_obj = Pool().get('analytic_account.account.selection')
 
         int_id = False
         if isinstance(ids, (int, long)):
@@ -85,7 +91,7 @@ class InvoiceLine(ModelSQL, ModelView):
         return res
 
     def create(self, vals):
-        selection_obj = self.pool.get('analytic_account.account.selection')
+        selection_obj = Pool().get('analytic_account.account.selection')
         vals = vals.copy()
         selection_vals = {}
         for field in vals.keys():
@@ -102,7 +108,7 @@ class InvoiceLine(ModelSQL, ModelView):
         return super(InvoiceLine, self).create(vals)
 
     def write(self, ids, vals):
-        selection_obj = self.pool.get('analytic_account.account.selection')
+        selection_obj = Pool().get('analytic_account.account.selection')
         vals = vals.copy()
         if isinstance(ids, (int, long)):
             ids = [ids]
@@ -143,7 +149,7 @@ class InvoiceLine(ModelSQL, ModelView):
         return super(InvoiceLine, self).write(ids, vals)
 
     def delete(self, ids):
-        selection_obj = self.pool.get('analytic_account.account.selection')
+        selection_obj = Pool().get('analytic_account.account.selection')
 
         if isinstance(ids, (int, long)):
             ids = [ids]
@@ -158,7 +164,7 @@ class InvoiceLine(ModelSQL, ModelView):
         return res
 
     def copy(self, ids, default=None):
-        selection_obj = self.pool.get('analytic_account.account.selection')
+        selection_obj = Pool().get('analytic_account.account.selection')
 
         new_ids = super(InvoiceLine, self).copy(ids, default=default)
 
@@ -178,6 +184,16 @@ class InvoiceLine(ModelSQL, ModelView):
             return new_ids[0]
         return new_ids
 
+    def _credit(self, line):
+        selection_obj = Pool().get('analytic_account.account.selection')
+
+        result = super(InvoiceLine, self)._credit(line)
+
+        if line.analytic_accounts:
+            selection_id = selection_obj.copy(line.analytic_accounts.id)
+            result['analytic_accounts'] = selection_id
+        return result
+
     def get_move_line(self, line):
         values = super(InvoiceLine, self).get_move_line(line)
         if line.analytic_accounts and line.analytic_accounts.accounts:
@@ -203,21 +219,21 @@ class Account(ModelSQL, ModelView):
     _name = 'analytic_account.account'
 
     def delete(self, ids):
-        account_invoice_line_obj = self.pool.get('account.invoice.line')
+        account_invoice_line_obj = Pool().get('account.invoice.line')
         res = super(Account, self).delete(ids)
         # Restart the cache on the fields_view_get method of account.invoice.line
         account_invoice_line_obj.fields_view_get.reset()
         return res
 
     def create(self, vals):
-        account_invoice_line_obj = self.pool.get('account.invoice.line')
+        account_invoice_line_obj = Pool().get('account.invoice.line')
         res = super(Account, self).create(vals)
         # Restart the cache on the fields_view_get method of account.invoice.line
         account_invoice_line_obj.fields_view_get.reset()
         return res
 
     def write(self, ids, vals):
-        account_invoice_line_obj = self.pool.get('account.invoice.line')
+        account_invoice_line_obj = Pool().get('account.invoice.line')
         res = super(Account, self).write(ids, vals)
         # Restart the cache on the fields_view_get method of account.invoice.line
         account_invoice_line_obj.fields_view_get.reset()
diff --git a/invoice.xml b/invoice.xml
index 2a476ca..7509e7f 100644
--- a/invoice.xml
+++ b/invoice.xml
@@ -10,7 +10,7 @@ this repository contains the full copyright notices and license terms. -->
                 <![CDATA[
                 <data>
                     <xpath
-                        expr="/form/notebook/page/separator[@name="taxes"]"
+                        expr="/form/notebook/page/field[@name="taxes"]"
                         position="before">
                         <group col="4" colspan="4" name="analytic_accounts">
                             <field name="analytic_accounts"/>
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
new file mode 100644
index 0000000..a6a5434
--- /dev/null
+++ b/locale/bg_BG.po
@@ -0,0 +1,7 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgid "Analytic Accounts"
+msgstr "Аналитични сметки"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
new file mode 100644
index 0000000..f73e5cf
--- /dev/null
+++ b/locale/cs_CZ.po
@@ -0,0 +1,7 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgid "Analytic Accounts"
+msgstr ""
diff --git a/locale/de_DE.po b/locale/de_DE.po
new file mode 100644
index 0000000..63e1de1
--- /dev/null
+++ b/locale/de_DE.po
@@ -0,0 +1,7 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgid "Analytic Accounts"
+msgstr "Kostenstellen"
diff --git a/locale/es_CO.po b/locale/es_CO.po
new file mode 100644
index 0000000..1fb0f97
--- /dev/null
+++ b/locale/es_CO.po
@@ -0,0 +1,7 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgid "Analytic Accounts"
+msgstr "Cuentas Analíticas"
diff --git a/locale/es_ES.po b/locale/es_ES.po
new file mode 100644
index 0000000..28ec000
--- /dev/null
+++ b/locale/es_ES.po
@@ -0,0 +1,7 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgid "Analytic Accounts"
+msgstr "Cuentas analíticas"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
new file mode 100644
index 0000000..0aaed0b
--- /dev/null
+++ b/locale/fr_FR.po
@@ -0,0 +1,7 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgid "Analytic Accounts"
+msgstr "Comptes analytiques"
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
new file mode 100644
index 0000000..f73e5cf
--- /dev/null
+++ b/locale/nl_NL.po
@@ -0,0 +1,7 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgid "Analytic Accounts"
+msgstr ""
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
new file mode 100644
index 0000000..f73e5cf
--- /dev/null
+++ b/locale/ru_RU.po
@@ -0,0 +1,7 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "field:account.invoice.line,analytic_accounts:0"
+msgid "Analytic Accounts"
+msgstr ""
diff --git a/setup.py b/setup.py
index fb82478..c4f6693 100644
--- a/setup.py
+++ b/setup.py
@@ -39,17 +39,20 @@ setup(name='trytond_analytic_invoice',
     classifiers=[
         'Development Status :: 5 - Production/Stable',
         'Environment :: Plugins',
+        'Framework :: Tryton',
         'Intended Audience :: Developers',
         'Intended Audience :: Financial and Insurance Industry',
         'Intended Audience :: Legal Industry',
         'License :: OSI Approved :: GNU General Public License (GPL)',
         'Natural Language :: Bulgarian',
+        'Natural Language :: Czech',
+        'Natural Language :: Dutch',
         'Natural Language :: English',
         'Natural Language :: French',
         'Natural Language :: German',
+        'Natural Language :: Russian',
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
-        'Programming Language :: Python :: 2.5',
         'Programming Language :: Python :: 2.6',
         'Programming Language :: Python :: 2.7',
         'Topic :: Office/Business',
diff --git a/tests/test_analytic_invoice.py b/tests/test_analytic_invoice.py
index b8eaf33..b2c088f 100644
--- a/tests/test_analytic_invoice.py
+++ b/tests/test_analytic_invoice.py
@@ -10,7 +10,7 @@ if os.path.isdir(DIR):
 
 import unittest
 import trytond.tests.test_tryton
-from trytond.tests.test_tryton import test_view
+from trytond.tests.test_tryton import test_view, test_depends
 
 
 class AnalyticInvoiceTestCase(unittest.TestCase):
@@ -27,6 +27,12 @@ class AnalyticInvoiceTestCase(unittest.TestCase):
         '''
         test_view('analytic_invoice')
 
+    def test0006depends(self):
+        '''
+        Test depends.
+        '''
+        test_depends()
+
 def suite():
     suite = trytond.tests.test_tryton.suite()
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index e8e9d17..70f8ed4 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,28 +1,31 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 2.0.0
+Version: 2.2.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.0/
+Download-URL: http://downloads.tryton.org/2.2/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
+Classifier: Framework :: Tryton
 Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Financial and Insurance Industry
 Classifier: Intended Audience :: Legal Industry
 Classifier: License :: OSI Approved :: GNU General Public License (GPL)
 Classifier: Natural Language :: Bulgarian
+Classifier: Natural Language :: Czech
+Classifier: Natural Language :: Dutch
 Classifier: Natural Language :: English
 Classifier: Natural Language :: French
 Classifier: Natural Language :: German
+Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2.5
 Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Topic :: Office/Business
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
index 59ccf91..bfd16bf 100644
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -4,11 +4,6 @@ INSTALL
 LICENSE
 MANIFEST.in
 README
-bg_BG.csv
-de_DE.csv
-es_CO.csv
-es_ES.csv
-fr_FR.csv
 invoice.xml
 setup.py
 ./__init__.py
@@ -16,6 +11,14 @@ setup.py
 ./invoice.py
 ./tests/__init__.py
 ./tests/test_analytic_invoice.py
+locale/bg_BG.po
+locale/cs_CZ.po
+locale/de_DE.po
+locale/es_CO.po
+locale/es_ES.po
+locale/fr_FR.po
+locale/nl_NL.po
+locale/ru_RU.po
 trytond_analytic_invoice.egg-info/PKG-INFO
 trytond_analytic_invoice.egg-info/SOURCES.txt
 trytond_analytic_invoice.egg-info/dependency_links.txt
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
index 1ce5496..8853fbc 100644
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -1,3 +1,3 @@
-trytond_account_invoice >= 2.0, < 2.1
-trytond_analytic_account >= 2.0, < 2.1
-trytond >= 2.0, < 2.1
\ No newline at end of file
+trytond_account_invoice >= 2.2, < 2.3
+trytond_analytic_account >= 2.2, < 2.3
+trytond >= 2.2, < 2.3
\ No newline at end of file
commit 179f65693afd32e2e7c016a0170537f988bdfc6d
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Jul 22 12:26:55 2011 +0200

    Removing deprecated XB-Python-Version for dh_python2.

diff --git a/debian/control b/debian/control
index 88fff43..0069889 100644
--- a/debian/control
+++ b/debian/control
@@ -17,7 +17,6 @@ Depends:
  ${misc:Depends}, ${python:Depends}, tryton-server (>= 2.0),
  tryton-modules-account-invoice (>= 2.0),
  tryton-modules-analytic-account (>= 2.0), python-pkg-resources
-XB-Python-Version: ${python:Versions}
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
  and using PostgreSQL as database engine. It is the core base of a complete
commit b099e964cad2f292c89c577a4e14747b43baad52
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Jul 14 01:12:43 2011 +0200

    Releasing debian version 2.0.0-2.

diff --git a/debian/changelog b/debian/changelog
index 60f73ab..ea95e8c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+tryton-modules-analytic-invoice (1:2.0.0-2) unstable; urgency=low
+
+  [ Daniel Baumann ]
+  * Removing for new source package version obsoleted README.source file.
+  * Adding options for source package.
+  * Compacting copyright file.
+  * Not wrapping uploaders field, it does not exceed 80 chars.
+
+  [ Mathias Behrle ]
+  * Moving from deprecated python-support to dh_python2.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Thu, 14 Jul 2011 01:12:27 +0200
+
 tryton-modules-analytic-invoice (1:2.0.0-1) unstable; urgency=low
 
   * Updating to standards version 3.9.2.
commit 0220337dea3df48d288648aaed32be6a36a062ca
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Jul 13 20:28:22 2011 +0200

    Moving from deprecated python-support to dh_python2.

diff --git a/debian/control b/debian/control
index fddd4d5..88fff43 100644
--- a/debian/control
+++ b/debian/control
@@ -4,11 +4,12 @@ Priority: optional
 Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
 Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
 Dm-Upload-Allowed: yes
-Build-Depends: debhelper (>= 8), python, python-setuptools, python-support
+Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
 Standards-Version: 3.9.2
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
+X-Python-Version: >= 2.5
 
 Package: tryton-modules-analytic-invoice
 Architecture: all
diff --git a/debian/pycompat b/debian/pycompat
deleted file mode 100644
index 0cfbf08..0000000
--- a/debian/pycompat
+++ /dev/null
@@ -1 +0,0 @@
-2
diff --git a/debian/pyversions b/debian/pyversions
deleted file mode 100644
index b3dc41e..0000000
--- a/debian/pyversions
+++ /dev/null
@@ -1 +0,0 @@
-2.5-
diff --git a/debian/rules b/debian/rules
index 000210b..e32b791 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,4 +1,9 @@
 #!/usr/bin/make -f
 
 %:
-	dh ${@}
+	dh ${@} --with python2
+
+override_dh_auto_clean:
+	dh_auto_clean
+
+	rm -rf *.egg-info
commit 959bf5a75622ff7bce8055f33b3195664b935787
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Jul 10 16:01:11 2011 +0200

    Not wrapping uploaders field, it does not exceed 80 chars.

diff --git a/debian/control b/debian/control
index 02b31a8..fddd4d5 100644
--- a/debian/control
+++ b/debian/control
@@ -2,9 +2,7 @@ Source: tryton-modules-analytic-invoice
 Section: python
 Priority: optional
 Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
-Uploaders:
- Daniel Baumann <daniel at debian.org>,
- Mathias Behrle <mathiasb at m9s.biz>
+Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
 Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 8), python, python-setuptools, python-support
 Standards-Version: 3.9.2
commit 087728b49bf622e2a36c93e2afc7d2d937056cc9
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Jul 10 15:54:39 2011 +0200

    Compacting copyright file.

diff --git a/debian/copyright b/debian/copyright
index 8d14400..753c790 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,33 +1,15 @@
-Upstream-Contact: Tryton project <tryton at googlegroups.com>
-Upstream-Homepage: http://downloads.tryton.org/
-Maintainer-Contact: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
-Maintainer-Homepage: http://tryton.debian-maintainers.org/
-
 Files: *
 Copyright:
  (C) 2008-2011 Cedric Krier
  (C) 2008-2011 Bertrand Chenal
  (C) 2008-2011 B2CK SPRL
 License: GPL-3+
- 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 <http://www.gnu.org/licenses/>.
- .
- On Debian systems, the complete text of the GNU General Public License
- can be found in /usr/share/common-licenses/GPL-3 file.
 
 Files: debian/*
 Copyright: (C) 2009-2011 Daniel Baumann <daniel at debian.org>
 License: GPL-3+
+
+License: GPL-3+
  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
@@ -41,5 +23,5 @@ License: GPL-3+
  You should have received a copy of the GNU General Public License
  along with this program. If not, see <http://www.gnu.org/licenses/>.
  .
- On Debian systems, the complete text of the GNU General Public License
+ The complete text of the GNU General Public License
  can be found in /usr/share/common-licenses/GPL-3 file.
commit c9b4b7229959cd926689bab636d1df6d12d32dad
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Jul 10 15:38:54 2011 +0200

    Adding options for source package.

diff --git a/debian/source/options b/debian/source/options
new file mode 100644
index 0000000..d053b65
--- /dev/null
+++ b/debian/source/options
@@ -0,0 +1,2 @@
+compression = gzip
+compression-level = 9
commit 38e34d70e1dc2f829ed2f8b6e29d19d8cde42ebc
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Jul 10 15:38:02 2011 +0200

    Removing for new source package version obsoleted README.source file.

diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644
index 18b6b24..0000000
--- a/debian/README.source
+++ /dev/null
@@ -1,37 +0,0 @@
-Package Repositories
---------------------
-
-Backports for the current stable debian distribution as well as snapshots of
-unreleased versions may be available in repositories listed on the maintainers
-homepage. The current URL of the maintainer homepage can be seen in
-debian/copyright.
-
-
-Source Access
--------------
-
-You can obtain the sources of this package with:
-
-  $ apt-get source ${PACKAGE}
-
-whereas '${PACKAGE}' has to be replaced with the actual name of the package.
-
-This package is maintained with the Git version control system. The current git
-source tree can be obtained with:
-
-  $ git clone ${GIT_URI}
-
-whereas '${GIT_URI}' has to be replaced with the actual URI for the Git
-repository. The current Git URI can be seen in debian/control in the extracted
-package sources.
-
-More information about Git can be found in the git-core package.
-
-This package may use the Quilt patch system to manage all modifications to the
-upstream source. Changes, if any, are stored in the source package as diffs in
-debian/diff and are applied during the build. Current modifications can be
-applied to the source tree with:
-
-  $ QUILT_PATCHES=debian/patches quilt push -a
-
-More information about Quilt can be found in the quilt package.
commit a8387bfd1253da8b2608e968552a8a5e6ecb22b1
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue May 24 21:55:51 2011 +0200

    Releasing debian version 2.0.0-1.

diff --git a/debian/changelog b/debian/changelog
index ce18c4e..60f73ab 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+tryton-modules-analytic-invoice (1:2.0.0-1) unstable; urgency=low
+
+  * Updating to standards version 3.9.2.
+  * Merging upstream version 2.0.0.
+  * Updating Copyright.
+  * Updating versioned tryton depends to 2.0.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Tue, 24 May 2011 21:53:55 +0200
+
 tryton-modules-analytic-invoice (1:1.8.0-2) unstable; urgency=low
 
   * Changing my email address.
commit d75f9ca23d5e2d65ee88cae4a73508bf19034bd4
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue May 24 21:21:33 2011 +0200

    Updating versioned tryton depends to 2.0.

diff --git a/debian/control b/debian/control
index f68672f..02b31a8 100644
--- a/debian/control
+++ b/debian/control
@@ -15,9 +15,9 @@ Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-inv
 Package: tryton-modules-analytic-invoice
 Architecture: all
 Depends:
- ${misc:Depends}, ${python:Depends}, tryton-server (>= 1.8),
- tryton-modules-account-invoice (>= 1.8),
- tryton-modules-analytic-account (>= 1.8), python-pkg-resources
+ ${misc:Depends}, ${python:Depends}, tryton-server (>= 2.0),
+ tryton-modules-account-invoice (>= 2.0),
+ tryton-modules-analytic-account (>= 2.0), python-pkg-resources
 XB-Python-Version: ${python:Versions}
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
commit 6711d050cb1668b513aa89a09209f1fa99e1699a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue May 24 20:40:03 2011 +0200

    Updating Copyright.

diff --git a/debian/copyright b/debian/copyright
index 96ed7b4..8d14400 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -5,9 +5,9 @@ Maintainer-Homepage: http://tryton.debian-maintainers.org/
 
 Files: *
 Copyright:
- (C) 2008-2010 Cedric Krier
- (C) 2008-2010 Bertrand Chenal
- (C) 2008-2010 B2CK SPRL
+ (C) 2008-2011 Cedric Krier
+ (C) 2008-2011 Bertrand Chenal
+ (C) 2008-2011 B2CK SPRL
 License: GPL-3+
  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
commit 7172cb023d583f948e8a04795ba4f6163a1ef184
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue May 24 19:12:41 2011 +0200

    Merging upstream version 2.0.0.

diff --git a/CHANGELOG b/CHANGELOG
index 29d9fb1..f74f0b3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.0.0 - 2011-04-27
+* Bug fixes (see mercurial logs for details)
+
 Version 1.8.0 - 2010-11-01
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index cca7db9..3d2324b 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2008-2010 Cédric Krier.
-Copyright (C) 2008-2010 Bertrand Chenal.
-Copyright (C) 2008-2010 B2CK SPRL.
+Copyright (C) 2008-2011 Cédric Krier.
+Copyright (C) 2008-2011 Bertrand Chenal.
+Copyright (C) 2008-2011 B2CK SPRL.
 
 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
diff --git a/PKG-INFO b/PKG-INFO
index 6a9394b..0741569 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 1.8.0
+Version: 2.0.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/1.8/
+Download-URL: http://downloads.tryton.org/2.0/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
@@ -16,11 +16,14 @@ Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Financial and Insurance Industry
 Classifier: Intended Audience :: Legal Industry
 Classifier: License :: OSI Approved :: GNU General Public License (GPL)
+Classifier: Natural Language :: Bulgarian
 Classifier: Natural Language :: English
 Classifier: Natural Language :: French
 Classifier: Natural Language :: German
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2.5
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
 Classifier: Topic :: Office/Business
 Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/__tryton__.py b/__tryton__.py
index e0c4c1d..f37bd0f 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -2,16 +2,19 @@
 #this repository contains the full copyright notices and license terms.
 {
     'name': 'Analytic Invoice',
+    'name_bg_BG': 'Аналитична фактура',
     'name_de_DE': 'Kostenstellen Rechnungsstellung',
     'name_es_CO': 'Facturación Analítica',
     'name_es_ES': 'Facturación analítica',
     'name_fr_FR': 'Facturation analytique',
-    'version': '1.8.0',
+    'version': '2.0.0',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
     'description': '''Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 ''',
+    'description_bg_BG': ''' - Добавя аналитична сметна за редове на фактури и генерира аналитични редове за движения от фактура
+''',
     'description_de_DE': ''' - Fügt Kostenstellen zu Rechnungszeilen hinzu
  - Erstellt Positionen für Kostenstellen bei Buchung von Rechnungen
 ''',
@@ -32,6 +35,7 @@
         'invoice.xml',
     ],
     'translation': [
+        'bg_BG.csv',
         'de_DE.csv',
         'es_CO.csv',
         'es_ES.csv',
diff --git a/bg_BG.csv b/bg_BG.csv
new file mode 100644
index 0000000..6108a14
--- /dev/null
+++ b/bg_BG.csv
@@ -0,0 +1,2 @@
+type,name,res_id,src,value,fuzzy
+field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Аналитични сметки,0
diff --git a/invoice.py b/invoice.py
index 4af1bfc..b85c5f3 100644
--- a/invoice.py
+++ b/invoice.py
@@ -15,10 +15,11 @@ class InvoiceLine(ModelSQL, ModelView):
                 'invisible': Not(Equal(Eval('type'), 'line')),
             })
 
-    def _view_look_dom_arch(self, tree, type):
+    def _view_look_dom_arch(self, tree, type, field_children=None):
         analytic_account_obj = self.pool.get('analytic_account.account')
         analytic_account_obj.convert_view(tree)
-        arch, fields = super(InvoiceLine, self)._view_look_dom_arch(tree, type)
+        arch, fields = super(InvoiceLine, self)._view_look_dom_arch(tree, type,
+            field_children=field_children)
         return arch, fields
 
     def fields_get(self, fields_names=None):
@@ -178,21 +179,22 @@ class InvoiceLine(ModelSQL, ModelView):
         return new_ids
 
     def get_move_line(self, line):
-        res = super(InvoiceLine, self).get_move_line(line)
+        values = super(InvoiceLine, self).get_move_line(line)
         if line.analytic_accounts and line.analytic_accounts.accounts:
-            res['analytic_lines'] = []
-            for account in line.analytic_accounts.accounts:
-                vals = {}
-                vals['name'] = line.description
-                vals['debit'] = res['debit']
-                vals['credit'] = res['credit']
-                vals['account'] = account.id
-                vals['journal'] = line.invoice.journal.id
-                vals['date'] = line.invoice.invoice_date
-                vals['reference'] = line.invoice.reference
-                vals['party'] = line.invoice.party.id
-                res['analytic_lines'].append(('create', vals))
-        return res
+            for value in values:
+                value['analytic_lines'] = []
+                for account in line.analytic_accounts.accounts:
+                    vals = {}
+                    vals['name'] = line.description
+                    vals['debit'] = value['debit']
+                    vals['credit'] = value['credit']
+                    vals['account'] = account.id
+                    vals['journal'] = line.invoice.journal.id
+                    vals['date'] = line.invoice.invoice_date
+                    vals['reference'] = line.invoice.reference
+                    vals['party'] = line.invoice.party.id
+                    value['analytic_lines'].append(('create', vals))
+        return values
 
 InvoiceLine()
 
diff --git a/setup.py b/setup.py
index 8e44c05..fb82478 100644
--- a/setup.py
+++ b/setup.py
@@ -43,12 +43,15 @@ setup(name='trytond_analytic_invoice',
         'Intended Audience :: Financial and Insurance Industry',
         'Intended Audience :: Legal Industry',
         'License :: OSI Approved :: GNU General Public License (GPL)',
+        'Natural Language :: Bulgarian',
         'Natural Language :: English',
         'Natural Language :: French',
         'Natural Language :: German',
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
-        'Programming Language :: Python',
+        'Programming Language :: Python :: 2.5',
+        'Programming Language :: Python :: 2.6',
+        'Programming Language :: Python :: 2.7',
         'Topic :: Office/Business',
         'Topic :: Office/Business :: Financial :: Accounting',
     ],
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index 6b22242..e8e9d17 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 1.8.0
+Version: 2.0.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/1.8/
+Download-URL: http://downloads.tryton.org/2.0/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
@@ -16,11 +16,14 @@ Classifier: Intended Audience :: Developers
 Classifier: Intended Audience :: Financial and Insurance Industry
 Classifier: Intended Audience :: Legal Industry
 Classifier: License :: OSI Approved :: GNU General Public License (GPL)
+Classifier: Natural Language :: Bulgarian
 Classifier: Natural Language :: English
 Classifier: Natural Language :: French
 Classifier: Natural Language :: German
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2.5
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
 Classifier: Topic :: Office/Business
 Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
index b615c3f..59ccf91 100644
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -4,6 +4,7 @@ INSTALL
 LICENSE
 MANIFEST.in
 README
+bg_BG.csv
 de_DE.csv
 es_CO.csv
 es_ES.csv
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
index 860d8e4..1ce5496 100644
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -1,3 +1,3 @@
-trytond_account_invoice >= 1.8, < 1.9
-trytond_analytic_account >= 1.8, < 1.9
-trytond >= 1.8, < 1.9
\ No newline at end of file
+trytond_account_invoice >= 2.0, < 2.1
+trytond_analytic_account >= 2.0, < 2.1
+trytond >= 2.0, < 2.1
\ No newline at end of file
commit 5a829979896742ce94746da6f64591d781c16b57
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 26 21:08:53 2011 +0200

    Updating to standards version 3.9.2.

diff --git a/debian/control b/debian/control
index ee3ad63..f68672f 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Uploaders:
  Mathias Behrle <mathiasb at m9s.biz>
 Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 8), python, python-setuptools, python-support
-Standards-Version: 3.9.1
+Standards-Version: 3.9.2
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
commit bcc6f8ccee8b8f867a58e8eed6a84370c9fe405b
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Feb 15 13:06:50 2011 +0100

    Releasing debian version 1.8.0-2.

diff --git a/debian/changelog b/debian/changelog
index f6e2f4d..ce18c4e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+tryton-modules-analytic-invoice (1:1.8.0-2) unstable; urgency=low
+
+  * Changing my email address.
+  * Setting minimal Python version to 2.5.
+  * Updating Copyright.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Tue, 15 Feb 2011 13:06:32 +0100
+
 tryton-modules-analytic-invoice (1:1.8.0-1) experimental; urgency=low
 
   * Updating standards version to 3.9.0.
commit 8c3c351bc24fedd49bfae93602f897fd170f5ca6
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Feb 15 12:38:40 2011 +0100

    Updating Copyright.

diff --git a/debian/copyright b/debian/copyright
index a775c9c..96ed7b4 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -26,7 +26,7 @@ License: GPL-3+
  can be found in /usr/share/common-licenses/GPL-3 file.
 
 Files: debian/*
-Copyright: (C) 2009-2010 Daniel Baumann <daniel at debian.org>
+Copyright: (C) 2009-2011 Daniel Baumann <daniel at debian.org>
 License: GPL-3+
  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
commit e9387699194dc86f7553b883ce290f079276a221
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Jan 15 17:27:16 2011 +0100

    Setting minimal Python version to 2.5.

diff --git a/debian/pyversions b/debian/pyversions
index 8b253bc..b3dc41e 100644
--- a/debian/pyversions
+++ b/debian/pyversions
@@ -1 +1 @@
-2.4-
+2.5-
commit 144b5fcb51c9f8aa74e0abbace410e890417fa2c
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Nov 20 11:48:52 2010 +0100

    Changing my email address.

diff --git a/debian/control b/debian/control
index 0b1d600..ee3ad63 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
 Uploaders:
  Daniel Baumann <daniel at debian.org>,
- Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
+ Mathias Behrle <mathiasb at m9s.biz>
 Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 8), python, python-setuptools, python-support
 Standards-Version: 3.9.1
commit bb1cbb2cad2a9edfcbe5d313e8620120ea8e12ad
Author: Daniel Baumann <daniel at debian.org>
Date:   Fri Nov 12 12:55:06 2010 +0100

    Releasing debian version 1.8.0-1.

diff --git a/debian/changelog b/debian/changelog
index 0c8d9d7..f6e2f4d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+tryton-modules-analytic-invoice (1:1.8.0-1) experimental; urgency=low
+
+  * Updating standards version to 3.9.0.
+  * Updating to debhelper version 8.
+  * Updating to standards version 3.9.1.
+  * Switching to source format 3.0 (quilt).
+  * Merging upstream version 1.8.0.
+  * Updating versioned tryton depends to 1.8.
+
+ -- Daniel Baumann <daniel at debian.org>  Fri, 12 Nov 2010 12:54:57 +0100
+
 tryton-modules-analytic-invoice (1:1.6.0-1) unstable; urgency=low
 
   [ Daniel Baumann ]
commit 76c3b572f2b1b92a8fd00d893470b3793e0af374
Author: Daniel Baumann <daniel at debian.org>
Date:   Thu Nov 4 20:16:01 2010 +0100

    Updating versioned tryton depends to 1.8.

diff --git a/debian/control b/debian/control
index 03cabc9..0b1d600 100644
--- a/debian/control
+++ b/debian/control
@@ -15,9 +15,9 @@ Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-inv
 Package: tryton-modules-analytic-invoice
 Architecture: all
 Depends:
- ${misc:Depends}, ${python:Depends}, tryton-server (>= 1.6),
- tryton-modules-account-invoice (>= 1.6),
- tryton-modules-analytic-account (>= 1.6), python-pkg-resources
+ ${misc:Depends}, ${python:Depends}, tryton-server (>= 1.8),
+ tryton-modules-account-invoice (>= 1.8),
+ tryton-modules-analytic-account (>= 1.8), python-pkg-resources
 XB-Python-Version: ${python:Versions}
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
commit 83ceff6b0b5fe9ce87bc257bef61a2542b0cf7f9
Author: Daniel Baumann <daniel at debian.org>
Date:   Thu Nov 4 20:13:23 2010 +0100

    Merging upstream version 1.8.0.

diff --git a/CHANGELOG b/CHANGELOG
index e36b38a..29d9fb1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 1.8.0 - 2010-11-01
+* Bug fixes (see mercurial logs for details)
+
 Version 1.6.0 - 2010-05-13
 * Bug fixes (see mercurial logs for details)
 
diff --git a/INSTALL b/INSTALL
index d9f4210..53bd980 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_analytic_invoice
 Prerequisites
 -------------
 
- * Python 2.4 or later (http://www.python.org/)
+ * Python 2.5 or later (http://www.python.org/)
  * trytond (http://www.tryton.org/)
  * trytond_account_invoice (http://www.tryton.org/)
  * trytond_analytic_account (http://www.tryton.org/)
diff --git a/PKG-INFO b/PKG-INFO
index 29d8c26..6a9394b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 1.6.0
+Version: 1.8.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/1.6/
+Download-URL: http://downloads.tryton.org/1.8/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/__tryton__.py b/__tryton__.py
index 0515ee7..e0c4c1d 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -6,7 +6,7 @@
     'name_es_CO': 'Facturación Analítica',
     'name_es_ES': 'Facturación analítica',
     'name_fr_FR': 'Facturation analytique',
-    'version': '1.6.0',
+    'version': '1.8.0',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
diff --git a/invoice.py b/invoice.py
index dad3475..4af1bfc 100644
--- a/invoice.py
+++ b/invoice.py
@@ -1,8 +1,9 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
-"Invoice"
+from __future__ import with_statement
 from trytond.model import ModelView, ModelSQL, fields
 from trytond.pyson import Not, Equal, Eval
+from trytond.transaction import Transaction
 
 
 class InvoiceLine(ModelSQL, ModelView):
@@ -14,28 +15,25 @@ class InvoiceLine(ModelSQL, ModelView):
                 'invisible': Not(Equal(Eval('type'), 'line')),
             })
 
-    def _view_look_dom_arch(self, cursor, user, tree, type, context=None):
+    def _view_look_dom_arch(self, tree, type):
         analytic_account_obj = self.pool.get('analytic_account.account')
-        analytic_account_obj.convert_view(cursor, user, tree, context=context)
-        arch, fields = super(InvoiceLine, self)._view_look_dom_arch(cursor,
-                user, tree, type, context=context)
+        analytic_account_obj.convert_view(tree)
+        arch, fields = super(InvoiceLine, self)._view_look_dom_arch(tree, type)
         return arch, fields
 
-    def fields_get(self, cursor, user, fields_names=None, context=None):
+    def fields_get(self, fields_names=None):
         analytic_account_obj = self.pool.get('analytic_account.account')
 
-        res = super(InvoiceLine, self).fields_get(cursor, user, fields_names,
-                context=context)
+        res = super(InvoiceLine, self).fields_get(fields_names)
 
-        analytic_accounts_field = super(InvoiceLine, self).fields_get(cursor,
-                user, ['analytic_accounts'],
-                context=context)['analytic_accounts']
+        analytic_accounts_field = super(InvoiceLine, self).fields_get(
+                ['analytic_accounts'])['analytic_accounts']
 
-        res.update(analytic_account_obj.analytic_accounts_fields_get(cursor,
-            user, analytic_accounts_field, fields_names, context=context))
+        res.update(analytic_account_obj.analytic_accounts_fields_get(
+            analytic_accounts_field, fields_names))
         return res
 
-    def read(self, cursor, user, ids, fields_names=None, context=None):
+    def read(self, ids, fields_names=None):
         selection_obj = self.pool.get('analytic_account.account.selection')
 
         int_id = False
@@ -49,8 +47,7 @@ class InvoiceLine(ModelSQL, ModelView):
         else:
             fields_names2 = fields_names
 
-        res = super(InvoiceLine, self).read(cursor, user, ids,
-                fields_names=fields_names2, context=context)
+        res = super(InvoiceLine, self).read(ids, fields_names=fields_names2)
 
         if not fields_names:
             fields_names = list(set(self._columns.keys() \
@@ -64,8 +61,11 @@ class InvoiceLine(ModelSQL, ModelView):
             id2record = {}
             for record in res:
                 id2record[record['id']] = record
-            lines = self.browse(cursor, user, ids, context=context)
+            lines = self.browse(ids)
             for line in lines:
+                for root_id in root_ids:
+                    id2record[line.id]['analytic_account_' \
+                            + str(root_id)] = False
                 if line.type != 'line':
                     continue
                 if not line.analytic_accounts:
@@ -83,7 +83,7 @@ class InvoiceLine(ModelSQL, ModelView):
             return res[0]
         return res
 
-    def create(self, cursor, user, vals, context=None):
+    def create(self, vals):
         selection_obj = self.pool.get('analytic_account.account.selection')
         vals = vals.copy()
         selection_vals = {}
@@ -94,16 +94,13 @@ class InvoiceLine(ModelSQL, ModelView):
                     selection_vals['accounts'].append(('add', vals[field]))
                 del vals[field]
         if vals.get('analytic_accounts'):
-            selection_obj.write(cursor, user, vals['analytic_accounts'],
-                    selection_vals, context=context)
+            selection_obj.write(vals['analytic_accounts'], selection_vals)
         elif vals.get('type', 'line') == 'line':
-            selection_id = selection_obj.create(cursor, user, selection_vals,
-                    context=context)
+            selection_id = selection_obj.create(selection_vals)
             vals['analytic_accounts'] = selection_id
-        return super(InvoiceLine, self).create(cursor, user, vals,
-                context=context)
+        return super(InvoiceLine, self).create(vals)
 
-    def write(self, cursor, user, ids, vals, context=None):
+    def write(self, ids, vals):
         selection_obj = self.pool.get('analytic_account.account.selection')
         vals = vals.copy()
         if isinstance(ids, (int, long)):
@@ -115,19 +112,19 @@ class InvoiceLine(ModelSQL, ModelView):
                 selection_vals[root_id] = vals[field]
                 del vals[field]
         if selection_vals:
-            lines = self.browse(cursor, user, ids, context=context)
+            lines = self.browse(ids)
             for line in lines:
                 if line.type != 'line':
                     continue
                 accounts = []
                 if not line.analytic_accounts:
                     # Create missing selection
-                    selection_id = selection_obj.create(cursor, 0, {},
-                            context=context)
-                    self.write(cursor, user, line.id, {
+                    with Transaction().set_user(0):
+                            selection_id = selection_obj.create({})
+                    self.write(line.id, {
                         'analytic_accounts': selection_id,
-                        }, context=context)
-                    line = self.browse(cursor, user, line.id, context=context)
+                        })
+                    line = self.browse(line.id)
                 for account in line.analytic_accounts.accounts:
                     if account.root.id in selection_vals:
                         value = selection_vals[account.root.id]
@@ -139,54 +136,49 @@ class InvoiceLine(ModelSQL, ModelView):
                     if account_id \
                             and account_id not in accounts:
                         accounts.append(account_id)
-                selection_obj.write(cursor, user, line.analytic_accounts.id, {
+                selection_obj.write(line.analytic_accounts.id, {
                     'accounts': [('set', accounts)],
-                    }, context=context)
-        return super(InvoiceLine, self).write(cursor, user, ids, vals,
-                context=context)
+                    })
+        return super(InvoiceLine, self).write(ids, vals)
 
-    def delete(self, cursor, user, ids, context=None):
+    def delete(self, ids):
         selection_obj = self.pool.get('analytic_account.account.selection')
 
         if isinstance(ids, (int, long)):
             ids = [ids]
         selection_ids = []
-        lines = self.browse(cursor, user, ids, context=context)
+        lines = self.browse(ids)
         for line in lines:
             if line.analytic_accounts:
                 selection_ids.append(line.analytic_accounts.id)
 
-        res = super(InvoiceLine, self).delete(cursor, user, ids,
-                context=context)
-        selection_obj.delete(cursor, user, selection_ids, context=context)
+        res = super(InvoiceLine, self).delete(ids)
+        selection_obj.delete(selection_ids)
         return res
 
-    def copy(self, cursor, user, ids, default=None, context=None):
+    def copy(self, ids, default=None):
         selection_obj = self.pool.get('analytic_account.account.selection')
 
-        new_ids = super(InvoiceLine, self).copy(cursor, user, ids,
-                default=default, context=context)
+        new_ids = super(InvoiceLine, self).copy(ids, default=default)
 
         int_id = False
         if isinstance(new_ids, (int, long)):
             int_id = True
             new_ids = [new_ids]
 
-        for line in self.browse(cursor, user, new_ids, context=context):
+        for line in self.browse(new_ids):
             if line.analytic_accounts:
-                selection_id = selection_obj.copy(cursor, user,
-                        line.analytic_accounts.id, context=context)
-                self.write(cursor, user, line.id, {
+                selection_id = selection_obj.copy(line.analytic_accounts.id)
+                self.write(line.id, {
                     'analytic_accounts': selection_id,
-                    }, context=context)
+                    })
 
         if int_id:
             return new_ids[0]
         return new_ids
 
-    def get_move_line(self, cursor, user, line, context=None):
-        res = super(InvoiceLine, self).get_move_line(cursor, user, line,
-                context=context)
+    def get_move_line(self, line):
+        res = super(InvoiceLine, self).get_move_line(line)
         if line.analytic_accounts and line.analytic_accounts.accounts:
             res['analytic_lines'] = []
             for account in line.analytic_accounts.accounts:
@@ -208,26 +200,25 @@ InvoiceLine()
 class Account(ModelSQL, ModelView):
     _name = 'analytic_account.account'
 
-    def delete(self, cursor, user, ids, context=None):
+    def delete(self, ids):
         account_invoice_line_obj = self.pool.get('account.invoice.line')
-        res = super(Account, self).delete(cursor, user, ids, context=context)
+        res = super(Account, self).delete(ids)
         # Restart the cache on the fields_view_get method of account.invoice.line
-        account_invoice_line_obj.fields_view_get(cursor.dbname)
+        account_invoice_line_obj.fields_view_get.reset()
         return res
 
-    def create(self, cursor, user, vals, context=None):
+    def create(self, vals):
         account_invoice_line_obj = self.pool.get('account.invoice.line')
-        res = super(Account, self).create(cursor, user, vals, context=context)
+        res = super(Account, self).create(vals)
         # Restart the cache on the fields_view_get method of account.invoice.line
-        account_invoice_line_obj.fields_view_get(cursor.dbname)
+        account_invoice_line_obj.fields_view_get.reset()
         return res
 
-    def write(self, cursor, user, ids, vals, context=None):
+    def write(self, ids, vals):
         account_invoice_line_obj = self.pool.get('account.invoice.line')
-        res = super(Account, self).write(cursor, user, ids, vals,
-                context=context)
+        res = super(Account, self).write(ids, vals)
         # Restart the cache on the fields_view_get method of account.invoice.line
-        account_invoice_line_obj.fields_view_get(cursor.dbname)
+        account_invoice_line_obj.fields_view_get.reset()
         return res
 
 Account()
diff --git a/tests/test_analytic_invoice.py b/tests/test_analytic_invoice.py
index bd75423..b8eaf33 100644
--- a/tests/test_analytic_invoice.py
+++ b/tests/test_analytic_invoice.py
@@ -25,7 +25,7 @@ class AnalyticInvoiceTestCase(unittest.TestCase):
         '''
         Test views.
         '''
-        self.assertRaises(Exception, test_view('analytic_invoice'))
+        test_view('analytic_invoice')
 
 def suite():
     suite = trytond.tests.test_tryton.suite()
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index a69bd24..6b22242 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 1.6.0
+Version: 1.8.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/1.6/
+Download-URL: http://downloads.tryton.org/1.8/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
index 475c704..860d8e4 100644
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -1,3 +1,3 @@
-trytond_account_invoice >= 1.6, < 1.7
-trytond_analytic_account >= 1.6, < 1.7
-trytond >= 1.6, < 1.7
\ No newline at end of file
+trytond_account_invoice >= 1.8, < 1.9
+trytond_analytic_account >= 1.8, < 1.9
+trytond >= 1.8, < 1.9
\ No newline at end of file
commit fecca419df31145f99a116b11cd7c52273a943c5
Author: Daniel Baumann <daniel at debian.org>
Date:   Tue Nov 2 14:26:22 2010 +0100

    Switching to source format 3.0 (quilt).

diff --git a/debian/source/format b/debian/source/format
index d3827e7..163aaf8 100644
--- a/debian/source/format
+++ b/debian/source/format
@@ -1 +1 @@
-1.0
+3.0 (quilt)
commit 7b36c8c31fd34cb7392b20ec041c6dea1e99d85d
Author: Daniel Baumann <daniel at debian.org>
Date:   Thu Sep 30 01:05:32 2010 +0200

    Updating to standards version 3.9.1.

diff --git a/debian/control b/debian/control
index 2ab121b..03cabc9 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Uploaders:
  Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
 Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 8), python, python-setuptools, python-support
-Standards-Version: 3.9.0
+Standards-Version: 3.9.1
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
commit ccdab8ab75c032284a6a2a758339d81c925ae62d
Author: Daniel Baumann <daniel at debian.org>
Date:   Thu Sep 30 01:04:04 2010 +0200

    Updating to debhelper version 8.

diff --git a/debian/compat b/debian/compat
index 7f8f011..45a4fb7 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+8
diff --git a/debian/control b/debian/control
index a64d0ef..2ab121b 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders:
  Daniel Baumann <daniel at debian.org>,
  Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
 Dm-Upload-Allowed: yes
-Build-Depends: debhelper (>= 7), python, python-setuptools, python-support
+Build-Depends: debhelper (>= 8), python, python-setuptools, python-support
 Standards-Version: 3.9.0
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
commit 89a88357f2baa2d14e30f5333247e8ca01ac58c4
Author: Daniel Baumann <daniel at debian.org>
Date:   Mon Jun 28 20:35:29 2010 +0200

    Updating standards version to 3.9.0.

diff --git a/debian/control b/debian/control
index 91d121c..a64d0ef 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Uploaders:
  Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
 Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 7), python, python-setuptools, python-support
-Standards-Version: 3.8.4
+Standards-Version: 3.9.0
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
commit 29c48dad09f495db06c960bac306c31706fd65fc
Author: Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
Date:   Thu May 13 20:58:11 2010 +0200

    Releasing debian version 1.6.0-1.

diff --git a/debian/changelog b/debian/changelog
index 485ba19..0c8d9d7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+tryton-modules-analytic-invoice (1:1.6.0-1) unstable; urgency=low
+
+  [ Daniel Baumann ]
+  * Adding Dm-Upload-Allowed in control in preparation for Mathias.
+
+  [ Mathias Behrle ]
+  * Merging upstream version 1.6.0.
+  * Updating copyright.
+  * Updating depends.
+
+ -- Mathias Behrle <mathiasb at mbsolutions.selfip.biz>  Thu, 13 May 2010 20:56:02 +0200
+
 tryton-modules-analytic-invoice (1:1.4.0-3) unstable; urgency=low
 
   * Making depends versioned for tryton 1.4.
commit 4b1971a4b3338a6e96786af9144c866b74e624eb
Author: Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
Date:   Thu May 13 20:55:52 2010 +0200

    Updating depends.

diff --git a/debian/control b/debian/control
index 8be3a79..91d121c 100644
--- a/debian/control
+++ b/debian/control
@@ -15,9 +15,9 @@ Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-inv
 Package: tryton-modules-analytic-invoice
 Architecture: all
 Depends:
- ${misc:Depends}, ${python:Depends}, tryton-server (>= 1.4),
- tryton-modules-account-invoice (>= 1.4),
- tryton-modules-analytic-account (>= 1.4), python-pkg-resources
+ ${misc:Depends}, ${python:Depends}, tryton-server (>= 1.6),
+ tryton-modules-account-invoice (>= 1.6),
+ tryton-modules-analytic-account (>= 1.6), python-pkg-resources
 XB-Python-Version: ${python:Versions}
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
commit 3c89126b038bf618eb0ae5f6b0c1d13d603f2e16
Author: Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
Date:   Thu May 13 20:55:49 2010 +0200

    Updating copyright.

diff --git a/debian/copyright b/debian/copyright
index 03aa93b..a775c9c 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -5,8 +5,9 @@ Maintainer-Homepage: http://tryton.debian-maintainers.org/
 
 Files: *
 Copyright:
- (C) 2008-2009 Cedric Krier
- (C) 2008-2009 B2CK SPRL
+ (C) 2008-2010 Cedric Krier
+ (C) 2008-2010 Bertrand Chenal
+ (C) 2008-2010 B2CK SPRL
 License: GPL-3+
  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
commit 0614da34f9eb159fe7c40f4e594f0bf2825311ab
Author: Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
Date:   Thu May 13 20:41:26 2010 +0200

    Merging upstream version 1.6.0.

diff --git a/CHANGELOG b/CHANGELOG
index b4765f1..e36b38a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 1.6.0 - 2010-05-13
+* Bug fixes (see mercurial logs for details)
+
 Version 1.4.0 - 2009-10-19
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index 853f1f7..cca7db9 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,5 +1,6 @@
-Copyright (C) 2008-2009 Cédric Krier.
-Copyright (C) 2008-2009 B2CK SPRL.
+Copyright (C) 2008-2010 Cédric Krier.
+Copyright (C) 2008-2010 Bertrand Chenal.
+Copyright (C) 2008-2010 B2CK SPRL.
 
 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
diff --git a/MANIFEST.in b/MANIFEST.in
index c61b52d..5343ad8 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -7,4 +7,3 @@ include LICENSE
 include *.xml
 include *.odt
 include *.csv
-include tests/*
diff --git a/PKG-INFO b/PKG-INFO
index dcf0876..29d8c26 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 1.4.0
+Version: 1.6.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/1.4/
+Download-URL: http://downloads.tryton.org/1.6/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/__tryton__.py b/__tryton__.py
index d4e0a90..0515ee7 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -6,7 +6,7 @@
     'name_es_CO': 'Facturación Analítica',
     'name_es_ES': 'Facturación analítica',
     'name_fr_FR': 'Facturation analytique',
-    'version': '1.4.0',
+    'version': '1.6.0',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
diff --git a/invoice.py b/invoice.py
index 86a3fd9..dad3475 100644
--- a/invoice.py
+++ b/invoice.py
@@ -2,6 +2,7 @@
 #this repository contains the full copyright notices and license terms.
 "Invoice"
 from trytond.model import ModelView, ModelSQL, fields
+from trytond.pyson import Not, Equal, Eval
 
 
 class InvoiceLine(ModelSQL, ModelView):
@@ -10,7 +11,7 @@ class InvoiceLine(ModelSQL, ModelView):
     analytic_accounts = fields.Many2One('analytic_account.account.selection',
             'Analytic Accounts',
             states={
-                'invisible': "type != 'line'",
+                'invisible': Not(Equal(Eval('type'), 'line')),
             })
 
     def _view_look_dom_arch(self, cursor, user, tree, type, context=None):
diff --git a/setup.py b/setup.py
index 98580f0..8e44c05 100644
--- a/setup.py
+++ b/setup.py
@@ -2,19 +2,22 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 
-from setuptools import setup, find_packages
+from setuptools import setup
 import re
 
-info = eval(file('__tryton__.py').read())
+info = eval(open('__tryton__.py').read())
+major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
+major_version = int(major_version)
+minor_version = int(minor_version)
 
 requires = []
 for dep in info.get('depends', []):
     if not re.match(r'(ir|res|workflow|webdav)(\W|$)', dep):
-        requires.append('trytond_' + dep)
-
-major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
-requires.append('trytond >= %s.%s' % (major_version, minor_version))
-requires.append('trytond < %s.%s' % (major_version, int(minor_version) + 1))
+        requires.append('trytond_%s >= %s.%s, < %s.%s' %
+                (dep, major_version, minor_version, major_version,
+                    minor_version + 1))
+requires.append('trytond >= %s.%s, < %s.%s' %
+        (major_version, minor_version, major_version, minor_version + 1))
 
 setup(name='trytond_analytic_invoice',
     version=info.get('version', '0.0.1'),
@@ -27,6 +30,7 @@ setup(name='trytond_analytic_invoice',
     package_dir={'trytond.modules.analytic_invoice': '.'},
     packages=[
         'trytond.modules.analytic_invoice',
+        'trytond.modules.analytic_invoice.tests',
     ],
     package_data={
         'trytond.modules.analytic_invoice': info.get('xml', []) \
@@ -55,4 +59,6 @@ setup(name='trytond_analytic_invoice',
     [trytond.modules]
     analytic_invoice = trytond.modules.analytic_invoice
     """,
+    test_suite='tests',
+    test_loader='trytond.test_loader:Loader',
 )
diff --git a/tests/__init__.py b/tests/__init__.py
index 2f6f571..f977db0 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1,4 +1,4 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 
-from test_analytic_invoice import *
+from test_analytic_invoice import suite
diff --git a/tests/test_analytic_invoice.py b/tests/test_analytic_invoice.py
index 0cdbd2b..bd75423 100644
--- a/tests/test_analytic_invoice.py
+++ b/tests/test_analytic_invoice.py
@@ -10,7 +10,7 @@ if os.path.isdir(DIR):
 
 import unittest
 import trytond.tests.test_tryton
-from trytond.tests.test_tryton import RPCProxy, CONTEXT, SOCK, test_view
+from trytond.tests.test_tryton import test_view
 
 
 class AnalyticInvoiceTestCase(unittest.TestCase):
@@ -28,11 +28,10 @@ class AnalyticInvoiceTestCase(unittest.TestCase):
         self.assertRaises(Exception, test_view('analytic_invoice'))
 
 def suite():
-    return unittest.TestLoader().loadTestsFromTestCase(AnalyticInvoiceTestCase)
+    suite = trytond.tests.test_tryton.suite()
+    suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
+        AnalyticInvoiceTestCase))
+    return suite
 
 if __name__ == '__main__':
-    suiteTrytond = trytond.tests.test_tryton.suite()
-    suiteAnalyticInvoice = suite()
-    alltests = unittest.TestSuite([suiteTrytond, suiteAnalyticInvoice])
-    unittest.TextTestRunner(verbosity=2).run(alltests)
-    SOCK.disconnect()
+    unittest.TextTestRunner(verbosity=2).run(suite())
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index d32ba69..a69bd24 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 1.4.0
+Version: 1.6.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/1.4/
+Download-URL: http://downloads.tryton.org/1.6/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
index 7929e54..b615c3f 100644
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -13,8 +13,8 @@ setup.py
 ./__init__.py
 ./__tryton__.py
 ./invoice.py
-tests/__init__.py
-tests/test_analytic_invoice.py
+./tests/__init__.py
+./tests/test_analytic_invoice.py
 trytond_analytic_invoice.egg-info/PKG-INFO
 trytond_analytic_invoice.egg-info/SOURCES.txt
 trytond_analytic_invoice.egg-info/dependency_links.txt
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
index 78ff445..475c704 100644
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -1,4 +1,3 @@
-trytond_account_invoice
-trytond_analytic_account
-trytond >= 1.4
-trytond < 1.5
\ No newline at end of file
+trytond_account_invoice >= 1.6, < 1.7
+trytond_analytic_account >= 1.6, < 1.7
+trytond >= 1.6, < 1.7
\ No newline at end of file
commit 2b6e1db24eef8f5bcfa7932151cd9927c28d866b
Author: Daniel Baumann <daniel at debian.org>
Date:   Fri Apr 9 14:31:32 2010 +0200

    Adding Dm-Upload-Allowed in control in preparation for Mathias.

diff --git a/debian/control b/debian/control
index dd8e1a5..8be3a79 100644
--- a/debian/control
+++ b/debian/control
@@ -5,6 +5,7 @@ Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
 Uploaders:
  Daniel Baumann <daniel at debian.org>,
  Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
+Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 7), python, python-setuptools, python-support
 Standards-Version: 3.8.4
 Homepage: http://www.tryton.org/
commit e064a0627fa9c3b772bcec4a9571bf861f77f9a3
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Feb 20 10:08:01 2010 +0100

    Releasing debian version 1.4.0-3.

diff --git a/debian/changelog b/debian/changelog
index 41c2246..485ba19 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+tryton-modules-analytic-invoice (1:1.4.0-3) unstable; urgency=low
+
+  * Making depends versioned for tryton 1.4.
+  * Adding explicit debian source version 1.0 until switch to 3.0.
+  * Updating year in copyright file.
+  * Removing unneeded python-all-dev from build-depends.
+  * Updating to standards 3.8.4.
+  * Updating README.source.
+
+ -- Daniel Baumann <daniel at debian.org>  Sat, 20 Feb 2010 10:07:02 +0100
+
 tryton-modules-analytic-invoice (1:1.4.0-2) unstable; urgency=low
 
   * Reuploading package without changes, apparently the build process
commit 411951a1ee40869a1e354dae419d3945dac6195e
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Feb 20 10:06:38 2010 +0100

    Updating README.source.

diff --git a/debian/README.source b/debian/README.source
index dcc7ba3..18b6b24 100644
--- a/debian/README.source
+++ b/debian/README.source
@@ -32,6 +32,6 @@ upstream source. Changes, if any, are stored in the source package as diffs in
 debian/diff and are applied during the build. Current modifications can be
 applied to the source tree with:
 
-  $ quilt push -a
+  $ QUILT_PATCHES=debian/patches quilt push -a
 
 More information about Quilt can be found in the quilt package.
commit 4e27e69e503f9cfdbd45805c0e6ddb996b0da94a
Author: Daniel Baumann <daniel at debian.org>
Date:   Thu Jan 28 07:53:21 2010 +0100

    Updating to standards 3.8.4.

diff --git a/debian/control b/debian/control
index 5c4fe0f..dd8e1a5 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders:
  Daniel Baumann <daniel at debian.org>,
  Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
 Build-Depends: debhelper (>= 7), python, python-setuptools, python-support
-Standards-Version: 3.8.3
+Standards-Version: 3.8.4
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
commit 9453c3166a322b1f2a92756d5fe1dbe95c1213de
Author: Daniel Baumann <daniel at debian.org>
Date:   Mon Jan 25 10:12:27 2010 +0100

    Removing unneeded python-all-dev from build-depends.

diff --git a/debian/control b/debian/control
index 0a9e81d..5c4fe0f 100644
--- a/debian/control
+++ b/debian/control
@@ -5,8 +5,7 @@ Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
 Uploaders:
  Daniel Baumann <daniel at debian.org>,
  Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
-Build-Depends:
- debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
+Build-Depends: debhelper (>= 7), python, python-setuptools, python-support
 Standards-Version: 3.8.3
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
commit 11e8c406f349acb5203d8d3cb7953343b041439b
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Jan 2 11:35:05 2010 +0100

    Updating year in copyright file.

diff --git a/debian/copyright b/debian/copyright
index 5cc0bab..03aa93b 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -25,7 +25,7 @@ License: GPL-3+
  can be found in /usr/share/common-licenses/GPL-3 file.
 
 Files: debian/*
-Copyright: (C) 2009 Daniel Baumann <daniel at debian.org>
+Copyright: (C) 2009-2010 Daniel Baumann <daniel at debian.org>
 License: GPL-3+
  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
commit 323e5a289b841b2456b70f7ec7d88622ffce0508
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Dec 12 10:06:18 2009 +0100

    Adding explicit debian source version 1.0 until switch to 3.0.

diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..d3827e7
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+1.0
commit 22b40db70599bb6be0d7c60996e699787edb2bda
Author: Daniel Baumann <daniel at debian.org>
Date:   Wed Nov 4 12:22:19 2009 +0100

    Making depends versioned for tryton 1.4.

diff --git a/debian/control b/debian/control
index 4f628a4..0a9e81d 100644
--- a/debian/control
+++ b/debian/control
@@ -15,9 +15,9 @@ Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-inv
 Package: tryton-modules-analytic-invoice
 Architecture: all
 Depends:
- ${misc:Depends}, ${python:Depends}, tryton-server,
- tryton-modules-account-invoice, tryton-modules-analytic-account,
- python-pkg-resources
+ ${misc:Depends}, ${python:Depends}, tryton-server (>= 1.4),
+ tryton-modules-account-invoice (>= 1.4),
+ tryton-modules-analytic-account (>= 1.4), python-pkg-resources
 XB-Python-Version: ${python:Versions}
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
commit 93a849ef1bb57bb8dd2e743fcb84f824b3993565
Author: Daniel Baumann <daniel at debian.org>
Date:   Fri Oct 23 07:06:39 2009 +0200

    Releasing debian version 1.4.0-2.

diff --git a/debian/changelog b/debian/changelog
index f90b3fd..41c2246 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-modules-analytic-invoice (1:1.4.0-2) unstable; urgency=low
+
+  * Reuploading package without changes, apparently the build process
+    tainted invoice.py somehow (Closes: #551990).
+
+ -- Daniel Baumann <daniel at debian.org>  Fri, 23 Oct 2009 07:06:22 +0200
+
 tryton-modules-analytic-invoice (1:1.4.0-1) unstable; urgency=low
 
   * Merging upstream version 1.4.0.
commit 4526a2e9e1e3ab4b43fa720ff03f7c882fdb4809
Author: Daniel Baumann <daniel at debian.org>
Date:   Fri Oct 23 07:06:10 2009 +0200

    Reuploading package without changes, apparently the build process tainted invoice.py somehow (Closes: #551990).
commit 8d9e85b5f14d87765067a7119af4c7c78864cb1e
Author: Daniel Baumann <daniel at debian.org>
Date:   Mon Oct 19 21:46:38 2009 +0200

    Releasing debian version 1.4.0-1.

diff --git a/debian/changelog b/debian/changelog
index 464ccc0..f90b3fd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-modules-analytic-invoice (1:1.4.0-1) unstable; urgency=low
+
+  * Merging upstream version 1.4.0.
+
+ -- Daniel Baumann <daniel at debian.org>  Mon, 19 Oct 2009 21:46:29 +0200
+
 tryton-modules-analytic-invoice (1:1.2.0-5) unstable; urgency=low
 
   * Updating to standards version 3.8.3.
commit e8213ed2a85fe4491da948fc377e3fcf6262a783
Author: Daniel Baumann <daniel at debian.org>
Date:   Mon Oct 19 21:46:19 2009 +0200

    Merging upstream version 1.4.0.

diff --git a/CHANGELOG b/CHANGELOG
index d28f483..b4765f1 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 1.4.0 - 2009-10-19
+* Bug fixes (see mercurial logs for details)
+
 Version 1.2.0 - 2009-04-20
 * Bug fixes (see mercurial logs for details)
 * Allow egg installation
diff --git a/INSTALL b/INSTALL
index 895fbf8..d9f4210 100644
--- a/INSTALL
+++ b/INSTALL
@@ -5,7 +5,7 @@ Prerequisites
 -------------
 
  * Python 2.4 or later (http://www.python.org/)
- * trytond 1.1.x (http://www.tryton.org/)
+ * trytond (http://www.tryton.org/)
  * trytond_account_invoice (http://www.tryton.org/)
  * trytond_analytic_account (http://www.tryton.org/)
 
diff --git a/MANIFEST.in b/MANIFEST.in
index 5343ad8..c61b52d 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -7,3 +7,4 @@ include LICENSE
 include *.xml
 include *.odt
 include *.csv
+include tests/*
diff --git a/PKG-INFO b/PKG-INFO
index f98d718..dcf0876 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 1.2.0
+Version: 1.4.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/1.2/
+Download-URL: http://downloads.tryton.org/1.4/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/__init__.py b/__init__.py
index 646e21a..d415f1d 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,3 +1,4 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
 
 from invoice import *
diff --git a/__tryton__.py b/__tryton__.py
index 55c768c..d4e0a90 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -4,9 +4,9 @@
     'name': 'Analytic Invoice',
     'name_de_DE': 'Kostenstellen Rechnungsstellung',
     'name_es_CO': 'Facturación Analítica',
-    'name_es_ES': 'Facturación Analítica',
+    'name_es_ES': 'Facturación analítica',
     'name_fr_FR': 'Facturation analytique',
-    'version': '1.2.0',
+    'version': '1.4.0',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
@@ -18,9 +18,8 @@
     'description_es_CO': ''' - Adición de contabilidad analítica a las líneas de facturación 
  -  Generación de líneas analíticas en la factura.
 ''',
-    'description_es_ES': ''' - Adición de contabilidad analítica a las líneas de facturación 
- -  Generación de líneas analíticas en la factura.
-''',
+    'description_es_ES': '''Añade una cuenta analítica en las líneas de '''
+    '''factura y genera líneas analíticas en los asientos de la factura.''',
     'description_fr_FR': '''Ajoute la comptabilité analytique sur les lignes '''
     '''de facture et génère les lignes analytiques sur les mouvements de la '''
     '''facture.''',
diff --git a/invoice.py b/invoice.py
index ef9ec77..86a3fd9 100644
--- a/invoice.py
+++ b/invoice.py
@@ -1,4 +1,5 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
 "Invoice"
 from trytond.model import ModelView, ModelSQL, fields
 
@@ -192,7 +193,6 @@ class InvoiceLine(ModelSQL, ModelView):
                 vals['name'] = line.description
                 vals['debit'] = res['debit']
                 vals['credit'] = res['credit']
-                vals['currency'] = line.invoice.currency.id
                 vals['account'] = account.id
                 vals['journal'] = line.invoice.journal.id
                 vals['date'] = line.invoice.invoice_date
diff --git a/setup.py b/setup.py
index b0e0eec..98580f0 100644
--- a/setup.py
+++ b/setup.py
@@ -9,17 +9,12 @@ info = eval(file('__tryton__.py').read())
 
 requires = []
 for dep in info.get('depends', []):
-    match = re.compile(
-            '(ir|res|workflow|webdav)((\s|$|<|>|<=|>=|==|!=).*?$)').match(dep)
-    if match:
-        continue
-    else:
-        dep = 'trytond_' + dep
-    requires.append(dep)
+    if not re.match(r'(ir|res|workflow|webdav)(\W|$)', dep):
+        requires.append('trytond_' + dep)
 
 major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
 requires.append('trytond >= %s.%s' % (major_version, minor_version))
-requires.append('trytond < %s.%s' % (major_version, str(int(minor_version) + 1)))
+requires.append('trytond < %s.%s' % (major_version, int(minor_version) + 1))
 
 setup(name='trytond_analytic_invoice',
     version=info.get('version', '0.0.1'),
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..2f6f571
--- /dev/null
+++ b/tests/__init__.py
@@ -0,0 +1,4 @@
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
+
+from test_analytic_invoice import *
diff --git a/tests/test_analytic_invoice.py b/tests/test_analytic_invoice.py
new file mode 100644
index 0000000..0cdbd2b
--- /dev/null
+++ b/tests/test_analytic_invoice.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
+
+import sys, os
+DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
+    '..', '..', '..', '..', '..', 'trytond')))
+if os.path.isdir(DIR):
+    sys.path.insert(0, os.path.dirname(DIR))
+
+import unittest
+import trytond.tests.test_tryton
+from trytond.tests.test_tryton import RPCProxy, CONTEXT, SOCK, test_view
+
+
+class AnalyticInvoiceTestCase(unittest.TestCase):
+    '''
+    Test AnalyticInvoice module.
+    '''
+
+    def setUp(self):
+        trytond.tests.test_tryton.install_module('analytic_invoice')
+
+    def test0005views(self):
+        '''
+        Test views.
+        '''
+        self.assertRaises(Exception, test_view('analytic_invoice'))
+
+def suite():
+    return unittest.TestLoader().loadTestsFromTestCase(AnalyticInvoiceTestCase)
+
+if __name__ == '__main__':
+    suiteTrytond = trytond.tests.test_tryton.suite()
+    suiteAnalyticInvoice = suite()
+    alltests = unittest.TestSuite([suiteTrytond, suiteAnalyticInvoice])
+    unittest.TextTestRunner(verbosity=2).run(alltests)
+    SOCK.disconnect()
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index 0aa6af9..d32ba69 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 1.2.0
+Version: 1.4.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/1.2/
+Download-URL: http://downloads.tryton.org/1.4/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
index bfe7099..7929e54 100644
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -13,6 +13,8 @@ setup.py
 ./__init__.py
 ./__tryton__.py
 ./invoice.py
+tests/__init__.py
+tests/test_analytic_invoice.py
 trytond_analytic_invoice.egg-info/PKG-INFO
 trytond_analytic_invoice.egg-info/SOURCES.txt
 trytond_analytic_invoice.egg-info/dependency_links.txt
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
index b1fdc3d..78ff445 100644
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -1,4 +1,4 @@
 trytond_account_invoice
 trytond_analytic_account
-trytond >= 1.2
-trytond < 1.3
\ No newline at end of file
+trytond >= 1.4
+trytond < 1.5
\ No newline at end of file
commit 4bf37361b92ac29ba85792e84faae37431fe8f97
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Sep 5 09:38:51 2009 +0200

    Releasing debian version 1.2.0-5.

diff --git a/debian/changelog b/debian/changelog
index d76ae8b..464ccc0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+tryton-modules-analytic-invoice (1:1.2.0-5) unstable; urgency=low
+
+  * Updating to standards version 3.8.3.
+  * Adding maintainer homepage field to control.
+  * Adding README.source.
+  * Moving maintainer homepage field to copyright.
+  * Updating README.source.
+  * Using ascii only characters in copyright.
+
+ -- Daniel Baumann <daniel at debian.org>  Sat, 05 Sep 2009 09:38:48 +0200
+
 tryton-modules-analytic-invoice (1:1.2.0-4) unstable; urgency=low
 
   * Updating maintainer field.
commit 9a811affbac125e3843c784687b30223d9dc7f0c
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Sep 5 09:34:33 2009 +0200

    Using ascii only characters in copyright.

diff --git a/debian/copyright b/debian/copyright
index d8a282e..5cc0bab 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -5,7 +5,7 @@ Maintainer-Homepage: http://tryton.debian-maintainers.org/
 
 Files: *
 Copyright:
- (C) 2008-2009 Cédric Krier
+ (C) 2008-2009 Cedric Krier
  (C) 2008-2009 B2CK SPRL
 License: GPL-3+
  This program is free software: you can redistribute it and/or modify
commit d26f67bb8f097e256f2f86f3701c58ca0a0e3d29
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Sep 5 09:31:18 2009 +0200

    Updating README.source.

diff --git a/debian/README.source b/debian/README.source
index 259f923..dcc7ba3 100644
--- a/debian/README.source
+++ b/debian/README.source
@@ -4,7 +4,7 @@ Package Repositories
 Backports for the current stable debian distribution as well as snapshots of
 unreleased versions may be available in repositories listed on the maintainers
 homepage. The current URL of the maintainer homepage can be seen in
-debian/control.
+debian/copyright.
 
 
 Source Access
commit 65436f686dd42e6cf729dbe78039ca1db124162a
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Sep 5 09:27:12 2009 +0200

    Moving maintainer homepage field to copyright.

diff --git a/debian/control b/debian/control
index bdd8dfe..4f628a4 100644
--- a/debian/control
+++ b/debian/control
@@ -11,7 +11,6 @@ Standards-Version: 3.8.3
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
-XSBC-Maintainer-Homepage: http://tryton.debian-maintainers.org/
 
 Package: tryton-modules-analytic-invoice
 Architecture: all
diff --git a/debian/copyright b/debian/copyright
index d1603bc..d8a282e 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,5 +1,7 @@
-Author: Tryton Project <http://www.tryton.org/>
-Download: http://www.tryton.org/downloads.html
+Upstream-Contact: Tryton project <tryton at googlegroups.com>
+Upstream-Homepage: http://downloads.tryton.org/
+Maintainer-Contact: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
+Maintainer-Homepage: http://tryton.debian-maintainers.org/
 
 Files: *
 Copyright:
commit 2b7f03c38e3275e4b4c8485c68be4f97c8f36949
Author: Daniel Baumann <daniel at debian.org>
Date:   Tue Aug 25 08:18:22 2009 +0200

    Adding README.source.

diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..259f923
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,37 @@
+Package Repositories
+--------------------
+
+Backports for the current stable debian distribution as well as snapshots of
+unreleased versions may be available in repositories listed on the maintainers
+homepage. The current URL of the maintainer homepage can be seen in
+debian/control.
+
+
+Source Access
+-------------
+
+You can obtain the sources of this package with:
+
+  $ apt-get source ${PACKAGE}
+
+whereas '${PACKAGE}' has to be replaced with the actual name of the package.
+
+This package is maintained with the Git version control system. The current git
+source tree can be obtained with:
+
+  $ git clone ${GIT_URI}
+
+whereas '${GIT_URI}' has to be replaced with the actual URI for the Git
+repository. The current Git URI can be seen in debian/control in the extracted
+package sources.
+
+More information about Git can be found in the git-core package.
+
+This package may use the Quilt patch system to manage all modifications to the
+upstream source. Changes, if any, are stored in the source package as diffs in
+debian/diff and are applied during the build. Current modifications can be
+applied to the source tree with:
+
+  $ quilt push -a
+
+More information about Quilt can be found in the quilt package.
commit dc86ea020ac12c619f7c76c46a37501e036d3801
Author: Daniel Baumann <daniel at debian.org>
Date:   Mon Aug 24 17:49:55 2009 +0200

    Adding maintainer homepage field to control.

diff --git a/debian/control b/debian/control
index 4f628a4..bdd8dfe 100644
--- a/debian/control
+++ b/debian/control
@@ -11,6 +11,7 @@ Standards-Version: 3.8.3
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
+XSBC-Maintainer-Homepage: http://tryton.debian-maintainers.org/
 
 Package: tryton-modules-analytic-invoice
 Architecture: all
commit f77260e76cb15c87d0157480468e984b890b5dd2
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Aug 16 10:13:00 2009 +0200

    Updating to standards version 3.8.3.

diff --git a/debian/control b/debian/control
index 52d8939..4f628a4 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Uploaders:
  Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
 Build-Depends:
  debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
-Standards-Version: 3.8.2
+Standards-Version: 3.8.3
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
commit 0e5c92af8244590e3ca657211c7d474f2aa00eb2
Author: Daniel Baumann <daniel at debian.org>
Date:   Mon Aug 10 19:58:58 2009 +0200

    Releasing debian version 1.2.0-4.

diff --git a/debian/changelog b/debian/changelog
index 9b80619..d76ae8b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+tryton-modules-analytic-invoice (1:1.2.0-4) unstable; urgency=low
+
+  * Updating maintainer field.
+  * Updating vcs fields.
+  * Wrapping lines in control.
+
+ -- Daniel Baumann <daniel at debian.org>  Mon, 10 Aug 2009 19:58:56 +0200
+
 tryton-modules-analytic-invoice (1:1.2.0-3) unstable; urgency=low
 
   * Minimizing rules file.
commit 6e9e2f6017540a2e8202273f7196231f092bf60e
Author: Daniel Baumann <daniel at debian.org>
Date:   Mon Aug 10 19:58:54 2009 +0200

    Wrapping lines in control.

diff --git a/debian/control b/debian/control
index dd393e9..52d8939 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,9 @@ Source: tryton-modules-analytic-invoice
 Section: python
 Priority: optional
 Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
-Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
+Uploaders:
+ Daniel Baumann <daniel at debian.org>,
+ Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
 Build-Depends:
  debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
 Standards-Version: 3.8.2
commit c4f264a6b6bd81263d8fa7a07a7a61f0680513f5
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Aug 8 23:26:50 2009 +0200

    Updating vcs fields.

diff --git a/debian/control b/debian/control
index 38ffe80..dd393e9 100644
--- a/debian/control
+++ b/debian/control
@@ -7,8 +7,8 @@ Build-Depends:
  debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
 Standards-Version: 3.8.2
 Homepage: http://www.tryton.org/
-Vcs-Browser: http://git.debian.net/?p=debian/tryton-modules-analytic-invoice.git
-Vcs-Git: git://git.debian.net/git/debian/tryton-modules-analytic-invoice.git
+Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-modules-analytic-invoice.git
+Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-modules-analytic-invoice.git
 
 Package: tryton-modules-analytic-invoice
 Architecture: all
commit 10ac923d3d7d8ae7b822ce63323920aaad49038b
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Aug 8 23:19:30 2009 +0200

    Updating maintainer field.

diff --git a/debian/control b/debian/control
index 8ed93e5..38ffe80 100644
--- a/debian/control
+++ b/debian/control
@@ -1,8 +1,8 @@
 Source: tryton-modules-analytic-invoice
 Section: python
 Priority: optional
-Maintainer: Daniel Baumann <daniel at debian.org>
-Uploaders: Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
+Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
+Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
 Build-Depends:
  debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
 Standards-Version: 3.8.2
commit 5f9d9c04a83ad6e57df7aa6578938a1c84406ee1
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Jul 26 20:15:31 2009 +0200

    Releasing debian version 1.2.0-3.

diff --git a/debian/changelog b/debian/changelog
index 14df66d..9b80619 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-modules-analytic-invoice (1:1.2.0-3) unstable; urgency=low
+
+  * Minimizing rules file.
+
+ -- Daniel Baumann <daniel at debian.org>  Sun, 26 Jul 2009 20:15:20 +0200
+
 tryton-modules-analytic-invoice (1:1.2.0-2) unstable; urgency=low
 
   * Reverting wrong source import (Closes: #537225).
commit b94cacb5806ee97926010bfe8da40b494d90c855
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Jul 26 20:15:15 2009 +0200

    Minimizing rules file.

diff --git a/debian/rules b/debian/rules
index d082f67..000210b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,41 +1,4 @@
 #!/usr/bin/make -f
 
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp
-
-	python setup.py clean
-	rm -rf dist build trytond_analytic_invoice.egg-info
-
-	dh_clean
-
-build:
-
-install:
-	dh_testdir
-	dh_testroot
-	dh_prep
-
-	python setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tryton-modules-analytic-invoice --install-lib /usr/share/python-support/tryton-modules-analytic-invoice
-
-	find debian/tryton-modules-analytic-invoice -type f -name "*.pyc" | xargs rm -f
-
-binary: binary-indep
-
-binary-arch:
-
-binary-indep: install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs CHANGELOG
-	dh_installdocs
-	dh_pysupport
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-.PHONY: clean build install binary binary-arch binary-indep
+%:
+	dh ${@}
commit 8edc118bcd7bf6b16b9c807c5f70979fcad31d5d
Author: Daniel Baumann <daniel at debian.org>
Date:   Thu Jul 16 14:26:21 2009 +0200

    Releasing debian version 1.2.0-2.

diff --git a/debian/changelog b/debian/changelog
index 754bf3b..14df66d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-modules-analytic-invoice (1:1.2.0-2) unstable; urgency=low
+
+  * Reverting wrong source import (Closes: #537225).
+
+ -- Daniel Baumann <daniel at debian.org>  Thu, 16 Jul 2009 14:26:02 +0200
+
 tryton-modules-analytic-invoice (1.2.1-1) unstable; urgency=low
 
   * Updating package to standards version 3.8.2.
commit dfd9098fae5f53112243fb25df6caac93cc4422e
Author: Daniel Baumann <daniel at debian.org>
Date:   Thu Jul 16 14:25:43 2009 +0200

    Reverting wrong source import (Closes: #537225).

diff --git a/CHANGELOG b/CHANGELOG
index 0f9bc23..d28f483 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,12 +1,5 @@
-Version 1.2.1 - 2009-07-07
-* Some bug fixes (see mercurial logs for details)
-
 Version 1.2.0 - 2009-04-20
 * Bug fixes (see mercurial logs for details)
-* Add accounting date on invoice
-* Use amount_to_pay if amount_to_pay_today is zero in pay invoice wizard
-* Use reference to taxes for invoice line in invoice report
-* Add mechanism for invoice line standalone
 * Allow egg installation
 
 Version 1.0.0 - 2008-11-17
diff --git a/COPYRIGHT b/COPYRIGHT
index da277a9..853f1f7 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,4 @@
-Copyright (C) 2004-2008 Tiny SPRL.
 Copyright (C) 2008-2009 Cédric Krier.
-Copyright (C) 2008-2009 Bertrand Chenal.
 Copyright (C) 2008-2009 B2CK SPRL.
 
 This program is free software: you can redistribute it and/or modify
diff --git a/INSTALL b/INSTALL
index 61f6b9c..895fbf8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,23 +1,18 @@
-Installing trytond_account_invoice
-==================================
+Installing trytond_analytic_invoice
+===================================
 
 Prerequisites
 -------------
 
  * Python 2.4 or later (http://www.python.org/)
- * egenix-mx-base (http://www.egenix.com/products/python/)
  * trytond 1.1.x (http://www.tryton.org/)
- * trytond_account (http://www.tryton.org/)
- * trytond_company (http://www.tryton.org/)
- * trytond_party (http://www.tryton.org/)
- * trytond_currency (http://www.tryton.org/)
- * trytond_product (http://www.tryton.org/)
- * trytond_account_product (http://www.tryton.org/)
+ * trytond_account_invoice (http://www.tryton.org/)
+ * trytond_analytic_account (http://www.tryton.org/)
 
 Installation
 ------------
 
-Once you've downloaded and unpacked the trytond_account_invoice source release, enter the
+Once you've downloaded and unpacked the trytond_analytic_invoice source release, enter the
 directory where the archive was unpacked, and run:
 
     python setup.py install
@@ -33,4 +28,4 @@ documentation:
   http://docs.python.org/inst/inst.html
 
 To use without installation, extract the archive into ``trytond/modules`` with
-the directory name account_invoice.
+the directory name analytic_invoice.
diff --git a/PKG-INFO b/PKG-INFO
index 4aed3db..f98d718 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,15 +1,7 @@
 Metadata-Version: 1.0
-Name: trytond_account_invoice
-Version: 1.2.1
-Summary: Financial and Accounting Module with:
-    - Payment Term
-    - Invoice / Credit Note
-    - Supplier Invoice / Supplier Credit Note
-
-With the possibilities:
-    - to follow the payment of the invoices.
-    - to define invoice sequences on fiscal year or period.
-    - to credit any invoice.
+Name: trytond_analytic_invoice
+Version: 1.2.0
+Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/README b/README
index 845a5ed..27ef5eb 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
-trytond_account_invoice
-=======================
+trytond_analytic_invoice
+========================
 
-The account_invoice module of the Tryton application platform.
+The analytic_invoice module of the Tryton application platform.
 See __tryton__.py
 
 Installing
diff --git a/TODO b/TODO
deleted file mode 100644
index 66ce446..0000000
--- a/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-- Add a reference field on the invoice to provide links to other
-  models (e.g. sale, purchase)
\ No newline at end of file
diff --git a/__init__.py b/__init__.py
index 87e60c6..646e21a 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,7 +1,3 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+#This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
 
-from payment_term import *
 from invoice import *
-from party import *
-from account import *
diff --git a/__tryton__.py b/__tryton__.py
index 598377d..55c768c 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -1,86 +1,41 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 {
-    'name': 'Account Invoice',
-    'name_de_DE': 'Fakturierung',
-    'name_fr_FR': 'Facturation',
-    'name_es_CO': 'Facturación',
-    'name_es_ES': 'Facturación',
-    'version': '1.2.1',
+    'name': 'Analytic Invoice',
+    'name_de_DE': 'Kostenstellen Rechnungsstellung',
+    'name_es_CO': 'Facturación Analítica',
+    'name_es_ES': 'Facturación Analítica',
+    'name_fr_FR': 'Facturation analytique',
+    'version': '1.2.0',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
-    'description': '''Financial and Accounting Module with:
-    - Payment Term
-    - Invoice / Credit Note
-    - Supplier Invoice / Supplier Credit Note
-
-With the possibilities:
-    - to follow the payment of the invoices.
-    - to define invoice sequences on fiscal year or period.
-    - to credit any invoice.
+    'description': '''Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 ''',
-    'description_de_DE': '''Modul für Buchhaltung und Fakturierung mit:
-    - Definition von Zahlungsbedingungen
-    - Erstellung von Rechnungen und Gutschriften für Kunden
-    - Erstellung von Rechnungen und Gutschriften für Lieferanten
-
-Ermöglicht:
-    - die Verfolgung der Bezahlung von Rechnungen
-    - die Definition von Rechnungssequenzen für das Geschäftsjahr bzw. die Buchungszeiträume
-    - die Erstellung von Gutschriften zu jeglicher Rechnung
+    'description_de_DE': ''' - Fügt Kostenstellen zu Rechnungszeilen hinzu
+ - Erstellt Positionen für Kostenstellen bei Buchung von Rechnungen
 ''',
-    'description_fr_FR': '''Module financier et comptable avec:
-    - Condition de paiement
-    - Facture / Note de crédit
-    - Facture fournisseur / Note de crédit fournisseur
-
-Avec la possibilité:
-    - de suivre le paiment des factures
-    - de définir les numérotations de facture par période ou par année fiscale
-    - de créditer n'importe quelle facture
+    'description_es_CO': ''' - Adición de contabilidad analítica a las líneas de facturación 
+ -  Generación de líneas analíticas en la factura.
 ''',
-    'description_es_CO': '''Módulo Financiero y de Contabilidad con:
-    - Términos de Pago
-    - Notas de Facturación / Crédito
-    - Factura de Proveedores / Nota de Crédito de Proveedores
-
-Con las posibilidades de:
-    - hacer seguimiento al pago de facturas.
-    - definir secuencias de facturas en año o período fiscal.
-    - acreditar una factura.
+    'description_es_ES': ''' - Adición de contabilidad analítica a las líneas de facturación 
+ -  Generación de líneas analíticas en la factura.
 ''',
-    'description_es_ES': '''Módulo Financiero y de Contabilidad con:
-    - Términos de Pago
-    - Notas de Facturación / Crédito
-    - Factura de Proveedores / Nota de Crédito de Proveedores
+    'description_fr_FR': '''Ajoute la comptabilité analytique sur les lignes '''
+    '''de facture et génère les lignes analytiques sur les mouvements de la '''
+    '''facture.''',
 
-Con las posibilidades de:
-    - hacer seguimiento al pago de facturas.
-    - definir secuencias de facturas en año o período fiscal.
-    - acreditar una factura.
-''',
     'depends': [
-        'ir',
-        'account',
-        'company',
-        'party',
-        'product',
-        'res',
-        'workflow',
-        'currency',
-        'account_product',
+        'account_invoice',
+        'analytic_account',
     ],
     'xml': [
         'invoice.xml',
-        'payment_term.xml',
-        'party.xml',
-        'account.xml',
     ],
     'translation': [
-        'fr_FR.csv',
         'de_DE.csv',
         'es_CO.csv',
         'es_ES.csv',
-    ]
+        'fr_FR.csv',
+    ],
 }
diff --git a/account.py b/account.py
deleted file mode 100644
index bebea80..0000000
--- a/account.py
+++ /dev/null
@@ -1,181 +0,0 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
-from trytond.model import ModelView, ModelSQL, fields
-
-
-class FiscalYear(ModelSQL, ModelView):
-    _name = 'account.fiscalyear'
-    out_invoice_sequence = fields.Many2One('ir.sequence.strict',
-            'Customer Invoice Sequence', required=True,
-            domain="[('code', '=', 'account.invoice')," \
-                    "['OR', ('company', '=', company)," \
-                    "('company', '=', False)]]",
-                    context="{'code': 'account.invoice', 'company': company}")
-    in_invoice_sequence = fields.Many2One('ir.sequence.strict',
-            'Supplier Invoice Sequence', required=True,
-            domain="[('code', '=', 'account.invoice')," \
-                    "['OR', ('company', '=', company)," \
-                    "('company', '=', False)]]",
-                    context="{'code': 'account.invoice', 'company': company}")
-    out_credit_note_sequence = fields.Many2One('ir.sequence.strict',
-            'Customer Credit Note Sequence', required=True,
-            domain="[('code', '=', 'account.invoice')," \
-                    "['OR', ('company', '=', company)," \
-                    "('company', '=', False)]]",
-                    context="{'code': 'account.invoice', 'company': company}")
-    in_credit_note_sequence = fields.Many2One('ir.sequence.strict',
-            'Supplier Credit Note Sequence', required=True,
-            domain="[('code', '=', 'account.invoice')," \
-                    "['OR', ('company', '=', company)," \
-                    "('company', '=', False)]]",
-                    context="{'code': 'account.invoice', 'company': company}")
-
-    def __init__(self):
-        super(FiscalYear, self).__init__()
-        self._constraints += [
-            ('check_invoice_sequences', 'different_invoice_sequence'),
-        ]
-        self._error_messages.update({
-            'change_invoice_sequence': 'You can not change ' \
-                    'the invoice sequence if there is already ' \
-                    'an invoice opened in the fiscalyear',
-            'different_invoice_sequence': 'You must have different ' \
-                    'invoice sequences per fiscal year!',
-            })
-
-    def check_invoice_sequences(self, cursor, user, ids):
-        for fiscalyear in self.browse(cursor, user, ids):
-            for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
-                    'out_credit_note_sequence', 'in_credit_note_sequence'):
-                if self.search(cursor, user, [
-                    (sequence, '=', fiscalyear[sequence].id),
-                    ('id', '!=', fiscalyear.id),
-                    ]):
-                    return False
-        return True
-
-    def write(self, cursor, user, ids, vals, context=None):
-        invoice_obj = self.pool.get('account.invoice')
-        for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
-                'out_credit_note_sequence', 'in_credit_note_sequence'):
-            if vals.get(sequence):
-                for fiscalyear in self.browse(cursor, user, ids,
-                        context=context):
-                    if fiscalyear[sequence] and \
-                            fiscalyear[sequence].id != \
-                            vals[sequence]:
-                        if invoice_obj.search(cursor, user, [
-                            ('invoice_date', '>=', fiscalyear.start_date),
-                            ('invoice_date', '<=', fiscalyear.end_date),
-                            ('number', '!=', False),
-                            ('type', '=', sequence[:-9]),
-                            ], context=context):
-                            self.raise_user_error(cursor,
-                                    'change_invoice_sequence', context=context)
-        return super(FiscalYear, self).write(cursor, user, ids, vals,
-                context=context)
-
-FiscalYear()
-
-
-class Period(ModelSQL, ModelView):
-    _name = 'account.period'
-    out_invoice_sequence = fields.Many2One('ir.sequence.strict',
-            'Customer Invoice Sequence',
-            domain="[('code', '=', 'account.invoice')]",
-            context="{'code': 'account.invoice'}",
-            states={
-                'required': "type == 'standard'",
-                'invisible': "type != 'standard'",
-            })
-    in_invoice_sequence = fields.Many2One('ir.sequence.strict',
-            'Supplier Invoice Sequence',
-            domain="[('code', '=', 'account.invoice')]",
-            context="{'code': 'account.invoice'}",
-            states={
-                'required': "type == 'standard'",
-                'invisible': "type != 'standard'",
-            })
-    out_credit_note_sequence = fields.Many2One('ir.sequence.strict',
-            'Customer Credit Note Sequence',
-            domain="[('code', '=', 'account.invoice')]",
-            context="{'code': 'account.invoice'}",
-            states={
-                'required': "type == 'standard'",
-                'invisible': "type != 'standard'",
-            })
-    in_credit_note_sequence = fields.Many2One('ir.sequence.strict',
-            'Supplier Credit Note Sequence',
-            domain="[('code', '=', 'account.invoice')]",
-            context="{'code': 'account.invoice'}",
-            states={
-                'required': "type == 'standard'",
-                'invisible': "type != 'standard'",
-            })
-
-    def __init__(self):
-        super(Period, self).__init__()
-        self._constraints += [
-            ('check_invoice_sequences', 'check_invoice_sequences'),
-        ]
-        self._error_messages.update({
-            'change_invoice_sequence': 'You can not change ' \
-                    'the invoice sequence if there is already ' \
-                    'an invoice opened in the period',
-            'check_invoice_sequences': 'You must have different ' \
-                    'invoice sequences per fiscal year and ' \
-                    'in the same company!',
-            })
-
-    def check_invoice_sequences(self, cursor, user, ids):
-        for period in self.browse(cursor, user, ids):
-            for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
-                    'out_credit_note_sequence', 'in_credit_note_sequence'):
-                if self.search(cursor, user, [
-                    (sequence, '=', period[sequence].id),
-                    ('fiscalyear', '!=', period.fiscalyear.id),
-                    ]):
-                    return False
-                if period[sequence].company \
-                        and period[sequence].company.id != \
-                        period.fiscalyear.company.id:
-                    return False
-        return True
-
-    def create(self, cursor, user, vals, context=None):
-        fiscalyear_obj = self.pool.get('account.fiscalyear')
-        vals = vals.copy()
-        if vals.get('fiscalyear'):
-            fiscalyear = fiscalyear_obj.browse(cursor, user, vals['fiscalyear'],
-                    context=context)
-            for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
-                    'out_credit_note_sequence', 'in_credit_note_sequence'):
-                if not vals.get(sequence):
-                    vals[sequence] = fiscalyear[sequence].id
-        return super(Period, self).create(cursor, user, vals, context=context)
-
-    def write(self, cursor, user, ids, vals, context=None):
-        invoice_obj = self.pool.get('account.invoice')
-
-        if isinstance(ids, (int, long)):
-            ids = [ids]
-
-        for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
-                'out_credit_note_sequence', 'in_credit_note_sequence'):
-            if vals.get(sequence):
-                for period in self.browse(cursor, user, ids, context=context):
-                    if period[sequence] and \
-                            period[sequence].id != \
-                            vals[sequence]:
-                        if invoice_obj.search(cursor, user, [
-                            ('date', '>=', period.start_date),
-                            ('date', '<=', period.end_date),
-                            ('number', '!=', False),
-                            ('type', '=', sequence[:-9]),
-                            ], context=context):
-                            self.raise_user_error(cursor,
-                                    'change_invoice_sequence', context=context)
-        return super(Period, self).write(cursor, user, ids, vals,
-                context=context)
-
-Period()
diff --git a/account.xml b/account.xml
deleted file mode 100644
index 275c1b2..0000000
--- a/account.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<tryton>
-    <data>
-        <record model="ir.ui.view" id="fiscalyear_view_form">
-            <field name="model">account.fiscalyear</field>
-            <field name="inherit" ref="account.fiscalyear_view_form"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/form/notebook/page[@id="sequences"]/field[@name="post_move_sequence"]"
-                        position="after">
-                        <newline/>
-                        <label name="out_invoice_sequence"/>
-                        <field name="out_invoice_sequence"/>
-                        <label name="in_invoice_sequence"/>
-                        <field name="in_invoice_sequence"/>
-                        <label name="out_credit_note_sequence"/>
-                        <field name="out_credit_note_sequence"/>
-                        <label name="in_credit_note_sequence"/>
-                        <field name="in_credit_note_sequence"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
-        </record>
-
-        <record model="ir.ui.view" id="period_view_form">
-            <field name="model">account.period</field>
-            <field name="inherit" ref="account.period_view_form"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/form/field[@name="post_move_sequence"]"
-                        position="after">
-                        <newline/>
-                        <label name="out_invoice_sequence"/>
-                        <field name="out_invoice_sequence"/>
-                        <label name="in_invoice_sequence"/>
-                        <field name="in_invoice_sequence"/>
-                        <label name="out_credit_note_sequence"/>
-                        <field name="out_credit_note_sequence"/>
-                        <label name="in_credit_note_sequence"/>
-                        <field name="in_credit_note_sequence"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
-        </record>
-    </data>
-</tryton>
diff --git a/de_DE.csv b/de_DE.csv
index dc58aed..3de2537 100644
--- a/de_DE.csv
+++ b/de_DE.csv
@@ -1,348 +1,2 @@
 type,name,res_id,src,value,fuzzy
-error,account.fiscalyear,0,You can not change the invoice sequence if there is already an invoice opened in the fiscalyear,"Sie können die Rechnungsnummern-Sequenz nicht ändern, wenn bereits eine Rechnung im laufenden Buchungsjahr eröffnet wurde.",0
-error,account.fiscalyear,0,You must have different invoice sequences per fiscal year!,Für unterschiedliche Geschäftsjahre müssen jeweils eigene Rechnungssequenzen erstellt werden!,0
-error,account.invoice,0,"Base taxes different from invoice lines!
-Re-compute the invoice.",Steuern stimmen nicht mit den Rechnungspositionen überein!,0
-error,account.invoice,0,"Taxes defined but not on invoice lines!
-Re-compute the invoice.","Es sind Steuern definiert, allerdings nicht in den Rechnungspositionen!
-Bitte lassen Sie die Rechnung erneut berechnen.",0
-error,account.invoice,0,"Taxes defined on invoice lines but not on invoice!
-Re-compute the invoice.","Steuern sind für die Rechnungspositionen definiert, allerdings nicht für die Rechnung selbst!
-",0
-error,account.invoice,0,The credit account on journal is missing!,Haben-Konto im Journal fehlt!,0
-error,account.invoice,0,The credit account on journal is the same than the invoice account!,Das Habenkonto des Journals ist das selbe wie das Rechnungskonto!,0
-error,account.invoice,0,The debit account on journal is missing!,Soll-Konto im Journal fehlt,0
-error,account.invoice,0,The debit account on journal is the same than the invoice account!,Das Sollkonto des Journals ist das selbe wie das Rechnungskonto!,0
-error,account.invoice,0,There is no invoice sequence on the period/fiscal year!,Rechnungsnummern-Sequenz für diese Periode oder dieses Buchungsjahr fehlt!,0
-error,account.invoice,0,"You can not create an invoice
-with account from a different invoice company!",Es können keine Rechnungen mit einem Konto von einer anderen rechnungsstellenden Firma angelegt werden,0
-error,account.invoice,0,"You can not modify an invoice that is open, paid or canceled!","Fakturierte, Bezahlte oder Annulierte Rechnungen können nicht geändert werden!",0
-error,account.invoice,0,You can not reset to draft an invoice that has move!,"Eine Rechnung, die Buchungen enthält, kann nicht auf Entwurf zurückgesetzt werden!",0
-error,account.invoice,0,"You can not use the same account
-as on invoice line!",Es kann nicht das selbe Konto verwendet werden!,0
-error,account.invoice.credit_invoice,0,You can not credit with refund an invoice that is not opened!,Die Verrechnung von nicht fakturierten Rechnungen ist nicht möglich!,0
-error,account.invoice.credit_invoice,0,You can not credit with refund an invoice with payments!,"Die Verrechnung einer Rechnung ist nicht möglich, wenn bereits Zahlungen für diese gebucht sind!",0
-error,account.invoice.line,0,"Line with ""line"" type must have an account!","Eine Zeile vom Typ ""Position"" muss einem Konto zugeordnet sein!",0
-error,account.invoice.line,0,"Line without ""line"" type must have an invoice!","Eine Zeile, die nicht vom Typ ""Position"" ist, muss einer Rechnung zugeordnet sein!",0
-error,account.invoice.line,0,"You can not add a line to an invoice that is open, paid or canceled!","Einer Rechnung mit dem Status Fakturiert, Bezahlt oder Annulliert kann keine neue Position hinzugefügt werden!",0
-error,account.invoice.line,0,"You can not create invoice line
-with account with a different invoice company!","Eine Rechnungszeile kann sich nicht
-auf ein Konto eines anderen Unternehmens beziehen!",0
-error,account.invoice.line,0,"You can not modify line from an invoice that is open, paid or canceled!","In einer Rechnung mit dem Status Fakturiert, Bezahlt oder Annulliert können Positionen nicht bearbeitet werden!",0
-error,account.invoice.line,0,"You can not use the same account
-as on the invoice!",Es kann nicht das selbe Konto verwendet werden!,0
-error,account.invoice.pay_invoice,0,You can not create a partial payment with an amount greater then the amount to pay!,Ein Teilbetrag kann nicht größer als der Gesamtbetrag der Rechnung sein!,0
-error,account.invoice.payment_term,0,Invalid payment term line!,Ungültige Position in Zahlungsbedingung!,0
-error,account.invoice.payment_term,0,Payment term missing a remainder line!,In der Zahlungsbedingung fehlt eine Restbetragszeile!,0
-error,account.invoice.payment_term.line.delay,0,The code must be unique!,Code kann nicht mehrfach vergeben werden!,0
-error,account.invoice.payment_term.line.type,0,The code must be unique!,Code kann nicht mehrfach vergeben werden!,0
-error,account.invoice.tax,0,"You can not add a line to an invoice that is open, paid or canceled!","Einer Rechnung mit dem Status Fakturiert, Bezahlt oder Annulliert kann keine neue Position hinzugefügt werden!",0
-error,account.invoice.tax,0,"You can not modify tax from an invoice that is open, paid or canceled!","In Rechnungen mit dem Status Fakturiert, Bezahlt oder Annulliert können Steuern nicht bearbeitet werden!",0
-error,account.period,0,You can not change the invoice sequence if there is already an invoice opened in the period,"Sie können die Rechnungsnummern-Sequenz nicht ändern, wenn bereits eine Rechnung in der laufenden Periode eröffnet wurde.",0
-error,account.period,0,You must have different invoice sequences per fiscal year and in the same company!,Verschiedene Geschäftsjahre eines Unternehmens erfordern unterschiedliche Rechnungssequenzen!,0
-field,"account.fiscalyear,in_credit_note_sequence",0,Supplier Credit Note Sequence,Sequenz Gutschriften Lieferanten,0
-field,"account.fiscalyear,in_invoice_sequence",0,Supplier Invoice Sequence,Sequenz Rechnungen Lieferanten,0
-field,"account.fiscalyear,out_credit_note_sequence",0,Customer Credit Note Sequence,Sequenz Gutschriften Kunden,0
-field,"account.fiscalyear,out_invoice_sequence",0,Customer Invoice Sequence,Sequenz Rechnungen Kunden,0
-field,"account.invoice,account",0,Account,Konto,0
-field,"account.invoice,accounting_date",0,Accounting Date,Buchungsdatum,0
-field,"account.invoice-account.move.line,invoice",0,Invoice,Rechnung,0
-field,"account.invoice-account.move.line,line",0,Payment Line,Zahlungsposition,0
-field,"account.invoice-account.move.line,rec_name",0,Name,Name,0
-field,"account.invoice,amount_to_pay",0,Amount to Pay,Zahlbarer Betrag,0
-field,"account.invoice,amount_to_pay_today",0,Amount to Pay Today,Zahlbarer Betrag (heute),0
-field,"account.invoice,comment",0,Comment,Kommentar,0
-field,"account.invoice,company",0,Company,Unternehmen,0
-field,"account.invoice.credit_invoice.init,with_refund",0,With Refund,Verrechnung,0
-field,"account.invoice,currency",0,Currency,Währung,0
-field,"account.invoice,currency_digits",0,Currency Digits,Währung (signifikante Stellen),0
-field,"account.invoice,description",0,Description,Beschreibung,0
-field,"account.invoice,invoice_address",0,Invoice Address,Rechnungsadresse,0
-field,"account.invoice,invoice_date",0,Invoice Date,Rechnungsdatum,0
-field,"account.invoice,invoice_report",0,Invoice Report,Rechnungsbericht,0
-field,"account.invoice,invoice_report_format",0,Invoice Report Format,Format Rechnungsbericht,0
-field,"account.invoice,journal",0,Journal,Journal,0
-field,"account.invoice.line,account",0,Account,Konto,0
-field,"account.invoice.line-account.tax,line",0,Invoice Line,Rechnungsposition,0
-field,"account.invoice.line-account.tax,rec_name",0,Name,Name,0
-field,"account.invoice.line-account.tax,tax",0,Tax,Steuer,0
-field,"account.invoice.line,amount",0,Amount,Betrag,0
-field,"account.invoice.line,company",0,Company,Unternehmen,0
-field,"account.invoice.line,currency",0,Currency,Währung,0
-field,"account.invoice.line,currency_digits",0,Currency Digits,Stellen Währung,0
-field,"account.invoice.line,description",0,Description,Bezeichnung,0
-field,"account.invoice.line,invoice",0,Invoice,Rechnung,0
-field,"account.invoice.line,invoice_taxes",0,Invoice Taxes,Steuern Rechnung,0
-field,"account.invoice.line,invoice_type",0,Invoice Type,Rechnungstyp,0
-field,"account.invoice.line,note",0,Note,Notiz,0
-field,"account.invoice.line,party",0,Party,Partei,0
-field,"account.invoice.line,product",0,Product,Artikel,0
-field,"account.invoice.line,quantity",0,Quantity,Anzahl,0
-field,"account.invoice.line,rec_name",0,Name,Name,0
-field,"account.invoice,lines",0,Lines,Positionen,0
-field,"account.invoice.line,sequence",0,Sequence,Sequenz,0
-field,"account.invoice,lines_to_pay",0,Lines to Pay,Zahlbare Positionen,0
-field,"account.invoice.line,taxes",0,Taxes,Steuern,0
-field,"account.invoice.line,type",0,Type,Typ,0
-field,"account.invoice.line,unit",0,Unit,Einheit,0
-field,"account.invoice.line,unit_digits",0,Unit Digits,Anzahl Stellen,0
-field,"account.invoice.line,unit_price",0,Unit Price,Einzelpreis,0
-field,"account.invoice,move",0,Move,Buchung,0
-field,"account.invoice,number",0,Number,Nummer,0
-field,"account.invoice,party",0,Party,Partei,0
-field,"account.invoice,party_lang",0,Party Language,Sprache Partei,0
-field,"account.invoice.pay_invoice.ask,account",0,Account,Konto,0
-field,"account.invoice.pay_invoice.ask,account_writeoff",0,Write-Off Account,Konto Ausbuchung,0
-field,"account.invoice.pay_invoice.ask,amount",0,Payment Amount,Betrag,0
-field,"account.invoice.pay_invoice.ask,amount_writeoff",0,Write-Off Amount,Betrag Ausbuchung,0
-field,"account.invoice.pay_invoice.ask,company",0,Company,Unternehmen,0
-field,"account.invoice.pay_invoice.ask,currency",0,Payment Currency,Währung,0
-field,"account.invoice.pay_invoice.ask,currency_digits",0,Payment Currency Digits,Stellen Währung,0
-field,"account.invoice.pay_invoice.ask,currency_digits_writeoff",0,Write-Off Currency Digits,Stellen Währung Ausbuchung,0
-field,"account.invoice.pay_invoice.ask,currency_writeoff",0,Write-Off Currency,Währung Ausbuchung,0
-field,"account.invoice.pay_invoice.ask,date",0,Date,Datum,0
-field,"account.invoice.pay_invoice.ask,description",0,Description,Beschreibung,0
-field,"account.invoice.pay_invoice.ask,invoice",0,Invoice,Rechnung,0
-field,"account.invoice.pay_invoice.ask,journal",0,Journal,Journal,0
-field,"account.invoice.pay_invoice.ask,journal_writeoff",0,Write-Off Journal,Journal Ausbuchung,0
-field,"account.invoice.pay_invoice.ask,lines",0,Lines,Positionen,0
-field,"account.invoice.pay_invoice.ask,lines_to_pay",0,Lines to Pay,Zahlbare Positionen,0
-field,"account.invoice.pay_invoice.ask,payment_lines",0,Payment Lines,Zahlungspositionen,0
-field,"account.invoice.pay_invoice.ask,type",0,Type,Typ,0
-field,"account.invoice.pay_invoice.init,amount",0,Amount,Betrag,0
-field,"account.invoice.pay_invoice.init,currency",0,Currency,Währung,0
-field,"account.invoice.pay_invoice.init,currency_digits",0,Currency Digits,Stellen Währung,0
-field,"account.invoice.pay_invoice.init,date",0,Date,Datum,0
-field,"account.invoice.pay_invoice.init,description",0,Description,Beschreibung,0
-field,"account.invoice.pay_invoice.init,journal",0,Journal,Journal,0
-field,"account.invoice,payment_lines",0,Payment Lines,Zahlungspositionen,0
-field,"account.invoice,payment_term",0,Payment Term,Zahlungsbedingung,0
-field,"account.invoice.payment_term,active",0,Active,Aktiv,0
-field,"account.invoice.payment_term,description",0,Description,Beschreibung,0
-field,"account.invoice.payment_term.line,amount",0,Amount,Betrag,0
-field,"account.invoice.payment_term.line,currency",0,Currency,Währung,0
-field,"account.invoice.payment_term.line,currency_digits",0,Currency Digits,Währung (signifikante Stellen),0
-field,"account.invoice.payment_term.line,days",0,Number of Days,Anzahl an Tagen,0
-field,"account.invoice.payment_term.line,delay",0,Condition,Bedingung,0
-field,"account.invoice.payment_term.line.delay,code",0,Code,Kundennummer,0
-field,"account.invoice.payment_term.line.delay,name",0,Name,Name,0
-field,"account.invoice.payment_term.line.delay,rec_name",0,Name,Name,0
-field,"account.invoice.payment_term.line,payment",0,Payment Term,Zahlungsbedingung,0
-field,"account.invoice.payment_term.line,percentage",0,Percentage,Prozentsatz,0
-field,"account.invoice.payment_term.line,rec_name",0,Name,Name,0
-field,"account.invoice.payment_term,lines",0,Lines,Positionen,0
-field,"account.invoice.payment_term.line,sequence",0,Sequence,Sequenz,0
-field,"account.invoice.payment_term.line,type",0,Type,Typ,0
-field,"account.invoice.payment_term.line.type,code",0,Code,Kundennummer,0
-field,"account.invoice.payment_term.line.type,name",0,Name,Name,0
-field,"account.invoice.payment_term.line.type,rec_name",0,Name,Name,0
-field,"account.invoice.payment_term,name",0,Payment Term,Zahlungsbedingung,0
-field,"account.invoice.payment_term,rec_name",0,Name,Name,0
-field,"account.invoice,rec_name",0,Name,Name,0
-field,"account.invoice,reconciled",0,Reconciled,Abgestimmt,0
-field,"account.invoice,reference",0,Reference,Referenz,0
-field,"account.invoice,state",0,State,Status,0
-field,"account.invoice.tax,account",0,Account,Konto,0
-field,"account.invoice,tax_amount",0,Tax,Steuer,0
-field,"account.invoice.tax,amount",0,Amount,Betrag,0
-field,"account.invoice.tax,base",0,Base,Netto,0
-field,"account.invoice.tax,base_code",0,Base Code,Code Netto,0
-field,"account.invoice.tax,base_sign",0,Base Sign,Vorzeichen (Netto),0
-field,"account.invoice.tax,description",0,Description,Beschreibung,0
-field,"account.invoice,taxes",0,Tax Lines,Steuerpositionen,0
-field,"account.invoice.tax,invoice",0,Invoice,Rechnung,0
-field,"account.invoice.tax,manual",0,Manual,Manuell,0
-field,"account.invoice.tax,rec_name",0,Name,Name,0
-field,"account.invoice.tax,sequence",0,Sequence,Sequenz,0
-field,"account.invoice.tax,sequence_number",0,Sequence Number,Nummer Sequenz,0
-field,"account.invoice.tax,tax",0,Tax,Steuer,0
-field,"account.invoice.tax,tax_code",0,Tax Code,Steuerkennziffer,0
-field,"account.invoice.tax,tax_sign",0,Tax Sign,Vorzeichen (Steuer),0
-field,"account.invoice,total_amount",0,Total,Brutto,0
-field,"account.invoice,type",0,Type,Typ,0
-field,"account.invoice,type_name",0,Type,Typ,0
-field,"account.invoice,untaxed_amount",0,Untaxed,Netto,0
-field,"account.period,in_credit_note_sequence",0,Supplier Credit Note Sequence,Sequenz Gutschriften Lieferanten,0
-field,"account.period,in_invoice_sequence",0,Supplier Invoice Sequence,Sequenz Rechnungen Lieferanten,0
-field,"account.period,out_credit_note_sequence",0,Customer Credit Note Sequence,Sequenz Gutschriften Kunden,0
-field,"account.period,out_invoice_sequence",0,Customer Invoice Sequence,Sequenz Rechnungen Kunden,0
-field,"party.address,invoice",0,Invoice,Rechnungsadresse,0
-field,"party.party,payment_term",0,Invoice Payment Term,Zahlungsbedingung Verkauf,0
-field,"party.party,supplier_payment_term",0,Supplier Payment Term,Zahlungsbedingung Einkauf,0
-help,"account.invoice.credit_invoice.init,with_refund",0,"If true, the current invoice(s) will be paid.",Bei Aktivierung werden die aktuelle(n ) Rechnung(en) und Gutschrift(en) bezahlt und abgestimmt.,0
-help,"account.invoice.payment_term.line,percentage",0,In %,Eingabe in %,0
-help,"account.invoice.payment_term.line,sequence",0,Use to order lines in ascending order,Ordnet Positionen in aufsteigender Reihenfolge,0
-model,"account.invoice-account.move.line,name",0,Invoice - Payment Line,Rechnung - Zahlungsposition,0
-model,"account.invoice.credit_invoice.init,name",0,Credit Invoice Init,Gutschrift Init,0
-model,"account.invoice.line-account.tax,name",0,Invoice Line - Tax,Rechnungsposition - Steuer,0
-model,"account.invoice.line,name",0,Invoice Line,Rechnungsposition,0
-model,"account.invoice,name",0,Invoice,Rechnung,0
-model,"account.invoice.pay_invoice.ask,name",0,Pay Invoice Ask,Zahlung Rechnung Nachfrage,0
-model,"account.invoice.pay_invoice.init,name",0,Pay Invoice Init,Zahlung Rechnung Init,0
-model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_end_month,End Month,Ende Monat,0
-model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_net_days,Net Days,Tage netto,0
-model,"account.invoice.payment_term.line.delay,name",0,Payment Term Line Delay,Zahlungsbedingung Position Frist,0
-model,"account.invoice.payment_term.line,name",0,Payment Term Line,Zahlungsbedingung,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_fixed,Fixed,Fix,0
-model,"account.invoice.payment_term.line.type,name",0,Payment Term Line Type,Zahlungsbedingung Position Typ,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_percent,Percentage,Prozentsatz,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_remainder,Remainder,Rest,0
-model,"account.invoice.payment_term,name",0,Payment Term,Zahlungsbedingung,0
-model,"account.invoice.print_invoice_report.warning,name",0,Print Invoice Report Warning,Druck Rechnung Warnung,0
-model,"account.invoice.tax,name",0,Invoice Tax,Rechnung Steuer,0
-model,"ir.action,name",act_invoice_form,All Invoices,Alle Rechnungen,0
-model,"ir.action,name",credit_invoice,Credit,Gutschrift erstellen,0
-model,"ir.action,name",act_invoice_out_credit_note_form,Credit Notes,Gutschriften an Kunden,0
-model,"ir.action,name",act_invoice_out_credit_note_form2,Credit Notes,Gutschriften,0
-model,"ir.action,name",act_invoice_out_credit_note_form3,Draft Credit Notes,Entwürfe Kundengutschriften,0
-model,"ir.action,name",act_invoice_out_invoice_form3,Draft Invoices,Entwürfe Kundenrechnungen,0
-model,"ir.action,name",act_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Entwürfe Lieferantengutschriften,0
-model,"ir.action,name",act_invoice_in_invoice_form3,Draft Supplier Invoices,Entwürfe Lieferantenrechnungen,0
-model,"ir.action,name",report_invoice,Invoice,Rechnung,0
-model,"ir.action,name",print_invoice_report,Invoice,Rechnung / Gutschrift drucken,0
-model,"ir.action,name",act_invoice_out_invoice_form,Invoices,Rechnungsausgang,0
-model,"ir.action,name",act_invoice_out_invoice_form2,Invoices,Kundenrechnungen,0
-model,"ir.action,name",act_invoice_form2,Invoices,Rechnungen,0
-model,"ir.action,name",act_invoice_out_credit_note_form5,Opened Credit Notes,Fakturierte Kundengutschriften,0
-model,"ir.action,name",act_invoice_out_invoice_form5,Opened Invoices,Fakturierte Kundenrechnungen,0
-model,"ir.action,name",act_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Fakturierte Lieferantengutschriften,0
-model,"ir.action,name",act_invoice_in_invoice_form5,Opened Supplier Invoices,Fakturierte Lieferantenrechnungen,0
-model,"ir.action,name",wizard_pay_invoice,Pay Invoice,Rechnung bezahlen,0
-model,"ir.action,name",act_payment_term_form,Payment Terms,Zahlungsbedingungen,0
-model,"ir.action,name",act_invoice_out_credit_note_form4,Pro Forma Credit Notes,Pro Forma Kundengutschriften,0
-model,"ir.action,name",act_invoice_out_invoice_form4,Pro Forma Invoices,Pro Forma Kundenrechnungen,0
-model,"ir.action,name",act_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Pro Forma Lieferantengutschriften,0
-model,"ir.action,name",act_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Pro Forma Lieferantenrechnungen,0
-model,"ir.action,name",act_invoice_in_credit_note_form,Supplier Credit Notes,Gutschriften von Lieferanten,0
-model,"ir.action,name",act_invoice_in_credit_note_form2,Supplier Credit Notes,Gutschriften von Lieferanten,0
-model,"ir.action,name",act_invoice_in_invoice_form,Supplier Invoices,Rechnungseingang,0
-model,"ir.action,name",act_invoice_in_invoice_form2,Supplier Invoices,Lieferantenrechnungen,0
-model,"ir.sequence.type,name",sequence_type_account_invoice,Invoice,Rechnung,0
-model,"ir.ui.menu,name",menu_invoice_form,All Invoices,Alle Rechnungen,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form,Credit Notes,Gutschriften an Kunden,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form3,Draft Credit Notes,Entwürfe Kundengutschriften,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form3,Draft Invoices,Entwürfe Kundenrechnungen,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Entwürfe Lieferantengutschriften,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form3,Draft Supplier Invoices,Entwürfe Lieferantenrechnungen,0
-model,"ir.ui.menu,name",menu_invoices,Invoices,Rechnungen,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form,Invoices,Rechnungsausgang,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form2,New Credit Note,Neue Gutschrift an Kunden,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form2,New Invoice,Neue Kundenrechnung,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form2,New Supplier Credit Note,Neue Gutschrift von Lieferant,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form2,New Supplier Invoice,Neue Lieferantenrechnung,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form5,Opened Credit Notes,Fakturierte Kundengutschriften,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form5,Opened Invoices,Fakturierte Kundenrechnungen,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Fakturierte Lieferantengutschriften,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form5,Opened Supplier Invoices,Fakturierte Lieferantenrechnungen,0
-model,"ir.ui.menu,name",menu_payment_terms_configuration,Payment Terms,Zahlungsbedingungen,0
-model,"ir.ui.menu,name",menu_payment_term_form,Payment Terms,Zahlungsbedingungen,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form4,Pro Forma Credit Notes,Pro Forma Kundengutschriften,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form4,Pro Forma Invoices,Pro Forma Kundenrechnungen,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Pro Forma Lieferantengutschriften,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Pro Forma Lieferantenrechnungen,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form,Supplier Credit Notes,Gutschriften von Lieferanten,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form,Supplier Invoices,Rechnungseingang,0
-model,"workflow.activity,name",invoice_activity_cancel,Canceled,Annulliert,0
-model,"workflow.activity,name",invoice_activity_draft,Draft,Entwurf,0
-model,"workflow.activity,name",invoice_activity_open,Open,Fakturieren,0
-model,"workflow.activity,name",invoice_activity_paid,Paid,Bezahlt,0
-model,"workflow.activity,name",invoice_activity_proforma,Pro forma,Pro Forma,0
-model,"workflow,name",invoice_workflow,Invoice workflow,Workflow Rechnung,0
-odt,account.invoice,0,Amount,Betrag,0
-odt,account.invoice,0,Base,Netto,0
-odt,account.invoice,0,Credit Note N°:,Gutschrift Nr.:,0
-odt,account.invoice,0,Date,Fällig am,0
-odt,account.invoice,0,Date:,Datum:,0
-odt,account.invoice,0,Description,Beschreibung,0
-odt,account.invoice,0,Description:,Beschreibung:,0
-odt,account.invoice,0,Draft Credit Note,Gutschrift (Entwurf),0
-odt,account.invoice,0,Draft Invoice,Rechnung (Entwurf),0
-odt,account.invoice,0,Draft Supplier Credit Note,Gutschrift (Entwurf),0
-odt,account.invoice,0,Draft Supplier Invoice,Rechnung (Entwurf),0
-odt,account.invoice,0,E-Mail:,E-Mail:,0
-odt,account.invoice,0,Invoice N°:,Rechnung Nr.:,0
-odt,account.invoice,0,Payment Term,Zahlungsbedingung,0
-odt,account.invoice,0,Phone:,Telefon:,0
-odt,account.invoice,0,Pro forma Credit Note,Gutschrift Pro Forma,0
-odt,account.invoice,0,Pro forma Invoice,Rechnung Pro Forma,0
-odt,account.invoice,0,Pro forma Supplier Credit Note,Gutschrift Pro Forma,0
-odt,account.invoice,0,Pro forma Supplier Invoice,Rechnung Pro Forma,0
-odt,account.invoice,0,Quantity,Anzahl,0
-odt,account.invoice,0,Supplier Credit Note N°:,Gutschrift Nr.:,0
-odt,account.invoice,0,Supplier Invoice N°:,Rechnung Nr.:,0
-odt,account.invoice,0,Tax,Steuer,0
-odt,account.invoice,0,Taxes,Steuern,0
-odt,account.invoice,0,Taxes:,Steuern:,0
-odt,account.invoice,0,Total:,Gesamt:,0
-odt,account.invoice,0,Total (excl. taxes):,Netto:,0
-odt,account.invoice,0,Unit Price,Einzelpreis,0
-odt,account.invoice,0,VAT:,USt-ID-Nr:,0
-selection,"account.invoice.line,invoice_type",0,Credit Note,Kundengutschrift,0
-selection,"account.invoice.line,invoice_type",0,Invoice,Lieferantenrechnung,0
-selection,"account.invoice.line,invoice_type",0,Supplier Credit Note,Lieferantengutschrift,0
-selection,"account.invoice.line,invoice_type",0,Supplier Invoice,Lieferantenrechnung,0
-selection,"account.invoice.line,type",0,Comment,Kommentar,0
-selection,"account.invoice.line,type",0,Line,Position,0
-selection,"account.invoice.line,type",0,Subtotal,Zwischensumme,0
-selection,"account.invoice.line,type",0,Title,Überschrift,0
-selection,"account.invoice.pay_invoice.ask,type",0,Partial Payment,Teilzahlung,0
-selection,"account.invoice.pay_invoice.ask,type",0,Write-Off,Ausbuchung,0
-selection,"account.invoice,state",0,Canceled,Annulliert,0
-selection,"account.invoice,state",0,Draft,Entwurf,0
-selection,"account.invoice,state",0,Opened,Fakturiert,0
-selection,"account.invoice,state",0,Paid,Bezahlt,0
-selection,"account.invoice,state",0,Pro forma,Pro Forma,0
-selection,"account.invoice,type",0,Credit Note,Gutschrift an Kunde,0
-selection,"account.invoice,type",0,Invoice,Kundenrechnung,0
-selection,"account.invoice,type",0,Supplier Credit Note,Gutschrift von Lieferant,0
-selection,"account.invoice,type",0,Supplier Invoice,Lieferantenrechnung,0
-view,account.invoice,0,Amount Second Currency,Betrag Zweitwährung,0
-view,account.invoice,0,_Cancel,_Annullieren,0
-view,account.invoice,0,Credit,Haben,0
-view,account.invoice,0,Debit,Soll,0
-view,account.invoice,0,_Draft,_Entwurf,0
-view,account.invoice,0,Invoice,Rechnung,0
-view,account.invoice,0,Invoices,Rechnungen,0
-view,account.invoice,0,Lines,Positionen,0
-view,account.invoice,0,_Open,_Fakturieren,0
-view,account.invoice,0,Other Info,Sonstiges,0
-view,account.invoice,0,_Pay,_Bezahlen,0
-view,account.invoice,0,Payment,Zahlung,0
-view,account.invoice,0,Payment Lines,Zahlungspositionen,0
-view,account.invoice,0,Pro For_ma,_Pro Forma,0
-view,account.invoice,0,_Reset to Draft,Auf Entwurf _Zurücksetzen,0
-view,account.invoice,0,Taxes,Steuern,0
-view,account.invoice.credit_invoice.init,0,Are you sure to credit those/this invoice(s)?,Wollen Sie diese Rechnungen wirklich gutschreiben?,0
-view,account.invoice.credit_invoice.init,0,Credit Invoice,Rechnung gutschreiben,0
-view,account.invoice.line,0,General,Allgemein,0
-view,account.invoice.line,0,Invoice Line,Rechnungsposition,0
-view,account.invoice.line,0,Invoice Lines,Rechnungspositionen,0
-view,account.invoice.line,0,Notes,Notizen,0
-view,account.invoice.line,0,Products,Artikel,0
-view,account.invoice.pay_invoice.ask,0,Amount Second Currency,Betrag Zweitwährung,0
-view,account.invoice.pay_invoice.ask,0,Credit,Haben,0
-view,account.invoice.pay_invoice.ask,0,Debit,Soll,0
-view,account.invoice.pay_invoice.ask,0,Lines to Pay,Zahlbare Positionen,0
-view,account.invoice.pay_invoice.ask,0,Pay Invoice,Rechnung bezahlen,0
-view,account.invoice.pay_invoice.ask,0,Payment Lines,Zahlungspositionen,0
-view,account.invoice.pay_invoice.init,0,Pay Invoice,Rechnung bezahlen,0
-view,account.invoice.payment_term,0,Payment Term,Zahlungsbedingung,0
-view,account.invoice.payment_term,0,Payment Term Line,Zahlungsbedingung,0
-view,account.invoice.payment_term,0,Payment Term Lines,Positionen Zahlungsbedingung,0
-view,account.invoice.payment_term,0,Payment Terms,Zahlungsbedingung,0
-view,account.invoice.print_invoice_report.warning,0,<b>Warning!</b>,<b>Warnung!</b>,0
-view,account.invoice.print_invoice_report.warning,0,Print Invoice,Rechnung / Gutschrift drucken,0
-view,account.invoice.print_invoice_report.warning,0,The invoices will be sent <i>directly</i> to the printer.,Die Rechnungen werden <i>direkt</i> an den Drucker gesendet.,0
-view,account.invoice.print_invoice_report.warning,0,You have selected more than one invoice to print.,Sie haben mehr als eine Rechnung zum ausdrucken gewählt.,0
-view,account.invoice.tax,0,Invoice Tax,Rechnungssteuer,0
-view,account.invoice.tax,0,Invoice Taxes,Rechnungssteuern,0
-view,account.invoice.tax,0,Tax Code,Steuerkennziffer,0
-view,party.party,0,Payment Terms,Zahlungsbedingungen,0
-wizard_button,"account.invoice.credit_invoice,init,credit",0,Credit,Gutschrift erstellen,0
-wizard_button,"account.invoice.credit_invoice,init,end",0,Cancel,Abbrechen,0
-wizard_button,"account.invoice.pay_invoice,ask,end",0,Cancel,Abbrechen,0
-wizard_button,"account.invoice.pay_invoice,ask,pay",0,Ok,OK,0
-wizard_button,"account.invoice.pay_invoice,init,choice",0,Ok,OK,0
-wizard_button,"account.invoice.pay_invoice,init,end",0,Cancel,Abbrechen,0
-wizard_button,"account.invoice.print_invoice_report,warning,end",0,Cancel,Abbrechen,0
-wizard_button,"account.invoice.print_invoice_report,warning,print",0,Print,Drucken,0
+field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Kostenstellen,0
diff --git a/es_CO.csv b/es_CO.csv
index d6ba724..0e71661 100644
--- a/es_CO.csv
+++ b/es_CO.csv
@@ -1,349 +1,2 @@
 type,name,res_id,src,value,fuzzy
-error,account.fiscalyear,0,You can not change the invoice sequence if there is already an invoice opened in the fiscalyear,No puede cambiar la secuencia de una factura si hay una factura abierta en el año fiscal,0
-error,account.fiscalyear,0,You must have different invoice sequences per fiscal year!,¡Debe tener una secuencia diferente de facturación por año fiscal!,0
-error,account.invoice,0,"Base taxes different from invoice lines!
-Re-compute the invoice.",Los Impuestos Base difieren de las líneas de factura!,0
-error,account.invoice,0,"Taxes defined but not on invoice lines!
-Re-compute the invoice.","Impuestos definidos pero no en líneas de factura!
-Recalcule la factura.",0
-error,account.invoice,0,"Taxes defined on invoice lines but not on invoice!
-Re-compute the invoice.",Impuestos definidos en factura pero no usados en las líneas!,0
-error,account.invoice,0,The credit account on journal is missing!,Falta la cuenta crédito del diario!,0
-error,account.invoice,0,The credit account on journal is the same than the invoice account!,¡La cuenta crédito en el diario es la misma que la cuenta facturada!,0
-error,account.invoice,0,The debit account on journal is missing!,Falta la cuenta débito del diario!,0
-error,account.invoice,0,The debit account on journal is the same than the invoice account!,¡La cuenta débito en el diario es la misma que la cuenta facturada!,0
-error,account.invoice,0,There is no invoice sequence on the period/fiscal year!,No hay una secuencia de facturaas para el período/año fiscal!,0
-error,account.invoice,0,"You can not create an invoice
-with account from a different invoice company!",No puede crear una factura,0
-error,account.invoice,0,"You can not modify an invoice that is open, paid or canceled!","¡No puede modificar una factura abierta, pagada o cancelada!",0
-error,account.invoice,0,You can not reset to draft an invoice that has move!,¡No puede poner en borrador una factura que ha sido movida!,0
-error,account.invoice,0,"You can not use the same account
-as on invoice line!","¡No puede usar la misma cuenta
-como línea en la factura!",0
-error,account.invoice.credit_invoice,0,You can not credit with refund an invoice that is not openned!,¡No puede acreditar una devolución de una factura que no está abierta!,0
-error,account.invoice.credit_invoice,0,You can not credit with refund an invoice with payments!,¡No puede acreditar una devolución de una factura con pagos!,0
-error,account.invoice.line,0,"Line with ""line"" type must have an account!","¡Una línea con tipo de ""línea"" debe tener una cuenta!",0
-error,account.invoice.line,0,"Line without ""line"" type must have an invoice!","¡Una línea sin tipo de ""línea"" debe tener una factura!",0
-error,account.invoice.line,0,"You can not add a line to an invoice that is open, paid or canceled!","No puede adicionar una línea a una factura que está abierta, pagada o cancelada!",0
-error,account.invoice.line,0,"You can not create invoice line
-with account with a different invoice company!","¡No puede crear una línea de factura
-con cuenta a partir de una factura de una compañía distinta!",0
-error,account.invoice.line,0,"You can not modify line from an invoice that is open, paid or canceled!","No puede modificar la línea de una factura que esté abierta, pagada o cancelada!",0
-error,account.invoice.line,0,"You can not use the same account
-as on the invoice!","No puede usar la misma cuenta
-que en la factura!",0
-error,account.invoice.pay_invoice,0,You can not create a partial payment with an amount greater then the amount to pay!,¡No puede crear un pago parcial con un monto mayor que el valor a pagar!,0
-error,account.invoice.payment_term,0,Invalid payment term line!,Línea de opción de pago inválida!,0
-error,account.invoice.payment_term,0,Payment term missing a remainder line!,Hace falta una línea final al término de pago!,0
-error,account.invoice.payment_term.line.delay,0,The code must be unique!,¡El código debe ser único!,0
-error,account.invoice.payment_term.line.type,0,The code must be unique!,¡El código debe ser único!,0
-error,account.invoice.tax,0,"You can not add a line to an invoice that is open, paid or canceled!","No puede adicionar una línea a una factura que está abierta, pagada o cancelada!",0
-error,account.invoice.tax,0,"You can not modify tax from an invoice that is open, paid or canceled!","No puede modificar impuestos de una factura abierta, pagada o cancelada!",0
-error,account.period,0,You can not change the invoice sequence if there is already an invoice opened in the period,No puede cambiar la secuencia de una factura si hay una factura abierta en el período,0
-error,account.period,0,You must have different invoice sequences per fiscal year and in the same company!,¡Debe tener secuencias diferentes de facturas por año fiscal en la misma compañía!,0
-field,"account.fiscalyear,in_credit_note_sequence",0,Supplier Credit Note Sequence,Secuencia de la Nota Crédito del Proveedor,0
-field,"account.fiscalyear,in_invoice_sequence",0,Supplier Invoice Sequence,Secuencia de Factura de Proveedor,0
-field,"account.fiscalyear,out_credit_note_sequence",0,Customer Credit Note Sequence,Secuencia de Nota Crédito de Cliente,0
-field,"account.fiscalyear,out_invoice_sequence",0,Customer Invoice Sequence,Secuencia de Facturas de Cliente,0
-field,"account.invoice,account",0,Account,Cuenta,0
-field,"account.invoice,accounting_date",0,Accounting Date,Fecha de contabilización,0
-field,"account.invoice-account.move.line,invoice",0,Invoice,Factura,0
-field,"account.invoice-account.move.line,line",0,Payment Line,Línea de pago,0
-field,"account.invoice-account.move.line,rec_name",0,Name,Nombre,0
-field,"account.invoice,amount_to_pay",0,Amount to Pay,Cantidad a pagar,0
-field,"account.invoice,amount_to_pay_today",0,Amount to Pay Today,Cantidad a pagar hoy,0
-field,"account.invoice,comment",0,Comment,Comentario,0
-field,"account.invoice,company",0,Company,Compañía,0
-field,"account.invoice.credit_invoice.init,with_refund",0,With Refund,Con devolución,0
-field,"account.invoice,currency",0,Currency,Moneda,0
-field,"account.invoice,currency_digits",0,Currency Digits,Dígitos de Moneda,0
-field,"account.invoice,description",0,Description,Descripción,0
-field,"account.invoice,invoice_address",0,Invoice Address,Dirección de Facturación,0
-field,"account.invoice,invoice_date",0,Invoice Date,Fecha de Factura,0
-field,"account.invoice,invoice_report",0,Invoice Report,Reporte de Facturación,0
-field,"account.invoice,invoice_report_format",0,Invoice Report Format,Formato de Reporte de Facturación,0
-field,"account.invoice,journal",0,Journal,Diario,0
-field,"account.invoice.line,account",0,Account,Cuenta,0
-field,"account.invoice.line-account.tax,line",0,Invoice Line,Línea de Factura,0
-field,"account.invoice.line-account.tax,rec_name",0,Name,Nombre,0
-field,"account.invoice.line-account.tax,tax",0,Tax,Impuesto,0
-field,"account.invoice.line,amount",0,Amount,Cantidad,0
-field,"account.invoice.line,company",0,Company,Compañía,0
-field,"account.invoice.line,currency",0,Currency,Moneda,0
-field,"account.invoice.line,currency_digits",0,Currency Digits,Dígitos de Moneda,0
-field,"account.invoice.line,description",0,Description,Descripción,0
-field,"account.invoice.line,invoice",0,Invoice,Factura,0
-field,"account.invoice.line,invoice_taxes",0,Invoice Taxes,Impuestos de Facturas,0
-field,"account.invoice.line,invoice_type",0,Invoice Type,Tipo de Factura,0
-field,"account.invoice.line,note",0,Note,Nota,0
-field,"account.invoice.line,party",0,Party,Terceros,0
-field,"account.invoice.line,product",0,Product,Producto,0
-field,"account.invoice.line,quantity",0,Quantity,Cantidad,0
-field,"account.invoice.line,rec_name",0,Name,Nombre,0
-field,"account.invoice,lines",0,Lines,Líneas,0
-field,"account.invoice.line,sequence",0,Sequence,Secuencia,0
-field,"account.invoice,lines_to_pay",0,Lines to Pay,Líneas a Pagar,0
-field,"account.invoice.line,taxes",0,Taxes,Impuestos,0
-field,"account.invoice.line,type",0,Type,Tipo,0
-field,"account.invoice.line,unit",0,Unit,Unidad,0
-field,"account.invoice.line,unit_digits",0,Unit Digits,Dígitos de Unidad,0
-field,"account.invoice.line,unit_price",0,Unit Price,Precio Unitario,0
-field,"account.invoice,move",0,Move,Movimiento,0
-field,"account.invoice,number",0,Number,Número,0
-field,"account.invoice,party",0,Party,Tercero,0
-field,"account.invoice,party_lang",0,Party Language,Idioma del Tercero,0
-field,"account.invoice.pay_invoice.ask,account",0,Account,Cuenta,0
-field,"account.invoice.pay_invoice.ask,account_writeoff",0,Write-Off Account,Cuenta de Ajustes,0
-field,"account.invoice.pay_invoice.ask,amount",0,Payment Amount,Valor del Pago,0
-field,"account.invoice.pay_invoice.ask,amount_writeoff",0,Write-Off Amount,Valor del Ajuste,0
-field,"account.invoice.pay_invoice.ask,company",0,Company,Compañía,0
-field,"account.invoice.pay_invoice.ask,currency",0,Payment Currency,Pago en Moneda,0
-field,"account.invoice.pay_invoice.ask,currency_digits",0,Payment Currency Digits,Dígitos de Pago de Moneda,0
-field,"account.invoice.pay_invoice.ask,currency_digits_writeoff",0,Write-Off Currency Digits,Ajuste de Dígitos de Moneda,0
-field,"account.invoice.pay_invoice.ask,currency_writeoff",0,Write-Off Currency,Ajuste de Moneda,0
-field,"account.invoice.pay_invoice.ask,date",0,Date,Fecha,0
-field,"account.invoice.pay_invoice.ask,description",0,Description,Descripción,0
-field,"account.invoice.pay_invoice.ask,invoice",0,Invoice,Factura,0
-field,"account.invoice.pay_invoice.ask,journal",0,Journal,Diario,0
-field,"account.invoice.pay_invoice.ask,journal_writeoff",0,Write-Off Journal,Diario de Ajuste,0
-field,"account.invoice.pay_invoice.ask,lines",0,Lines,Líneas,0
-field,"account.invoice.pay_invoice.ask,lines_to_pay",0,Lines to Pay,Líneas a Pagar,0
-field,"account.invoice.pay_invoice.ask,payment_lines",0,Payment Lines,Líneas de Pago,0
-field,"account.invoice.pay_invoice.ask,type",0,Type,Tipo,0
-field,"account.invoice.pay_invoice.init,amount",0,Amount,Cantidad,0
-field,"account.invoice.pay_invoice.init,currency",0,Currency,Moneda,0
-field,"account.invoice.pay_invoice.init,currency_digits",0,Currency Digits,Dígitos de Moneda,0
-field,"account.invoice.pay_invoice.init,date",0,Date,Fecha,0
-field,"account.invoice.pay_invoice.init,description",0,Description,Descripción,0
-field,"account.invoice.pay_invoice.init,journal",0,Journal,Diario,0
-field,"account.invoice,payment_lines",0,Payment Lines,Líneas de Pago,0
-field,"account.invoice,payment_term",0,Payment Term,Término de Pago,0
-field,"account.invoice.payment_term,active",0,Active,Activo,0
-field,"account.invoice.payment_term,description",0,Description,Descripción,0
-field,"account.invoice.payment_term.line,amount",0,Amount,Cantidad,0
-field,"account.invoice.payment_term.line,currency",0,Currency,Moneda,0
-field,"account.invoice.payment_term.line,currency_digits",0,Currency Digits,Dígitos de Moneda,0
-field,"account.invoice.payment_term.line,days",0,Number of Days,Cantidad de días,0
-field,"account.invoice.payment_term.line,delay",0,Condition,Condición,0
-field,"account.invoice.payment_term.line.delay,code",0,Code,Código,0
-field,"account.invoice.payment_term.line.delay,name",0,Name,Nombre,0
-field,"account.invoice.payment_term.line.delay,rec_name",0,Name,Nombre,0
-field,"account.invoice.payment_term.line,payment",0,Payment Term,Término de Pago,0
-field,"account.invoice.payment_term.line,percentage",0,Percentage,Porcentaje,0
-field,"account.invoice.payment_term.line,rec_name",0,Name,Nombre,0
-field,"account.invoice.payment_term,lines",0,Lines,Líneas,0
-field,"account.invoice.payment_term.line,sequence",0,Sequence,Secuencia,0
-field,"account.invoice.payment_term.line,type",0,Type,Tipo,0
-field,"account.invoice.payment_term.line.type,code",0,Code,Código,0
-field,"account.invoice.payment_term.line.type,name",0,Name,Nombre,0
-field,"account.invoice.payment_term.line.type,rec_name",0,Name,Nombre,0
-field,"account.invoice.payment_term,name",0,Payment Term,Término de Pago,0
-field,"account.invoice.payment_term,rec_name",0,Name,Nombre,0
-field,"account.invoice,rec_name",0,Name,Nombre,0
-field,"account.invoice,reconciled",0,Reconciled,Conciliado,0
-field,"account.invoice,reference",0,Reference,Referencia,0
-field,"account.invoice,state",0,State,Estado,0
-field,"account.invoice.tax,account",0,Account,Cuenta,0
-field,"account.invoice,tax_amount",0,Tax,Impuesto,0
-field,"account.invoice.tax,amount",0,Amount,Cantidad,0
-field,"account.invoice.tax,base",0,Base,Base,0
-field,"account.invoice.tax,base_code",0,Base Code,Código Base,0
-field,"account.invoice.tax,base_sign",0,Base Sign,Signo Base,0
-field,"account.invoice.tax,description",0,Description,Descripción,0
-field,"account.invoice,taxes",0,Tax Lines,Líneas de Impuestos,0
-field,"account.invoice.tax,invoice",0,Invoice,Factura,0
-field,"account.invoice.tax,manual",0,Manual,Manual,0
-field,"account.invoice.tax,rec_name",0,Name,Nombre,0
-field,"account.invoice.tax,sequence",0,Sequence,Secuencia,0
-field,"account.invoice.tax,sequence_number",0,Sequence Number,Número de Secuencia,0
-field,"account.invoice.tax,tax",0,Tax,Impuesto,0
-field,"account.invoice.tax,tax_code",0,Tax Code,Código de Impuesto,0
-field,"account.invoice.tax,tax_sign",0,Tax Sign,Signo del Impuesto,0
-field,"account.invoice,total_amount",0,Total,Total,0
-field,"account.invoice,type",0,Type,Tipo,0
-field,"account.invoice,type_name",0,Type,Tipo,0
-field,"account.invoice,untaxed_amount",0,Untaxed,Sin Impuesto,0
-field,"account.period,in_credit_note_sequence",0,Supplier Credit Note Sequence,Secuencia de la Nota Crédito del Proveedor,0
-field,"account.period,in_invoice_sequence",0,Supplier Invoice Sequence,Secuencia de Factura de Proveedor,0
-field,"account.period,out_credit_note_sequence",0,Customer Credit Note Sequence,Secuencia de Nota Crédito de Cliente,0
-field,"account.period,out_invoice_sequence",0,Customer Invoice Sequence,Secuencia de Facturas de Cliente,0
-field,"party.address,invoice",0,Invoice,Factura,0
-field,"party.party,payment_term",0,Invoice Payment Term,Término de Pago de la Factura,0
-field,"party.party,supplier_payment_term",0,Supplier Payment Term,Término de Pago a Proveedor,0
-help,"account.invoice.credit_invoice.init,with_refund",0,"If true, the current invoice(s) will be paid.","Si cierto, la(s) factura(s) actuales se pagarán.",0
-help,"account.invoice.payment_term.line,percentage",0,In %,En %,0
-help,"account.invoice.payment_term.line,sequence",0,Use to order lines in ascending order,Para ordenar las líneas ascendentemente,0
-model,"account.invoice-account.move.line,name",0,Invoice - Payment Line,Factura - Línea de pago,0
-model,"account.invoice.credit_invoice.init,name",0,Credit Invoice Init,Inicio de Factura Crédito,0
-model,"account.invoice.line-account.tax,name",0,Invoice Line - Tax,Línea de Factura - Impuesto,0
-model,"account.invoice.line,name",0,Invoice Line,Línea de Factura,0
-model,"account.invoice,name",0,Invoice,Factura,0
-model,"account.invoice.pay_invoice.ask,name",0,Pay Invoice Ask,Solicitud de Pago de Factura,0
-model,"account.invoice.pay_invoice.init,name",0,Pay Invoice Init,Inicio de Pago de Factura,0
-model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_end_month,End Month,Mes Final,0
-model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_net_days,Net Days,Días Netos,0
-model,"account.invoice.payment_term.line.delay,name",0,Payment Term Line Delay,Línea de Pago Tardío,0
-model,"account.invoice.payment_term.line,name",0,Payment Term Line,Línea de Término de Pago,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_fixed,Fixed,Fijo,0
-model,"account.invoice.payment_term.line.type,name",0,Payment Term Line Type,Tipo Pago de Término,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_percent,Percentage,Porcentaje,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_remainder,Remainder,Diferencia,0
-model,"account.invoice.payment_term,name",0,Payment Term,Término de Pago,0
-model,"account.invoice.print_invoice_report.warning,name",0,Print Invoice Report Warning,Imprimir Advertencia de Pago de Factura,0
-model,"account.invoice.tax,name",0,Invoice Tax,Impuesto en Factura,0
-model,"ir.action,name",act_invoice_form,All Invoices,Todas las facturas,0
-model,"ir.action,name",credit_invoice,Credit,Crédito,0
-model,"ir.action,name",act_invoice_out_credit_note_form,Credit Notes,Notas Crédito,0
-model,"ir.action,name",act_invoice_out_credit_note_form2,Credit Notes,Notas Crédito,0
-model,"ir.action,name",act_invoice_out_credit_note_form3,Draft Credit Notes,Notas Crédito en Borrador,0
-model,"ir.action,name",act_invoice_out_invoice_form3,Draft Invoices,Factura en Borrador,0
-model,"ir.action,name",act_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Borrador Nota Crédito del Proveedor,0
-model,"ir.action,name",act_invoice_in_invoice_form3,Draft Supplier Invoices,Borrador de Factura de Proveedor,0
-model,"ir.action,name",report_invoice,Invoice,Factura,0
-model,"ir.action,name",print_invoice_report,Invoice,Factura,0
-model,"ir.action,name",act_invoice_out_invoice_form,Invoices,Facturas,0
-model,"ir.action,name",act_invoice_out_invoice_form2,Invoices,Facturas,0
-model,"ir.action,name",act_invoice_form2,Invoices,Facturas,0
-model,"ir.action,name",act_invoice_out_credit_note_form5,Opened Credit Notes,Nota Crédito Abierta,0
-model,"ir.action,name",act_invoice_out_invoice_form5,Opened Invoices,Factura Abierta,0
-model,"ir.action,name",act_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Nota Crédito de Proveedor Abierta,0
-model,"ir.action,name",act_invoice_in_invoice_form5,Opened Supplier Invoices,Factura de Proveedor Abierta,0
-model,"ir.action,name",wizard_pay_invoice,Pay Invoice,Pagar Factura,0
-model,"ir.action,name",act_payment_term_form,Payment Terms,Términos de Pago,0
-model,"ir.action,name",act_invoice_out_credit_note_form4,Pro Forma Credit Notes,Nota Crédito Proforma,0
-model,"ir.action,name",act_invoice_out_invoice_form4,Pro Forma Invoices,Factura Proforma,0
-model,"ir.action,name",act_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Nota Crédito de Proveedor Proforma,0
-model,"ir.action,name",act_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Factura del Proveedor Proforma,0
-model,"ir.action,name",act_invoice_in_credit_note_form,Supplier Credit Notes,Notas Crédito del Proveedor,0
-model,"ir.action,name",act_invoice_in_credit_note_form2,Supplier Credit Notes,Notas Crédito del Proveedor,0
-model,"ir.action,name",act_invoice_in_invoice_form,Supplier Invoices,Facturas de Proveedor,0
-model,"ir.action,name",act_invoice_in_invoice_form2,Supplier Invoices,Facturas de Proveedor,0
-model,"ir.sequence.type,name",sequence_type_account_invoice,Invoice,Factura,0
-model,"ir.ui.menu,name",menu_invoice_form,All Invoices,Todas las facturas,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form,Credit Notes,Notas Crédito,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form3,Draft Credit Notes,Borrador Nota Crédito,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form3,Draft Invoices,Borrador Factura,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Borrador Nota Crédito Proveedor,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form3,Draft Supplier Invoices,Borrador Factura Proveedor,0
-model,"ir.ui.menu,name",menu_invoices,Invoices,Facturas,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form,Invoices,Facturas,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form2,New Credit Note,Nueva Nota Crédito,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form2,New Invoice,Nueva Factura,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form2,New Supplier Credit Note,Nueva Nota Crédito Proveedor,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form2,New Supplier Invoice,Factura Nuevo Proveedor,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form5,Opened Credit Notes,Nota Crédito Abierta,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form5,Opened Invoices,Factura Abierta,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Nota Crédito Proveedor Abierta,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form5,Opened Supplier Invoices,Factura Proveedor Abierta,0
-model,"ir.ui.menu,name",menu_payment_terms_configuration,Payment Terms,Términos de Pago,0
-model,"ir.ui.menu,name",menu_payment_term_form,Payment Terms,Términos de Pago,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form4,Pro Forma Credit Notes,Nota Crédito Proforma,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form4,Pro Forma Invoices,Factura Proforma,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Nota Crédito Proveedor Proforma,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Factura Proveedor Proforma,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form,Supplier Credit Notes,Notas Crédito del Proveedor,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form,Supplier Invoices,Facturas de Proveedor,0
-model,"workflow.activity,name",invoice_activity_cancel,Canceled,Cancelado,0
-model,"workflow.activity,name",invoice_activity_draft,Draft,Borrador,0
-model,"workflow.activity,name",invoice_activity_open,Open,Abrir,0
-model,"workflow.activity,name",invoice_activity_paid,Paid,Pagado,0
-model,"workflow.activity,name",invoice_activity_proforma,Pro forma,Pro forma,0
-model,"workflow,name",invoice_workflow,Invoice workflow,Flujo de Trabajo Factura,0
-odt,account.invoice,0,Amount,Cantidad,0
-odt,account.invoice,0,Base,Base,0
-odt,account.invoice,0,Credit Note N°:,Nota Crédito N°:,0
-odt,account.invoice,0,Date,Fecha,0
-odt,account.invoice,0,Date:,Fecha:,0
-odt,account.invoice,0,Description,Descripción,0
-odt,account.invoice,0,Description:,Descripción:,0
-odt,account.invoice,0,Draft Credit Note,Borrador de Nota Crédito,0
-odt,account.invoice,0,Draft Invoice,Borrador de Factura,0
-odt,account.invoice,0,Draft Supplier Credit Note,Borrador de Nota Crédito del Proveedor,0
-odt,account.invoice,0,Draft Supplier Invoice,Borrador de Factura del Proveedor,0
-odt,account.invoice,0,E-Mail:,Correo electrónico:,0
-odt,account.invoice,0,Invoice N°:,Factura N°:,0
-odt,account.invoice,0,Payment Term,Término de Pago,0
-odt,account.invoice,0,Phone:,Teléfono:,0
-odt,account.invoice,0,Pro forma Credit Note,Nota Crédito Proforma,0
-odt,account.invoice,0,Pro forma Invoice,Factura Proforma,0
-odt,account.invoice,0,Pro forma Supplier Credit Note,Nota Crédito del Proveedor Proforma,0
-odt,account.invoice,0,Pro forma Supplier Invoice,Factura del Proveedor Proforma,0
-odt,account.invoice,0,Quantity,Cantidad,0
-odt,account.invoice,0,Supplier Credit Note N°:,Nota Crédito del Proveedor N°:,0
-odt,account.invoice,0,Supplier Invoice N°:,Factura del Proveedor N°:,0
-odt,account.invoice,0,Tax,Impuesto,0
-odt,account.invoice,0,Taxes,Impuestos,0
-odt,account.invoice,0,Taxes:,Impuestos:,0
-odt,account.invoice,0,Total:,Total:,0
-odt,account.invoice,0,Total (excl. taxes):,Total (sin impuestos):,0
-odt,account.invoice,0,Unit Price,Precio Unitario,0
-odt,account.invoice,0,VAT:,IVA:,0
-selection,"account.invoice.line,invoice_type",0,Credit Note,Nota Crédito,0
-selection,"account.invoice.line,invoice_type",0,Invoice,Factura,0
-selection,"account.invoice.line,invoice_type",0,Supplier Credit Note,Nota Crédito del Proveedor,0
-selection,"account.invoice.line,invoice_type",0,Supplier Invoice,Factura de Proveedor,0
-selection,"account.invoice.line,type",0,Comment,Comentario,0
-selection,"account.invoice.line,type",0,Line,Línea,0
-selection,"account.invoice.line,type",0,Subtotal,Subtotal,0
-selection,"account.invoice.line,type",0,Title,Título,0
-selection,"account.invoice.pay_invoice.ask,type",0,Partial Payment,Pago Parcial,0
-selection,"account.invoice.pay_invoice.ask,type",0,Write-Off,Ajuste,0
-selection,"account.invoice,state",0,Canceled,Cancelado,0
-selection,"account.invoice,state",0,Draft,Borrador,0
-selection,"account.invoice,state",0,Opened,Abierto,0
-selection,"account.invoice,state",0,Paid,Pagado,0
-selection,"account.invoice,state",0,Pro forma,Pro forma,0
-selection,"account.invoice,type",0,Credit Note,Nota de Crédito,0
-selection,"account.invoice,type",0,Invoice,Factura,0
-selection,"account.invoice,type",0,Supplier Credit Note,Nota Crédito del Proveedor,0
-selection,"account.invoice,type",0,Supplier Invoice,Factura de Proveedor,0
-view,account.invoice,0,Amount Second Currency,Cantidad en la Moneda Secundaria,0
-view,account.invoice,0,_Cancel,_Cancelar,0
-view,account.invoice,0,Credit,Crédito,0
-view,account.invoice,0,Debit,Débito,0
-view,account.invoice,0,_Draft,_Borrador,0
-view,account.invoice,0,Invoice,Factura,0
-view,account.invoice,0,Invoices,Facturas,0
-view,account.invoice,0,Lines,Líneas,0
-view,account.invoice,0,_Open,_Abrir,0
-view,account.invoice,0,Other Info,Información Adicional,0
-view,account.invoice,0,_Pay,_Pago,0
-view,account.invoice,0,Payment,Pago,0
-view,account.invoice,0,Payment Lines,Líneas de Pago,0
-view,account.invoice,0,Pro For_ma,Pro For_ma,0
-view,account.invoice,0,_Reset to Draft,_Revertir a Borrador,0
-view,account.invoice,0,Taxes,Impuestos,0
-view,account.invoice.credit_invoice.init,0,Are you sure to credit those/this invoice(s)?,Segur@ desea acreditar la(s) factura(s)?,0
-view,account.invoice.credit_invoice.init,0,Credit Invoice,Factura Crédito,0
-view,account.invoice.line,0,General,General,0
-view,account.invoice.line,0,Invoice Line,Línea de Factura,0
-view,account.invoice.line,0,Invoice Lines,Líneas de Factura,0
-view,account.invoice.line,0,Notes,Notas,0
-view,account.invoice.line,0,Products,Productos,0
-view,account.invoice.pay_invoice.ask,0,Amount Second Currency,Cantidad en la Moneda Secundaria,0
-view,account.invoice.pay_invoice.ask,0,Credit,Crédito,0
-view,account.invoice.pay_invoice.ask,0,Debit,Débito,0
-view,account.invoice.pay_invoice.ask,0,Lines to Pay,Líneas a Pagar,0
-view,account.invoice.pay_invoice.ask,0,Pay Invoice,Pagar Factura,0
-view,account.invoice.pay_invoice.ask,0,Payment Lines,Líneas de Pago,0
-view,account.invoice.pay_invoice.init,0,Pay Invoice,Pagar Factura,0
-view,account.invoice.payment_term,0,Payment Term,Término de Pago,0
-view,account.invoice.payment_term,0,Payment Term Line,Línea de Término de Pago,0
-view,account.invoice.payment_term,0,Payment Term Lines,Líneas de Término de Pago,0
-view,account.invoice.payment_term,0,Payment Terms,Términos de Pago,0
-view,account.invoice.print_invoice_report.warning,0,<b>Warning!</b>,<b>Advertencia!</b>,0
-view,account.invoice.print_invoice_report.warning,0,Print Invoice,Imprimir Factura,0
-view,account.invoice.print_invoice_report.warning,0,The invoices will be sent <i>directly</i> to the printer.,Las facturas serán enviadas <i>directamente</i> a la impresora.,0
-view,account.invoice.print_invoice_report.warning,0,You have selected more than one invoice to print.,Ha elegido más de una factura para imprimir,0
-view,account.invoice.tax,0,Invoice Tax,Impuesto en Factura,0
-view,account.invoice.tax,0,Invoice Taxes,Impuestos de Facturas,0
-view,account.invoice.tax,0,Tax Code,Código de Impuesto,0
-view,party.party,0,Payment Terms,Términos de Pago,0
-wizard_button,"account.invoice.credit_invoice,init,credit",0,Credit,Crédito,0
-wizard_button,"account.invoice.credit_invoice,init,end",0,Cancel,Cancelar,0
-wizard_button,"account.invoice.pay_invoice,ask,end",0,Cancel,Cancelar,0
-wizard_button,"account.invoice.pay_invoice,ask,pay",0,Ok,Aceptar,0
-wizard_button,"account.invoice.pay_invoice,init,choice",0,Ok,Aceptar,0
-wizard_button,"account.invoice.pay_invoice,init,end",0,Cancel,Cancelar,0
-wizard_button,"account.invoice.print_invoice_report,warning,end",0,Cancel,Cancelar,0
-wizard_button,"account.invoice.print_invoice_report,warning,print",0,Print,Imprimir,0
+field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Cuentas Analíticas,0
diff --git a/es_ES.csv b/es_ES.csv
index eb8c2db..8750e2e 100644
--- a/es_ES.csv
+++ b/es_ES.csv
@@ -1,352 +1,2 @@
 type,name,res_id,src,value,fuzzy
-error,account.fiscalyear,0,You can not change the invoice sequence if there is already an invoice opened in the fiscalyear,No puede cambiar la secuencia de una factura si hay una factura abierta en el año fiscal,0
-error,account.fiscalyear,0,You must have different invoice sequences per fiscal year!,Debe tener una secuencia diferente de facturación por año fiscal,0
-error,account.invoice,0,"Base taxes different from invoice lines!
-Re-compute the invoice.","Los Impuestos base son distintos de las líneas de la factura.
-Recalcule la factura.",0
-error,account.invoice,0,"Taxes defined but not on invoice lines!
-Re-compute the invoice.","Tiene impuestos definidos pero ninguno en las líneas de la factura
-Recalcule la factura.",0
-error,account.invoice,0,"Taxes defined on invoice lines but not on invoice!
-Re-compute the invoice.","Los impuestos están definidos en las lineas de la factura pero no en la factura.
-Recalcule la factura.",0
-error,account.invoice,0,The credit account on journal is missing!,Falta la cuenta crédito del diario,0
-error,account.invoice,0,The credit account on journal is the same than the invoice account!,La cuenta de crédito en el diario es la misma que la cuenta facturada,0
-error,account.invoice,0,The debit account on journal is missing!,Falta la cuenta débito del diario,0
-error,account.invoice,0,The debit account on journal is the same than the invoice account!,La cuenta de débito en el diario es la misma que la cuenta facturada,0
-error,account.invoice,0,There is no invoice sequence on the period/fiscal year!,No hay una secuencia de factura para el período/año fiscal,0
-error,account.invoice,0,"You can not create an invoice
-with account from a different invoice company!","No puede crear una factura
-con una cuenta de una compañía distinta a la que factura",0
-error,account.invoice,0,"You can not modify an invoice that is open, paid or canceled!","No puede modificar una factura abierta, pagada o cancelada",0
-error,account.invoice,0,You can not reset to draft an invoice that has move!,No puede poner en borrador una factura que tiene asientos,0
-error,account.invoice,0,"You can not use the same account
-as on invoice line!","No puede usar la misma cuenta
-que la línea de la factura",0
-error,account.invoice.credit_invoice,0,You can not credit with refund an invoice that is not opened!,,0
-error,account.invoice.credit_invoice,0,You can not credit with refund an invoice with payments!,No puede acreditar una devolución de una factura con pagos,0
-error,account.invoice.line,0,"Line with ""line"" type must have an account!",Una línea con tipo «línea» debe tener una cuenta,0
-error,account.invoice.line,0,"Line without ""line"" type must have an invoice!",Una línea sin tipo «línea» debe tener una factura,0
-error,account.invoice.line,0,"You can not add a line to an invoice that is open, paid or canceled!","No puede añadir una línea a una factura que está abierta, pagada o cancelada",0
-error,account.invoice.line,0,"You can not create invoice line
-with account with a different invoice company!","No puede crear una línea de factura
-con una cuenta de una empresa distinta a la que factura",0
-error,account.invoice.line,0,"You can not modify line from an invoice that is open, paid or canceled!","No puede modificar la línea de una factura que esté abierta, pagada o cancelada",0
-error,account.invoice.line,0,"You can not use the same account
-as on the invoice!","No puede usar la misma cuenta
-que en la factura",0
-error,account.invoice.pay_invoice,0,You can not create a partial payment with an amount greater then the amount to pay!,No puede crear un pago parcial con una cantidad mayor de la que hay que pagar,0
-error,account.invoice.payment_term,0,Invalid payment term line!,La línea de término de pago no es válida,0
-error,account.invoice.payment_term,0,Payment term missing a remainder line!,Al término de pago le una línea final,0
-error,account.invoice.payment_term.line.delay,0,The code must be unique!,El código debe ser único,0
-error,account.invoice.payment_term.line.type,0,The code must be unique!,El código debe ser único,0
-error,account.invoice.tax,0,"You can not add a line to an invoice that is open, paid or canceled!","No puede añadir una línea a una factura que está abierta, pagada o cancelada",0
-error,account.invoice.tax,0,"You can not modify tax from an invoice that is open, paid or canceled!","No puede modificar impuestos de una factura abierta, pagada o cancelada",0
-error,account.period,0,You can not change the invoice sequence if there is already an invoice opened in the period,No puede cambiar la secuencia de una factura si hay una factura abierta en el período,0
-error,account.period,0,You must have different invoice sequences per fiscal year and in the same company!,Debe tener secuencias diferentes de facturas por año fiscal en la misma empresa,0
-field,"account.fiscalyear,in_credit_note_sequence",0,Supplier Credit Note Sequence,Secuencia de abono de proveedor,0
-field,"account.fiscalyear,in_invoice_sequence",0,Supplier Invoice Sequence,Secuencia de factura de proveedor,0
-field,"account.fiscalyear,out_credit_note_sequence",0,Customer Credit Note Sequence,Secuencia de abono a cliente,0
-field,"account.fiscalyear,out_invoice_sequence",0,Customer Invoice Sequence,Secuencia de facturas a cliente,0
-field,"account.invoice,account",0,Account,Cuenta,0
-field,"account.invoice,accounting_date",0,Accounting Date,Fecha de contabilización,0
-field,"account.invoice-account.move.line,invoice",0,Invoice,Factura,0
-field,"account.invoice-account.move.line,line",0,Payment Line,Línea de pago,0
-field,"account.invoice-account.move.line,rec_name",0,Name,Nombre,0
-field,"account.invoice,amount_to_pay",0,Amount to Pay,Cantidad a pagar,0
-field,"account.invoice,amount_to_pay_today",0,Amount to Pay Today,Cantidad a pagar hoy,0
-field,"account.invoice,comment",0,Comment,Comentario,0
-field,"account.invoice,company",0,Company,Empresa,0
-field,"account.invoice.credit_invoice.init,with_refund",0,With Refund,Con devolución,0
-field,"account.invoice,currency",0,Currency,Divisa,0
-field,"account.invoice,currency_digits",0,Currency Digits,Dígitos de la divisa,0
-field,"account.invoice,description",0,Description,Descripción,0
-field,"account.invoice,invoice_address",0,Invoice Address,Dirección de facturación,0
-field,"account.invoice,invoice_date",0,Invoice Date,Fecha de factura,0
-field,"account.invoice,invoice_report",0,Invoice Report,Informe de facturación,0
-field,"account.invoice,invoice_report_format",0,Invoice Report Format,Formato del informe de facturación,0
-field,"account.invoice,journal",0,Journal,Diario,0
-field,"account.invoice.line,account",0,Account,Cuenta,0
-field,"account.invoice.line-account.tax,line",0,Invoice Line,Línea de factura,0
-field,"account.invoice.line-account.tax,rec_name",0,Name,Nombre,0
-field,"account.invoice.line-account.tax,tax",0,Tax,Impuesto,0
-field,"account.invoice.line,amount",0,Amount,Cantidad,0
-field,"account.invoice.line,company",0,Company,Empresa,0
-field,"account.invoice.line,currency",0,Currency,Divisa,0
-field,"account.invoice.line,currency_digits",0,Currency Digits,Dígitos de la divisa,0
-field,"account.invoice.line,description",0,Description,Descripción,0
-field,"account.invoice.line,invoice",0,Invoice,Factura,0
-field,"account.invoice.line,invoice_taxes",0,Invoice Taxes,Impuestos de la factura,0
-field,"account.invoice.line,invoice_type",0,Invoice Type,Tipo de factura,0
-field,"account.invoice.line,note",0,Note,Nota,0
-field,"account.invoice.line,party",0,Party,Terceros,0
-field,"account.invoice.line,product",0,Product,Producto,0
-field,"account.invoice.line,quantity",0,Quantity,Cantidad,0
-field,"account.invoice.line,rec_name",0,Name,Nombre,0
-field,"account.invoice,lines",0,Lines,Líneas,0
-field,"account.invoice.line,sequence",0,Sequence,Secuencia,0
-field,"account.invoice,lines_to_pay",0,Lines to Pay,Líneas a pagar,0
-field,"account.invoice.line,taxes",0,Taxes,Impuestos,0
-field,"account.invoice.line,type",0,Type,Tipo,0
-field,"account.invoice.line,unit",0,Unit,Unidad,0
-field,"account.invoice.line,unit_digits",0,Unit Digits,Dígitos de unidad,0
-field,"account.invoice.line,unit_price",0,Unit Price,Precio unitario,0
-field,"account.invoice,move",0,Move,Asiento,0
-field,"account.invoice,number",0,Number,Número,0
-field,"account.invoice,party",0,Party,Tercero,0
-field,"account.invoice,party_lang",0,Party Language,Idioma del tercero,0
-field,"account.invoice.pay_invoice.ask,account",0,Account,Cuenta,0
-field,"account.invoice.pay_invoice.ask,account_writeoff",0,Write-Off Account,Cuenta de pérdidas,0
-field,"account.invoice.pay_invoice.ask,amount",0,Payment Amount,Cantidad del pago,0
-field,"account.invoice.pay_invoice.ask,amount_writeoff",0,Write-Off Amount,Valor de la pérdida,0
-field,"account.invoice.pay_invoice.ask,company",0,Company,Empresa,0
-field,"account.invoice.pay_invoice.ask,currency",0,Payment Currency,Divisa de pago,0
-field,"account.invoice.pay_invoice.ask,currency_digits",0,Payment Currency Digits,Decimales del pago de divisa,0
-field,"account.invoice.pay_invoice.ask,currency_digits_writeoff",0,Write-Off Currency Digits,Pérdida por decimales de divisa,0
-field,"account.invoice.pay_invoice.ask,currency_writeoff",0,Write-Off Currency,Divisa de la pérdida,0
-field,"account.invoice.pay_invoice.ask,date",0,Date,Fecha,0
-field,"account.invoice.pay_invoice.ask,description",0,Description,Descripción,0
-field,"account.invoice.pay_invoice.ask,invoice",0,Invoice,Factura,0
-field,"account.invoice.pay_invoice.ask,journal",0,Journal,Diario,0
-field,"account.invoice.pay_invoice.ask,journal_writeoff",0,Write-Off Journal,Diario de pérdidas,0
-field,"account.invoice.pay_invoice.ask,lines",0,Lines,Líneas,0
-field,"account.invoice.pay_invoice.ask,lines_to_pay",0,Lines to Pay,Líneas a pagar,0
-field,"account.invoice.pay_invoice.ask,payment_lines",0,Payment Lines,Líneas de pago,0
-field,"account.invoice.pay_invoice.ask,type",0,Type,Tipo,0
-field,"account.invoice.pay_invoice.init,amount",0,Amount,Cantidad,0
-field,"account.invoice.pay_invoice.init,currency",0,Currency,Divisa,0
-field,"account.invoice.pay_invoice.init,currency_digits",0,Currency Digits,Decimales de la divisa,0
-field,"account.invoice.pay_invoice.init,date",0,Date,Fecha,0
-field,"account.invoice.pay_invoice.init,description",0,Description,Descripción,0
-field,"account.invoice.pay_invoice.init,journal",0,Journal,Diario,0
-field,"account.invoice,payment_lines",0,Payment Lines,Líneas de pago,0
-field,"account.invoice,payment_term",0,Payment Term,Término de pago,0
-field,"account.invoice.payment_term,active",0,Active,Activo,0
-field,"account.invoice.payment_term,description",0,Description,Descripción,0
-field,"account.invoice.payment_term.line,amount",0,Amount,Cantidad,0
-field,"account.invoice.payment_term.line,currency",0,Currency,Divisa,0
-field,"account.invoice.payment_term.line,currency_digits",0,Currency Digits,Dígitos de la divisa,0
-field,"account.invoice.payment_term.line,days",0,Number of Days,Cantidad de días,0
-field,"account.invoice.payment_term.line,delay",0,Condition,Condición,0
-field,"account.invoice.payment_term.line.delay,code",0,Code,Código,0
-field,"account.invoice.payment_term.line.delay,name",0,Name,Nombre,0
-field,"account.invoice.payment_term.line.delay,rec_name",0,Name,Nombre,0
-field,"account.invoice.payment_term.line,payment",0,Payment Term,Término de pago,0
-field,"account.invoice.payment_term.line,percentage",0,Percentage,Porcentaje,0
-field,"account.invoice.payment_term.line,rec_name",0,Name,Nombre,0
-field,"account.invoice.payment_term,lines",0,Lines,Líneas,0
-field,"account.invoice.payment_term.line,sequence",0,Sequence,Secuencia,0
-field,"account.invoice.payment_term.line,type",0,Type,Tipo,0
-field,"account.invoice.payment_term.line.type,code",0,Code,Código,0
-field,"account.invoice.payment_term.line.type,name",0,Name,Nombre,0
-field,"account.invoice.payment_term.line.type,rec_name",0,Name,Nombre,0
-field,"account.invoice.payment_term,name",0,Payment Term,Término de pago,0
-field,"account.invoice.payment_term,rec_name",0,Name,Nombre,0
-field,"account.invoice,rec_name",0,Name,Nombre,0
-field,"account.invoice,reconciled",0,Reconciled,Conciliado,0
-field,"account.invoice,reference",0,Reference,Referencia,0
-field,"account.invoice,state",0,State,Estado,0
-field,"account.invoice.tax,account",0,Account,Cuenta,0
-field,"account.invoice,tax_amount",0,Tax,Impuesto,0
-field,"account.invoice.tax,amount",0,Amount,Cantidad,0
-field,"account.invoice.tax,base",0,Base,Base,0
-field,"account.invoice.tax,base_code",0,Base Code,Código base,0
-field,"account.invoice.tax,base_sign",0,Base Sign,Signo de la base,0
-field,"account.invoice.tax,description",0,Description,Descripción,0
-field,"account.invoice,taxes",0,Tax Lines,Líneas de impuestos,0
-field,"account.invoice.tax,invoice",0,Invoice,Factura,0
-field,"account.invoice.tax,manual",0,Manual,Manual,0
-field,"account.invoice.tax,rec_name",0,Name,Nombre,0
-field,"account.invoice.tax,sequence",0,Sequence,Secuencia,0
-field,"account.invoice.tax,sequence_number",0,Sequence Number,Número de secuencia,0
-field,"account.invoice.tax,tax",0,Tax,Impuesto,0
-field,"account.invoice.tax,tax_code",0,Tax Code,Código de impuesto,0
-field,"account.invoice.tax,tax_sign",0,Tax Sign,Signo del impuesto,0
-field,"account.invoice,total_amount",0,Total,Total,0
-field,"account.invoice,type",0,Type,Tipo,0
-field,"account.invoice,type_name",0,Type,Tipo,0
-field,"account.invoice,untaxed_amount",0,Untaxed,Sin impuesto,0
-field,"account.period,in_credit_note_sequence",0,Supplier Credit Note Sequence,Secuencia del abono de proveedor,0
-field,"account.period,in_invoice_sequence",0,Supplier Invoice Sequence,Secuencia de factura de proveedor,0
-field,"account.period,out_credit_note_sequence",0,Customer Credit Note Sequence,Secuencia de abono a cliente,0
-field,"account.period,out_invoice_sequence",0,Customer Invoice Sequence,Secuencia de factura a cliente,0
-field,"party.address,invoice",0,Invoice,Factura,0
-field,"party.party,payment_term",0,Invoice Payment Term,Término de pago de la factura,0
-field,"party.party,supplier_payment_term",0,Supplier Payment Term,Término de pago al proveedor,0
-help,"account.invoice.credit_invoice.init,with_refund",0,"If true, the current invoice(s) will be paid.","Si es cierto, la(s) factura(s) actuales se pagarán.",0
-help,"account.invoice.payment_term.line,percentage",0,In %,En %,0
-help,"account.invoice.payment_term.line,sequence",0,Use to order lines in ascending order,Empleado para ordenar las líneas ascendentemente,0
-model,"account.invoice-account.move.line,name",0,Invoice - Payment Line,Factura - Línea de pago,0
-model,"account.invoice.credit_invoice.init,name",0,Credit Invoice Init,Inicio de factura de crédito,0
-model,"account.invoice.line-account.tax,name",0,Invoice Line - Tax,Línea de factura - Impuesto,0
-model,"account.invoice.line,name",0,Invoice Line,Línea de factura,0
-model,"account.invoice,name",0,Invoice,Factura,0
-model,"account.invoice.pay_invoice.ask,name",0,Pay Invoice Ask,Solicitud de pago de factura,0
-model,"account.invoice.pay_invoice.init,name",0,Pay Invoice Init,Inicio de pago de factura,0
-model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_end_month,End Month,Mes final,0
-model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_net_days,Net Days,Días netos,0
-model,"account.invoice.payment_term.line.delay,name",0,Payment Term Line Delay,Línea de término de pago retrasado,0
-model,"account.invoice.payment_term.line,name",0,Payment Term Line,Línea de término de pago,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_fixed,Fixed,Fijo,0
-model,"account.invoice.payment_term.line.type,name",0,Payment Term Line Type,Línea de tipo de término de pago,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_percent,Percentage,Porcentaje,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_remainder,Remainder,Resto,0
-model,"account.invoice.payment_term,name",0,Payment Term,Término de pago,0
-model,"account.invoice.print_invoice_report.warning,name",0,Print Invoice Report Warning,Imprimir informe de aviso de facturas,0
-model,"account.invoice.tax,name",0,Invoice Tax,Impuesto en factura,0
-model,"ir.action,name",act_invoice_form,All Invoices,Todas las facturas,0
-model,"ir.action,name",credit_invoice,Credit,Haber,0
-model,"ir.action,name",act_invoice_out_credit_note_form,Credit Notes,Abonos,0
-model,"ir.action,name",act_invoice_out_credit_note_form2,Credit Notes,Abonos,0
-model,"ir.action,name",act_invoice_out_credit_note_form3,Draft Credit Notes,Abonos borrador,0
-model,"ir.action,name",act_invoice_out_invoice_form3,Draft Invoices,Facturas borrador,0
-model,"ir.action,name",act_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Borrador de abonos de proveedor,0
-model,"ir.action,name",act_invoice_in_invoice_form3,Draft Supplier Invoices,Borrador de facturas de proveedor,0
-model,"ir.action,name",report_invoice,Invoice,Factura,0
-model,"ir.action,name",print_invoice_report,Invoice,Factura,0
-model,"ir.action,name",act_invoice_out_invoice_form,Invoices,Facturas,0
-model,"ir.action,name",act_invoice_out_invoice_form2,Invoices,Facturas,0
-model,"ir.action,name",act_invoice_form2,Invoices,Facturas,0
-model,"ir.action,name",act_invoice_out_credit_note_form5,Opened Credit Notes,Abonos abiertos,0
-model,"ir.action,name",act_invoice_out_invoice_form5,Opened Invoices,Facturas abiertas,0
-model,"ir.action,name",act_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Abonos de proveedor abiertos,0
-model,"ir.action,name",act_invoice_in_invoice_form5,Opened Supplier Invoices,Facturas de proveedor abiertas,0
-model,"ir.action,name",wizard_pay_invoice,Pay Invoice,Pagar factura,0
-model,"ir.action,name",act_payment_term_form,Payment Terms,Términos de pago,0
-model,"ir.action,name",act_invoice_out_credit_note_form4,Pro Forma Credit Notes,Abonos pro forma,0
-model,"ir.action,name",act_invoice_out_invoice_form4,Pro Forma Invoices,Facturas pro forma,0
-model,"ir.action,name",act_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Abonos de proveedor pro forma,0
-model,"ir.action,name",act_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Facturas de proveedor pro forma,0
-model,"ir.action,name",act_invoice_in_credit_note_form,Supplier Credit Notes,Abonos de proveedor,0
-model,"ir.action,name",act_invoice_in_credit_note_form2,Supplier Credit Notes,Abonos de proveedor,0
-model,"ir.action,name",act_invoice_in_invoice_form,Supplier Invoices,Facturas de proveedor,0
-model,"ir.action,name",act_invoice_in_invoice_form2,Supplier Invoices,Facturas de proveedor,0
-model,"ir.sequence.type,name",sequence_type_account_invoice,Invoice,Factura,0
-model,"ir.ui.menu,name",menu_invoice_form,All Invoices,Todas las facturas,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form,Credit Notes,Abonos,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form3,Draft Credit Notes,Abono borrador,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form3,Draft Invoices,Facturas borrador,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Abonos de proveedor borrador,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form3,Draft Supplier Invoices,Facturas de proveedor borrador,0
-model,"ir.ui.menu,name",menu_invoices,Invoices,Facturas,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form,Invoices,Facturas,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form2,New Credit Note,Nuevo abono,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form2,New Invoice,Nueva factura,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form2,New Supplier Credit Note,Nuevo abono de proveedor,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form2,New Supplier Invoice,Nueva factura de proveedor,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form5,Opened Credit Notes,Abonos abiertos,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form5,Opened Invoices,Facturas abiertas,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Abonos de proveedor abiertos,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form5,Opened Supplier Invoices,Facturas de proveedor abiertas,0
-model,"ir.ui.menu,name",menu_payment_terms_configuration,Payment Terms,Términos de pago,0
-model,"ir.ui.menu,name",menu_payment_term_form,Payment Terms,Términos de pago,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form4,Pro Forma Credit Notes,Abonos pro forma,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form4,Pro Forma Invoices,Facturas pro forma,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Abonos de proveedor pro forma,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Facturas de proveedor pro forma,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form,Supplier Credit Notes,Abonos del proveedor,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form,Supplier Invoices,Facturas de proveedor,0
-model,"workflow.activity,name",invoice_activity_cancel,Canceled,Cancelado,0
-model,"workflow.activity,name",invoice_activity_draft,Draft,Borrador,0
-model,"workflow.activity,name",invoice_activity_open,Open,Abierto,0
-model,"workflow.activity,name",invoice_activity_paid,Paid,Pagado,0
-model,"workflow.activity,name",invoice_activity_proforma,Pro forma,Pro forma,0
-model,"workflow,name",invoice_workflow,Invoice workflow,Flujo de trabajo de la factura,0
-odt,account.invoice,0,Amount,Cantidad,0
-odt,account.invoice,0,Base,Base,0
-odt,account.invoice,0,Credit Note N°:,Abono Nº:,0
-odt,account.invoice,0,Date,Fecha,0
-odt,account.invoice,0,Date:,Fecha:,0
-odt,account.invoice,0,Description,Descripción,0
-odt,account.invoice,0,Description:,Descripción:,0
-odt,account.invoice,0,Draft Credit Note,Abono borrador,0
-odt,account.invoice,0,Draft Invoice,Factura borrador,0
-odt,account.invoice,0,Draft Supplier Credit Note,Borrador de abono de proveedor,0
-odt,account.invoice,0,Draft Supplier Invoice,Borrador de factura de proveedor,0
-odt,account.invoice,0,E-Mail:,Correo electrónico:,0
-odt,account.invoice,0,Invoice N°:,Factura Nº:,0
-odt,account.invoice,0,Payment Term,Término de pago,0
-odt,account.invoice,0,Phone:,Teléfono:,0
-odt,account.invoice,0,Pro forma Credit Note,Abono pro forma,0
-odt,account.invoice,0,Pro forma Invoice,Factura pro forma,0
-odt,account.invoice,0,Pro forma Supplier Credit Note,Abono de proveedor pro forma,0
-odt,account.invoice,0,Pro forma Supplier Invoice,Factura de proveedor pro forma,0
-odt,account.invoice,0,Quantity,Cantidad,0
-odt,account.invoice,0,Supplier Credit Note N°:,Abono de proveedor Nº:,0
-odt,account.invoice,0,Supplier Invoice N°:,Factura de proveedor Nº:,0
-odt,account.invoice,0,Tax,Impuesto,0
-odt,account.invoice,0,Taxes,Impuestos,0
-odt,account.invoice,0,Taxes:,Impuestos:,0
-odt,account.invoice,0,Total:,Total:,0
-odt,account.invoice,0,Total (excl. taxes):,Total (sin impuestos):,0
-odt,account.invoice,0,Unit Price,Precio unitario,0
-odt,account.invoice,0,VAT:,IVA:,0
-selection,"account.invoice.line,invoice_type",0,Credit Note,Abono,0
-selection,"account.invoice.line,invoice_type",0,Invoice,Factura,0
-selection,"account.invoice.line,invoice_type",0,Supplier Credit Note,Abono de proveedor,0
-selection,"account.invoice.line,invoice_type",0,Supplier Invoice,Factura de proveedor,0
-selection,"account.invoice.line,type",0,Comment,Comentario,0
-selection,"account.invoice.line,type",0,Line,Línea,0
-selection,"account.invoice.line,type",0,Subtotal,Subtotal,0
-selection,"account.invoice.line,type",0,Title,Título,0
-selection,"account.invoice.pay_invoice.ask,type",0,Partial Payment,Pago parcial,0
-selection,"account.invoice.pay_invoice.ask,type",0,Write-Off,Pérdida,0
-selection,"account.invoice,state",0,Canceled,Cancelada,0
-selection,"account.invoice,state",0,Draft,Borrador,0
-selection,"account.invoice,state",0,Opened,Abierto,0
-selection,"account.invoice,state",0,Paid,Pagada,0
-selection,"account.invoice,state",0,Pro forma,Pro forma,0
-selection,"account.invoice,type",0,Credit Note,Abono,0
-selection,"account.invoice,type",0,Invoice,Factura,0
-selection,"account.invoice,type",0,Supplier Credit Note,Abono del proveedor,0
-selection,"account.invoice,type",0,Supplier Invoice,Factura de proveedor,0
-view,account.invoice,0,Amount Second Currency,Cantidad en la divisa secundaria,0
-view,account.invoice,0,_Cancel,_Cancelar,0
-view,account.invoice,0,Credit,Haber,0
-view,account.invoice,0,Debit,Debe,0
-view,account.invoice,0,_Draft,_Borrador,0
-view,account.invoice,0,Invoice,Factura,0
-view,account.invoice,0,Invoices,Facturas,0
-view,account.invoice,0,Lines,Líneas,0
-view,account.invoice,0,_Open,_Abrir,0
-view,account.invoice,0,Other Info,Información adicional,0
-view,account.invoice,0,_Pay,_Pagar,0
-view,account.invoice,0,Payment,Pago,0
-view,account.invoice,0,Payment Lines,Líneas de pago,0
-view,account.invoice,0,Pro For_ma,Pro for_ma,0
-view,account.invoice,0,_Reset to Draft,_Restablecer a borrador,0
-view,account.invoice,0,Taxes,Impuestos,0
-view,account.invoice.credit_invoice.init,0,Are you sure to credit those/this invoice(s)?,¿Está seguro que quiere acreditar esas/esta factura(s)?,0
-view,account.invoice.credit_invoice.init,0,Credit Invoice,Factura crédito,0
-view,account.invoice.line,0,General,General,0
-view,account.invoice.line,0,Invoice Line,Línea de factura,0
-view,account.invoice.line,0,Invoice Lines,Líneas de factura,0
-view,account.invoice.line,0,Notes,Notas,0
-view,account.invoice.line,0,Products,Productos,0
-view,account.invoice.pay_invoice.ask,0,Amount Second Currency,Cantidad en la divisa secundaria,0
-view,account.invoice.pay_invoice.ask,0,Credit,Haber,0
-view,account.invoice.pay_invoice.ask,0,Debit,Debe,0
-view,account.invoice.pay_invoice.ask,0,Lines to Pay,Líneas a pagar,0
-view,account.invoice.pay_invoice.ask,0,Pay Invoice,Pagar factura,0
-view,account.invoice.pay_invoice.ask,0,Payment Lines,Líneas de pago,0
-view,account.invoice.pay_invoice.init,0,Pay Invoice,Pagar factura,0
-view,account.invoice.payment_term,0,Payment Term,Término de pago,0
-view,account.invoice.payment_term,0,Payment Term Line,Línea de término de pago,0
-view,account.invoice.payment_term,0,Payment Term Lines,Líneas de término de pago,0
-view,account.invoice.payment_term,0,Payment Terms,Términos de pago,0
-view,account.invoice.print_invoice_report.warning,0,<b>Warning!</b>,<b>Atención</b>,0
-view,account.invoice.print_invoice_report.warning,0,Print Invoice,Imprimir factura,0
-view,account.invoice.print_invoice_report.warning,0,The invoices will be sent <i>directly</i> to the printer.,Las facturas se enviarán <i>directamente</i> a la impresora.,0
-view,account.invoice.print_invoice_report.warning,0,You have selected more than one invoice to print.,Ha elegido más de una factura para imprimir.,0
-view,account.invoice.tax,0,Invoice Tax,Impuesto de factura,0
-view,account.invoice.tax,0,Invoice Taxes,Impuestos de factura,0
-view,account.invoice.tax,0,Tax Code,Código de impuesto,0
-view,party.party,0,Payment Terms,Términos de pago,0
-wizard_button,"account.invoice.credit_invoice,init,credit",0,Credit,Haber,0
-wizard_button,"account.invoice.credit_invoice,init,end",0,Cancel,Cancelar,0
-wizard_button,"account.invoice.pay_invoice,ask,end",0,Cancel,Cancelar,0
-wizard_button,"account.invoice.pay_invoice,ask,pay",0,Ok,Aceptar,0
-wizard_button,"account.invoice.pay_invoice,init,choice",0,Ok,Aceptar,0
-wizard_button,"account.invoice.pay_invoice,init,end",0,Cancel,Cancelar,0
-wizard_button,"account.invoice.print_invoice_report,warning,end",0,Cancel,Cancelar,0
-wizard_button,"account.invoice.print_invoice_report,warning,print",0,Print,Imprimir,0
+field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Cuentas analíticas,0
diff --git a/fr_FR.csv b/fr_FR.csv
index 708712f..a64dce4 100644
--- a/fr_FR.csv
+++ b/fr_FR.csv
@@ -1,353 +1,2 @@
 type,name,res_id,src,value,fuzzy
-error,account.fiscalyear,0,You can not change the invoice sequence if there is already an invoice opened in the fiscalyear,Vous ne pouvez pas changer la séquence de facture si il y a déjà une facture ouverte dans l'année fiscale,0
-error,account.fiscalyear,0,You must have different invoice sequences per fiscal year!,Vous devez utiliser des séquences de facture différentes par année fiscale !,0
-error,account.invoice,0,"Base taxes different from invoice lines!
-Re-compute the invoice.","Le montant de base des taxes sont différents des lignes de facture !
-Re-calculez la facture.",0
-error,account.invoice,0,"Taxes defined but not on invoice lines!
-Re-compute the invoice.","Des taxes sont définies mais pas sur les lignes de facture !
-Re-calculez la facture.",0
-error,account.invoice,0,"Taxes defined on invoice lines but not on invoice!
-Re-compute the invoice.","Des taxes sont définies sur les lignes de facture mais pas sur la facture !
-Re-calculez la facture.",0
-error,account.invoice,0,The credit account on journal is missing!,Le compte de crédit sur le journal est manquant !,0
-error,account.invoice,0,The credit account on journal is the same than the invoice account!,Le compte de crébit sur le journal est le même que le compte de la facture !,0
-error,account.invoice,0,The debit account on journal is missing!,Le compte de débit sur le journal est manquant !,0
-error,account.invoice,0,The debit account on journal is the same than the invoice account!,Le compte de débit sur le journal est le même que le compte de la facture !,0
-error,account.invoice,0,There is no invoice sequence on the period/fiscal year!,Il n'y a pas de séquence de facture sur la période/année fiscale !,0
-error,account.invoice,0,"You can not create an invoice
-with account from a different invoice company!","Vous ne pouvez pas créer une facture
-avec un compte d'une société de facturation différente !",0
-error,account.invoice,0,"You can not modify an invoice that is open, paid or canceled!","Vous ne pouvez pas modifier une facture qui est ouverte, payée ou annulée !",0
-error,account.invoice,0,You can not reset to draft an invoice that has move!,Vous ne pouvez pas remettre en brouillon une facture qui a un mouvement !,0
-error,account.invoice,0,"You can not use the same account
-as on invoice line!","Vous ne pouvez pas utiliser le même compte
-que sur la ligne de facture !",0
-error,account.invoice.credit_invoice,0,You can not credit with refund an invoice that is not opened!,Vous ne pouvez pas créditer avec un remboursement une facture qui n'est pas ouverte !,0
-error,account.invoice.credit_invoice,0,You can not credit with refund an invoice with payments!,Vous ne pouvez pas créditer avec un remboursement une facture avec paiements !,0
-error,account.invoice.line,0,"Line with ""line"" type must have an account!","Ligne de type ""ligne"" doit avoir un compte !",0
-error,account.invoice.line,0,"Line without ""line"" type must have an invoice!","Ligne sans type ""ligne"" doit avoir une facture !",0
-error,account.invoice.line,0,"You can not add a line to an invoice that is open, paid or canceled!","Vous ne pouvez pas ajouter une ligne à une facture qui est ouverte, payée our annulée !",0
-error,account.invoice.line,0,"You can not create invoice line
-with account with a different invoice company!","Vous ne pouvez pas créer de ligne de facture
-avec un compte d'une différente société que celle de la  facture !",0
-error,account.invoice.line,0,"You can not modify line from an invoice that is open, paid or canceled!","Vous ne pouvez pas modifier de ligne d'une facture qui est ouverte, payée our annulée !",0
-error,account.invoice.line,0,"You can not use the same account
-as on the invoice!","Vous ne pouvez pas utilier le même compte
-que celui de la factiure !",0
-error,account.invoice.pay_invoice,0,You can not create a partial payment with an amount greater then the amount to pay!,Vous ne pouvez pas créer un paiement partiel dont le montant est supérieur au montant qu'il reste à payer !,0
-error,account.invoice.payment_term,0,Invalid payment term line!,Ligne de condition de paiement non-valide !,0
-error,account.invoice.payment_term,0,Payment term missing a remainder line!,La condition de paiement manque une ligne de reste !,0
-error,account.invoice.payment_term.line.delay,0,The code must be unique!,Le code doit être unique !,0
-error,account.invoice.payment_term.line.type,0,The code must be unique!,Le code doit être unique !,0
-error,account.invoice.tax,0,"You can not add a line to an invoice that is open, paid or canceled!","Vous ne pouvez pas ajouter une ligne à une facture qui est ouverte, payée ou annulée !",0
-error,account.invoice.tax,0,"You can not modify tax from an invoice that is open, paid or canceled!","Vous ne pouvez pas modifier les taxes d'une facture qui est ouverte, payée ou annulée !",0
-error,account.period,0,You can not change the invoice sequence if there is already an invoice opened in the period,Vous ne pouvez pas changer la séquence de facture s'il y a déjà une facture ouverte dans la période,0
-error,account.period,0,You must have different invoice sequences per fiscal year and in the same company!,Vous devez avoir des séquences de facture différentes par année fiscale et dans la même société !,0
-field,"account.fiscalyear,in_credit_note_sequence",0,Supplier Credit Note Sequence,Séquence des notes de crédit fournisseur,0
-field,"account.fiscalyear,in_invoice_sequence",0,Supplier Invoice Sequence,Séquence de facture fournisseur,0
-field,"account.fiscalyear,out_credit_note_sequence",0,Customer Credit Note Sequence,Séquence des notes de crédit client,0
-field,"account.fiscalyear,out_invoice_sequence",0,Customer Invoice Sequence,Séquence de facture client,0
-field,"account.invoice,account",0,Account,Compte,0
-field,"account.invoice,accounting_date",0,Accounting Date,Date comptable,0
-field,"account.invoice-account.move.line,invoice",0,Invoice,Facture,0
-field,"account.invoice-account.move.line,line",0,Payment Line,Ligne de paiement,0
-field,"account.invoice-account.move.line,rec_name",0,Name,Nom,0
-field,"account.invoice,amount_to_pay",0,Amount to Pay,Montant à payer,0
-field,"account.invoice,amount_to_pay_today",0,Amount to Pay Today,Montant à payer aujourd'hui,0
-field,"account.invoice,comment",0,Comment,Commentaire,0
-field,"account.invoice,company",0,Company,Société,0
-field,"account.invoice.credit_invoice.init,with_refund",0,With Refund,Avec remboursement,0
-field,"account.invoice,currency",0,Currency,Devise,0
-field,"account.invoice,currency_digits",0,Currency Digits,Décimales de la devise,0
-field,"account.invoice,description",0,Description,Description,0
-field,"account.invoice,invoice_address",0,Invoice Address,Adresse de facturation,0
-field,"account.invoice,invoice_date",0,Invoice Date,Date de facturation,0
-field,"account.invoice,invoice_report",0,Invoice Report,Rapport de facturation,0
-field,"account.invoice,invoice_report_format",0,Invoice Report Format,Format du rapport de facturation,0
-field,"account.invoice,journal",0,Journal,Journal,0
-field,"account.invoice.line,account",0,Account,Compte,0
-field,"account.invoice.line-account.tax,line",0,Invoice Line,Ligne de facture,0
-field,"account.invoice.line-account.tax,rec_name",0,Name,Nom,0
-field,"account.invoice.line-account.tax,tax",0,Tax,Taxe,0
-field,"account.invoice.line,amount",0,Amount,Montant,0
-field,"account.invoice.line,company",0,Company,Société,0
-field,"account.invoice.line,currency",0,Currency,Devise,0
-field,"account.invoice.line,currency_digits",0,Currency Digits,Décimales de la devise,0
-field,"account.invoice.line,description",0,Description,Description,0
-field,"account.invoice.line,invoice",0,Invoice,Facture,0
-field,"account.invoice.line,invoice_taxes",0,Invoice Taxes,Taxes de le facture,0
-field,"account.invoice.line,invoice_type",0,Invoice Type,Type de facture,0
-field,"account.invoice.line,note",0,Note,Note,0
-field,"account.invoice.line,party",0,Party,Tiers,0
-field,"account.invoice.line,product",0,Product,Produit,0
-field,"account.invoice.line,quantity",0,Quantity,Quantité,0
-field,"account.invoice.line,rec_name",0,Name,Nom,0
-field,"account.invoice,lines",0,Lines,Lignes,0
-field,"account.invoice.line,sequence",0,Sequence,Séquence,0
-field,"account.invoice,lines_to_pay",0,Lines to Pay,Lignes à payer,0
-field,"account.invoice.line,taxes",0,Taxes,Taxes,0
-field,"account.invoice.line,type",0,Type,Type,0
-field,"account.invoice.line,unit",0,Unit,Unité,0
-field,"account.invoice.line,unit_digits",0,Unit Digits,Décimales de l'unité,0
-field,"account.invoice.line,unit_price",0,Unit Price,Prix unitaire,0
-field,"account.invoice,move",0,Move,Mouvement,0
-field,"account.invoice,number",0,Number,Numéro,0
-field,"account.invoice,party",0,Party,Tiers,0
-field,"account.invoice,party_lang",0,Party Language,Langue du tiers,0
-field,"account.invoice.pay_invoice.ask,account",0,Account,Compte,0
-field,"account.invoice.pay_invoice.ask,account_writeoff",0,Write-Off Account,Compte de pertes et profits,0
-field,"account.invoice.pay_invoice.ask,amount",0,Payment Amount,Montant,0
-field,"account.invoice.pay_invoice.ask,amount_writeoff",0,Write-Off Amount,Montant de pertes et profits,0
-field,"account.invoice.pay_invoice.ask,company",0,Company,Société,0
-field,"account.invoice.pay_invoice.ask,currency",0,Payment Currency,Devise,0
-field,"account.invoice.pay_invoice.ask,currency_digits",0,Payment Currency Digits,Décimales de la devise,0
-field,"account.invoice.pay_invoice.ask,currency_digits_writeoff",0,Write-Off Currency Digits,Décimales de la devise de pertes et profits,0
-field,"account.invoice.pay_invoice.ask,currency_writeoff",0,Write-Off Currency,Devise pertes et profits,0
-field,"account.invoice.pay_invoice.ask,date",0,Date,Date,0
-field,"account.invoice.pay_invoice.ask,description",0,Description,Description,0
-field,"account.invoice.pay_invoice.ask,invoice",0,Invoice,Facture,0
-field,"account.invoice.pay_invoice.ask,journal",0,Journal,Journal,0
-field,"account.invoice.pay_invoice.ask,journal_writeoff",0,Write-Off Journal,Journal,0
-field,"account.invoice.pay_invoice.ask,lines",0,Lines,Lignes,0
-field,"account.invoice.pay_invoice.ask,lines_to_pay",0,Lines to Pay,Lignes à payer,0
-field,"account.invoice.pay_invoice.ask,payment_lines",0,Payment Lines,Lignes de paiement,0
-field,"account.invoice.pay_invoice.ask,type",0,Type,Type,0
-field,"account.invoice.pay_invoice.init,amount",0,Amount,Montant,0
-field,"account.invoice.pay_invoice.init,currency",0,Currency,Devise,0
-field,"account.invoice.pay_invoice.init,currency_digits",0,Currency Digits,Décimales de la devise,0
-field,"account.invoice.pay_invoice.init,date",0,Date,date,0
-field,"account.invoice.pay_invoice.init,description",0,Description,Description,0
-field,"account.invoice.pay_invoice.init,journal",0,Journal,Journal,0
-field,"account.invoice,payment_lines",0,Payment Lines,Lignes de paiement,0
-field,"account.invoice,payment_term",0,Payment Term,Condition de paiement,0
-field,"account.invoice.payment_term,active",0,Active,Actif,0
-field,"account.invoice.payment_term,description",0,Description,Description,0
-field,"account.invoice.payment_term.line,amount",0,Amount,Montant,0
-field,"account.invoice.payment_term.line,currency",0,Currency,Devise,0
-field,"account.invoice.payment_term.line,currency_digits",0,Currency Digits,Décimales de la devise,0
-field,"account.invoice.payment_term.line,days",0,Number of Days,Nombre de jours,0
-field,"account.invoice.payment_term.line,delay",0,Condition,Condition,0
-field,"account.invoice.payment_term.line.delay,code",0,Code,Code,0
-field,"account.invoice.payment_term.line.delay,name",0,Name,Nom,0
-field,"account.invoice.payment_term.line.delay,rec_name",0,Name,Nom,0
-field,"account.invoice.payment_term.line,payment",0,Payment Term,Condition de paiement,0
-field,"account.invoice.payment_term.line,percentage",0,Percentage,Pourcentage,0
-field,"account.invoice.payment_term.line,rec_name",0,Name,Nom,0
-field,"account.invoice.payment_term,lines",0,Lines,Lignes,0
-field,"account.invoice.payment_term.line,sequence",0,Sequence,Séquence,0
-field,"account.invoice.payment_term.line,type",0,Type,Type,0
-field,"account.invoice.payment_term.line.type,code",0,Code,Code,0
-field,"account.invoice.payment_term.line.type,name",0,Name,Nom,0
-field,"account.invoice.payment_term.line.type,rec_name",0,Name,Nom,0
-field,"account.invoice.payment_term,name",0,Payment Term,Condition de paiement,0
-field,"account.invoice.payment_term,rec_name",0,Name,Nom,0
-field,"account.invoice,rec_name",0,Name,Nom,0
-field,"account.invoice,reconciled",0,Reconciled,Réconcilié,0
-field,"account.invoice,reference",0,Reference,Référence,0
-field,"account.invoice,state",0,State,État,0
-field,"account.invoice.tax,account",0,Account,Compte,0
-field,"account.invoice,tax_amount",0,Tax,Taxe,0
-field,"account.invoice.tax,amount",0,Amount,Montant,0
-field,"account.invoice.tax,base",0,Base,Base,0
-field,"account.invoice.tax,base_code",0,Base Code,Code de base,0
-field,"account.invoice.tax,base_sign",0,Base Sign,Signe de base,0
-field,"account.invoice.tax,description",0,Description,Description,0
-field,"account.invoice,taxes",0,Tax Lines,Lignes de taxe,0
-field,"account.invoice.tax,invoice",0,Invoice,Facture,0
-field,"account.invoice.tax,manual",0,Manual,Manuel,0
-field,"account.invoice.tax,rec_name",0,Name,Nom,0
-field,"account.invoice.tax,sequence",0,Sequence,Séquence,0
-field,"account.invoice.tax,sequence_number",0,Sequence Number,Numéro de séquence,0
-field,"account.invoice.tax,tax",0,Tax,Taxe,0
-field,"account.invoice.tax,tax_code",0,Tax Code,Code de taxe,0
-field,"account.invoice.tax,tax_sign",0,Tax Sign,Signe de taxe,0
-field,"account.invoice,total_amount",0,Total,Total,0
-field,"account.invoice,type",0,Type,Type,0
-field,"account.invoice,type_name",0,Type,Type,0
-field,"account.invoice,untaxed_amount",0,Untaxed,Hors taxe,0
-field,"account.period,in_credit_note_sequence",0,Supplier Credit Note Sequence,Séquence des notes de crédit fournisseur,0
-field,"account.period,in_invoice_sequence",0,Supplier Invoice Sequence,Séquence de facture fournisseur,0
-field,"account.period,out_credit_note_sequence",0,Customer Credit Note Sequence,Séquence des notes de crédit client,0
-field,"account.period,out_invoice_sequence",0,Customer Invoice Sequence,Séquence de facture client,0
-field,"party.address,invoice",0,Invoice,Facture,0
-field,"party.party,payment_term",0,Invoice Payment Term,Conditions de paiement du client,0
-field,"party.party,supplier_payment_term",0,Supplier Payment Term,Conditions de paiement du fournisseur,0
-help,"account.invoice.credit_invoice.init,with_refund",0,"If true, the current invoice(s) will be paid.","Si vrai, les factures seront payées.",0
-help,"account.invoice.payment_term.line,percentage",0,In %,En %,0
-help,"account.invoice.payment_term.line,sequence",0,Use to order lines in ascending order,Utilisé pour trier les lignes en ordre croissant,0
-model,"account.invoice-account.move.line,name",0,Invoice - Payment Line,Facture - Ligne de paiement,0
-model,"account.invoice.credit_invoice.init,name",0,Credit Invoice Init,Crediter la facture - Init,0
-model,"account.invoice.line-account.tax,name",0,Invoice Line - Tax,Ligne de facture - Taxe,0
-model,"account.invoice.line,name",0,Invoice Line,Ligne de Facture,0
-model,"account.invoice,name",0,Invoice,Facture,0
-model,"account.invoice.pay_invoice.ask,name",0,Pay Invoice Ask,Payer la facture - Demande,0
-model,"account.invoice.pay_invoice.init,name",0,Pay Invoice Init,Payer la facture - Init,0
-model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_end_month,End Month,fin du mois,0
-model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_net_days,Net Days,Jours,0
-model,"account.invoice.payment_term.line.delay,name",0,Payment Term Line Delay,Délai de ligne de condition de paiement,0
-model,"account.invoice.payment_term.line,name",0,Payment Term Line,Ligne de condition de paiement,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_fixed,Fixed,Fixe,0
-model,"account.invoice.payment_term.line.type,name",0,Payment Term Line Type,Type de line de condition de paiement,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_percent,Percentage,Pourcentage,0
-model,"account.invoice.payment_term.line.type,name",payment_term_line_type_remainder,Remainder,Reste,0
-model,"account.invoice.payment_term,name",0,Payment Term,Conditions de paiement,0
-model,"account.invoice.print_invoice_report.warning,name",0,Print Invoice Report Warning,Imprimer de la factures - Avertissement,0
-model,"account.invoice.tax,name",0,Invoice Tax,Tax de facture,0
-model,"ir.action,name",act_invoice_form,All Invoices,Toutes les factures,0
-model,"ir.action,name",credit_invoice,Credit,Crédit,0
-model,"ir.action,name",act_invoice_out_credit_note_form,Credit Notes,Notes de crédit,0
-model,"ir.action,name",act_invoice_out_credit_note_form2,Credit Notes,Notes de crédit,0
-model,"ir.action,name",act_invoice_out_credit_note_form3,Draft Credit Notes,Notes de crédit en brouillon,0
-model,"ir.action,name",act_invoice_out_invoice_form3,Draft Invoices,Factures en brouillon,0
-model,"ir.action,name",act_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Notes de crédit fournisseurs en brouillon,0
-model,"ir.action,name",act_invoice_in_invoice_form3,Draft Supplier Invoices,Factures fournisseurs ouvertes,0
-model,"ir.action,name",report_invoice,Invoice,Facture,0
-model,"ir.action,name",print_invoice_report,Invoice,Facture,0
-model,"ir.action,name",act_invoice_out_invoice_form,Invoices,Factures,0
-model,"ir.action,name",act_invoice_out_invoice_form2,Invoices,Factures,0
-model,"ir.action,name",act_invoice_form2,Invoices,Factures,0
-model,"ir.action,name",act_invoice_out_credit_note_form5,Opened Credit Notes,Notes de crédit ouvertes,0
-model,"ir.action,name",act_invoice_out_invoice_form5,Opened Invoices,Factures ouvertes,0
-model,"ir.action,name",act_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Notes de crédit fournisseurs ouvertes,0
-model,"ir.action,name",act_invoice_in_invoice_form5,Opened Supplier Invoices,Factures fournisseurs ouvertes,0
-model,"ir.action,name",wizard_pay_invoice,Pay Invoice,Payer facture,0
-model,"ir.action,name",act_payment_term_form,Payment Terms,Conditions de paiement,0
-model,"ir.action,name",act_invoice_out_credit_note_form4,Pro Forma Credit Notes,Notes de crédit pro forma,0
-model,"ir.action,name",act_invoice_out_invoice_form4,Pro Forma Invoices,Factures pro forma,0
-model,"ir.action,name",act_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Notes de crédit fournisseurs pro forma,0
-model,"ir.action,name",act_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Factures fournisseurs pro forma,0
-model,"ir.action,name",act_invoice_in_credit_note_form,Supplier Credit Notes,Notes de crédit fournisseur,0
-model,"ir.action,name",act_invoice_in_credit_note_form2,Supplier Credit Notes,Notes de crédit fournisseurs,0
-model,"ir.action,name",act_invoice_in_invoice_form,Supplier Invoices,Factures fournisseurs,0
-model,"ir.action,name",act_invoice_in_invoice_form2,Supplier Invoices,Factures fournisseurs,0
-model,"ir.sequence.type,name",sequence_type_account_invoice,Invoice,Facture,0
-model,"ir.ui.menu,name",menu_invoice_form,All Invoices,Toutes les factures,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form,Credit Notes,Notes de crédit,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form3,Draft Credit Notes,Notes de crédit en brouillon,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form3,Draft Invoices,Factures en brouillon,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Notes de crédit fournisseur en brouillon,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form3,Draft Supplier Invoices,Factures fournisseurs en brouillon,0
-model,"ir.ui.menu,name",menu_invoices,Invoices,Factures,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form,Invoices,Factures,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form2,New Credit Note,Nouvelle note de crédit,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form2,New Invoice,Nouvelle facture,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form2,New Supplier Credit Note,Nouvelle note de crédit fournisseur,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form2,New Supplier Invoice,Nouvelle facture fournisseur,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form5,Opened Credit Notes,Notes de crédit ouvertes,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form5,Opened Invoices,Factures ouvertes,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Notes de crédit fournisseur ouvertes,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form5,Opened Supplier Invoices,Factures fournisseurs ouvertes,0
-model,"ir.ui.menu,name",menu_payment_terms_configuration,Payment Terms,Conditions de paiement,0
-model,"ir.ui.menu,name",menu_payment_term_form,Payment Terms,Conditions de paiement,0
-model,"ir.ui.menu,name",menu_invoice_out_credit_note_form4,Pro Forma Credit Notes,Notes de crédit pro forma,0
-model,"ir.ui.menu,name",menu_invoice_out_invoice_form4,Pro Forma Invoices,Factures pro forma,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Notes de crédit fournisseur pro forma,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Factures fournisseurs pro forma,0
-model,"ir.ui.menu,name",menu_invoice_in_credit_note_form,Supplier Credit Notes,Notes de crédit fournisseur,0
-model,"ir.ui.menu,name",menu_invoice_in_invoice_form,Supplier Invoices,Factures fournisseurs,0
-model,"workflow.activity,name",invoice_activity_cancel,Canceled,Annulé,0
-model,"workflow.activity,name",invoice_activity_draft,Draft,Brouillon,0
-model,"workflow.activity,name",invoice_activity_open,Open,Ouvert,0
-model,"workflow.activity,name",invoice_activity_paid,Paid,Payé,0
-model,"workflow.activity,name",invoice_activity_proforma,Pro forma,Pro forma,0
-model,"workflow,name",invoice_workflow,Invoice workflow,Workflow facture,0
-odt,account.invoice,0,Amount,Montant,0
-odt,account.invoice,0,Base,Base,0
-odt,account.invoice,0,Credit Note N°:,N° de note de crédit :,0
-odt,account.invoice,0,Date,Date,0
-odt,account.invoice,0,Date:,Date :,0
-odt,account.invoice,0,Description,Description,0
-odt,account.invoice,0,Description:,Description :,0
-odt,account.invoice,0,Draft Credit Note,Note de crédit brouillon,0
-odt,account.invoice,0,Draft Invoice,Facture brouillon,0
-odt,account.invoice,0,Draft Supplier Credit Note,Note de crédit fournisseur brouillon,0
-odt,account.invoice,0,Draft Supplier Invoice,Facture fournisseur brouillon,0
-odt,account.invoice,0,E-Mail:,E-Mail:,0
-odt,account.invoice,0,Invoice N°:,N° de facture :,0
-odt,account.invoice,0,Payment Term,Condition de paiement,0
-odt,account.invoice,0,Phone:,Téléphone,0
-odt,account.invoice,0,Pro forma Credit Note,Note de crédit pro forma,0
-odt,account.invoice,0,Pro forma Invoice,Facture pro forma,0
-odt,account.invoice,0,Pro forma Supplier Credit Note,Note de crédit fournisseur pro forma,0
-odt,account.invoice,0,Pro forma Supplier Invoice,Facture fournisseur pro forma,0
-odt,account.invoice,0,Quantity,Quantité,0
-odt,account.invoice,0,Supplier Credit Note N°:,N° de note de crédit fournisseur :,0
-odt,account.invoice,0,Supplier Invoice N°:,N° de facture fournisseur :,0
-odt,account.invoice,0,Tax,Taxe,0
-odt,account.invoice,0,Taxes,Taxes,0
-odt,account.invoice,0,Taxes:,Taxes :,0
-odt,account.invoice,0,Total:,Total :,0
-odt,account.invoice,0,Total (excl. taxes):,Total (hors-taxes) :,0
-odt,account.invoice,0,Unit Price,Prix unitaire,0
-odt,account.invoice,0,VAT:,TVA :,0
-selection,"account.invoice.line,invoice_type",0,Credit Note,Note de crédit,0
-selection,"account.invoice.line,invoice_type",0,Invoice,Facture,0
-selection,"account.invoice.line,invoice_type",0,Supplier Credit Note,Note de crédit fournisseur,0
-selection,"account.invoice.line,invoice_type",0,Supplier Invoice,Facture fournisseur,0
-selection,"account.invoice.line,type",0,Comment,Commentaire,0
-selection,"account.invoice.line,type",0,Line,Ligne,0
-selection,"account.invoice.line,type",0,Subtotal,Sous-total,0
-selection,"account.invoice.line,type",0,Title,Titre,0
-selection,"account.invoice.pay_invoice.ask,type",0,Partial Payment,Paiement partiel,0
-selection,"account.invoice.pay_invoice.ask,type",0,Write-Off,Pertes et profits,0
-selection,"account.invoice,state",0,Canceled,Annulé,0
-selection,"account.invoice,state",0,Draft,Brouillon,0
-selection,"account.invoice,state",0,Opened,Ouvert,0
-selection,"account.invoice,state",0,Paid,Payée,0
-selection,"account.invoice,state",0,Pro forma,Pro forma,0
-selection,"account.invoice,type",0,Credit Note,Note de crédit,0
-selection,"account.invoice,type",0,Invoice,Facture,0
-selection,"account.invoice,type",0,Supplier Credit Note,Note de crédit fournisseur,0
-selection,"account.invoice,type",0,Supplier Invoice,Facture fournisseur,0
-view,account.invoice,0,Amount Second Currency,Montant de devise secondaire,0
-view,account.invoice,0,_Cancel,_Annuler,0
-view,account.invoice,0,Credit,Crédit,0
-view,account.invoice,0,Debit,Débit,0
-view,account.invoice,0,_Draft,_Brouillon,0
-view,account.invoice,0,Invoice,Facture,0
-view,account.invoice,0,Invoices,Factures,0
-view,account.invoice,0,Lines,Lignes,0
-view,account.invoice,0,_Open,_Ouvrir,0
-view,account.invoice,0,Other Info,Autre information,0
-view,account.invoice,0,_Pay,_Payer,0
-view,account.invoice,0,Payment,Paiement,0
-view,account.invoice,0,Payment Lines,Lignes de paiement,0
-view,account.invoice,0,Pro For_ma,Pro For_ma,0
-view,account.invoice,0,_Reset to Draft,_Remettre en brouillon,0
-view,account.invoice,0,Taxes,Taxes,0
-view,account.invoice.credit_invoice.init,0,Are you sure to credit those/this invoice(s)?,Etes-vous sûr de vouloir créditer cette/ces factures ?,0
-view,account.invoice.credit_invoice.init,0,Credit Invoice,Facture de crédit,0
-view,account.invoice.line,0,General,Général,0
-view,account.invoice.line,0,Invoice Line,Ligne de facture,0
-view,account.invoice.line,0,Invoice Lines,Lignes de facture,0
-view,account.invoice.line,0,Notes,Notes,0
-view,account.invoice.line,0,Products,Produits,0
-view,account.invoice.pay_invoice.ask,0,Amount Second Currency,Montant en devise secondaire,0
-view,account.invoice.pay_invoice.ask,0,Credit,Crédit,0
-view,account.invoice.pay_invoice.ask,0,Debit,Débit,0
-view,account.invoice.pay_invoice.ask,0,Lines to Pay,Lignes à payer,0
-view,account.invoice.pay_invoice.ask,0,Pay Invoice,Payer la facture,0
-view,account.invoice.pay_invoice.ask,0,Payment Lines,Lignes de paiement,0
-view,account.invoice.pay_invoice.init,0,Pay Invoice,Payer la facture,0
-view,account.invoice.payment_term,0,Payment Term,Conditions de paiement,0
-view,account.invoice.payment_term,0,Payment Term Line,Ligne de condition de paiement,0
-view,account.invoice.payment_term,0,Payment Term Lines,Lignes de condition de paiement,0
-view,account.invoice.payment_term,0,Payment Terms,Conditions de paiement,0
-view,account.invoice.print_invoice_report.warning,0,<b>Warning!</b>,<b>Attention!</b>,0
-view,account.invoice.print_invoice_report.warning,0,Print Invoice,Imprimer la facture,0
-view,account.invoice.print_invoice_report.warning,0,The invoices will be sent <i>directly</i> to the printer.,Les factures seront envoyées <i>directement</i> à l'imprimante.,0
-view,account.invoice.print_invoice_report.warning,0,You have selected more than one invoice to print.,Vous avez sélectionné plus d'une facture à imprimer.,0
-view,account.invoice.tax,0,Invoice Tax,Taxes de le facture,0
-view,account.invoice.tax,0,Invoice Taxes,Taxes de le facture,0
-view,account.invoice.tax,0,Tax Code,Code de taxe,0
-view,party.party,0,Payment Terms,Conditions de paiement,0
-view,product.product,0,Taxes,Taxes,0
-wizard_button,"account.invoice.credit_invoice,init,credit",0,Credit,Créditer,0
-wizard_button,"account.invoice.credit_invoice,init,end",0,Cancel,Annuler,0
-wizard_button,"account.invoice.pay_invoice,ask,end",0,Cancel,Annuler,0
-wizard_button,"account.invoice.pay_invoice,ask,pay",0,Ok,Ok,0
-wizard_button,"account.invoice.pay_invoice,init,choice",0,Ok,Ok,0
-wizard_button,"account.invoice.pay_invoice,init,end",0,Cancel,Annuler,0
-wizard_button,"account.invoice.print_invoice_report,warning,end",0,Cancel,Annuler,0
-wizard_button,"account.invoice.print_invoice_report,warning,print",0,Print,Imprimer,0
+field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Comptes analytiques,0
diff --git a/invoice.odt b/invoice.odt
deleted file mode 100644
index f49be6f..0000000
Binary files a/invoice.odt and /dev/null differ
diff --git a/invoice.py b/invoice.py
index c1dc25a..ef9ec77 100644
--- a/invoice.py
+++ b/invoice.py
@@ -1,2518 +1,232 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
+#This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
 "Invoice"
-from trytond.model import ModelWorkflow, ModelView, ModelSQL, fields
-from trytond.report import Report
-from trytond.wizard import Wizard
-from trytond.backend import TableHandler
-from decimal import Decimal
-import base64
+from trytond.model import ModelView, ModelSQL, fields
 
-_STATES = {
-    'readonly': "state != 'draft'",
-}
 
-_TYPE = [
-    ('out_invoice', 'Invoice'),
-    ('in_invoice', 'Supplier Invoice'),
-    ('out_credit_note', 'Credit Note'),
-    ('in_credit_note', 'Supplier Credit Note'),
-]
-
-_TYPE2JOURNAL = {
-    'out_invoice': 'revenue',
-    'in_invoice': 'expense',
-    'out_credit_note': 'revenue',
-    'in_credit_note': 'expense',
-}
-
-
-class Invoice(ModelWorkflow, ModelSQL, ModelView):
-    'Invoice'
-    _name = 'account.invoice'
-    _description = __doc__
-    _order_name = 'number'
-    company = fields.Many2One('company.company', 'Company', required=True,
-            states=_STATES, domain="[('id', '=', context.get('company', 0))]")
-    type = fields.Selection(_TYPE, 'Type', select=1, on_change=['type'],
-            required=True, states={
-                'readonly': "state != 'draft' or context.get('type', False)" \
-                        " or (bool(lines) and bool(type))",
-            })
-    type_name = fields.Function('get_type_name', type='char', string='Type')
-    number = fields.Char('Number', size=None, readonly=True, select=1)
-    reference = fields.Char('Reference', size=None)
-    description = fields.Char('Description', size=None, states=_STATES)
-    state = fields.Selection([
-        ('draft', 'Draft'),
-        ('proforma', 'Pro forma'),
-        ('open', 'Opened'),
-        ('paid', 'Paid'),
-        ('cancel', 'Canceled'),
-        ], 'State', readonly=True)
-    invoice_date = fields.Date('Invoice Date', required=True,
-        states=_STATES)
-    accounting_date = fields.Date('Accounting Date', states=_STATES)
-    party = fields.Many2One('party.party', 'Party', change_default=True,
-        required=True, states=_STATES, on_change=['party', 'payment_term',
-            'type', 'company'])
-    party_lang = fields.Function('get_party_language', type='char',
-            string='Party Language', on_change_with=['party'])
-    invoice_address = fields.Many2One('party.address', 'Invoice Address',
-        required=True, states=_STATES, domain="[('party', '=', party)]")
-    currency = fields.Many2One('currency.currency', 'Currency', required=True,
-        states={
-            'readonly': "state != 'draft' or (bool(lines) and bool(currency))",
-        })
-    currency_digits = fields.Function('get_currency_digits', type='integer',
-            string='Currency Digits', on_change_with=['currency'])
-    journal = fields.Many2One('account.journal', 'Journal', required=True,
-        states=_STATES, domain=[('centralised', '=', False)])
-    move = fields.Many2One('account.move', 'Move', readonly=True)
-    account = fields.Many2One('account.account', 'Account', required=True,
-        states=_STATES,
-        domain="[('company', '=', company), ('kind', '!=', 'view')]")
-    payment_term = fields.Many2One('account.invoice.payment_term',
-        'Payment Term', required=True, states=_STATES)
-    lines = fields.One2Many('account.invoice.line', 'invoice', 'Lines',
-        states=_STATES, on_change=['lines', 'taxes', 'currency', 'party', 'type'])
-    taxes = fields.One2Many('account.invoice.tax', 'invoice', 'Tax Lines',
-        states=_STATES, on_change=['lines', 'taxes', 'currency', 'party', 'type'])
-    comment = fields.Text('Comment')
-    untaxed_amount = fields.Function('get_untaxed_amount', type='numeric',
-            digits="(16, currency_digits)", string='Untaxed',
-            fnct_search='search_untaxed_amount')
-    tax_amount = fields.Function('get_tax_amount', type='numeric',
-            digits="(16, currency_digits)", string='Tax',
-            fnct_search='search_tax_amount')
-    total_amount = fields.Function('get_total_amount', type='numeric',
-            digits="(16, currency_digits)", string='Total',
-            fnct_search='search_total_amount')
-    reconciled = fields.Function('get_reconciled', type='boolean',
-            string='Reconciled')
-    lines_to_pay = fields.Function('get_lines_to_pay', type='one2many',
-            relation='account.move.line', string='Lines to Pay')
-    payment_lines = fields.Many2Many('account.invoice-account.move.line',
-            'invoice', 'line', readonly=True, string='Payment Lines')
-    amount_to_pay_today = fields.Function('get_amount_to_pay',
-            type='numeric', digits="(16, currency_digits)",
-            string='Amount to Pay Today')
-    amount_to_pay = fields.Function('get_amount_to_pay',
-            type='numeric', digits="(16, currency_digits)",
-            string='Amount to Pay')
-    invoice_report = fields.Binary('Invoice Report', readonly=True)
-    invoice_report_format = fields.Char('Invoice Report Format', readonly=True)
+class InvoiceLine(ModelSQL, ModelView):
+    _name = 'account.invoice.line'
 
-    def __init__(self):
-        super(Invoice, self).__init__()
-        self._rpc.update({
-            'button_draft': True,
-        })
-        self._constraints += [
-            ('check_account', 'account_different_company'),
-            ('check_account2', 'same_account_on_line'),
-        ]
-        self._order.insert(0, ('number', 'DESC'))
-        self._order.insert(1, ('id', 'DESC'))
-        self._error_messages.update({
-            'reset_draft': 'You can not reset to draft ' \
-                    'an invoice that has move!',
-            'missing_tax_line': 'Taxes defined ' \
-                    'but not on invoice lines!\n' \
-                    'Re-compute the invoice.',
-            'diff_tax_line': 'Base taxes ' \
-                    'different from invoice lines!\n' \
-                    'Re-compute the invoice.',
-            'missing_tax_line2': 'Taxes defined ' \
-                    'on invoice lines but not on invoice!\n' \
-                    'Re-compute the invoice.',
-            'no_invoice_sequence': 'There is no invoice sequence ' \
-                    'on the period/fiscal year!',
-            'modify_invoice': 'You can not modify an invoice that is ' \
-                    'open, paid or canceled!',
-            'same_debit_account': 'The debit account on journal is ' \
-                    'the same than the invoice account!',
-            'missing_debit_account': 'The debit account on journal is ' \
-                    'missing!',
-            'same_credit_account': 'The credit account on journal is ' \
-                    'the same than the invoice account!',
-            'missing_credit_account': 'The credit account on journal is ' \
-                    'missing!',
-            'account_different_company': 'You can not create an invoice\n' \
-                    'with account from a different invoice company!',
-            'same_account_on_line': 'You can not use the same account\n' \
-                    'as on invoice line!',
+    analytic_accounts = fields.Many2One('analytic_account.account.selection',
+            'Analytic Accounts',
+            states={
+                'invisible': "type != 'line'",
             })
 
-    def default_type(self, cursor, user, context=None):
-        if context is None:
-            context = {}
-        return context.get('type', 'out_invoice')
-
-    def default_state(self, cursor, user, context=None):
-        return 'draft'
-
-    def default_invoice_date(self, cursor, user, context=None):
-        date_obj = self.pool.get('ir.date')
-        return date_obj.today(cursor, user, context=context)
-
-    def default_currency(self, cursor, user, context=None):
-        company_obj = self.pool.get('company.company')
-        currency_obj = self.pool.get('currency.currency')
-        if context is None:
-            context = {}
-        if context.get('company'):
-            company = company_obj.browse(cursor, user, context['company'],
-                    context=context)
-            return company.currency.id
-        return False
-
-    def default_currency_digits(self, cursor, user, context=None):
-        company_obj = self.pool.get('company.company')
-        if context is None:
-            context = {}
-        if context.get('company'):
-            company = company_obj.browse(cursor, user, context['company'],
-                    context=context)
-            return company.currency.digits
-        return 2
-
-    def default_company(self, cursor, user, context=None):
-        company_obj = self.pool.get('company.company')
-        if context is None:
-            context = {}
-        if context.get('company'):
-            return context['company']
-        return False
-
-    def default_payment_term(self, cursor, user, context=None):
-        payment_term_obj = self.pool.get('account.invoice.payment_term')
-        payment_term_ids = payment_term_obj.search(cursor, user,
-                self.payment_term.domain, context=context)
-        if len(payment_term_ids) == 1:
-            return payment_term_ids[0]
-        return False
-
-    def on_change_type(self, cursor, user, ids, vals, context=None):
-        journal_obj = self.pool.get('account.journal')
-        res = {}
-        journal_ids = journal_obj.search(cursor, user, [
-            ('type', '=', _TYPE2JOURNAL.get(vals.get('type', 'out_invoice'),
-                'revenue')),
-            ], limit=1, context=context)
-        if journal_ids:
-            journal = journal_obj.browse(cursor, user, journal_ids[0],
-                    context=context)
-            res['journal'] = journal.id
-            res['journal.rec_name'] = journal.rec_name
-        return res
-
-    def on_change_party(self, cursor, user, ids, vals, context=None):
-        party_obj = self.pool.get('party.party')
-        address_obj = self.pool.get('party.address')
-        account_obj = self.pool.get('account.account')
-        payment_term_obj = self.pool.get('account.invoice.payment_term')
-        company_obj = self.pool.get('company.company')
-        res = {
-            'invoice_address': False,
-            'account': False,
-        }
-        if vals.get('party'):
-            party = party_obj.browse(cursor, user, vals['party'],
-                    context=context)
-            res['invoice_address'] = party_obj.address_get(cursor, user,
-                    party.id, type='invoice', context=context)
-            if vals.get('type') in ('out_invoice', 'out_credit_note'):
-                res['account'] = party.account_receivable.id
-                if vals['type'] == 'out_invoice' and party.payment_term:
-                    res['payment_term'] = party.payment_term.id
-            elif vals.get('type') in ('in_invoice', 'in_credit_note'):
-                res['account'] = party.account_payable.id
-                if vals['type'] == 'in_invoice' and party.supplier_payment_term:
-                    res['payment_term'] = party.supplier_payment_term.id
-
-        if vals.get('company'):
-            company = company_obj.browse(cursor, user, vals['company'],
-                    context=context)
-            if vals.get('type') == 'out_credit_note':
-                res['payment_term'] = company.payment_term.id
-            elif vals.get('type') == 'in_credit_note':
-                res['payment_term'] = company.supplier_payment_term.id
-
-        if res['invoice_address']:
-            res['invoice_address.rec_name'] = address_obj.browse(cursor, user,
-                    res['invoice_address'], context=context).rec_name
-        if res['account']:
-            res['account.rec_name'] = account_obj.browse(cursor, user,
-                    res['account'], context=context).rec_name
-        if res.get('payment_term'):
-            res['payment_term.rec_name'] = payment_term_obj.browse(cursor, user,
-                    res['payment_term'], context=context).rec_name
-        return res
-
-    def on_change_with_currency_digits(self, cursor, user, ids, vals,
-            context=None):
-        currency_obj = self.pool.get('currency.currency')
-        if vals.get('currency'):
-            currency = currency_obj.browse(cursor, user, vals['currency'],
-                    context=context)
-            return currency.digits
-        return 2
-
-    def get_currency_digits(self, cursor, user, ids, name, arg, context=None):
-        res = {}
-        for invoice in self.browse(cursor, user, ids, context=context):
-            res[invoice.id] = invoice.currency.digits
-        return res
-
-    def on_change_with_party_lang(self, cursor, user, ids, vals, context=None):
-        party_obj = self.pool.get('party.party')
-        if vals.get('party'):
-            party = party_obj.browse(cursor, user, vals['party'],
-                    context=context)
-            if party.lang:
-                return party.lang.code
-        return 'en_US'
-
-    def get_party_language(self, cursor, user, ids, name, arg, context=None):
-        '''
-        Return the language code of the party of each invoice
-
-        :param cursor: the database cursor
-        :param user: the user id
-        :param ids: the ids of the invoices
-        :param context: the context
-        :return: a dictionary with invoice id as key and
-            language code as value
-        '''
-        res = {}
-        for invoice in self.browse(cursor, user, ids, context=context):
-            if invoice.party.lang:
-                res[invoice.id] = invoice.party.lang.code
-            else:
-                res[invoice.id] = 'en_US'
-        return res
-
-    def get_type_name(self, cursor, user, ids, name, arg, context=None):
-        res = {}
-        type2name = {}
-        for type, name in self.fields_get(cursor, user, fields_names=['type'],
-                context=context)['type']['selection']:
-            type2name[type] = name
-        for invoice in self.browse(cursor, user, ids, context=context):
-            res[invoice.id] = type2name[invoice.type]
-        return res
-
-    def on_change_lines(self, cursor, user, ids, vals, context=None):
-        return self._on_change_lines_taxes(cursor, user, ids, vals, context=context)
-
-    def on_change_taxes(self, cursor, user, ids, vals, context=None):
-        return self._on_change_lines_taxes(cursor, user, ids, vals, context=context)
-
-    def _on_change_lines_taxes(self, cursor, user, ids, vals, context=None):
-        currency_obj = self.pool.get('currency.currency')
-        tax_obj = self.pool.get('account.tax')
-        if context is None:
-            context = {}
-        res = {
-            'untaxed_amount': Decimal('0.0'),
-            'tax_amount': Decimal('0.0'),
-            'total_amount': Decimal('0.0'),
-            'taxes': {},
-        }
-        currency = None
-        if vals.get('currency'):
-            currency = currency_obj.browse(cursor, user, vals['currency'],
-                    context=context)
-        computed_taxes = {}
-        if vals.get('lines'):
-            ctx = context.copy()
-            ctx.update(self.get_tax_context(cursor, user, vals,
-                context=context))
-            for line in vals['lines']:
-                if line.get('type', 'line') != 'line':
-                    continue
-                res['untaxed_amount'] += line.get('amount', Decimal('0.0'))
-
-                for tax in tax_obj.compute(cursor, user, line.get('taxes', []),
-                        line.get('unit_price', Decimal('0.0')),
-                        line.get('quantity', 0.0), context=context):
-                    key, val = self._compute_tax(cursor, user, tax,
-                            vals.get('type', 'out_invoice'), context=context)
-                    if not key in computed_taxes:
-                        computed_taxes[key] = val
-                    else:
-                        computed_taxes[key]['base'] += val['base']
-                        computed_taxes[key]['amount'] += val['amount']
-        if currency:
-            for key in computed_taxes:
-                for field in ('base', 'amount'):
-                    computed_taxes[key][field] = currency_obj.round(cursor,
-                            user, currency, computed_taxes[key][field])
-        tax_keys = []
-        for tax in vals.get('taxes', []):
-            if tax.get('manual', False):
-                res['tax_amount'] += tax.get('amount', Decimal('0.0'))
-                continue
-            key = (tax.get('base_code'), tax.get('base_sign'),
-                    tax.get('tax_code'), tax.get('tax_sign'),
-                    tax.get('account'), tax.get('tax'))
-            if (key not in computed_taxes) or (key in tax_keys):
-                res['taxes'].setdefault('remove', [])
-                res['taxes']['remove'].append(tax.get('id'))
-                continue
-            tax_keys.append(key)
-            if currency:
-                if not currency_obj.is_zero(cursor, user, currency,
-                        computed_taxes[key]['base'] - \
-                                tax.get('base', Decimal('0.0'))):
-                    res['tax_amount'] += computed_taxes[key]['amount']
-                    res['taxes'].setdefault('update', [])
-                    res['taxes']['update'].append({
-                        'id': tax.get('id'),
-                        'amount': computed_taxes[key]['amount'],
-                        'base': computed_taxes[key]['base'],
-                        })
-                else:
-                    res['tax_amount'] += tax.get('amount', Decimal('0.0'))
-            else:
-                if computed_taxes[key]['base'] - \
-                        tax.get('base', Decimal('0.0')) != Decimal('0.0'):
-                    res['tax_amount'] += computed_taxes[key]['amount']
-                    res['taxes'].setdefault('update', [])
-                    res['taxes']['update'].append({
-                        'id': tax.get('id'),
-                        'amount': computed_taxes[key]['amount'],
-                        'base': computed_taxes[key]['base'],
-                        })
-                else:
-                    res['tax_amount'] += tax.get('amount', Decimal('0.0'))
-        for key in computed_taxes:
-            if key not in tax_keys:
-                res['tax_amount'] += computed_taxes[key]['amount']
-                res['taxes'].setdefault('add', [])
-                res['taxes']['add'].append(computed_taxes[key])
-        if currency:
-            res['untaxed_amount'] = currency_obj.round(cursor, user, currency,
-                    res['untaxed_amount'])
-            res['tax_amount'] = currency_obj.round(cursor, user, currency,
-                    res['tax_amount'])
-        res['total_amount'] = res['untaxed_amount'] + res['tax_amount']
-        if currency:
-            res['total_amount'] = currency_obj.round(cursor, user, currency,
-                    res['total_amount'])
-        return res
-
-    def get_untaxed_amount(self, cursor, user, ids, name, arg, context=None):
-        currency_obj = self.pool.get('currency.currency')
-        res = {}
-        for invoice in self.browse(cursor, user, ids, context=context):
-            res.setdefault(invoice.id, Decimal('0.0'))
-            for line in invoice.lines:
-                if line.type != 'line':
-                    continue
-                res[invoice.id] += line.amount
-            res[invoice.id] = currency_obj.round(cursor, user, invoice.currency,
-                    res[invoice.id])
-        return res
-
-    def get_tax_amount(self, cursor, user, ids, name, arg, context=None):
-        currency_obj = self.pool.get('currency.currency')
-        res = {}
-        cursor.execute('SELECT invoice, ' \
-                    'COALESCE(SUM(amount), 0)::DECIMAL ' \
-                'FROM account_invoice_tax ' \
-                'WHERE invoice IN (' + ','.join(['%s' for x in ids]) + ') ' \
-                'GROUP BY invoice', ids)
-        for invoice_id, sum in cursor.fetchall():
-            res[invoice_id] = sum
-
-        for invoice in self.browse(cursor, user, ids, context=context):
-            res.setdefault(invoice.id, Decimal('0.0'))
-            res[invoice.id] = currency_obj.round(cursor, user, invoice.currency,
-                    res[invoice.id])
-        return res
-
-    def get_total_amount(self, cursor, user, ids, name, arg, context=None):
-        currency_obj = self.pool.get('currency.currency')
-        res = {}
-        for invoice in self.browse(cursor, user, ids, context=context):
-            res[invoice.id] = currency_obj.round(cursor, user, invoice.currency,
-                    invoice.untaxed_amount + invoice.tax_amount)
-        return res
-
-    def get_reconciled(self, cursor, user, ids, name, arg, context=None):
-        res = {}
-        for invoice in self.browse(cursor, user, ids, context=context):
-            res[invoice.id] = True
-            if not invoice.lines_to_pay:
-                res[invoice.id] = False
-                continue
-            for line in invoice.lines_to_pay:
-                if not line.reconciliation:
-                    res[invoice.id] = False
-                    break
-        return res
-
-    def get_lines_to_pay(self, cursor, user, ids, name, args, context=None):
-        res = {}
-        for invoice in self.browse(cursor, user, ids, context=context):
-            lines = []
-            if invoice.move:
-                for line in invoice.move.lines:
-                    if line.account.id == invoice.account.id \
-                            and line.maturity_date:
-                        lines.append(line)
-            lines.sort(lambda x, y: cmp(x.maturity_date, y.maturity_date))
-            res[invoice.id] = [x.id for x in lines]
-        return res
-
-    def get_amount_to_pay(self, cursor, user, ids, name, arg,
-            context=None):
-        currency_obj = self.pool.get('currency.currency')
-        date_obj = self.pool.get('ir.date')
-
-        res = {}
-        for invoice in self.browse(cursor, user, ids, context=context):
-            amount = Decimal('0.0')
-            amount_currency = Decimal('0.0')
-            for line in invoice.lines_to_pay:
-                if line.reconciliation:
-                    continue
-                if name == 'amount_to_pay_today' \
-                        and line.maturity_date > date_obj.today(cursor, user,
-                                context=context):
-                    continue
-                if line.second_currency.id == invoice.currency.id:
-                    if line.debit - line.credit > Decimal('0.0'):
-                        amount_currency += line.amount_second_currency
-                    else:
-                        amount_currency -= line.amount_second_currency
-                else:
-                    amount += line.debit - line.credit
-            for line in invoice.payment_lines:
-                if line.reconciliation:
-                    continue
-                if line.second_currency.id == invoice.currency.id:
-                    if line.debit - line.credit > Decimal('0.0'):
-                        amount_currency += line.amount_second_currency
-                    else:
-                        amount_currency -= line.amount_second_currency
-                else:
-                    amount += line.debit - line.credit
-            if invoice.type in ('in_invoice', 'out_credit_note'):
-                amount = - amount
-                amount_currency = - amount_currency
-            if amount != Decimal('0.0'):
-                amount_currency += currency_obj.compute(cursor, user,
-                        invoice.company.currency, amount, invoice.currency,
-                        context=context)
-            if amount_currency < Decimal('0.0'):
-                amount_currency = Decimal('0.0')
-            res[invoice.id] = amount_currency
-        return res
-
-    def search_total_amount(self, cursor, user, name, args, context=None):
-        rule_obj = self.pool.get('ir.rule')
-        line_obj = self.pool.get('account.invoice.line')
-        tax_obj = self.pool.get('account.invoice.tax')
-
-        if not len(args):
-            return []
-
-        if context is None:
-            context = {}
-
-        invoice_query, invoice_val = rule_obj.domain_get(
-            cursor, user, 'account.invoice', context=context)
-
-        cursor.execute(
-            'SELECT invoice '\
-            'FROM ( '\
-               'SELECT invoice, COALESCE(SUM(quantity * unit_price), 0) as total_amount '\
-               'FROM "' + line_obj._table + '" '\
-                 'JOIN "' + self._table + '" on '\
-                     '("' + self._table + '".id = "' + line_obj._table + '".invoice) '\
-               'WHERE ' + invoice_query + ' '\
-               'GROUP BY invoice  '\
-             'UNION '\
-               'SELECT invoice, COALESCE(SUM(amount), 0) as total_amount '\
-               'FROM "' + tax_obj._table + '" '\
-                 'JOIN "' + self._table + '" on '\
-                     '("' + self._table + '".id = "' + tax_obj._table + '".invoice) '\
-               'WHERE ' + invoice_query + ' '\
-               'GROUP BY invoice  '\
-              ') as u '\
-             'GROUP BY u.invoice '\
-             'HAVING ' + \
-                'AND '.join(('(SUM(u.total_amount) ' + arg[1] + ' %s) ' \
-                                for arg in args)),
-            invoice_val + invoice_val + [arg[2] for arg in args])
-
-        if not cursor.rowcount:
-            return [('id', '=', 0)]
-        return [('id', 'in', [x[0] for x in cursor.fetchall()])]
-
-    def search_untaxed_amount(self, cursor, user, name, args, context=None):
-        rule_obj = self.pool.get('ir.rule')
-        line_obj = self.pool.get('account.invoice.line')
-        tax_obj = self.pool.get('account.invoice.tax')
-
-        if not len(args):
-            return []
-
-        if context is None:
-            context = {}
-
-        invoice_query, invoice_val = rule_obj.domain_get(
-            cursor, user, 'account.invoice', context=context)
-
-        cursor.execute(
-            'SELECT invoice '\
-            'FROM "' + line_obj._table + '" '\
-               'JOIN "' + self._table + '" on '\
-                   '("' + self._table + '".id = "' + line_obj._table + '".invoice) '\
-            'WHERE ' + invoice_query + ' '\
-            'GROUP BY invoice  '\
-            'HAVING ' + \
-              'AND '.join(('(COALESCE(SUM(quantity * unit_price), 0) ' + \
-                                arg[1] + ' %s) ' for arg in args)),
-            invoice_val + [arg[2] for arg in args])
-
-        if not cursor.rowcount:
-            return [('id', '=', 0)]
-        return [('id', 'in', [x[0] for x in cursor.fetchall()])]
-
-    def search_tax_amount(self, cursor, user, name, args, context=None):
-        rule_obj = self.pool.get('ir.rule')
-        line_obj = self.pool.get('account.invoice.line')
-        tax_obj = self.pool.get('account.invoice.tax')
-
-        if not len(args):
-            return []
-
-        if context is None:
-            context = {}
-
-        invoice_query, invoice_val = rule_obj.domain_get(
-            cursor, user, 'account.invoice', context=context)
+    def _view_look_dom_arch(self, cursor, user, tree, type, context=None):
+        analytic_account_obj = self.pool.get('analytic_account.account')
+        analytic_account_obj.convert_view(cursor, user, tree, context=context)
+        arch, fields = super(InvoiceLine, self)._view_look_dom_arch(cursor,
+                user, tree, type, context=context)
+        return arch, fields
 
-        cursor.execute(
-            'SELECT invoice '\
-            'FROM "' + tax_obj._table + '" '\
-             'JOIN "' + self._table + '" on '\
-                   '("' + self._table + '".id = "' + tax_obj._table + '".invoice) '\
-            'WHERE ' + invoice_query + ' '\
-            'GROUP BY invoice  '\
-            'HAVING ' + \
-              'AND '.join(('(COALESCE(SUM(amount), 0) ' + arg[1] + ' %s) ' \
-                                for arg in args)),
-            invoice_val + [arg[2] for arg in args])
+    def fields_get(self, cursor, user, fields_names=None, context=None):
+        analytic_account_obj = self.pool.get('analytic_account.account')
 
-        if not cursor.rowcount:
-            return [('id', '=', 0)]
-        return [('id', 'in', [x[0] for x in cursor.fetchall()])]
-
-    def button_draft(self, cursor, user, ids, context=None):
-        invoices = self.browse(cursor, user, ids, context=context)
-        for invoice in invoices:
-            if invoice.move:
-                self.raise_user_error(cursor, 'reset_draft',
-                        context=context)
-        self.workflow_trigger_create(cursor, user,
-                [x.id for x in invoices], context=context)
-        self.write(cursor, user, ids, {'state': 'draft'})
-        return True
-
-    def get_tax_context(self, cursor, user, invoice, context=None):
-        party_obj = self.pool.get('party.party')
-        res = {}
-        if isinstance(invoice, dict):
-            if invoice.get('party'):
-                party = party_obj.browse(cursor, user, invoice['party'],
-                        context=context)
-                if party.lang:
-                    res['language'] = party.lang.code
-        else:
-            if invoice.party.lang:
-                res['language'] = invoice.party.lang.code
-        return res
-
-    def _compute_tax(self, cursor, user, tax, invoice_type, context=None):
-        val = {}
-        val['manual'] = False
-        val['description'] = tax['tax'].description
-        val['base'] = tax['base']
-        val['amount'] = tax['amount']
-        val['tax'] = tax['tax'].id
-
-        if invoice_type in ('out_invoice', 'in_invoice'):
-            val['base_code'] = tax['tax'].invoice_base_code.id
-            val['base_sign'] = tax['tax'].invoice_base_sign
-            val['tax_code'] = tax['tax'].invoice_tax_code.id
-            val['tax_sign'] = tax['tax'].invoice_tax_sign
-            val['account'] = tax['tax'].invoice_account.id
-        else:
-            val['base_code'] = tax['tax'].credit_note_base_code.id
-            val['base_sign'] = tax['tax'].credit_note_base_sign
-            val['tax_code'] = tax['tax'].credit_note_tax_code.id
-            val['tax_sign'] = tax['tax'].credit_note_tax_sign
-            val['account'] = tax['tax'].credit_note_account.id
-        key = (val['base_code'], val['base_sign'],
-                val['tax_code'], val['tax_sign'],
-                val['account'], val['tax'])
-        return key, val
-
-    def _compute_taxes(self, cursor, user, invoice, context=None):
-        tax_obj = self.pool.get('account.tax')
-        currency_obj = self.pool.get('currency.currency')
-        if context is None:
-            context = {}
-
-        ctx = context.copy()
-        ctx.update(self.get_tax_context(cursor, user, invoice,
-            context=context))
-
-        res = {}
-        for line in invoice.lines:
-            # Don't round on each line to handle rounding error
-            if line.type != 'line':
-                continue
-            tax_ids = [x.id for x in line.taxes]
-            for tax in tax_obj.compute(cursor, user, tax_ids, line.unit_price,
-                    line.quantity, context=ctx):
-                key, val = self._compute_tax(cursor, user, tax, invoice.type,
-                        context=context)
-                val['invoice'] = invoice.id
-                if not key in res:
-                    res[key] = val
-                else:
-                    res[key]['base'] += val['base']
-                    res[key]['amount'] += val['amount']
-        for key in res:
-            for field in ('base', 'amount'):
-                res[key][field] = currency_obj.round(cursor,
-                        user, invoice.currency, res[key][field])
-        return res
-
-    def update_taxes(self, cursor, user, ids, context=None, exception=False):
-        tax_obj = self.pool.get('account.invoice.tax')
-        currency_obj = self.pool.get('currency.currency')
-        for invoice in self.browse(cursor, user, ids, context=context):
-            if invoice.state in ('open', 'paid', 'cancel'):
-                continue
-            computed_taxes = self._compute_taxes(cursor, user, invoice,
-                    context=context)
-            if not invoice.taxes:
-                for tax in computed_taxes.values():
-                    tax_obj.create(cursor, user, tax, context=context)
-            else:
-                tax_keys = []
-                for tax in invoice.taxes:
-                    if tax.manual:
-                        continue
-                    key = (tax.base_code.id, tax.base_sign,
-                            tax.tax_code.id, tax.tax_sign,
-                            tax.account.id, tax.tax.id)
-                    if (not key in computed_taxes) or (key in tax_keys):
-                        if exception:
-                            self.raise_user_error(cursor, 'missing_tax_line',
-                                    context=context)
-                        tax_obj.delete(cursor, user, tax.id,
-                                context=context)
-                        continue
-                    tax_keys.append(key)
-                    if not currency_obj.is_zero(cursor, user,
-                            invoice.currency,
-                            computed_taxes[key]['base'] - tax.base):
-                        if exception:
-                            self.raise_user_error(cursor, 'diff_tax_line',
-                                    context=context)
-                        tax_obj.write(cursor, user, tax.id,
-                                computed_taxes[key], context=context)
-                for key in computed_taxes:
-                    if not key in tax_keys:
-                        if exception:
-                            self.raise_user_error(cursor, 'missing_tax_line',
-                                    context=context)
-                        tax_obj.create(cursor, user, computed_taxes[key],
-                                context=context)
-        return True
-
-    def _get_move_line_invoice_line(self, cursor, user, invoice, context=None):
-        '''
-        Return list of move line values for each invoice lines
-        '''
-        line_obj = self.pool.get('account.invoice.line')
-        res = []
-        for line in invoice.lines:
-            val = line_obj.get_move_line(cursor, user, line,
-                    context=context)
-            if val:
-                res.append(val)
-        return res
-
-    def _get_move_line_invoice_tax(self, cursor, user, invoice, context=None):
-        '''
-        Return list of move line values for each invoice taxes
-        '''
-        tax_obj = self.pool.get('account.invoice.tax')
-        res = []
-        for tax in invoice.taxes:
-            val = tax_obj.get_move_line(cursor, user, tax,
-                    context=context)
-            res.append(val)
-        return res
-
-    def _get_move_line(self, cursor, user, invoice, date, amount, context=None):
-        '''
-        Return move line
-        '''
-        currency_obj = self.pool.get('currency.currency')
-        res = {}
-        if invoice.currency.id != invoice.company.currency.id:
-            res['amount_second_currency'] = currency_obj.compute(cursor, user,
-                    invoice.company.currency, amount,
-                    invoice.currency, context=context)
-            res['amount_second_currency'] = abs(res['amount_second_currency'])
-            res['second_currency'] = invoice.currency.id
-        else:
-            res['amount_second_currency'] = Decimal('0.0')
-            res['second_currency'] = False
-        if amount >= Decimal('0.0'):
-            res['debit'] = Decimal('0.0')
-            res['credit'] = amount
-        else:
-            res['debit'] = - amount
-            res['credit'] = Decimal('0.0')
-        res['account'] = invoice.account.id
-        res['maturity_date'] = date
-        res['reference'] = invoice.reference
-        res['name'] = invoice.number
-        res['party'] = invoice.party.id
-        return res
-
-    def create_move(self, cursor, user, invoice_id, context=None):
-        tax_obj = self.pool.get('account.invoice.tax')
-        payment_term_obj = self.pool.get('account.invoice.payment_term')
-        currency_obj = self.pool.get('currency.currency')
-        move_obj = self.pool.get('account.move')
-        period_obj = self.pool.get('account.period')
-
-        invoice = self.browse(cursor, user, invoice_id, context=context)
-        if invoice.move:
-            return True
-        self.update_taxes(cursor, user, [invoice.id], context=context,
-                exception=True)
-        move_lines = self._get_move_line_invoice_line(cursor, user, invoice,
-                context=context)
-        move_lines += self._get_move_line_invoice_tax(cursor, user, invoice,
+        res = super(InvoiceLine, self).fields_get(cursor, user, fields_names,
                 context=context)
 
-        total = Decimal('0.0')
-        total_currency = Decimal('0.0')
-        for line in move_lines:
-            total += line['debit'] - line['credit']
-            total_currency += line['amount_second_currency']
-
-        term_lines = payment_term_obj.compute(cursor, user, total,
-                invoice.company.currency, invoice.payment_term,
-                invoice.invoice_date, context=context)
-        remainder_total_currency = total_currency
-        for date, amount in term_lines:
-            val = self._get_move_line(cursor, user, invoice, date, amount,
-                    context=None)
-            remainder_total_currency -= val['amount_second_currency']
-            move_lines.append(val)
-        if not currency_obj.is_zero(cursor, user, invoice.currency,
-                remainder_total_currency):
-            move_lines[-1]['amount_second_currency'] += remainder_total_currency
+        analytic_accounts_field = super(InvoiceLine, self).fields_get(cursor,
+                user, ['analytic_accounts'],
+                context=context)['analytic_accounts']
 
-        accounting_date = invoice.accounting_date or invoice.invoice_date
-        period_id = period_obj.find(cursor, user, invoice.company.id,
-                date=accounting_date, context=context)
-
-        move_id = move_obj.create(cursor, user, {
-            'journal': invoice.journal.id,
-            'period': period_id,
-            'date': accounting_date,
-            'lines': [('create', x) for x in move_lines],
-            }, context=context)
-        self.write(cursor, user, invoice.id, {
-            'move': move_id,
-            }, context=context)
-        move_obj.post(cursor, user, move_id, context=context)
-        return move_id
-
-    def set_number(self, cursor, user, invoice_id, context=None):
-        period_obj = self.pool.get('account.period')
-        sequence_obj = self.pool.get('ir.sequence.strict')
-
-        if context is None:
-            context = {}
-
-        invoice = self.browse(cursor, user, invoice_id, context=context)
-
-        if invoice.number:
-            return True
-
-        test_state = True
-        if invoice.type in ('in_invoice', 'in_credit_note'):
-            test_state = False
-
-        period_id = period_obj.find(cursor, user, invoice.company.id,
-                date=invoice.invoice_date, test_state=test_state,
-                context=context)
-        period = period_obj.browse(cursor, user, period_id, context=context)
-        sequence_id = period[invoice.type + '_sequence'].id
-        if not sequence_id:
-            self.raise_user_error(cursor, 'no_invoice_sequence',
-                    context=context)
-        ctx = context.copy()
-        ctx['date'] = invoice.invoice_date
-        number = sequence_obj.get_id(cursor, user, sequence_id, context=ctx)
-        self.write(cursor, user, invoice_id, {
-            'number': number,
-            }, context=context)
-        return True
-
-    def check_modify(self, cursor, user, ids, context=None):
-        '''
-        Check if the invoices can be modified
-        '''
-        for invoice in self.browse(cursor, user, ids, context=context):
-            if invoice.state in ('open', 'paid'):
-                self.raise_user_error(cursor, 'modify_invoice',
-                        context=context)
-        return
-
-    def get_rec_name(self, cursor, user, ids, name, arg, context=None):
-        if not ids:
-            return {}
-        res = {}
-        for invoice in self.browse(cursor, user, ids, context=context):
-            res[invoice.id] = invoice.number or unicode(invoice.id) + \
-                    (invoice.reference and (' ' + invoice.reference) or '') + \
-                    ' ' + invoice.party.rec_name
+        res.update(analytic_account_obj.analytic_accounts_fields_get(cursor,
+            user, analytic_accounts_field, fields_names, context=context))
         return res
 
-    def search_rec_name(self, cursor, user, name, args, context=None):
-        args2 = []
-        i = 0
-        while i < len(args):
-            ids = self.search(cursor, user, ['OR',
-                ('number', args[i][1], args[i][2]),
-                ('reference', args[i][1], args[i][2]),
-                ], limit=1, context=context)
-            if ids:
-                args2.append(('number', args[i][1], args[i][2]))
-            else:
-                args2.append(('party', args[i][1], args[i][2]))
-            i += 1
-        return args2
-
-    def delete(self, cursor, user, ids, context=None):
-        if not ids:
-            return True
-        if isinstance(ids, (int, long)):
-            ids = [ids]
-        self.check_modify(cursor, user, ids, context=context)
-        return super(Invoice, self).delete(cursor, user, ids,
-                context=context)
-
-    def write(self, cursor, user, ids, vals, context=None):
-        if isinstance(ids, (int, long)):
-            ids = [ids]
-        keys = vals.keys()
-        for key in ('state', 'payment_lines',
-                'invoice_report', 'invoice_report_format'):
-            if key in keys:
-                keys.remove(key)
-        if len(keys):
-            self.check_modify(cursor, user, ids, context=context)
-        update_tax_ids = [x.id for x in self.browse(cursor, user, ids,
-            context=context) if x.state == 'draft']
-        res = super(Invoice, self).write(cursor, user, ids, vals,
-                context=context)
-        if update_tax_ids:
-            self.update_taxes(cursor, user, update_tax_ids, context=context)
-        if 'state' in vals and vals['state'] in ('paid', 'cancel'):
-            self.workflow_trigger_trigger(cursor, user, ids, context=context)
-        return res
-
-    def copy(self, cursor, user, ids, default=None, context=None):
-        line_obj = self.pool.get('account.invoice.line')
-        tax_obj = self.pool.get('account.invoice.tax')
-        date_obj = self.pool.get('ir.date')
+    def read(self, cursor, user, ids, fields_names=None, context=None):
+        selection_obj = self.pool.get('analytic_account.account.selection')
 
         int_id = False
         if isinstance(ids, (int, long)):
             int_id = True
             ids = [ids]
 
-        if default is None:
-            default = {}
-        default = default.copy()
-        default['state'] = 'draft'
-        default['number'] = False
-        default['move'] = False
-        default['invoice_report'] = False
-        default['invoice_report_format'] = False
-        default['payment_lines'] = False
-        default['lines'] = False
-        default['taxes'] = False
-        default['invoice_date'] = date_obj.today(cursor, user, context=context)
-        default['accounting_date'] = False
-        default['lines_to_pay'] = False
-
-        new_ids = []
-        for invoice in self.browse(cursor, user, ids, context=context):
-            new_id = super(Invoice, self).copy(cursor, user, invoice.id,
-                    default=default, context=context)
-            line_obj.copy(cursor, user, [x.id for x in invoice.lines], default={
-                'invoice': new_id,
-                }, context=context)
-            tax_obj.copy(cursor, user, [x.id for x in invoice.taxes], default={
-                'invoice': new_id,
-                }, context=context)
-            new_ids.append(new_id)
-
-        if int_id:
-            return new_ids[0]
-        return new_ids
-
-    def check_account(self, cursor, user, ids):
-        for invoice in self.browse(cursor, user, ids):
-            if invoice.account.company.id != invoice.company.id:
-                return False
-        return True
-
-    def check_account2(self, cursor, user, ids):
-        for invoice in self.browse(cursor, user, ids):
-            for line in invoice.lines:
-                if line.type == 'line' \
-                        and line.account.id == invoice.account.id:
-                    return False
-        return True
-
-    def get_reconcile_lines_for_amount(self, cursor, user, invoice, amount,
-            exclude_ids=None, context=None):
-        '''
-        Return list of line ids and the remainder to make reconciliation.
-        '''
-        currency_obj = self.pool.get('currency.currency')
-
-        if exclude_ids is None:
-            exclude_ids = []
-        payment_amount = Decimal('0.0')
-        remainder = invoice.total_amount
-        lines = []
-        payment_lines = []
-
-        for line in invoice.payment_lines:
-            if line.reconciliation:
-                continue
-            payment_amount += line.debit - line.credit
-            payment_lines.append(line.id)
-
-        if invoice.type in ('out_invoice', 'in_credit_note'):
-            amount = - abs(amount)
-        else:
-            amount = abs(amount)
-
-        for line in invoice.lines_to_pay:
-
-            if line.reconciliation:
-                continue
-            if line.id in exclude_ids:
-                continue
-
-            test_amount = amount + (line.debit - line.credit)
-            if currency_obj.is_zero(cursor, user, invoice.currency,
-                    test_amount):
-                return ([line.id], Decimal('0.0'))
-            if abs(test_amount) < abs(remainder):
-                lines = [line.id]
-                remainder = test_amount
-
-            test_amount = (amount + payment_amount) + (line.debit - line.credit)
-            if currency_obj.is_zero(cursor, user, invoice.currency,
-                    test_amount):
-                return ([line.id] + payment_lines, Decimal('0.0'))
-            if abs(test_amount) < abs(remainder):
-                lines = [line.id] + payment_lines
-                remainder = test_amount
-
-            exclude_ids2 = exclude_ids[:]
-            exclude_ids2.append(line.id)
-            res = self.get_reconcile_lines_for_amount(cursor, user, invoice,
-                    (amount + (line.debit - line.credit)),
-                    exclude_ids=exclude_ids2, context=context)
-            if res[1] == Decimal('0.0'):
-                res[0].append(line.id)
-                return res
-            if abs(res[1]) < abs(remainder):
-                res[0].append(line.id)
-                lines = res[0]
-                remainder = res[1]
-
-        return (lines, remainder)
-
-    def pay_invoice(self, cursor, user, invoice_id, amount, journal_id, date,
-            description, amount_second_currency=False, second_currency=False,
-            context=None):
-        '''
-        Add a payment to an invoice
-
-        :param cursor: the database cursor
-        :param invoice_id: the invoice id
-        :param amount: the amount to pay
-        :param journal_id: the journal id for the move
-        :param date: the date of the move
-        :param description: the description of the move
-        :param amount_second_currency: the amount in the second currenry if one
-        :param second_currency: the id of the second currency
-        :param context: the context
-        :return: the id of the payment line
-        '''
-        journal_obj = self.pool.get('account.journal')
-        move_obj = self.pool.get('account.move')
-        period_obj = self.pool.get('account.period')
-
-        lines = []
-        invoice = self.browse(cursor, user, invoice_id, context=context)
-        journal = journal_obj.browse(cursor, user, journal_id, context=context)
-
-        if invoice.type in ('out_invoice', 'in_credit_note'):
-            lines.append({
-                'name': description,
-                'account': invoice.account.id,
-                'party': invoice.party.id,
-                'debit': Decimal('0.0'),
-                'credit': amount,
-                'amount_second_currency': amount_second_currency,
-                'second_currency': second_currency,
-            })
-            lines.append({
-                'name': description,
-                'account': journal.debit_account.id,
-                'party': invoice.party.id,
-                'debit': amount,
-                'credit': Decimal('0.0'),
-                'amount_second_currency': amount_second_currency,
-                'second_currency': second_currency,
-            })
-            if invoice.account.id == journal.debit_account.id:
-                self.raise_user_error(cursor, 'same_debit_account',
-                        context=context)
-            if not journal.debit_account:
-                self.raise_user_error(cursor, 'missing_debit_account',
-                        context=context)
-        else:
-            lines.append({
-                'name': description,
-                'account': invoice.account.id,
-                'party': invoice.party.id,
-                'debit': amount,
-                'credit': Decimal('0.0'),
-                'amount_second_currency': amount_second_currency,
-                'second_currency': second_currency,
-            })
-            lines.append({
-                'name': description,
-                'account': journal.credit_account.id,
-                'party': invoice.party.id,
-                'debit': Decimal('0.0'),
-                'credit': amount,
-                'amount_second_currency': amount_second_currency,
-                'second_currency': second_currency,
-            })
-            if invoice.account.id == journal.debit_account.id:
-                self.raise_user_error(cursor, 'same_credit_account',
-                        context=context)
-            if not journal.credit_account:
-                self.raise_user_error(cursor, 'missing_credit_account',
-                        context=context)
-
-        period_id = period_obj.find(cursor, user, invoice.company.id,
-                date=date, context=context)
-
-        move_id = move_obj.create(cursor, user, {
-            'journal': journal.id,
-            'period': period_id,
-            'date': date,
-            'lines': [('create', x) for x in lines],
-            }, context=context)
-
-        move = move_obj.browse(cursor, user, move_id, context=context)
-
-        for line in move.lines:
-            if line.account.id == invoice.account.id:
-                self.write(cursor, user, invoice.id, {
-                    'payment_lines': [('add', line.id)],
-                    }, context=context)
-                return line.id
-        raise Exception('Missing account')
-
-    def print_invoice(self, cursor, user, invoice_id, context=None):
-        '''
-        Generate invoice report and store it in invoice_report field.
-        '''
-        invoice_report = self.pool.get('account.invoice', type='report')
-        val = invoice_report.execute(cursor, user, [invoice_id],
-                {'id': invoice_id}, context=context)
-        self.write(cursor, user, invoice_id, {
-            'invoice_report_format': val[0],
-            'invoice_report': val[1],
-            }, context=context)
-        return
-
-    def _credit(self, cursor, user, invoice, context=None):
-        '''
-        Return values to credit invoice.
-        '''
-        invoice_line_obj = self.pool.get('account.invoice.line')
-        invoice_tax_obj = self.pool.get('account.invoice.tax')
-
-        res = {}
-        if invoice.type == 'out_invoice':
-            res['type'] = 'out_credit_note'
-        elif invoice.type == 'in_invoice':
-            res['type'] = 'in_credit_note'
-        elif invoice.type == 'out_credit_note':
-            res['type'] = 'out_invoice'
-        elif invoice.type == 'in_credit_note':
-            res['type'] = 'in_invoice'
-
-        for field in ('description', 'comment'):
-            res[field] = invoice[field]
-
-        res['reference'] = invoice.number or invoice.reference
-
-        for field in ('company', 'party', 'invoice_address', 'currency',
-                'journal', 'account', 'payment_term'):
-            res[field] = invoice[field].id
-
-        res['lines'] = []
-        for line in invoice.lines:
-            value = invoice_line_obj._credit(cursor, user, line,
-                    context=context)
-            res['lines'].append(('create', value))
-
-        res['taxes'] = []
-        for tax in invoice.taxes:
-            if not tax.manual:
-                continue
-            value = invoice_tax_obj._credit(cursor, user, tax,
-                    context=context)
-            res[taxes].append(('create', value))
-        return res
-
-    def credit(self, cursor, user, ids, refund=False, context=None):
-        '''
-        Credit invoices and return ids of new invoices.
-
-        :param cursor: the database cursor
-        :param user: the user id
-        :param ids: a list of invoice id
-        :param refund: a boolean to specify the refund
-        :param context: the context
-        :return: the list of new invoice id
-        '''
-        move_line_obj = self.pool.get('account.move.line')
-
-        new_ids = []
-        for invoice in self.browse(cursor, user, ids, context=context):
-            vals = self._credit(cursor, user, invoice, context=context)
-            new_id = self.create(cursor, user, vals, context=context)
-            new_ids.append(new_id)
-            if refund:
-                self.workflow_trigger_validate(cursor, user, new_id, 'open',
-                        context=context)
-                new_invoice = self.browse(cursor, user, new_id, context=context)
-                if new_invoice.state == 'open':
-                    line_ids = [x.id for x in invoice.lines_to_pay
-                            if not x.reconciliation] + \
-                                    [x.id for x in new_invoice.lines_to_pay
-                                            if not x.reconciliation]
-                    move_line_obj.reconcile(cursor, user, line_ids,
-                            context=context)
-        return new_ids
-
-Invoice()
-
-
-class InvoicePaymentLine(ModelSQL):
-    'Invoice - Payment Line'
-    _name = 'account.invoice-account.move.line'
-    _description = __doc__
-    invoice = fields.Many2One('account.invoice', 'Invoice', ondelete='CASCADE',
-            select=1, required=True)
-    line = fields.Many2One('account.move.line', 'Payment Line',
-            ondelete='CASCADE', select=1, required=True)
-
-InvoicePaymentLine()
-
-
-class InvoiceLine(ModelSQL, ModelView):
-    'Invoice Line'
-    _name = 'account.invoice.line'
-    _rec_name = 'description'
-    _description = __doc__
-
-    invoice = fields.Many2One('account.invoice', 'Invoice', ondelete='CASCADE',
-            select=1, states={
-            'required': "not bool(globals().get('invoice_type')) " \
-                    "and bool(globals().get('party')) " \
-                    "and bool(globals().get('currency')) " \
-                    "and bool(globals().get('company'))",
-            'invisible': "context.get('standalone', False)",
-        })
-    invoice_type = fields.Selection(_TYPE, 'Invoice Type', select=1, states={
-        'readonly': "context.get('type', False) or bool(type)",
-        'required': "not bool(invoice)",
-        })
-    party = fields.Many2One('party.party', 'Party', select=1, states={
-        'required': "not bool(invoice)",
-        })
-    currency = fields.Many2One('currency.currency', 'Currency', states={
-        'required': "not bool(invoice)",
-        })
-    currency_digits = fields.Function('get_currency_digits', type='integer',
-            string='Currency Digits', on_change_with=['currency'])
-    company = fields.Many2One('company.company', 'Company', states={
-        'required': "not bool(invoice)",
-        }, domain="[('id', '=', context.get('company', 0))]")
-
-    sequence = fields.Integer('Sequence', states={
-            'invisible': "context.get('standalone', False)",
-        })
-    type = fields.Selection([
-        ('line', 'Line'),
-        ('subtotal', 'Subtotal'),
-        ('title', 'Title'),
-        ('comment', 'Comment'),
-        ], 'Type', select=1, required=True, states={
-            'invisible': "context.get('standalone', False)",
-        })
-    quantity = fields.Float('Quantity',
-            digits="(16, unit_digits)",
-            states={
-                'invisible': "type != 'line'",
-                'required': "type == 'line'",
-            })
-    unit = fields.Many2One('product.uom', 'Unit',
-            states={
-                'required': "product",
-                'invisible': "type != 'line'",
-            }, domain="[('category', '=', " \
-                    "(product, 'product.default_uom.category'))]",
-            context="{'category': (product, 'product.default_uom.category')}")
-    unit_digits = fields.Function('get_unit_digits', type='integer',
-            string='Unit Digits', on_change_with=['unit'])
-    product = fields.Many2One('product.product', 'Product',
-            states={
-                'invisible': "type != 'line'",
-            }, on_change=['product', 'unit', 'quantity', 'description',
-                '_parent_invoice.type', '_parent_invoice.party',
-                '_parent_invoice.currency', 'party', 'currency'])
-    account = fields.Many2One('account.account', 'Account',
-            domain="[('kind', '!=', 'view'), " \
-                    "('company', '=', " \
-                        "globals().get('_parent_invoice') and " \
-                        "globals().get('_parent_invoice').company or " \
-                        "globals()['company']), " \
-                    "('id', '!=', globals().get('_parent_invoice') and " \
-                        "globals().get('_parent_invoice').account or 0)]",
-            states={
-                'invisible': "type != 'line'",
-                'required': "type == 'line'",
-            })
-    unit_price = fields.Numeric('Unit Price', digits=(16, 4),
-            states={
-                'invisible': "type != 'line'",
-                'required': "type == 'line'",
-            })
-    amount = fields.Function('get_amount', type='numeric', string='Amount',
-            digits="(16, globals().get('_parent_invoice') and " \
-                        "globals().get('_parent_invoice').currency_digits or " \
-                        "globals()['currency_digits'])",
-            states={
-                'invisible': "type not in ('line', 'subtotal')",
-            }, on_change_with=['type', 'quantity', 'unit_price',
-                '_parent_invoice.currency', 'currency'])
-    description = fields.Text('Description', size=None, required=True)
-    note = fields.Text('Note')
-    taxes = fields.Many2Many('account.invoice.line-account.tax',
-            'line', 'tax', 'Taxes', domain=[('parent', '=', False)],
-            states={
-                'invisible': "type != 'line'",
-            })
-    invoice_taxes = fields.Function('get_invoice_taxes', type='many2many',
-            relation='account.invoice.tax', string='Invoice Taxes')
-
-    def __init__(self):
-        super(InvoiceLine, self).__init__()
-        self._sql_constraints += [
-            ('type_account',
-                'CHECK((type = \'line\' AND account IS NOT NULL) ' \
-                        'OR (type != \'line\'))',
-                'Line with "line" type must have an account!'),
-            ('type_invoice',
-                'CHECK((type != \'line\' AND invoice IS NOT NULL) ' \
-                        'OR (type = \'line\'))',
-                'Line without "line" type must have an invoice!'),
-        ]
-        self._constraints += [
-            ('check_account', 'account_different_company'),
-            ('check_account2', 'same_account_on_invoice'),
-        ]
-        self._order.insert(0, ('sequence', 'ASC'))
-        self._error_messages.update({
-            'modify': 'You can not modify line from an invoice ' \
-                    'that is open, paid or canceled!',
-            'create': 'You can not add a line to an invoice ' \
-                    'that is open, paid or canceled!',
-            'account_different_company': 'You can not create invoice line\n' \
-                    'with account with a different invoice company!',
-            'same_account_on_invoice': 'You can not use the same account\n' \
-                    'as on the invoice!',
-            })
-
-    def init(self, cursor, module_name):
-        super(InvoiceLine, self).init(cursor, module_name)
-        table = TableHandler(cursor, self, module_name)
-
-        # Migration from 1.0 invoice is no more required
-        table.not_null_action('invoice', action='remove')
-
-    def default_invoice_type(self, cursor, user, context=None):
-        if context is None:
-            context = {}
-        return context.get('invoice_type', 'out_invoice')
-
-    def default_currency(self, cursor, user, context=None):
-        company_obj = self.pool.get('company.company')
-        currency_obj = self.pool.get('currency.currency')
-        if context is None:
-            context = {}
-        if context.get('company'):
-            company = company_obj.browse(cursor, user, context['company'],
-                    context=context)
-            return company.currency.id
-        return False
-
-    def default_currency_digits(self, cursor, user, context=None):
-        company_obj = self.pool.get('company.company')
-        if context is None:
-            context = {}
-        if context.get('company'):
-            company = company_obj.browse(cursor, user, context['company'],
-                    context=context)
-            return company.currency.digits
-        return 2
-
-    def default_company(self, cursor, user, context=None):
-        company_obj = self.pool.get('company.company')
-        if context is None:
-            context = {}
-        if context.get('company'):
-            return context['company']
-        return False
-
-    def default_type(self, cursor, user, context=None):
-        return 'line'
-
-    def default_quantity(self, cursor, user, context=None):
-        return 0.0
-
-    def default_unit_price(self, cursor, user, context=None):
-        return Decimal('0.0')
-
-    def on_change_with_amount(self, cursor, user, ids, vals, context=None):
-        currency_obj = self.pool.get('currency.currency')
-        if vals.get('type') == 'line':
-            currency = vals.get('_parent_invoice.currency', vals.get('currency'))
-            if isinstance(currency, (int, long)):
-                currency = currency_obj.browse(cursor, user, currency,
-                        context=context)
-            amount = Decimal(str(vals.get('quantity') or '0.0')) * \
-                    (vals.get('unit_price') or Decimal('0.0'))
-            if currency:
-                return currency_obj.round(cursor, user, currency, amount)
-            return amount
-        return Decimal('0.0')
-
-    def on_change_with_unit_digits(self, cursor, user, ids, vals,
-            context=None):
-        uom_obj = self.pool.get('product.uom')
-        if vals.get('unit'):
-            uom = uom_obj.browse(cursor, user, vals['unit'],
-                    context=context)
-            return uom.digits
-        return 2
-
-    def get_unit_digits(self, cursor, user, ids, name, arg, context=None):
-        res = {}
-        for line in self.browse(cursor, user, ids, context=context):
-            if line.unit:
-                res[line.id] = line.unit.digits
-            else:
-                res[line.id] = 2
-        return res
-
-    def on_change_with_currency_digits(self, cursor, user, ids, vals,
-            context=None):
-        currency_obj = self.pool.get('currency.currency')
-        if vals.get('currency'):
-            currency = currency_obj.browse(cursor, user, vals['currency'],
-                    context=context)
-            return currency.digits
-        return 2
-
-    def get_currency_digits(self, cursor, user, ids, name, arg, context=None):
-        res = {}
-        for line in self.browse(cursor, user, ids, context=context):
-            res[line.id] = line.currency and line.currency.digits or 2
-        return res
-
-    def get_amount(self, cursor, user, ids, name, arg, context=None):
-        currency_obj = self.pool.get('currency.currency')
-        res = {}
-        for line in self.browse(cursor, user, ids, context=context):
-            if line.type == 'line':
-                currency = line.invoice and line.invoice.currency \
-                        or line.currency
-                res[line.id] = currency_obj.round(cursor, user, currency,
-                        Decimal(str(line.quantity)) * line.unit_price)
-            elif line.type == 'subtotal':
-                res[line.id] = Decimal('0.0')
-                for line2 in line.invoice.lines:
-                    if line2.type == 'line':
-                        res[line.id] += currency_obj.round(cursor, user,
-                                line2.invoice.currency,
-                                Decimal(str(line2.quantity)) * line2.unit_price)
-                    elif line2.type == 'subtotal':
-                        if line.id == line2.id:
-                            break
-                        res[line.id] = Decimal('0.0')
-            else:
-                res[line.id] = Decimal('0.0')
-        return res
-
-    def get_invoice_taxes(self, cursor, user, ids, name, arg, context=None):
-        tax_obj = self.pool.get('account.tax')
-        invoice_obj = self.pool.get('account.invoice')
-
-        if context is None:
-            context = {}
-
-        res = {}
-        for line in self.browse(cursor, user, ids, context=context):
-            ctx = context.copy()
-            ctx.update(invoice_obj.get_tax_context(cursor, user, line.invoice,
-                context=context))
-            tax_ids = [x.id for x in line.taxes]
-            taxes_keys = []
-            for tax in tax_obj.compute(cursor, user, tax_ids, line.unit_price,
-                    line.quantity, context=ctx):
-                key, _ = invoice_obj._compute_tax(cursor, user, tax,
-                        line.invoice.type, context=context)
-                taxes_keys.append(key)
-            res[line.id] = []
-            for tax in line.invoice.taxes:
-                if tax.manual:
-                    continue
-                key = (tax.base_code.id, tax.base_sign,
-                        tax.tax_code.id, tax.tax_sign,
-                        tax.account.id, tax.tax.id)
-                if key in taxes_keys:
-                    res[line.id].append(tax.id)
-        return res
-
-    def _get_tax_rule_pattern(self, cursor, user, party, vals, context=None):
-        '''
-        Get tax rule pattern
-
-        :param cursor: the database cursor
-        :param user: the user id
-        :param party: the BrowseRecord of the party
-        :param vals: a dictionary with value from on_change
-        :param context: the context
-        :return: a dictionary to use as pattern for tax rule
-        '''
-        res = {}
-        return res
-
-    def on_change_product(self, cursor, user, ids, vals, context=None):
-        product_obj = self.pool.get('product.product')
-        party_obj = self.pool.get('party.party')
-        account_obj = self.pool.get('account.account')
-        uom_obj = self.pool.get('product.uom')
-        company_obj = self.pool.get('company.company')
-        currency_obj = self.pool.get('currency.currency')
-        tax_rule_obj = self.pool.get('account.tax.rule')
-
-        if context is None:
-            context = {}
-        if not vals.get('product'):
-            return {}
-        res = {}
-
-        ctx = context.copy()
-        party = None
-        if vals.get('_parent_invoice.party', vals.get('party')):
-            party = party_obj.browse(cursor, user, vals.get('_parent_invoice.party',
-                    vals.get('party')),
-                    context=context)
-            if party.lang:
-                ctx['language'] = party.lang.code
-
-        product = product_obj.browse(cursor, user, vals['product'],
-                context=context)
-
-        company = None
-        if context.get('company'):
-            company = company_obj.browse(cursor, user, context['company'],
-                    context=context)
-        currency = None
-        if vals.get('_parent_invoice.currency', vals.get('currency')):
-            #TODO check if today date is correct
-            currency = currency_obj.browse(cursor, user,
-                    vals.get('_parent_invoice.currency', vals.get('currency')),
-                    context=context)
-
-        if vals.get('_parent_invoice.type', vals.get('invoice_type')) \
-                in ('in_invoice', 'in_credit_note'):
-            if company and currency:
-                res['unit_price'] = currency_obj.compute(cursor, user,
-                        company.currency, product.cost_price, currency,
-                        round=False, context=context)
-            else:
-                res['unit_price'] = product.cost_price
-            try:
-                res['account'] = product.account_expense_used.id
-                res['account.rec_name'] = product.account_expense_used.rec_name
-            except:
-                pass
-            res['taxes'] = []
-            pattern = self._get_tax_rule_pattern(cursor, user, party, vals,
-                    context=context)
-            for tax in product.supplier_taxes_used:
-                if party and party.supplier_tax_rule:
-                    tax_ids = tax_rule_obj.apply(cursor, user,
-                            party.supplier_tax_rule, tax, pattern,
-                            context=context)
-                    if tax_ids:
-                        res['taxes'].extend(tax_ids)
+        if fields_names:
+            fields_names2 = [x for x in fields_names
+                    if not x.startswith('analytic_account_')]
+        else:
+            fields_names2 = fields_names
+
+        res = super(InvoiceLine, self).read(cursor, user, ids,
+                fields_names=fields_names2, context=context)
+
+        if not fields_names:
+            fields_names = list(set(self._columns.keys() \
+                    + self._inherit_fields.keys()))
+
+        root_ids = []
+        for field in fields_names:
+            if field.startswith('analytic_account_') and '.' not in field:
+                root_ids.append(int(field[len('analytic_account_'):]))
+        if root_ids:
+            id2record = {}
+            for record in res:
+                id2record[record['id']] = record
+            lines = self.browse(cursor, user, ids, context=context)
+            for line in lines:
+                if line.type != 'line':
                     continue
-                res['taxes'].append(tax.id)
-            if party and party.supplier_tax_rule:
-                tax_ids = tax_rule_obj.apply(cursor, user,
-                        party.supplier_tax_rule, False, pattern,
-                        context=context)
-                if tax_ids:
-                    res['taxes'].extend(tax_ids)
-        else:
-            if company and currency:
-                res['unit_price'] = currency_obj.compute(cursor, user,
-                        company.currency, product.list_price, currency,
-                        round=False, context=context)
-            else:
-                res['unit_price'] = product.list_price
-            try:
-                res['account'] = product.account_revenue_used.id
-                res['account.rec_name'] = product.account_revenue_used.rec_name
-            except:
-                pass
-            res['taxes'] = []
-            pattern = self._get_tax_rule_pattern(cursor, user, party, vals,
-                    context=context)
-            for tax in product.customer_taxes_used:
-                if party and party.customer_tax_rule:
-                    tax_ids = tax_rule_obj.apply(cursor, user,
-                            party.customer_tax_rule, tax, pattern,
-                            context=context)
-                    if tax_ids:
-                        res['taxes'].extend(tax_ids)
+                if not line.analytic_accounts:
                     continue
-                res['taxes'].append(tax.id)
-            if party and party.customer_tax_rule:
-                tax_ids = tax_rule_obj.apply(cursor, user,
-                        party.customer_tax_rule, False, pattern,
-                        context=context)
-                if tax_ids:
-                    res['taxes'].extend(tax_ids)
-
-        if not vals.get('description'):
-            res['description'] = product_obj.browse(cursor, user, product.id,
-                    context=ctx).rec_name
-
-        category = product.default_uom.category
-        if not vals.get('unit') \
-                or vals.get('unit') not in [x.id for x in category.uoms]:
-            res['unit'] = product.default_uom.id
-            res['unit.rec_name'] = product.default_uom.rec_name
-            res['unit_digits'] = product.default_uom.digits
-
-        vals = vals.copy()
-        vals['unit_price'] = res['unit_price']
-        vals['type'] = 'line'
-        res['amount'] = self.on_change_with_amount(cursor, user, ids,
-                vals, context=context)
+                for account in line.analytic_accounts.accounts:
+                    if account.root.id in root_ids:
+                        id2record[line.id]['analytic_account_' \
+                                + str(account.root.id)] = account.id
+                        for field in fields_names:
+                            if field.startswith('analytic_account_' + \
+                                    str(account.root.id) + '.'):
+                                ham, field2 = field.split('.', 1)
+                                id2record[line.id][field] = account[field2]
+        if int_id:
+            return res[0]
         return res
 
-    def check_modify(self, cursor, user, ids, context=None):
-        '''
-        Check if the lines can be modified
-        '''
-        for line in self.browse(cursor, user, ids, context=context):
-            if line.invoice and \
-                    line.invoice.state in ('open', 'paid'):
-                self.raise_user_error(cursor, 'modify', context=context)
-        return
-
-    def delete(self, cursor, user, ids, context=None):
-        if isinstance(ids, (int, long)):
-            ids = [ids]
-        self.check_modify(cursor, user, ids, context=context)
-        return super(InvoiceLine, self).delete(cursor, user, ids,
+    def create(self, cursor, user, vals, context=None):
+        selection_obj = self.pool.get('analytic_account.account.selection')
+        vals = vals.copy()
+        selection_vals = {}
+        for field in vals.keys():
+            if field.startswith('analytic_account_'):
+                if vals[field]:
+                    selection_vals.setdefault('accounts', [])
+                    selection_vals['accounts'].append(('add', vals[field]))
+                del vals[field]
+        if vals.get('analytic_accounts'):
+            selection_obj.write(cursor, user, vals['analytic_accounts'],
+                    selection_vals, context=context)
+        elif vals.get('type', 'line') == 'line':
+            selection_id = selection_obj.create(cursor, user, selection_vals,
+                    context=context)
+            vals['analytic_accounts'] = selection_id
+        return super(InvoiceLine, self).create(cursor, user, vals,
                 context=context)
 
     def write(self, cursor, user, ids, vals, context=None):
+        selection_obj = self.pool.get('analytic_account.account.selection')
+        vals = vals.copy()
         if isinstance(ids, (int, long)):
             ids = [ids]
-        self.check_modify(cursor, user, ids, context=context)
+        selection_vals = {}
+        for field in vals.keys():
+            if field.startswith('analytic_account_'):
+                root_id = int(field[len('analytic_account_'):])
+                selection_vals[root_id] = vals[field]
+                del vals[field]
+        if selection_vals:
+            lines = self.browse(cursor, user, ids, context=context)
+            for line in lines:
+                if line.type != 'line':
+                    continue
+                accounts = []
+                if not line.analytic_accounts:
+                    # Create missing selection
+                    selection_id = selection_obj.create(cursor, 0, {},
+                            context=context)
+                    self.write(cursor, user, line.id, {
+                        'analytic_accounts': selection_id,
+                        }, context=context)
+                    line = self.browse(cursor, user, line.id, context=context)
+                for account in line.analytic_accounts.accounts:
+                    if account.root.id in selection_vals:
+                        value = selection_vals[account.root.id]
+                        if value:
+                            accounts.append(value)
+                    else:
+                        accounts.append(account.id)
+                for account_id in selection_vals.values():
+                    if account_id \
+                            and account_id not in accounts:
+                        accounts.append(account_id)
+                selection_obj.write(cursor, user, line.analytic_accounts.id, {
+                    'accounts': [('set', accounts)],
+                    }, context=context)
         return super(InvoiceLine, self).write(cursor, user, ids, vals,
                 context=context)
 
-    def create(self, cursor, user, vals, context=None):
-        invoice_obj = self.pool.get('account.invoice')
-        if vals.get('invoice'):
-            invoice = invoice_obj.browse(cursor, user, vals['invoice'],
-                    context=context)
-            if invoice.state in ('open', 'paid', 'cancel'):
-                self.raise_user_error(cursor, 'create', context=context)
-        return super(InvoiceLine, self).create(cursor, user, vals,
-                context=context)
-
-    def check_account(self, cursor, user, ids):
-        for line in self.browse(cursor, user, ids):
-            if line.type == 'line':
-                if line.invoice:
-                    if line.account.company.id != line.invoice.company.id:
-                        return False
-                elif line.company:
-                    if line.account.company.id != line.company.id:
-                        return False
-        return True
-
-    def check_account2(self, cursor, user, ids):
-        for line in self.browse(cursor, user, ids):
-            if line.type == 'line':
-                if line.invoice \
-                        and line.account.id == line.invoice.account.id:
-                    return False
-        return True
-
-    def _compute_taxes(self, cursor, user, line, context=None):
-        tax_obj = self.pool.get('account.tax')
-        currency_obj = self.pool.get('currency.currency')
-        invoice_obj = self.pool.get('account.invoice')
-        if context is None:
-            context = {}
-
-        ctx = context.copy()
-        ctx.update(invoice_obj.get_tax_context(cursor, user, line.invoice,
-            context=context))
-        res = []
-        if line.type != 'line':
-            return res
-        tax_ids = [x.id for x in line.taxes]
-        for tax in tax_obj.compute(cursor, user, tax_ids, line.unit_price,
-                line.quantity, context=ctx):
-            if line.invoice.type in ('out_invoice', 'in_invoice'):
-                base_code_id = tax['tax'].invoice_base_code.id
-                amount = tax['base'] * tax['tax'].invoice_base_sign
-            else:
-                base_code_id = tax['tax'].credit_note_base_code.id
-                amount = tax['base'] * tax['tax'].credit_note_base_sign
-            if base_code_id:
-                amount = currency_obj.compute(cursor, user,
-                        line.invoice.currency, amount,
-                        line.invoice.company.currency, context=context)
-                res.append({
-                    'code': base_code_id,
-                    'amount': amount,
-                })
-        return res
-
-    def get_move_line(self, cursor, user, line, context=None):
-        '''
-        Return move line value for invoice line
-        '''
-        currency_obj = self.pool.get('currency.currency')
-        res = {}
-        if line.type != 'line':
-            return res
-        res['name'] = line.description
-        if line.invoice.currency.id != line.invoice.company.currency.id:
-            amount = currency_obj.compute(cursor, user,
-                    line.invoice.currency, line.amount,
-                    line.invoice.company.currency, context=context)
-            res['amount_second_currency'] = line.amount
-            res['second_currency'] = line.invoice.currency.id
-        else:
-            amount = line.amount
-            res['amount_second_currency'] = Decimal('0.0')
-            res['second_currency'] = False
-        if line.invoice.type in ('in_invoice', 'out_credit_note'):
-            if amount >= Decimal('0.0'):
-                res['debit'] = amount
-                res['credit'] = Decimal('0.0')
-            else:
-                res['debit'] = Decimal('0.0')
-                res['credit'] = - amount
-                res['amount_second_currency'] = - res['amount_second_currency']
-        else:
-            if amount >= Decimal('0.0'):
-                res['debit'] = Decimal('0.0')
-                res['credit'] = amount
-                res['amount_second_currency'] = - res['amount_second_currency']
-            else:
-                res['debit'] = - amount
-                res['credit'] = Decimal('0.0')
-        res['account'] = line.account.id
-        res['party'] = line.invoice.party.id
-        computed_taxes = self._compute_taxes(cursor, user, line,
-                context=context)
-        for tax in computed_taxes:
-            res.setdefault('tax_lines', [])
-            res['tax_lines'].append(('create', tax))
-        return res
-
-    def _credit(self, cursor, user, line, context=None):
-        '''
-        Return values to credit line.
-        '''
-        res = {}
-
-        for field in ('sequence', 'type', 'quantity', 'unit_price',
-                'description'):
-            res[field] = line[field]
-
-        for field in ('unit', 'product', 'account'):
-            res[field] = line[field].id
-
-        res['taxes'] = []
-        for tax in line.taxes:
-            res['taxes'].append(('add', tax.id))
-        return res
-
-InvoiceLine()
-
-
-class InvoiceLineTax(ModelSQL):
-    'Invoice Line - Tax'
-    _name = 'account.invoice.line-account.tax'
-    _table = 'account_invoice_line_account_tax'
-    _description = __doc__
-    line = fields.Many2One('account.invoice.line', 'Invoice Line',
-            ondelete='CASCADE', select=1, required=True)
-    tax = fields.Many2One('account.tax', 'Tax', ondelete='RESTRICT',
-            required=True)
-
-InvoiceLineTax()
-
-
-class InvoiceTax(ModelSQL, ModelView):
-    'Invoice Tax'
-    _name = 'account.invoice.tax'
-    _rec_name = 'description'
-    _description = __doc__
-
-    invoice = fields.Many2One('account.invoice', 'Invoice', ondelete='CASCADE',
-            select=1)
-    description = fields.Char('Description', size=None, required=True)
-    sequence = fields.Integer('Sequence')
-    sequence_number = fields.Function('get_sequence_number', type='integer',
-            string='Sequence Number')
-    account = fields.Many2One('account.account', 'Account', required=True,
-            domain="[('kind', '!=', 'view'), " \
-                "('company', '=', _parent_invoice.company)]")
-    base = fields.Numeric('Base', digits="(16, _parent_invoice.currency_digits)")
-    amount = fields.Numeric('Amount', digits="(16, _parent_invoice.currency_digits)")
-    manual = fields.Boolean('Manual')
-    base_code = fields.Many2One('account.tax.code', 'Base Code',
-            domain="[('company', '=', _parent_invoice.company)]")
-    base_sign = fields.Numeric('Base Sign', digits=(2, 0))
-    tax_code = fields.Many2One('account.tax.code', 'Tax Code',
-            domain="[('company', '=', _parent_invoice.company)]")
-    tax_sign = fields.Numeric('Tax Sign', digits=(2, 0))
-    tax = fields.Many2One('account.tax', 'Tax')
-
-    def __init__(self):
-        super(InvoiceTax, self).__init__()
-        self._constraints += [
-            ('check_company', 'You can not create invoice tax \n' \
-                    'with account or code from a different invoice company!',
-                    ['account', 'base_code', 'tax_code']),
-        ]
-        self._order.insert(0, ('sequence', 'ASC'))
-        self._error_messages.update({
-            'modify': 'You can not modify tax from an invoice ' \
-                    'that is open, paid or canceled!',
-            'create': 'You can not add a line to an invoice ' \
-                    'that is open, paid or canceled!',
-            })
-
-    def default_base(self, cursor, user, context=None):
-        return Decimal('0.0')
-
-    def default_amount(self, cursor, user, context=None):
-        return Decimal('0.0')
-
-    def default_manual(self, cursor, user, context=None):
-        return True
-
-    def default_base_sign(self, cursor, user, context=None):
-        return Decimal('1')
-
-    def default_tax_sign(self, cursor, user, context=None):
-        return Decimal('1')
-
-    def check_modify(self, cursor, user, ids, context=None):
-        '''
-        Check if the taxes can be modified
-        '''
-        for tax in self.browse(cursor, user, ids, context=context):
-            if tax.invoice.state in ('open', 'paid', 'cancel'):
-                self.raise_user_error(cursor, 'modify',
-                        context=context)
-        return
-
-    def get_sequence_number(self, cursor, user, ids, name, arg, context=None):
-        res = {}
-        for tax in self.browse(cursor, user, ids, context=context):
-            res[tax.id] = 0
-            i = 1
-            for tax2 in tax.invoice.taxes:
-                if tax2.id == tax.id:
-                    res[tax.id] = i
-                    break
-                i += 1
-        return res
-
     def delete(self, cursor, user, ids, context=None):
-        if isinstance(ids, (int, long)):
-            ids = [ids]
-        self.check_modify(cursor, user, ids, context=context)
-        return super(InvoiceTax, self).delete(cursor, user, ids,
-                context=context)
+        selection_obj = self.pool.get('analytic_account.account.selection')
 
-    def write(self, cursor, user, ids, vals, context=None):
         if isinstance(ids, (int, long)):
             ids = [ids]
-        self.check_modify(cursor, user, ids, context=context)
-        return super(InvoiceTax, self).write(cursor, user, ids, vals,
-                context=context)
-
-    def create(self, cursor, user, vals, context=None):
-        invoice_obj = self.pool.get('account.invoice')
-        if vals.get('invoice'):
-            invoice = invoice_obj.browse(cursor, user, vals['invoice'],
-                    context=context)
-            if invoice.state in ('open', 'paid', 'cancel'):
-                self.raise_user_error(cursor, 'create', context=context)
-        return super(InvoiceTax, self).create(cursor, user, vals,
-                context=context)
-
-    def check_company(self, cursor, user, ids):
-        for tax in self.browse(cursor, user, ids):
-            company = tax.invoice.company
-            if tax.account.company.id != company.id:
-                return False
-            if tax.base_code:
-                if tax.base_code.company.id != company.id:
-                    return False
-            if tax.tax_code:
-                if tax.tax_code.company.id != company.id:
-                    return False
-        return True
+        selection_ids = []
+        lines = self.browse(cursor, user, ids, context=context)
+        for line in lines:
+            if line.analytic_accounts:
+                selection_ids.append(line.analytic_accounts.id)
 
-    def get_move_line(self, cursor, user, tax, context=None):
-        '''
-        Return move line value for invoice tax
-        '''
-        currency_obj = self.pool.get('currency.currency')
-        res = {}
-        res['name'] = tax.description
-        if tax.invoice.currency.id != tax.invoice.company.currency.id:
-            amount = currency_obj.compute(cursor, user,
-                    tax.invoice.currency, tax.amount,
-                    tax.invoice.company.currency, context=context)
-            res['amount_second_currency'] = tax.amount
-            res['second_currency'] = tax.invoice.currency.id
-        else:
-            amount = tax.amount
-            res['amount_second_currency'] = Decimal('0.0')
-            res['second_currency'] = False
-        if tax.invoice.type in ('in_invoice', 'out_credit_note'):
-            if amount >= Decimal('0.0'):
-                res['debit'] = amount
-                res['credit'] = Decimal('0.0')
-            else:
-                res['debit'] = Decimal('0.0')
-                res['credit'] = - amount
-                res['amount_second_currency'] = - res['amount_second_currency']
-        else:
-            if amount >= Decimal('0.0'):
-                res['debit'] = Decimal('0.0')
-                res['credit'] = amount
-                res['amount_second_currency'] = - res['amount_second_currency']
-            else:
-                res['debit'] = - amount
-                res['credit'] = Decimal('0.0')
-        res['account'] = tax.account.id
-        res['party'] = tax.invoice.party.id
-        if tax.tax_code:
-            res['tax_lines'] = [('create', {
-                'code': tax.tax_code.id,
-                'amount': amount * tax.tax_sign,
-            })]
-        return res
-
-    def _credit(self, cursor, user, tax, context=None):
-        '''
-        Return values to credit tax.
-        '''
-        res = {}
-
-        for field in ('description', 'sequence', 'base', 'amount',
-                'manual', 'base_sign', 'tax_sign'):
-            res[field] = tax[field]
-
-        for field in ('account', 'base_code', 'tax_code', 'tax'):
-            res[field] = tax[field].id
-        return res
-
-InvoiceTax()
-
-
-class PrintInvoiceReportWarning(ModelView):
-    'Print Invoice Report Warning'
-    _name = 'account.invoice.print_invoice_report.warning'
-    _description = __doc__
-
-PrintInvoiceReportWarning()
-
-
-class PrintInvoiceReport(Wizard):
-    'Print Invoice Report'
-    _name = 'account.invoice.print_invoice_report'
-    states = {
-        'init': {
-            'result': {
-                'type': 'choice',
-                'next_state': '_choice',
-            },
-        },
-        'warning': {
-            'result': {
-                'type': 'form',
-                'object': 'account.invoice.print_invoice_report.warning',
-                'state': [
-                    ('end', 'Cancel', 'tryton-cancel'),
-                    ('print', 'Print', 'tryton-ok', True),
-                ],
-            },
-        },
-        'print': {
-            'actions': ['_print_init'],
-            'result': {
-                'type': 'print',
-                'report': 'account.invoice',
-                'state': 'print_next',
-                'get_id_from_action': True,
-            },
-        },
-        'print_next': {
-            'actions': ['_next_id'],
-            'result': {
-                'type': 'choice',
-                'next_state': '_print_next',
-            },
-        }
-    }
-
-    def _choice(self, cursor, user, data, context=None):
-        if len(data['ids']) > 1:
-            return 'warning'
-        return 'print'
-
-    def _print_init(self, cursor, user, data, context=None):
-        res = {}
-        if 'ids' in data['form']:
-            res['ids'] = data['form']['ids']
-        else:
-            res['ids'] = data['ids']
-        return res
-
-    def _next_id(self, cursor, user, data, context=None):
-        res = {}
-        if data['form']['ids']:
-            data['form']['ids'].pop(0)
-        res['ids'] = data['form']['ids']
-        return res
-
-    def _print_next(self, cursor, user, data, context=None):
-        if not data['form']['ids']:
-            return 'end'
-        return 'print'
-
-PrintInvoiceReport()
-
-
-class InvoiceReport(Report):
-    _name = 'account.invoice'
-
-    def execute(self, cursor, user, ids, datas, context=None):
-        if context is None:
-            context = {}
-        res = super(InvoiceReport, self).execute(cursor, user, ids, datas,
+        res = super(InvoiceLine, self).delete(cursor, user, ids,
                 context=context)
-        if len(ids) > 1 or datas['id'] != ids[0]:
-            res = (res[0], res[1], True)
-        return res
-
-    def _get_objects(self, cursor, user_id, ids, model, datas, context):
-        invoice_obj = self.pool.get('account.invoice')
-
-        if context is None:
-            context = {}
-
-        context = context.copy()
-        if 'language' in context:
-            del context['language']
-        return invoice_obj.browse(cursor, user_id, [ids[0]], context=context)
-
-    def parse(self, cursor, user_id, report, objects, datas, context):
-        user_obj = self.pool.get('res.user')
-        invoice_obj = self.pool.get('account.invoice')
-
-        invoice = objects[0]
-
-        if invoice.invoice_report:
-            return (invoice.invoice_report_format,
-                    base64.decodestring(invoice.invoice_report))
-
-        user = user_obj.browse(cursor, user_id, user_id, context)
-        if context is None:
-            context = {}
-        context = context.copy()
-        context['company'] = user.company
-        res = super(InvoiceReport, self).parse(cursor, user_id, report, objects,
-                datas, context)
-        #If the invoice is open or paid and the report not saved in invoice_report
-        #there was an error somewhere. So we save it now in invoice_report
-        if invoice.state in ('open', 'paid'):
-            invoice_obj.write(cursor, user_id, invoice.id, {
-                'invoice_report_format': res[0],
-                'invoice_report': base64.encodestring(res[1]),
-                }, context=context)
+        selection_obj.delete(cursor, user, selection_ids, context=context)
         return res
 
-InvoiceReport()
-
-
-class PayInvoiceInit(ModelView):
-    'Pay Invoice Init'
-    _name = 'account.invoice.pay_invoice.init'
-    _description = __doc__
-    amount = fields.Numeric('Amount', digits="(16, currency_digits)")
-    currency = fields.Many2One('currency.currency', 'Currency', required=True)
-    currency_digits = fields.Integer('Currency Digits', readonly=True,
-            on_change_with=['currency'])
-    description = fields.Char('Description', size=None, required=True)
-    journal = fields.Many2One('account.journal', 'Journal', required=True,
-            domain=[('type', '=', 'cash')])
-    date = fields.Date('Date', required=True)
-
-    def default_date(self, cursor, user, context=None):
-        date_obj = self.pool.get('ir.date')
-        return date_obj.today(cursor, user, context=context)
-
-    def on_change_with_currency_digits(self, cursor, user, ids, vals,
-            context=None):
-        currency_obj = self.pool.get('currency.currency')
-        if vals.get('currency'):
-            currency = currency_obj.browse(cursor, user, vals['currency'],
-                    context=context)
-            return currency.digits
-        return 2
-
-PayInvoiceInit()
-
-
-class PayInvoiceAsk(ModelView):
-    'Pay Invoice Ask'
-    _name = 'account.invoice.pay_invoice.ask'
-    _description = __doc__
-    type = fields.Selection([
-        ('writeoff', 'Write-Off'),
-        ('partial', 'Partial Payment'),
-        ], 'Type', required=True)
-    journal_writeoff = fields.Many2One('account.journal', 'Write-Off Journal',
-            states={
-                'invisible': "type != 'writeoff'",
-                'required': "type == 'writeoff'",
-            })
-    account_writeoff = fields.Many2One('account.account', 'Write-Off Account',
-            domain="[('kind', '!=', 'view'), ('company', '=', company)]",
-            states={
-                'invisible': "type != 'writeoff'",
-                'required': "type == 'writeoff'",
-            })
-    amount = fields.Numeric('Payment Amount', digits="(16, currency_digits)",
-            readonly=True, depends=['currency_digits'])
-    currency = fields.Many2One('currency.currency', 'Payment Currency',
-            readonly=True)
-    currency_digits = fields.Integer('Payment Currency Digits', readonly=True)
-    amount_writeoff = fields.Numeric('Write-Off Amount',
-            digits="(16, currency_digits_writeoff)", readonly=True,
-            depends=['currency_digits_writeoff'], states={
-                'invisible': "type != 'writeoff'",
-            })
-    currency_writeoff = fields.Many2One('currency.currency',
-            'Write-Off Currency', readonly=True, states={
-                'invisible': "type != 'writeoff'",
-            })
-    currency_digits_writeoff = fields.Integer('Write-Off Currency Digits',
-            readonly=True)
-    lines_to_pay = fields.Many2Many('account.move.line', None, None,
-            'Lines to Pay', readonly=True)
-    lines = fields.Many2Many('account.move.line', None, None, 'Lines',
-            domain="[('id', 'in', lines_to_pay), " \
-                    "('reconciliation', '=', False)]",
-            states={
-                'invisible': "type != 'writeoff'",
-            }, on_change=['lines', 'amount', 'currency', 'currency_writeoff',
-                'invoice'],
-            depends=['lines_to_pay'])
-    payment_lines = fields.Many2Many('account.move.line', None, None,
-            'Payment Lines', readonly=True,
-            states={
-                'invisible': "type != 'writeoff'",
-            })
-    description = fields.Char('Description', size=None, readonly=True)
-    journal = fields.Many2One('account.journal', 'Journal', readonly=True,
-            domain=[('type', '=', 'cash')])
-    date = fields.Date('Date', readonly=True)
-    company = fields.Many2One('company.company', 'Company', readonly=True)
-    account = fields.Many2One('account.account', 'Account', readonly=True)
-    invoice = fields.Many2One('account.invoice', 'Invoice', readonly=True)
-
-    def default_type(self, cursor, user, context=None):
-        return 'partial'
-
-    def on_change_lines(self, cursor, user, ids, vals, context=None):
-        currency_obj = self.pool.get('currency.currency')
-        line_obj = self.pool.get('account.move.line')
-        invoice_obj = self.pool.get('account.invoice')
-
-        res = {}
-        invoice = invoice_obj.browse(cursor, user, vals['invoice'],
-                context=context)
-        amount = currency_obj.compute(cursor, user, vals['currency'],
-                vals['amount'], vals['currency_writeoff'], context=context)
-
-        res['amount_writeoff'] = Decimal('0.0')
-        for line in line_obj.browse(cursor, user, vals['lines'],
-                context=context):
-            res['amount_writeoff'] += line.debit - line.credit
-        if invoice.type in ('in_invoice', 'out_credit_note'):
-            res['amount_writeoff'] = - res['amount_writeoff'] - amount
-        else:
-            res['amount_writeoff'] = res['amount_writeoff'] - amount
-        return res
-
-PayInvoiceAsk()
+    def copy(self, cursor, user, ids, default=None, context=None):
+        selection_obj = self.pool.get('analytic_account.account.selection')
 
+        new_ids = super(InvoiceLine, self).copy(cursor, user, ids,
+                default=default, context=context)
 
-class PayInvoice(Wizard):
-    'Pay Invoice'
-    _name = 'account.invoice.pay_invoice'
-    states = {
-        'init': {
-            'actions': ['_init'],
-            'result': {
-                'type': 'form',
-                'object': 'account.invoice.pay_invoice.init',
-                'state': [
-                    ('end', 'Cancel', 'tryton-cancel'),
-                    ('choice', 'Ok', 'tryton-ok', True),
-                ],
-            },
-        },
-        'choice': {
-            'result': {
-                'type': 'choice',
-                'next_state': '_choice',
-            },
-        },
-        'ask': {
-            'actions': ['_ask'],
-            'result': {
-                'type': 'form',
-                'object': 'account.invoice.pay_invoice.ask',
-                'state': [
-                    ('end', 'Cancel', 'tryton-cancel'),
-                    ('pay', 'Ok', 'tryton-ok', True),
-                ],
-            },
-        },
-        'pay': {
-            'result': {
-                'type': 'action',
-                'action': '_action_pay',
-                'state': 'end',
-            },
-        },
-    }
+        int_id = False
+        if isinstance(new_ids, (int, long)):
+            int_id = True
+            new_ids = [new_ids]
+
+        for line in self.browse(cursor, user, new_ids, context=context):
+            if line.analytic_accounts:
+                selection_id = selection_obj.copy(cursor, user,
+                        line.analytic_accounts.id, context=context)
+                self.write(cursor, user, line.id, {
+                    'analytic_accounts': selection_id,
+                    }, context=context)
 
-    def __init__(self):
-        super(PayInvoice, self).__init__()
-        self._error_messages.update({
-            'amount_greater_amount_to_pay': 'You can not create a partial ' \
-                    'payment with an amount greater then the amount to pay!',
-            })
+        if int_id:
+            return new_ids[0]
+        return new_ids
 
-    def _init(self, cursor, user, data, context=None):
-        invoice_obj = self.pool.get('account.invoice')
-        res = {}
-        invoice = invoice_obj.browse(cursor, user, data['id'], context=context)
-        res['currency'] = invoice.currency.id
-        res['currency_digits'] = invoice.currency.digits
-        res['amount'] = invoice.amount_to_pay_today or invoice.amount_to_pay
-        res['description'] = invoice.number
+    def get_move_line(self, cursor, user, line, context=None):
+        res = super(InvoiceLine, self).get_move_line(cursor, user, line,
+                context=context)
+        if line.analytic_accounts and line.analytic_accounts.accounts:
+            res['analytic_lines'] = []
+            for account in line.analytic_accounts.accounts:
+                vals = {}
+                vals['name'] = line.description
+                vals['debit'] = res['debit']
+                vals['credit'] = res['credit']
+                vals['currency'] = line.invoice.currency.id
+                vals['account'] = account.id
+                vals['journal'] = line.invoice.journal.id
+                vals['date'] = line.invoice.invoice_date
+                vals['reference'] = line.invoice.reference
+                vals['party'] = line.invoice.party.id
+                res['analytic_lines'].append(('create', vals))
         return res
 
-    def _choice(self, cursor, user, data, context=None):
-        invoice_obj = self.pool.get('account.invoice')
-        currency_obj = self.pool.get('currency.currency')
-
-        invoice = invoice_obj.browse(cursor, user, data['id'], context=context)
-
-        ctx = context.copy()
-        ctx['date'] = data['form']['date']
-        amount = currency_obj.compute(cursor, user, data['form']['currency'],
-                data['form']['amount'], invoice.company.currency,
-                context=context)
-        res = invoice_obj.get_reconcile_lines_for_amount(cursor, user, invoice,
-                amount)
-        if res[1] == Decimal('0.0') and amount <= invoice.amount_to_pay:
-            return 'pay'
-        return 'ask'
-
-    def _ask(self, cursor, user, data, context=None):
-        invoice_obj = self.pool.get('account.invoice')
-        currency_obj = self.pool.get('currency.currency')
-        line_obj = self.pool.get('account.move.line')
-
-        res = {}
-        invoice = invoice_obj.browse(cursor, user, data['id'], context=context)
-        res['lines_to_pay'] = [x.id for x in invoice.lines_to_pay
-                if not x.reconciliation]
-
-        res['amount'] = data['form']['amount']
-        res['currency'] = data['form']['currency']
-        res['currency_digits'] = data['form']['currency_digits']
-        res['description'] = data['form']['description']
-        res['journal'] = data['form']['journal']
-        res['date'] = data['form']['date']
-        res['company'] = invoice.company.id
-
-        amount = currency_obj.compute(cursor, user, data['form']['currency'],
-                data['form']['amount'], invoice.company.currency,
-                context=context)
-
-        if currency_obj.is_zero(cursor, user, invoice.company.currency,
-                amount):
-            res['lines'] = [x.id for x in invoice.lines_to_pay]
-        else:
-            res['lines'] = invoice_obj.get_reconcile_lines_for_amount(cursor,
-                    user, invoice, amount)[0]
-        for line_id in res['lines'][:]:
-            if line_id not in res['lines_to_pay']:
-                res['lines'].remove(line_id)
+InvoiceLine()
 
-        res['amount_writeoff'] = Decimal('0.0')
-        for line in line_obj.browse(cursor, user, res['lines'], context=context):
-            res['amount_writeoff'] += line.debit - line.credit
-        for line in invoice.payment_lines:
-            res['amount_writeoff'] += line.debit - line.credit
-        if invoice.type in ('in_invoice', 'out_credit_note'):
-            res['amount_writeoff'] = - res['amount_writeoff'] - amount
-        else:
-            res['amount_writeoff'] = res['amount_writeoff'] - amount
 
-        res['currency_writeoff'] = invoice.company.currency.id
-        res['currency_digits_writeoff'] = invoice.company.currency.digits
-        res['invoice'] = invoice.id
-        res['payment_lines'] = [x.id for x in invoice.payment_lines
-                if not x.reconciliation]
+class Account(ModelSQL, ModelView):
+    _name = 'analytic_account.account'
 
-        if amount > invoice.amount_to_pay \
-                or currency_obj.is_zero(cursor, user, invoice.company.currency,
-                        amount):
-            res['type'] = 'writeoff'
+    def delete(self, cursor, user, ids, context=None):
+        account_invoice_line_obj = self.pool.get('account.invoice.line')
+        res = super(Account, self).delete(cursor, user, ids, context=context)
+        # Restart the cache on the fields_view_get method of account.invoice.line
+        account_invoice_line_obj.fields_view_get(cursor.dbname)
         return res
 
-    def _action_pay(self, cursor, user, data, context=None):
-        invoice_obj = self.pool.get('account.invoice')
-        currency_obj = self.pool.get('currency.currency')
-        move_line_obj = self.pool.get('account.move.line')
-
-        invoice = invoice_obj.browse(cursor, user, data['id'], context=context)
-
-        ctx = context.copy()
-        ctx['date'] = data['form']['date']
-        amount = currency_obj.compute(cursor, user, data['form']['currency'],
-                data['form']['amount'], invoice.company.currency,
-                context=context)
-
-        reconcile_lines = invoice_obj.get_reconcile_lines_for_amount(cursor,
-                user, invoice, amount)
-
-        amount_second_currency = False
-        second_currency = False
-        if data['form']['currency'] != invoice.company.currency.id:
-            amount_second_currency = data['form']['amount']
-            second_currency = data['form']['currency']
-
-        if amount > invoice.amount_to_pay and \
-                data['form'].get('type') != 'writeoff':
-            self.raise_user_error(cursor, 'amount_greater_amount_to_pay',
-                    context=context)
-
-        line_id = False
-        if not currency_obj.is_zero(cursor, user, invoice.company.currency,
-                amount):
-            line_id = invoice_obj.pay_invoice(cursor, user, data['id'], amount,
-                    data['form']['journal'], data['form']['date'],
-                    data['form']['description'], amount_second_currency,
-                    second_currency, context=context)
-
-        if reconcile_lines[1] != Decimal('0.0'):
-            if data['form'].get('type') == 'writeoff':
-                line_ids = data['form']['lines'][0][1] + \
-                        [x.id for x in invoice.payment_lines
-                                if not x.reconciliation]
-                if line_id:
-                    line_ids += [line_id]
-                if line_ids:
-                    move_line_obj.reconcile(cursor, user, line_ids,
-                            journal_id=data['form']['journal_writeoff'],
-                            date=data['form']['date'],
-                            account_id=data['form']['account_writeoff'],
-                            context=context)
-        else:
-            line_ids = reconcile_lines[0]
-            if line_id:
-                line_ids += [line_id]
-            if line_ids:
-                move_line_obj.reconcile(cursor, user, line_ids, context=context)
-        return {}
-
-PayInvoice()
-
-
-class CreditInvoiceInit(ModelView):
-    'Credit Invoice Init'
-    _name = 'account.invoice.credit_invoice.init'
-    _description = __doc__
-    with_refund = fields.Boolean('With Refund', help='If true, ' \
-            'the current invoice(s) will be paid.')
-
-CreditInvoiceInit()
-
-
-class CreditInvoice(Wizard):
-    'Credit Invoice'
-    _name = 'account.invoice.credit_invoice'
-    states = {
-        'init': {
-            'actions': ['_init'],
-            'result': {
-                'type': 'form',
-                'object': 'account.invoice.credit_invoice.init',
-                'state': [
-                    ('end', 'Cancel', 'tryton-cancel'),
-                    ('credit', 'Credit', 'tryton-ok', True),
-                ],
-            }
-        },
-        'credit': {
-            'result': {
-                'type': 'action',
-                'action': '_action_credit',
-                'state': 'end',
-            },
-        },
-    }
-
-    def __init__(self):
-        super(CreditInvoice, self).__init__()
-        self._error_messages.update({
-            'refund_non_open': 'You can not credit with refund ' \
-                    'an invoice that is not opened!',
-            'refund_with_payement': 'You can not credit with refund ' \
-                    'an invoice with payments!',
-            })
-
-    def _init(self, cursor, user, data, context=None):
-        invoice_obj = self.pool.get('account.invoice')
-        res = {
-            'with_refund': True,
-        }
-        for invoice in invoice_obj.browse(cursor, user, data['ids'],
-                context=context):
-            if invoice.state != 'open' or invoice.payment_lines:
-                res['with_refund'] = False
-                break
+    def create(self, cursor, user, vals, context=None):
+        account_invoice_line_obj = self.pool.get('account.invoice.line')
+        res = super(Account, self).create(cursor, user, vals, context=context)
+        # Restart the cache on the fields_view_get method of account.invoice.line
+        account_invoice_line_obj.fields_view_get(cursor.dbname)
         return res
 
-    def _action_credit(self, cursor, user, data, context=None):
-        model_data_obj = self.pool.get('ir.model.data')
-        act_window_obj = self.pool.get('ir.action.act_window')
-        invoice_obj = self.pool.get('account.invoice')
-
-        refund = data['form']['with_refund']
-
-        if refund:
-            for invoice in invoice_obj.browse(cursor, user, data['ids'],
-                    context=context):
-                if invoice.state != 'open':
-                    self.raise_user_error(cursor, 'refund_non_open',
-                            context=context)
-                if invoice.payment_lines:
-                    self.raise_user_error(cursor, 'refund_with_payement',
-                            context=context)
-
-        invoice_ids = invoice_obj.credit(cursor, user, data['ids'],
-                refund=refund, context=context)
-
-        model_data_ids = model_data_obj.search(cursor, user, [
-            ('fs_id', '=', 'act_invoice_form'),
-            ('module', '=', 'account_invoice'),
-            ('inherit', '=', False),
-            ], limit=1, context=context)
-        model_data = model_data_obj.browse(cursor, user, model_data_ids[0],
+    def write(self, cursor, user, ids, vals, context=None):
+        account_invoice_line_obj = self.pool.get('account.invoice.line')
+        res = super(Account, self).write(cursor, user, ids, vals,
                 context=context)
-        res = act_window_obj.read(cursor, user, model_data.db_id, context=context)
-        res['res_id'] = invoice_ids
-        if len(invoice_ids) == 1:
-            res['views'].reverse()
+        # Restart the cache on the fields_view_get method of account.invoice.line
+        account_invoice_line_obj.fields_view_get(cursor.dbname)
         return res
 
-CreditInvoice()
+Account()
diff --git a/invoice.xml b/invoice.xml
index 3df7d21..2a476ca 100644
--- a/invoice.xml
+++ b/invoice.xml
@@ -3,1024 +3,22 @@
 this repository contains the full copyright notices and license terms. -->
 <tryton>
     <data>
-        <menuitem name="Payment Terms" parent="account.menu_account_configuration"
-            id="menu_payment_terms_configuration"/>
-        <menuitem name="Invoices" parent="account.menu_account"
-            id="menu_invoices" sequence="20"/>
-
-        <record model="ir.action.wizard" id="wizard_pay_invoice">
-            <field name="name">Pay Invoice</field>
-            <field name="wiz_name">account.invoice.pay_invoice</field>
-            <field name="model">account.invoice</field>
-        </record>
-
-        <record model="ir.ui.view" id="invoice_view_form">
-            <field name="model">account.invoice</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <form string="Invoice" col="6" cursor="party">
-                    <label name="type"/>
-                    <field name="type"/>
-                    <label name="journal"/>
-                    <field name="journal"/>
-                    <label name="number"/>
-                    <field name="number"/>
-                    <label name="party"/>
-                    <field name="party"/>
-                    <label name="invoice_address"/>
-                    <field name="invoice_address"/>
-                    <newline/>
-                    <label name="description"/>
-                    <field name="description" colspan="3"/>
-                    <label name="reference"/>
-                    <field name="reference"/>
-                    <notebook colspan="6">
-                        <page string="Invoice" id="invoice" col="6">
-                            <label name="invoice_date"/>
-                            <field name="invoice_date"/>
-                            <label name="payment_term"/>
-                            <field name="payment_term"/>
-                            <label name="currency"/>
-                            <field name="currency"/>
-                            <field name="lines" colspan="6">
-                                <tree string="Lines" sequence="sequence" fill="1">
-                                    <field name="type"/>
-                                    <field name="product" select="1"/>
-                                    <field name="account" tree_invisible="1"/>
-                                    <field name="description"/>
-                                    <field name="quantity" select="1"/>
-                                    <field name="unit" select="2"/>
-                                    <field name="unit_price" select="2"/>
-                                    <field name="taxes"/>
-                                    <field name="amount"/>
-                                    <field name="sequence" tree_invisible="1"/>
-                                    <field name="unit_digits" tree_invisible="1"/>
-                                    <field name="currency_digits" tree_invisible="1"/>
-                                </tree>
-                            </field>
-                            <group col="2" colspan="6" id="taxes_amount_state_buttons">
-                                <group col="1" colspan="1" id="taxes">
-                                    <field name="taxes">
-                                        <tree string="Taxes" sequence="sequence" fill="1">
-                                            <field name="description"/>
-                                            <field name="base"/>
-                                            <field name="amount"/>
-                                            <field name="sequence" tree_invisible="1"/>
-                                            <field name="manual" tree_invisible="1"/>
-                                            <field name="base_code" tree_invisible="1"/>
-                                            <field name="base_sign" tree_invisible="1"/>
-                                            <field name="tax_code" tree_invisible="1"/>
-                                            <field name="tax_sign" tree_invisible="1"/>
-                                            <field name="account" tree_invisible="1"/>
-                                        </tree>
-                                    </field>
-                                </group>
-                                <group col="2" colspan="1" id="amount_state_buttons">
-                                    <label name="untaxed_amount"/>
-                                    <field name="untaxed_amount"/>
-                                    <label name="tax_amount"/>
-                                    <field name="tax_amount"/>
-                                    <label name="total_amount"/>
-                                    <field name="total_amount"/>
-                                    <group col="4" colspan="2" id="reconciled_state">
-                                        <label name="reconciled"/>
-                                        <field name="reconciled" xexpand="0"/>
-                                        <label name="state"/>
-                                        <field name="state"/>
-                                    </group>
-                                    <group col="5" colspan="2" id="buttons">
-                                        <button name="cancel" string="_Cancel"
-                                            states="{'invisible': '''state not in ('draft', 'proforma') ''', 'readonly': ''' %(account.group_account)d not in groups '''}"
-                                            icon="tryton-cancel"/>
-                                        <button name="button_draft" string="_Reset to Draft"
-                                            type="object"
-                                            states="{'invisible': '''state != 'cancel' '''}"
-                                            icon="tryton-clear"/>
-                                        <button name="draft" string="_Draft"
-                                            states="{'invisible': '''state != 'proforma' '''}"
-                                            icon="tryton-go-previous"/>
-                                        <button name="proforma" string="Pro For_ma"
-                                            states="{'invisible': '''state != 'draft' '''}"
-                                            icon="tryton-go-next"/>
-                                        <button name="open" string="_Open"
-                                            states="{'invisible': '''state not in ('draft', 'proforma') ''', 'readonly': ''' %(account.group_account)d not in groups '''}"
-                                            icon="tryton-ok"/>
-                                        <button name="%(wizard_pay_invoice)d" string="_Pay"
-                                            type="action"
-                                            states="{'invisible': '''state != 'open' ''', 'readonly': ''' %(account.group_account)d not in groups '''}"
-                                            icon="tryton-go-next"/>
-                                    </group>
-                                </group>
-                            </group>
-                        </page>
-                        <page string="Other Info" id="info">
-                            <label name="company"/>
-                            <field name="company"/>
-                            <label name="account"/>
-                            <field name="account"/>
-                            <label name="accounting_date"/>
-                            <field name="accounting_date"/>
-                            <label name="move"/>
-                            <field name="move"/>
-                            <label name="invoice_report"/>
-                            <field name="invoice_report"/>
-                            <separator name="comment" colspan="4"/>
-                            <field name="comment" colspan="4" spell="party_lang"/>
-                        </page>
-                        <page string="Payment" id="payment">
-                            <label name="amount_to_pay_today"/>
-                            <field name="amount_to_pay_today"/>
-                            <label name="amount_to_pay"/>
-                            <field name="amount_to_pay"/>
-                            <separator name="payment_lines" colspan="4"/>
-                            <field name="payment_lines" colspan="4">
-                                <tree string="Payment Lines">
-                                    <field name="date"/>
-                                    <field name="debit" sum="Debit"/>
-                                    <field name="credit" sum="Credit"/>
-                                    <field name="amount_second_currency"
-                                        sum="Amount Second Currency"/>
-                                    <field name="second_currency"/>
-                                    <field name="currency_digits" tree_invisible="1"/>
-                                    <field name="second_currency_digits" tree_invisible="1"/>
-                                </tree>
-                            </field>
-                        </page>
-                    </notebook>
-                    <field name="currency_digits" invisible="1" colspan="6"/>
-                    <field name="party_lang" invisible="1" colspan="6"/>
-                </form>
-                ]]>
-            </field>
-        </record>
-        <record model="ir.ui.view" id="invoice_view_tree">
-            <field name="model">account.invoice</field>
-            <field name="type">tree</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <tree string="Invoices">
-                    <field name="type" select="2"/>
-                    <field name="number" select="1"/>
-                    <field name="reference" select="1"/>
-                    <field name="invoice_date" select="2"/>
-                    <field name="party" select="1"/>
-                    <field name="currency" select="2"/>
-                    <field name="untaxed_amount" select="2"/>
-                    <field name="tax_amount" select="2"/>
-                    <field name="total_amount" select="2"/>
-                    <field name="state" select="2"/>
-                    <field name="amount_to_pay_today"/>
-                    <field name="description" select="2"/>
-                    <field name="currency_digits" tree_invisible="1"/>
-                </tree>
-                ]]>
-            </field>
-        </record>
-        <record model="ir.action.act_window" id="act_invoice_form">
-            <field name="name">All Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_form_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_form"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_form_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_form"/>
-        </record>
-        <menuitem parent="menu_invoices" action="act_invoice_form"
-            id="menu_invoice_form" sequence="5"/>
-
-        <record model="ir.action.act_window" id="act_invoice_out_invoice_form">
-            <field name="name">Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'out_invoice')]</field>
-            <field name="context">{'type': 'out_invoice'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_out_invoice_form"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_out_invoice_form"/>
-        </record>
-        <menuitem parent="menu_invoices" action="act_invoice_out_invoice_form"
-            id="menu_invoice_out_invoice_form" sequence="1"/>
-
-        <record model="ir.action.act_window" id="act_invoice_out_invoice_form2">
-            <field name="name">Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'out_invoice')]</field>
-            <field name="context">{'type': 'out_invoice'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form2_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_out_invoice_form2"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form2_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_out_invoice_form2"/>
-        </record>
-        <menuitem name="New Invoice" parent="menu_invoice_out_invoice_form"
-            action="act_invoice_out_invoice_form2"
-            id="menu_invoice_out_invoice_form2" sequence="1"/>
-
-        <record model="ir.action.act_window" id="act_invoice_out_invoice_form3">
-            <field name="name">Draft Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'out_invoice'), ('state', '=', 'draft')]</field>
-            <field name="context">{'type': 'out_invoice'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form3_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_out_invoice_form3"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form3_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_out_invoice_form3"/>
-        </record>
-        <menuitem parent="menu_invoice_out_invoice_form" action="act_invoice_out_invoice_form3"
-            id="menu_invoice_out_invoice_form3" sequence="2"/>
-
-        <record model="ir.action.act_window" id="act_invoice_out_invoice_form4">
-            <field name="name">Pro Forma Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'out_invoice'), ('state', '=', 'proforma')]</field>
-            <field name="context">{'type': 'out_invoice'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form4_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_out_invoice_form4"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form4_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_out_invoice_form4"/>
-        </record>
-        <menuitem parent="menu_invoice_out_invoice_form" action="act_invoice_out_invoice_form4"
-            id="menu_invoice_out_invoice_form4" sequence="3"/>
-
-        <record model="ir.action.act_window" id="act_invoice_out_invoice_form5">
-            <field name="name">Opened Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'out_invoice'), ('state', '=', 'open')]</field>
-            <field name="context">{'type': 'out_invoice'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form5_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_out_invoice_form5"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form5_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_out_invoice_form5"/>
-        </record>
-        <menuitem parent="menu_invoice_out_invoice_form" action="act_invoice_out_invoice_form5"
-            id="menu_invoice_out_invoice_form5" sequence="4"/>
-
-        <record model="ir.action.act_window" id="act_invoice_out_credit_note_form">
-            <field name="name">Credit Notes</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'out_credit_note')]</field>
-            <field name="context">{'type': 'out_credit_note'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_out_credit_note_form"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_out_credit_note_form"/>
-        </record>
-        <menuitem parent="menu_invoices" action="act_invoice_out_credit_note_form"
-            id="menu_invoice_out_credit_note_form" sequence="2"/>
-
-        <record model="ir.action.act_window" id="act_invoice_out_credit_note_form2">
-            <field name="name">Credit Notes</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'out_credit_note')]</field>
-            <field name="context">{'type': 'out_credit_note'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form2_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_out_credit_note_form2"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form2_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_out_credit_note_form2"/>
-        </record>
-        <menuitem name="New Credit Note" parent="menu_invoice_out_credit_note_form"
-            action="act_invoice_out_credit_note_form2"
-            id="menu_invoice_out_credit_note_form2" sequence="1"/>
-
-        <record model="ir.action.act_window" id="act_invoice_out_credit_note_form3">
-            <field name="name">Draft Credit Notes</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'out_credit_note'), ('domain', '=', 'draft')]</field>
-            <field name="context">{'type': 'out_credit_note'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form3_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_out_credit_note_form3"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form3_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_out_credit_note_form3"/>
-        </record>
-        <menuitem parent="menu_invoice_out_credit_note_form" action="act_invoice_out_credit_note_form3"
-            id="menu_invoice_out_credit_note_form3" sequence="2"/>
-
-        <record model="ir.action.act_window" id="act_invoice_out_credit_note_form4">
-            <field name="name">Pro Forma Credit Notes</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'out_credit_note'), ('domain', '=', 'proforma')]</field>
-            <field name="context">{'type': 'out_credit_note'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form4_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_out_credit_note_form4"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form4_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_out_credit_note_form4"/>
-        </record>
-        <menuitem parent="menu_invoice_out_credit_note_form" action="act_invoice_out_credit_note_form4"
-            id="menu_invoice_out_credit_note_form4" sequence="3"/>
-
-        <record model="ir.action.act_window" id="act_invoice_out_credit_note_form5">
-            <field name="name">Opened Credit Notes</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'out_credit_note'), ('domain', '=', 'open')]</field>
-            <field name="context">{'type': 'out_credit_note'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form5_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_out_credit_note_form5"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form5_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_out_credit_note_form5"/>
-        </record>
-        <menuitem parent="menu_invoice_out_credit_note_form" action="act_invoice_out_credit_note_form5"
-            id="menu_invoice_out_credit_note_form5" sequence="4"/>
-
-        <record model="ir.action.act_window" id="act_invoice_in_invoice_form">
-            <field name="name">Supplier Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'in_invoice')]</field>
-            <field name="context">{'type': 'in_invoice'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_in_invoice_form"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_in_invoice_form"/>
-        </record>
-        <menuitem parent="menu_invoices" action="act_invoice_in_invoice_form"
-            id="menu_invoice_in_invoice_form" sequence="3"/>
-
-        <record model="ir.action.act_window" id="act_invoice_in_invoice_form2">
-            <field name="name">Supplier Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'in_invoice')]</field>
-            <field name="context">{'type': 'in_invoice'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form2_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_in_invoice_form2"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form2_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_in_invoice_form2"/>
-        </record>
-        <menuitem name="New Supplier Invoice" parent="menu_invoice_in_invoice_form"
-            action="act_invoice_in_invoice_form2"
-            id="menu_invoice_in_invoice_form2" sequence="1"/>
-
-        <record model="ir.action.act_window" id="act_invoice_in_invoice_form3">
-            <field name="name">Draft Supplier Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'in_invoice'), ('state', '=', 'draft')]</field>
-            <field name="context">{'type': 'in_invoice'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form3_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_in_invoice_form3"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form3_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_in_invoice_form3"/>
-        </record>
-        <menuitem parent="menu_invoice_in_invoice_form" action="act_invoice_in_invoice_form3"
-            id="menu_invoice_in_invoice_form3" sequence="2"/>
-
-        <record model="ir.action.act_window" id="act_invoice_in_invoice_form4">
-            <field name="name">Pro Forma Supplier Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'in_invoice'), ('state', '=', 'proforma')]</field>
-            <field name="context">{'type': 'in_invoice'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form4_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_in_invoice_form4"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form4_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_in_invoice_form4"/>
-        </record>
-        <menuitem parent="menu_invoice_in_invoice_form" action="act_invoice_in_invoice_form4"
-            id="menu_invoice_in_invoice_form4" sequence="3"/>
-
-        <record model="ir.action.act_window" id="act_invoice_in_invoice_form5">
-            <field name="name">Opened Supplier Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'in_invoice'), ('state', '=', 'open')]</field>
-            <field name="context">{'type': 'in_invoice'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form5_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_in_invoice_form5"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form5_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_in_invoice_form5"/>
-        </record>
-        <menuitem parent="menu_invoice_in_invoice_form" action="act_invoice_in_invoice_form5"
-            id="menu_invoice_in_invoice_form5" sequence="4"/>
-
-        <record model="ir.action.act_window" id="act_invoice_in_credit_note_form">
-            <field name="name">Supplier Credit Notes</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'in_credit_note')]</field>
-            <field name="context">{'type': 'in_credit_note'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_in_credit_note_form"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_in_credit_note_form"/>
-        </record>
-        <menuitem parent="menu_invoices" action="act_invoice_in_credit_note_form"
-            id="menu_invoice_in_credit_note_form" sequence="4"/>
-
-        <record model="ir.action.act_window" id="act_invoice_in_credit_note_form2">
-            <field name="name">Supplier Credit Notes</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'in_credit_note')]</field>
-            <field name="context">{'type': 'in_credit_note'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form2_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_in_credit_note_form2"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form2_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_in_credit_note_form2"/>
-        </record>
-        <menuitem name="New Supplier Credit Note" parent="menu_invoice_in_credit_note_form"
-            action="act_invoice_in_credit_note_form2"
-            id="menu_invoice_in_credit_note_form2" sequence="1"/>
-
-        <record model="ir.action.act_window" id="act_invoice_in_credit_note_form3">
-            <field name="name">Draft Supplier Credit Notes</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'in_credit_note'), ('state', '=', 'draft')]</field>
-            <field name="context">{'type': 'in_credit_note'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form3_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_in_credit_note_form3"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form3_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_in_credit_note_form3"/>
-        </record>
-        <menuitem parent="menu_invoice_in_credit_note_form" action="act_invoice_in_credit_note_form3"
-            id="menu_invoice_in_credit_note_form3" sequence="2"/>
-
-        <record model="ir.action.act_window" id="act_invoice_in_credit_note_form4">
-            <field name="name">Pro Forma Supplier Credit Notes</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'in_credit_note'), ('state', '=', 'proforma')]</field>
-            <field name="context">{'type': 'in_credit_note'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form4_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_in_credit_note_form4"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form4_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_in_credit_note_form4"/>
-        </record>
-        <menuitem parent="menu_invoice_in_credit_note_form" action="act_invoice_in_credit_note_form4"
-            id="menu_invoice_in_credit_note_form4" sequence="3"/>
-
-        <record model="ir.action.act_window" id="act_invoice_in_credit_note_form5">
-            <field name="name">Opened Supplier Credit Notes</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[('type', '=', 'in_credit_note'), ('state', '=', 'open')]</field>
-            <field name="context">{'type': 'in_credit_note'}</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form5_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="invoice_view_tree"/>
-            <field name="act_window" ref="act_invoice_in_credit_note_form5"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form5_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="invoice_view_form"/>
-            <field name="act_window" ref="act_invoice_in_credit_note_form5"/>
-        </record>
-        <menuitem parent="menu_invoice_in_credit_note_form" action="act_invoice_in_credit_note_form5"
-            id="menu_invoice_in_credit_note_form5" sequence="4"/>
-
-        <record model="ir.model.access" id="access_invoice">
-            <field name="model" search="[('model', '=', 'account.invoice')]"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="False"/>
-            <field name="perm_create" eval="True"/>
-            <field name="perm_delete" eval="False"/>
-        </record>
-        <record model="ir.model.access" id="access_invoice_account">
-            <field name="model" search="[('model', '=', 'account.invoice')]"/>
-            <field name="group" ref="account.group_account"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="True"/>
-            <field name="perm_create" eval="True"/>
-            <field name="perm_delete" eval="True"/>
-        </record>
-        <record model="ir.action.report" id="report_invoice">
-            <field name="name">Invoice</field>
-            <field name="model">account.invoice</field>
-            <field name="report_name">account.invoice</field>
-            <field name="report">account_invoice/invoice.odt</field>
-            <field name="style">company/header_A4.odt</field>
-        </record>
-        <record model="ir.sequence.type" id="sequence_type_account_invoice">
-            <field name="name">Invoice</field>
-            <field name="code">account.invoice</field>
-        </record>
-        <record model="workflow" id="invoice_workflow">
-            <field name="name">Invoice workflow</field>
-            <field name="osv">account.invoice</field>
-            <field name="on_create" eval="True"/>
-        </record>
-        <record model="workflow.activity" id="invoice_activity_draft">
-            <field name="name">Draft</field>
-            <field name="workflow" ref="invoice_workflow"/>
-            <field name="kind">function</field>
-            <field name="action">write({'state': 'draft'})</field>
-            <field name="flow_start" eval="True"/>
-        </record>
-        <record model="workflow.activity" id="invoice_activity_proforma">
-            <field name="name">Pro forma</field>
-            <field name="workflow" ref="invoice_workflow"/>
-            <field name="kind">function</field>
-            <field name="action">write({'state': 'proforma'})</field>
-        </record>
-        <record model="workflow.activity" id="invoice_activity_open">
-            <field name="name">Open</field>
-            <field name="workflow" ref="invoice_workflow"/>
-            <field name="kind">function</field>
-            <field name="action">set_number()
create_move()
write({'state': 'open'})
print_invoice()</field>
-        </record>
-        <record model="workflow.activity" id="invoice_activity_paid">
-            <field name="name">Paid</field>
-            <field name="workflow" ref="invoice_workflow"/>
-            <field name="kind">function</field>
-            <field name="action">write({'state': 'paid'})</field>
-            <field name="flow_stop" eval="True"/>
-        </record>
-        <record model="workflow.activity" id="invoice_activity_cancel">
-            <field name="name">Canceled</field>
-            <field name="workflow" ref="invoice_workflow"/>
-            <field name="kind">function</field>
-            <field name="action">write({'state': 'cancel'})</field>
-            <field name="flow_stop" eval="True"/>
-        </record>
-        <record model="workflow.transition" id="invoice_transition_draft_proforma">
-            <field name="act_from" ref="invoice_activity_draft"/>
-            <field name="act_to" ref="invoice_activity_proforma"/>
-            <field name="signal">proforma</field>
-        </record>
-        <record model="workflow.transition" id="invoice_transition_proforma_draft">
-            <field name="act_from" ref="invoice_activity_proforma"/>
-            <field name="act_to" ref="invoice_activity_draft"/>
-            <field name="signal">draft</field>
-        </record>
-        <record model="workflow.transition" id="invoice_transition_draft_open">
-            <field name="act_from" ref="invoice_activity_draft"/>
-            <field name="act_to" ref="invoice_activity_open"/>
-            <field name="signal">open</field>
-            <field name="group" ref="account.group_account"/>
-        </record>
-        <record model="workflow.transition" id="invoice_transition_proforma_open">
-            <field name="act_from" ref="invoice_activity_proforma"/>
-            <field name="act_to" ref="invoice_activity_open"/>
-            <field name="signal">open</field>
-            <field name="group" ref="account.group_account"/>
-        </record>
-        <record model="workflow.transition" id="invoice_transition_open_paid">
-            <field name="act_from" ref="invoice_activity_open"/>
-            <field name="act_to" ref="invoice_activity_paid"/>
-            <field name="trigger_model">account.move.line</field>
-            <field name="trigger_expr_id">[x.id for x in lines_to_pay]</field>
-            <field name="condition">reconciled</field>
-        </record>
-        <record model="workflow.transition" id="invoice_transition_draft_cancel">
-            <field name="act_from" ref="invoice_activity_draft"/>
-            <field name="act_to" ref="invoice_activity_cancel"/>
-            <field name="signal">cancel</field>
-            <field name="group" ref="account.group_account"/>
-        </record>
-        <record model="workflow.transition" id="invoice_transition_proforma_cancel">
-            <field name="act_from" ref="invoice_activity_proforma"/>
-            <field name="act_to" ref="invoice_activity_cancel"/>
-            <field name="signal">cancel</field>
-            <field name="group" ref="account.group_account"/>
-        </record>
-
         <record model="ir.ui.view" id="invoice_line_view_form">
             <field name="model">account.invoice.line</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <form string="Invoice Line" cursor="product">
-                    <label name="invoice"/>
-                    <field name="invoice" colspan="3"/>
-                    <notebook colspan="4">
-                        <page string="General" id="general">
-                            <label name="type"/>
-                            <field name="type"/>
-                            <label name="sequence"/>
-                            <field name="sequence"/>
-                            <label name="product"/>
-                            <field name="product">
-                                <tree string="Products">
-                                    <field name="name" select="1"/>
-                                    <field name="code" select="1"/>
-                                    <field name="list_price_uom" select="2"/>
-                                    <field name="cost_price_uom" select="2"/>
-                                    <field name="default_uom" select="2"/>
-                                    <field name="active" select="2"/>
-                                </tree>
-                            </field>
-                            <label name="account"/>
-                            <field name="account"/>
-                            <newline/>
-                            <label name="description"/>
-                            <field name="description" colspan="3"
-                                spell="_parent_invoice.party_lang"/>
-                            <label name="quantity"/>
-                            <field name="quantity"/>
-                            <label name="unit"/>
-                            <field name="unit"/>
-                            <label name="unit_price"/>
-                            <field name="unit_price"/>
-                            <label name="amount"/>
-                            <field name="amount"/>
-                            <separator name="taxes" colspan="4"/>
-                            <field name="taxes" colspan="4"/>
-                        </page>
-                        <page string="Notes" id="notes">
-                            <separator name="note" colspan="4"/>
-                            <field name="note" colspan="4"
-                                spell="_parent_invoice.party_lang"/>
-                        </page>
-                    </notebook>
-                    <field name="unit_digits" invisible="1" colspan="4"/>
-                    <field name="currency_digits" invisible="1" colspan="4"/>
-                </form>
-                ]]>
-            </field>
-        </record>
-        <record model="ir.ui.view" id="invoice_line_view_tree">
-            <field name="model">account.invoice.line</field>
-            <field name="type">tree</field>
+            <field name="inherit" ref="account_invoice.invoice_line_view_form"/>
             <field name="arch" type="xml">
                 <![CDATA[
-                <tree string="Invoice Lines">
-                    <field name="invoice" select="1"/>
-                    <field name="type" select="1"/>
-                    <field name="product" select="1"/>
-                    <field name="account" select="2"/>
-                    <field name="description" select="1"/>
-                    <field name="quantity" select="2"/>
-                    <field name="unit" select="2"/>
-                    <field name="unit_price" select="2"/>
-                    <field name="taxes"/>
-                    <field name="amount"/>
-                    <field name="unit_digits" tree_invisible="1"/>
-                    <field name="currency_digits" tree_invisible="1"/>
-                </tree>
+                <data>
+                    <xpath
+                        expr="/form/notebook/page/separator[@name="taxes"]"
+                        position="before">
+                        <group col="4" colspan="4" name="analytic_accounts">
+                            <field name="analytic_accounts"/>
+                        </group>
+                    </xpath>
+                </data>
                 ]]>
             </field>
         </record>
-        <record model="ir.model.access" id="access_invoice_line">
-            <field name="model" search="[('model', '=', 'account.invoice.line')]"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="False"/>
-            <field name="perm_create" eval="True"/>
-            <field name="perm_delete" eval="False"/>
-        </record>
-        <record model="ir.model.access" id="access_invoice_line_account">
-            <field name="model" search="[('model', '=', 'account.invoice.line')]"/>
-            <field name="group" ref="account.group_account"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="True"/>
-            <field name="perm_create" eval="True"/>
-            <field name="perm_delete" eval="True"/>
-        </record>
-
-        <record model="ir.ui.view" id="invoice_tax_view_form">
-            <field name="model">account.invoice.tax</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <form string="Invoice Tax">
-                    <label name="invoice"/>
-                    <field name="invoice" colspan="3"/>
-                    <label name="description"/>
-                    <field name="description"/>
-                    <label name="sequence"/>
-                    <field name="sequence"/>
-                    <label name="account"/>
-                    <field name="account"/>
-                    <label name="manual"/>
-                    <field name="manual"/>
-                    <group col="6" colspan="4" string="Tax Code" id="tax_code">
-                        <label name="amount"/>
-                        <field name="amount"/>
-                        <label name="tax_code"/>
-                        <field name="tax_code"/>
-                        <label name="tax_sign"/>
-                        <field name="tax_sign"/>
-                        <label name="base"/>
-                        <field name="base"/>
-                        <label name="base_code"/>
-                        <field name="base_code"/>
-                        <label name="base_sign"/>
-                        <field name="base_sign"/>
-                    </group>
-                    <field name="tax" colspan="4" invisible="1"/>
-                </form>
-                ]]>
-            </field>
-        </record>
-        <record model="ir.ui.view" id="invoice_tax_view_tree">
-            <field name="model">account.invoice.tax</field>
-            <field name="type">tree</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <tree string="Invoice Taxes">
-                    <field name="invoice" select="1"/>
-                    <field name="description" select="1"/>
-                    <field name="account" select="1"/>
-                    <field name="manual" select="2"/>
-                    <field name="base"/>
-                    <field name="amount"/>
-                    <field name="tax" tree_invisible="1"/>
-                </tree>
-                ]]>
-            </field>
-        </record>
-        <record model="ir.model.access" id="access_invoice_tax">
-            <field name="model" search="[('model', '=', 'account.invoice.tax')]"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="False"/>
-            <field name="perm_create" eval="True"/>
-            <field name="perm_delete" eval="False"/>
-        </record>
-        <record model="ir.model.access" id="access_invoice_tax_account">
-            <field name="model" search="[('model', '=', 'account.invoice.tax')]"/>
-            <field name="group" ref="account.group_account"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="True"/>
-            <field name="perm_create" eval="True"/>
-            <field name="perm_delete" eval="True"/>
-        </record>
-
-        <record model="ir.ui.view" id="pay_invoice_init_view_form">
-            <field name="model">account.invoice.pay_invoice.init</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <form string="Pay Invoice">
-                    <label name="amount"/>
-                    <field name="amount"/>
-                    <label name="currency"/>
-                    <field name="currency"/>
-                    <label name="description"/>
-                    <field name="description" colspan="3"/>
-                    <label name="journal"/>
-                    <field name="journal"/>
-                    <label name="date"/>
-                    <field name="date"/>
-                    <field name="currency_digits" colspan="4" invisible="1"/>
-                </form>
-                ]]>
-            </field>
-        </record>
-
-        <record model="ir.ui.view" id="pay_invoice_ask_view_form">
-            <field name="model">account.invoice.pay_invoice.ask</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <form string="Pay Invoice">
-                    <label name="type"/>
-                    <field name="type" colspan="3"/>
-                    <label name="amount"/>
-                    <field name="amount"/>
-                    <label name="currency"/>
-                    <field name="currency"/>
-                    <label name="amount_writeoff"/>
-                    <field name="amount_writeoff"/>
-                    <label name="currency_writeoff"/>
-                    <field name="currency_writeoff"/>
-                    <label name="account_writeoff"/>
-                    <field name="account_writeoff"/>
-                    <label name="journal_writeoff"/>
-                    <field name="journal_writeoff"/>
-                    <separator name="lines" colspan="4"/>
-                    <field name="lines" colspan="4">
-                        <tree string="Lines to Pay" fill="1">
-                            <field name="maturity_date"/>
-                            <field name="debit" sum="Debit"/>
-                            <field name="credit" sum="Credit"/>
-                            <field name="amount_second_currency" sum="Amount Second Currency"/>
-                            <field name="second_currency"/>
-                            <field name="currency_digits" tree_invisible="1"/>
-                            <field name="second_currency_digits" tree_invisible="1"/>
-                        </tree>
-                    </field>
-                    <separator name="payment_lines" colspan="4"/>
-                    <field name="payment_lines" colspan="4">
-                        <tree string="Payment Lines" fill="1">
-                            <field name="date"/>
-                            <field name="debit" sum="Debit"/>
-                            <field name="credit" sum="Credit"/>
-                            <field name="amount_second_currency" sum="Amount Second Currency"/>
-                            <field name="second_currency"/>
-                            <field name="currency_digits" tree_invisible="1"/>
-                            <field name="second_currency_digits" tree_invisible="1"/>
-                        </tree>
-                    </field>
-                    <field name="description" colspan="4" invisible="1"/>
-                    <field name="journal" colspan="4" invisible="1"/>
-                    <field name="date" colspan="4" invisible="1"/>
-                    <field name="company" colspan="4" invisible="1"/>
-                    <field name="invoice" colspan="4" invisible="1"/>
-                </form>
-                ]]>
-            </field>
-        </record>
-
-        <record model="ir.ui.view" id="print_invoice_report_warning_view_form">
-            <field name="model">account.invoice.print_invoice_report.warning</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <form string="Print Invoice" col="2">
-                    <separator string="<b>Warning!</b>" colspan="2"
-                        align="0.5" id="warning"/>
-                    <image name="tryton-dialog-information"/>
-                    <group col="1" id="labels">
-                        <label string="You have selected more than one invoice to print."
-                            align="0.0" id="selected"/>
-                        <label string="The invoices will be sent <i>directly</i> to the printer."
-                            align="0.0" id="printer"/>
-                    </group>
-                </form>
-                ]]>
-            </field>
-        </record>
-
-        <record model="ir.action.wizard" id="print_invoice_report">
-            <field name="name">Invoice</field>
-            <field name="wiz_name">account.invoice.print_invoice_report</field>
-            <field name="model">account.invoice</field>
-        </record>
-        <record model="ir.action.keyword" id="print_invoice_report_keyword">
-            <field name="keyword">form_print</field>
-            <field name="model">account.invoice,0</field>
-            <field name="action" ref="print_invoice_report"/>
-        </record>
-
-        <record model="ir.ui.view" id="credit_invoice_init_view_form">
-            <field name="model">account.invoice.credit_invoice.init</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <form string="Credit Invoice" col="2">
-                    <image name="tryton-dialog-information"/>
-                    <group col="2" id="credit_refund">
-                        <label string="Are you sure to credit those/this invoice(s)?"
-                            align="0.0" id="credit" colspan="2"/>
-                        <label name="with_refund"/>
-                        <field name="with_refund"/>
-                    </group>
-                </form>
-                ]]>
-            </field>
-        </record>
-
-        <record model="ir.action.wizard" id="credit_invoice">
-            <field name="name">Credit</field>
-            <field name="wiz_name">account.invoice.credit_invoice</field>
-            <field name="model">account.invoice</field>
-        </record>
-        <record model="ir.action.keyword" id="credit_invoice_keyword">
-            <field name="keyword">form_action</field>
-            <field name="model">account.invoice,0</field>
-            <field name="action" ref="credit_invoice"/>
-        </record>
-
-        <record model="ir.rule.group" id="rule_group_invoice">
-            <field name="model" search="[('model', '=', 'account.invoice')]"/>
-            <field name="global_p" eval="True"/>
-        </record>
-        <record model="ir.rule" id="rule_invoice1">
-            <field name="field" search="[('name', '=', 'company'), ('model.model', '=', 'account.invoice')]"/>
-            <field name="operator">=</field>
-            <field name="operand">User/Current Company</field>
-            <field name="rule_group" ref="rule_group_invoice"/>
-        </record>
-
-        <record model="ir.rule.group" id="rule_group_invoice_line">
-            <field name="model" search="[('model', '=', 'account.invoice.line')]"/>
-            <field name="global_p" eval="True"/>
-        </record>
-        <record model="ir.rule" id="rule_invoice_line1">
-            <field name="field" search="[('name', '=', 'company'), ('model.model', '=', 'account.invoice.line')]"/>
-            <field name="operator">=</field>
-            <field name="operand">User/Current Company</field>
-            <field name="rule_group" ref="rule_group_invoice_line"/>
-        </record>
     </data>
 </tryton>
diff --git a/party.py b/party.py
deleted file mode 100644
index fba7dfc..0000000
--- a/party.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
-from trytond.model import ModelView, ModelSQL, fields
-
-
-class Address(ModelSQL, ModelView):
-    _name = 'party.address'
-    invoice = fields.Boolean('Invoice')
-
-Address()
-
-
-class Party(ModelSQL, ModelView):
-    _name = 'party.party'
-    payment_term = fields.Property(type='many2one',
-            relation='account.invoice.payment_term',
-            string='Invoice Payment Term')
-    supplier_payment_term = fields.Property(type='many2one',
-            relation='account.invoice.payment_term',
-            string='Supplier Payment Term')
-
-Party()
diff --git a/party.xml b/party.xml
deleted file mode 100644
index 4d89ade..0000000
--- a/party.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<tryton>
-    <data>
-        <record model="ir.ui.view" id="address_view_tree">
-            <field name="model">party.address</field>
-            <field name="inherit" ref="party.address_view_tree"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/tree/field[@name="active"]" position="after">
-                        <field name="invoice" select="2"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
-        </record>
-        <record model="ir.ui.view" id="address_view_form">
-            <field name="model">party.address</field>
-            <field name="inherit" ref="party.address_view_form"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/form/group/field[@name="active"]"
-                        position="after">
-                        <label name="invoice"/>
-                        <field name="invoice" xexpand="0" width="25"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
-        </record>
-
-        <record model="ir.ui.view" id="party_view_form">
-            <field name="model">party.party</field>
-            <field name="inherit" ref="party.party_view_form"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/form/notebook/page[@id="accounting"]/field[@name="vat_number"]"
-                        position="after">
-                        <separator string="Payment Terms" colspan="4" id="payment_terms"/>
-                        <label name="payment_term"/>
-                        <field name="payment_term"/>
-                        <label name="supplier_payment_term"/>
-                        <field name="supplier_payment_term"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
-        </record>
-
-        <record model="ir.action.act_window" id="act_invoice_form2">
-            <field name="name">Invoices</field>
-            <field name="res_model">account.invoice</field>
-            <field name="view_type">form</field>
-            <field name="domain">[("party", "=", active_id)]</field>
-        </record>
-        <record model="ir.action.keyword"
-                id="act_open_invoice_keyword1">
-            <field name="keyword">form_relate</field>
-            <field name="model">party.party,0</field>
-            <field name="action" ref="act_invoice_form2"/>
-        </record>
-
-    </data>
-</tryton>
diff --git a/payment_term.py b/payment_term.py
deleted file mode 100644
index 8640332..0000000
--- a/payment_term.py
+++ /dev/null
@@ -1,221 +0,0 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of
-#this repository contains the full copyright notices and license terms.
-from trytond.model import ModelView, ModelSQL, fields
-from trytond.backend import TableHandler
-from decimal import Decimal
-import datetime
-import mx.DateTime
-
-
-class PaymentTerm(ModelSQL, ModelView):
-    'Payment Term'
-    _name = 'account.invoice.payment_term'
-    _description = __doc__
-    name = fields.Char('Payment Term', size=None, required=True, translate=True)
-    active = fields.Boolean('Active')
-    description = fields.Text('Description', translate=True)
-    lines = fields.One2Many('account.invoice.payment_term.line', 'payment',
-            'Lines')
-
-    def __init__(self):
-        super(PaymentTerm, self).__init__()
-        self._order.insert(0, ('name', 'ASC'))
-        self._error_messages.update({
-            'invalid_line': 'Invalid payment term line!',
-            'missing_remainder': 'Payment term missing a remainder line!',
-            })
-
-    def default_active(self, cursor, user, context=None):
-        return True
-
-    def compute(self, cursor, user, amount, currency, payment_term, date=None,
-            context=None):
-        '''
-        Return list with (date, amount) for each payment term lines
-        '''
-        #TODO implement business_days
-        # http://pypi.python.org/pypi/BusinessHours/
-        type_obj = self.pool.get('account.invoice.payment_term.line.type')
-        delay_obj = self.pool.get(
-                'account.invoice.payment_term.line.delay')
-        currency_obj = self.pool.get('currency.currency')
-        date_obj = self.pool.get('ir.date')
-
-        res = []
-        if date is None:
-            date = date_obj.today(cursor, user, context=context)
-        remainder = amount
-        for line in payment_term.lines:
-            value = type_obj.get_value(cursor, user, line, remainder, currency,
-                    context)
-            value_date = delay_obj.get_date(cursor, user, line, date, context)
-            if not value or not value_date:
-                if (not remainder) and line.amount:
-                    self.raise_user_error(cursor, 'invalid_line',
-                            context=context)
-                else:
-                    continue
-            res.append((value_date, value))
-            remainder -= value
-        if not currency_obj.is_zero(cursor, user, currency, remainder):
-            self.raise_user_error(cursor, 'missing_remainder',
-                    context=context)
-        return res
-
-PaymentTerm()
-
-
-class PaymentTermLineType(ModelSQL, ModelView):
-    'Payment Term Line Type'
-    _name = 'account.invoice.payment_term.line.type'
-    _description = __doc__
-    name = fields.Char('Name', size=None, translate=True, required=True)
-    code = fields.Char('Code', size=None, required=True)
-
-    def __init__(self):
-        super(PaymentTermLineType, self).__init__()
-        self._sql_constraints += [
-            ('code_uniq', 'UNIQUE(code)', 'The code must be unique!'),
-        ]
-        self._order.insert(0, ('name', 'ASC'))
-
-    def get_value(self, cursor, user, line, amount, currency, context=None):
-        currency_obj = self.pool.get('currency.currency')
-        if line.type == 'fixed':
-            return currency_obj.compute(cursor, user, line.currency,
-                    line.amount, currency, context=context)
-        elif line.type == 'percent':
-            return currency_obj.round(cursor, user, currency,
-                    amount * line.percentage / Decimal('100'))
-        elif line.type == 'remainder':
-            return currency_obj.round(cursor, user, currency, amount)
-        return None
-
-PaymentTermLineType()
-
-
-class PaymentTermLineDelay(ModelSQL, ModelView):
-    'Payment Term Line Delay'
-    _name = 'account.invoice.payment_term.line.delay'
-    _description = __doc__
-    name = fields.Char('Name', size=None, translate=True, required=True)
-    code = fields.Char('Code', size=None, required=True)
-
-    def __init__(self):
-        super(PaymentTermLineDelay, self).__init__()
-        self._sql_constraints += [
-            ('code_uniq', 'UNIQUE(code)', 'The code must be unique!'),
-        ]
-        self._order.insert(0, ('name', 'ASC'))
-
-    def get_date(self, cursor, user, line, date, context=None):
-        value = None
-        if line.delay == 'net_days':
-            value = mx.DateTime.strptime(str(date), '%Y-%m-%d') + \
-                    mx.DateTime.RelativeDateTime(days=line.days)
-        elif line.delay == 'end_month':
-            value = mx.DateTime.strptime(str(date), '%Y-%m-%d') + \
-                    mx.DateTime.RelativeDateTime(days=line.days) + \
-                    mx.DateTime.RelativeDateTime(day=-1)
-        if value:
-            return datetime.date(value.year, value.month, value.day)
-        return None
-
-PaymentTermLineDelay()
-
-
-class PaymentTermLine(ModelSQL, ModelView):
-    'Payment Term Line'
-    _name = 'account.invoice.payment_term.line'
-    _description = __doc__
-    sequence = fields.Integer('Sequence',
-            help='Use to order lines in ascending order')
-    payment = fields.Many2One('account.invoice.payment_term', 'Payment Term',
-            required=True, ondelete="CASCADE")
-    type = fields.Selection('get_type', 'Type', required=True,
-            on_change=['type'])
-    percentage = fields.Numeric('Percentage', digits=(16, 8),
-            states={
-                'invisible': "type != 'percent'",
-                'required': "type == 'percent'",
-            }, help='In %')
-    amount = fields.Numeric('Amount', digits="(16, currency_digits)",
-            states={
-                'invisible': "type != 'fixed'",
-                'required': "type == 'fixed'",
-            })
-    currency = fields.Many2One('currency.currency', 'Currency',
-            states={
-                'invisible': "type != 'fixed'",
-                'required': "type == 'fixed'",
-            })
-    currency_digits = fields.Function('get_currency_digits', type='integer',
-            string='Currency Digits', on_change_with=['currency'])
-    days = fields.Integer('Number of Days')
-    delay = fields.Selection('get_delay', 'Condition', required=True)
-
-    def __init__(self):
-        super(PaymentTermLine, self).__init__()
-        self._order.insert(0, ('sequence', 'ASC'))
-
-    def init(self, cursor, module_name):
-        super(PaymentTermLine, self).init(cursor, module_name)
-        table = TableHandler(cursor, self, module_name)
-
-        # Migration from 1.0 percent change into percentage
-        if table.column_exist('percent'):
-            cursor.execute('UPDATE "' + self._table + '" ' \
-                    'SET percentage = percent * 100')
-            table.drop_column('percent', exception=True)
-
-    def default_type(self, cursor, user, context=None):
-        return 'remainder'
-
-    def default_delay(self, cursor, user, context=None):
-        return 'net_days'
-
-    def get_type(self, cursor, user, context=None):
-        type_obj = self.pool.get('account.invoice.payment_term.line.type')
-        type_ids = type_obj.search(cursor, user, [], context=context)
-        types = type_obj.browse(cursor, user, type_ids, context=context)
-        return [(x.code, x.name) for x in types]
-
-    def get_delay(self, cursor, user, context=None):
-        delay_obj = self.pool.get('account.invoice.payment_term.line.delay')
-        delay_ids = delay_obj.search(cursor, user, [], context=context)
-        delays = delay_obj.browse(cursor, user, delay_ids,
-                context=context)
-        return [(x.code, x.name) for x in delays]
-
-    def on_change_type(self, cursor, user, ids, vals, context=None):
-        if not 'type' in vals:
-            return {}
-        res = {}
-        if vals['type'] != 'fixed':
-            res['amount'] = Decimal('0.0')
-            res['currency'] =  False
-        if vals['type'] != 'percent':
-            res['percentage'] =  Decimal('0.0')
-        return res
-
-    def on_change_with_currency_digits(self, cursor, user, ids, vals,
-            context=None):
-        currency_obj = self.pool.get('currency.currency')
-        if vals.get('currency'):
-            currency = currency_obj.browse(cursor, user, vals['currency'],
-                    context=context)
-            return currency.digits
-        return 2
-
-    def get_currency_digits(self, cursor, user, ids, name, arg, context=None):
-        res = {}
-        for line in self.browse(cursor, user, ids, context=context):
-            if line.currency:
-                res[line.id] = line.currency.digits
-            else:
-                res[line.id] = 2
-        return res
-
-PaymentTermLine()
-
-
diff --git a/payment_term.xml b/payment_term.xml
deleted file mode 100644
index 449b414..0000000
--- a/payment_term.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<tryton>
-    <data>
-        <record model="ir.ui.view" id="payment_term_view_form">
-            <field name="model">account.invoice.payment_term</field>
-            <field name="type">form</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <form string="Payment Term">
-                    <label name="name"/>
-                    <field name="name"/>
-                    <label name="active"/>
-                    <field name="active" xexpand="0" width="100"/>
-                    <field name="description" colspan="4"/>
-                    <field name="lines" colspan="4">
-                        <tree string="Payment Term Line" sequence="sequence">
-                            <field name="type"/>
-                            <field name="percentage"/>
-                            <field name="amount"/>
-                            <field name="currency"/>
-                            <field name="days"/>
-                            <field name="delay"/>
-                            <field name="sequence" tree_invisible="1"/>
-                            <field name="currency_digits" tree_invisible="1"/>
-                        </tree>
-                        <form string="Payment Term Lines">
-                            <label name="type"/>
-                            <field name="type"/>
-                            <group col="1" id="label_amount_percent">
-                                <label name="percentage" fill="1" xexpand="1" expand="1"/>
-                                <label name="amount" fill="1" xexpand="1" expand="1"/>
-                            </group>
-                            <group col="3" id="amount_percent">
-                                <field name="percentage" colspan="3"/>
-                                <field name="amount"/>
-                                <label name="currency"/>
-                                <field name="currency"/>
-                            </group>
-                            <label name="days"/>
-                            <field name="days"/>
-                            <label name="delay"/>
-                            <field name="delay"/>
-                            <field name="currency_digits" invisible="1"/>
-                        </form>
-                    </field>
-                </form>
-                ]]>
-            </field>
-        </record>
-        <record model="ir.ui.view" id="payment_term_view_tree">
-            <field name="model">account.invoice.payment_term</field>
-            <field name="type">tree</field>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <tree string="Payment Terms">
-                    <field name="name" select="1"/>
-                    <field name="active" select="1"/>
-                </tree>
-                ]]>
-            </field>
-        </record>
-        <record model="ir.action.act_window" id="act_payment_term_form">
-            <field name="name">Payment Terms</field>
-            <field name="res_model">account.invoice.payment_term</field>
-            <field name="view_type">form</field>
-        </record>
-        <record model="ir.action.act_window.view" id="act_payment_term_form_view1">
-            <field name="sequence" eval="10"/>
-            <field name="view" ref="payment_term_view_tree"/>
-            <field name="act_window" ref="act_payment_term_form"/>
-        </record>
-        <record model="ir.action.act_window.view" id="act_payment_term_form_view2">
-            <field name="sequence" eval="20"/>
-            <field name="view" ref="payment_term_view_form"/>
-            <field name="act_window" ref="act_payment_term_form"/>
-        </record>
-        <record model="ir.model.access" id="access_payment_term">
-            <field name="model" search="[('model', '=', 'account.invoice.payment_term')]"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="False"/>
-            <field name="perm_create" eval="False"/>
-            <field name="perm_delete" eval="False"/>
-        </record>
-        <record model="ir.model.access" id="access_payment_term_account_admin">
-            <field name="model" search="[('model', '=', 'account.invoice.payment_term')]"/>
-            <field name="group" ref="account.group_account_admin"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="True"/>
-            <field name="perm_create" eval="True"/>
-            <field name="perm_delete" eval="True"/>
-        </record>
-        <record model="ir.model.access" id="access_payment_term_line">
-            <field name="model" search="[('model', '=', 'account.invoice.payment_term.line')]"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="False"/>
-            <field name="perm_create" eval="False"/>
-            <field name="perm_delete" eval="False"/>
-        </record>
-        <record model="ir.model.access" id="access_payment_term_line_account_admin">
-            <field name="model"
-                search="[('model', '=', 'account.invoice.payment_term.line')]"/>
-            <field name="group" ref="account.group_account_admin"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="True"/>
-            <field name="perm_create" eval="True"/>
-            <field name="perm_delete" eval="True"/>
-        </record>
-
-        <menuitem parent="menu_payment_terms_configuration"
-            action="act_payment_term_form" id="menu_payment_term_form"/>
-
-        <record model="account.invoice.payment_term.line.type"
-            id="payment_term_line_type_fixed">
-            <field name="name">Fixed</field>
-            <field name="code">fixed</field>
-        </record>
-        <record model="account.invoice.payment_term.line.type"
-            id="payment_term_line_type_percent">
-            <field name="name">Percentage</field>
-            <field name="code">percent</field>
-        </record>
-        <record model="account.invoice.payment_term.line.type"
-            id="payment_term_line_type_remainder">
-            <field name="name">Remainder</field>
-            <field name="code">remainder</field>
-        </record>
-
-        <record model="account.invoice.payment_term.line.delay"
-            id="payment_term_line_delay_net_days">
-            <field name="name">Net Days</field>
-            <field name="code">net_days</field>
-        </record>
-        <record model="account.invoice.payment_term.line.delay"
-            id="payment_term_line_delay_end_month">
-            <field name="name">End Month</field>
-            <field name="code">end_month</field>
-        </record>
-        <record model="ir.model.access" id="access_payment_term_line_type">
-            <field name="model"
-                search="[('model', '=', 'account.invoice.payment_term.line.type')]"/>
-            <field name="perm_read" eval="True"/>
-            <field name="perm_write" eval="False"/>
-            <field name="perm_create" eval="False"/>
-            <field name="perm_delete" eval="False"/>
-        </record>
-    </data>
-</tryton>
diff --git a/setup.py b/setup.py
index 0c8de7e..b0e0eec 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ import re
 
 info = eval(file('__tryton__.py').read())
 
-requires = ['egenix-mx-base']
+requires = []
 for dep in info.get('depends', []):
     match = re.compile(
             '(ir|res|workflow|webdav)((\s|$|<|>|<=|>=|==|!=).*?$)').match(dep)
@@ -21,7 +21,7 @@ major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
 requires.append('trytond >= %s.%s' % (major_version, minor_version))
 requires.append('trytond < %s.%s' % (major_version, str(int(minor_version) + 1)))
 
-setup(name='trytond_account_invoice',
+setup(name='trytond_analytic_invoice',
     version=info.get('version', '0.0.1'),
     description=info.get('description', ''),
     author=info.get('author', ''),
@@ -29,14 +29,13 @@ setup(name='trytond_account_invoice',
     url=info.get('website', ''),
     download_url="http://downloads.tryton.org/" + \
             info.get('version', '0.0.1').rsplit('.', 1)[0] + '/',
-    package_dir={'trytond.modules.account_invoice': '.'},
+    package_dir={'trytond.modules.analytic_invoice': '.'},
     packages=[
-        'trytond.modules.account_invoice',
+        'trytond.modules.analytic_invoice',
     ],
     package_data={
-        'trytond.modules.account_invoice': info.get('xml', []) \
-                + info.get('translation', []) \
-                + ['invoice.odt'],
+        'trytond.modules.analytic_invoice': info.get('xml', []) \
+                + info.get('translation', []),
     },
     classifiers=[
         'Development Status :: 5 - Production/Stable',
@@ -59,6 +58,6 @@ setup(name='trytond_account_invoice',
     zip_safe=False,
     entry_points="""
     [trytond.modules]
-    account_invoice = trytond.modules.account_invoice
+    analytic_invoice = trytond.modules.analytic_invoice
     """,
 )
diff --git a/trytond_account_invoice.egg-info/SOURCES.txt b/trytond_account_invoice.egg-info/SOURCES.txt
deleted file mode 100644
index ecd4482..0000000
--- a/trytond_account_invoice.egg-info/SOURCES.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-CHANGELOG
-COPYRIGHT
-INSTALL
-LICENSE
-MANIFEST.in
-README
-TODO
-account.xml
-de_DE.csv
-es_CO.csv
-es_ES.csv
-fr_FR.csv
-invoice.odt
-invoice.xml
-party.xml
-payment_term.xml
-setup.py
-./__init__.py
-./__tryton__.py
-./account.py
-./invoice.py
-./party.py
-./payment_term.py
-trytond_account_invoice.egg-info/PKG-INFO
-trytond_account_invoice.egg-info/SOURCES.txt
-trytond_account_invoice.egg-info/dependency_links.txt
-trytond_account_invoice.egg-info/entry_points.txt
-trytond_account_invoice.egg-info/not-zip-safe
-trytond_account_invoice.egg-info/requires.txt
-trytond_account_invoice.egg-info/top_level.txt
\ No newline at end of file
diff --git a/trytond_account_invoice.egg-info/entry_points.txt b/trytond_account_invoice.egg-info/entry_points.txt
deleted file mode 100644
index b324fbd..0000000
--- a/trytond_account_invoice.egg-info/entry_points.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-    [trytond.modules]
-    account_invoice = trytond.modules.account_invoice
-    
\ No newline at end of file
diff --git a/trytond_account_invoice.egg-info/requires.txt b/trytond_account_invoice.egg-info/requires.txt
deleted file mode 100644
index 3ba4229..0000000
--- a/trytond_account_invoice.egg-info/requires.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-egenix-mx-base
-trytond_account
-trytond_company
-trytond_party
-trytond_product
-trytond_currency
-trytond_account_product
-trytond >= 1.2
-trytond < 1.3
\ No newline at end of file
diff --git a/trytond_account_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
similarity index 71%
rename from trytond_account_invoice.egg-info/PKG-INFO
rename to trytond_analytic_invoice.egg-info/PKG-INFO
index 258b2a5..0aa6af9 100644
--- a/trytond_account_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,15 +1,7 @@
 Metadata-Version: 1.0
-Name: trytond-account-invoice
-Version: 1.2.1
-Summary: Financial and Accounting Module with:
-    - Payment Term
-    - Invoice / Credit Note
-    - Supplier Invoice / Supplier Credit Note
-
-With the possibilities:
-    - to follow the payment of the invoices.
-    - to define invoice sequences on fiscal year or period.
-    - to credit any invoice.
+Name: trytond-analytic-invoice
+Version: 1.2.0
+Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
new file mode 100644
index 0000000..bfe7099
--- /dev/null
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -0,0 +1,22 @@
+CHANGELOG
+COPYRIGHT
+INSTALL
+LICENSE
+MANIFEST.in
+README
+de_DE.csv
+es_CO.csv
+es_ES.csv
+fr_FR.csv
+invoice.xml
+setup.py
+./__init__.py
+./__tryton__.py
+./invoice.py
+trytond_analytic_invoice.egg-info/PKG-INFO
+trytond_analytic_invoice.egg-info/SOURCES.txt
+trytond_analytic_invoice.egg-info/dependency_links.txt
+trytond_analytic_invoice.egg-info/entry_points.txt
+trytond_analytic_invoice.egg-info/not-zip-safe
+trytond_analytic_invoice.egg-info/requires.txt
+trytond_analytic_invoice.egg-info/top_level.txt
\ No newline at end of file
diff --git a/trytond_account_invoice.egg-info/dependency_links.txt b/trytond_analytic_invoice.egg-info/dependency_links.txt
similarity index 100%
rename from trytond_account_invoice.egg-info/dependency_links.txt
rename to trytond_analytic_invoice.egg-info/dependency_links.txt
diff --git a/trytond_analytic_invoice.egg-info/entry_points.txt b/trytond_analytic_invoice.egg-info/entry_points.txt
new file mode 100644
index 0000000..f92f1a3
--- /dev/null
+++ b/trytond_analytic_invoice.egg-info/entry_points.txt
@@ -0,0 +1,4 @@
+
+    [trytond.modules]
+    analytic_invoice = trytond.modules.analytic_invoice
+    
\ No newline at end of file
diff --git a/trytond_account_invoice.egg-info/not-zip-safe b/trytond_analytic_invoice.egg-info/not-zip-safe
similarity index 100%
rename from trytond_account_invoice.egg-info/not-zip-safe
rename to trytond_analytic_invoice.egg-info/not-zip-safe
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
new file mode 100644
index 0000000..b1fdc3d
--- /dev/null
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -0,0 +1,4 @@
+trytond_account_invoice
+trytond_analytic_account
+trytond >= 1.2
+trytond < 1.3
\ No newline at end of file
diff --git a/trytond_account_invoice.egg-info/top_level.txt b/trytond_analytic_invoice.egg-info/top_level.txt
similarity index 100%
rename from trytond_account_invoice.egg-info/top_level.txt
rename to trytond_analytic_invoice.egg-info/top_level.txt
commit f6fd07dbd49612ae93ee761b2c59a35ee2e27b71
Author: Daniel Baumann <daniel at debian.org>
Date:   Fri Jul 10 14:24:21 2009 +0200

    Releasing debian version 1.2.1-1.

diff --git a/debian/changelog b/debian/changelog
index d489671..754bf3b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-modules-analytic-invoice (1.2.1-1) unstable; urgency=low
+
+  * Updating package to standards version 3.8.2.
+  * Merging upstream version 1.2.1.
+
+ -- Daniel Baumann <daniel at debian.org>  Fri, 10 Jul 2009 14:24:14 +0200
+
 tryton-modules-analytic-invoice (1.2.0-1) unstable; urgency=low
 
   [ Daniel Baumann ]
commit 35322e336818bb4744499e7abcf4e6ecf18aa3c8
Author: Daniel Baumann <daniel at debian.org>
Date:   Fri Jul 10 14:24:02 2009 +0200

    Merging upstream version 1.2.1.

diff --git a/CHANGELOG b/CHANGELOG
index d28f483..0f9bc23 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,12 @@
+Version 1.2.1 - 2009-07-07
+* Some bug fixes (see mercurial logs for details)
+
 Version 1.2.0 - 2009-04-20
 * Bug fixes (see mercurial logs for details)
+* Add accounting date on invoice
+* Use amount_to_pay if amount_to_pay_today is zero in pay invoice wizard
+* Use reference to taxes for invoice line in invoice report
+* Add mechanism for invoice line standalone
 * Allow egg installation
 
 Version 1.0.0 - 2008-11-17
diff --git a/COPYRIGHT b/COPYRIGHT
index 853f1f7..da277a9 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,4 +1,6 @@
+Copyright (C) 2004-2008 Tiny SPRL.
 Copyright (C) 2008-2009 Cédric Krier.
+Copyright (C) 2008-2009 Bertrand Chenal.
 Copyright (C) 2008-2009 B2CK SPRL.
 
 This program is free software: you can redistribute it and/or modify
diff --git a/INSTALL b/INSTALL
index 895fbf8..61f6b9c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,18 +1,23 @@
-Installing trytond_analytic_invoice
-===================================
+Installing trytond_account_invoice
+==================================
 
 Prerequisites
 -------------
 
  * Python 2.4 or later (http://www.python.org/)
+ * egenix-mx-base (http://www.egenix.com/products/python/)
  * trytond 1.1.x (http://www.tryton.org/)
- * trytond_account_invoice (http://www.tryton.org/)
- * trytond_analytic_account (http://www.tryton.org/)
+ * trytond_account (http://www.tryton.org/)
+ * trytond_company (http://www.tryton.org/)
+ * trytond_party (http://www.tryton.org/)
+ * trytond_currency (http://www.tryton.org/)
+ * trytond_product (http://www.tryton.org/)
+ * trytond_account_product (http://www.tryton.org/)
 
 Installation
 ------------
 
-Once you've downloaded and unpacked the trytond_analytic_invoice source release, enter the
+Once you've downloaded and unpacked the trytond_account_invoice source release, enter the
 directory where the archive was unpacked, and run:
 
     python setup.py install
@@ -28,4 +33,4 @@ documentation:
   http://docs.python.org/inst/inst.html
 
 To use without installation, extract the archive into ``trytond/modules`` with
-the directory name analytic_invoice.
+the directory name account_invoice.
diff --git a/PKG-INFO b/PKG-INFO
index f98d718..4aed3db 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,7 +1,15 @@
 Metadata-Version: 1.0
-Name: trytond_analytic_invoice
-Version: 1.2.0
-Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
+Name: trytond_account_invoice
+Version: 1.2.1
+Summary: Financial and Accounting Module with:
+    - Payment Term
+    - Invoice / Credit Note
+    - Supplier Invoice / Supplier Credit Note
+
+With the possibilities:
+    - to follow the payment of the invoices.
+    - to define invoice sequences on fiscal year or period.
+    - to credit any invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/README b/README
index 27ef5eb..845a5ed 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
-trytond_analytic_invoice
-========================
+trytond_account_invoice
+=======================
 
-The analytic_invoice module of the Tryton application platform.
+The account_invoice module of the Tryton application platform.
 See __tryton__.py
 
 Installing
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..66ce446
--- /dev/null
+++ b/TODO
@@ -0,0 +1,2 @@
+- Add a reference field on the invoice to provide links to other
+  models (e.g. sale, purchase)
\ No newline at end of file
diff --git a/__init__.py b/__init__.py
index 646e21a..87e60c6 100644
--- a/__init__.py
+++ b/__init__.py
@@ -1,3 +1,7 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
 
+from payment_term import *
 from invoice import *
+from party import *
+from account import *
diff --git a/__tryton__.py b/__tryton__.py
index 55c768c..598377d 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -1,41 +1,86 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 {
-    'name': 'Analytic Invoice',
-    'name_de_DE': 'Kostenstellen Rechnungsstellung',
-    'name_es_CO': 'Facturación Analítica',
-    'name_es_ES': 'Facturación Analítica',
-    'name_fr_FR': 'Facturation analytique',
-    'version': '1.2.0',
+    'name': 'Account Invoice',
+    'name_de_DE': 'Fakturierung',
+    'name_fr_FR': 'Facturation',
+    'name_es_CO': 'Facturación',
+    'name_es_ES': 'Facturación',
+    'version': '1.2.1',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
-    'description': '''Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
+    'description': '''Financial and Accounting Module with:
+    - Payment Term
+    - Invoice / Credit Note
+    - Supplier Invoice / Supplier Credit Note
+
+With the possibilities:
+    - to follow the payment of the invoices.
+    - to define invoice sequences on fiscal year or period.
+    - to credit any invoice.
 ''',
-    'description_de_DE': ''' - Fügt Kostenstellen zu Rechnungszeilen hinzu
- - Erstellt Positionen für Kostenstellen bei Buchung von Rechnungen
+    'description_de_DE': '''Modul für Buchhaltung und Fakturierung mit:
+    - Definition von Zahlungsbedingungen
+    - Erstellung von Rechnungen und Gutschriften für Kunden
+    - Erstellung von Rechnungen und Gutschriften für Lieferanten
+
+Ermöglicht:
+    - die Verfolgung der Bezahlung von Rechnungen
+    - die Definition von Rechnungssequenzen für das Geschäftsjahr bzw. die Buchungszeiträume
+    - die Erstellung von Gutschriften zu jeglicher Rechnung
 ''',
-    'description_es_CO': ''' - Adición de contabilidad analítica a las líneas de facturación 
- -  Generación de líneas analíticas en la factura.
+    'description_fr_FR': '''Module financier et comptable avec:
+    - Condition de paiement
+    - Facture / Note de crédit
+    - Facture fournisseur / Note de crédit fournisseur
+
+Avec la possibilité:
+    - de suivre le paiment des factures
+    - de définir les numérotations de facture par période ou par année fiscale
+    - de créditer n'importe quelle facture
 ''',
-    'description_es_ES': ''' - Adición de contabilidad analítica a las líneas de facturación 
- -  Generación de líneas analíticas en la factura.
+    'description_es_CO': '''Módulo Financiero y de Contabilidad con:
+    - Términos de Pago
+    - Notas de Facturación / Crédito
+    - Factura de Proveedores / Nota de Crédito de Proveedores
+
+Con las posibilidades de:
+    - hacer seguimiento al pago de facturas.
+    - definir secuencias de facturas en año o período fiscal.
+    - acreditar una factura.
 ''',
-    'description_fr_FR': '''Ajoute la comptabilité analytique sur les lignes '''
-    '''de facture et génère les lignes analytiques sur les mouvements de la '''
-    '''facture.''',
+    'description_es_ES': '''Módulo Financiero y de Contabilidad con:
+    - Términos de Pago
+    - Notas de Facturación / Crédito
+    - Factura de Proveedores / Nota de Crédito de Proveedores
 
+Con las posibilidades de:
+    - hacer seguimiento al pago de facturas.
+    - definir secuencias de facturas en año o período fiscal.
+    - acreditar una factura.
+''',
     'depends': [
-        'account_invoice',
-        'analytic_account',
+        'ir',
+        'account',
+        'company',
+        'party',
+        'product',
+        'res',
+        'workflow',
+        'currency',
+        'account_product',
     ],
     'xml': [
         'invoice.xml',
+        'payment_term.xml',
+        'party.xml',
+        'account.xml',
     ],
     'translation': [
+        'fr_FR.csv',
         'de_DE.csv',
         'es_CO.csv',
         'es_ES.csv',
-        'fr_FR.csv',
-    ],
+    ]
 }
diff --git a/account.py b/account.py
new file mode 100644
index 0000000..bebea80
--- /dev/null
+++ b/account.py
@@ -0,0 +1,181 @@
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
+from trytond.model import ModelView, ModelSQL, fields
+
+
+class FiscalYear(ModelSQL, ModelView):
+    _name = 'account.fiscalyear'
+    out_invoice_sequence = fields.Many2One('ir.sequence.strict',
+            'Customer Invoice Sequence', required=True,
+            domain="[('code', '=', 'account.invoice')," \
+                    "['OR', ('company', '=', company)," \
+                    "('company', '=', False)]]",
+                    context="{'code': 'account.invoice', 'company': company}")
+    in_invoice_sequence = fields.Many2One('ir.sequence.strict',
+            'Supplier Invoice Sequence', required=True,
+            domain="[('code', '=', 'account.invoice')," \
+                    "['OR', ('company', '=', company)," \
+                    "('company', '=', False)]]",
+                    context="{'code': 'account.invoice', 'company': company}")
+    out_credit_note_sequence = fields.Many2One('ir.sequence.strict',
+            'Customer Credit Note Sequence', required=True,
+            domain="[('code', '=', 'account.invoice')," \
+                    "['OR', ('company', '=', company)," \
+                    "('company', '=', False)]]",
+                    context="{'code': 'account.invoice', 'company': company}")
+    in_credit_note_sequence = fields.Many2One('ir.sequence.strict',
+            'Supplier Credit Note Sequence', required=True,
+            domain="[('code', '=', 'account.invoice')," \
+                    "['OR', ('company', '=', company)," \
+                    "('company', '=', False)]]",
+                    context="{'code': 'account.invoice', 'company': company}")
+
+    def __init__(self):
+        super(FiscalYear, self).__init__()
+        self._constraints += [
+            ('check_invoice_sequences', 'different_invoice_sequence'),
+        ]
+        self._error_messages.update({
+            'change_invoice_sequence': 'You can not change ' \
+                    'the invoice sequence if there is already ' \
+                    'an invoice opened in the fiscalyear',
+            'different_invoice_sequence': 'You must have different ' \
+                    'invoice sequences per fiscal year!',
+            })
+
+    def check_invoice_sequences(self, cursor, user, ids):
+        for fiscalyear in self.browse(cursor, user, ids):
+            for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
+                    'out_credit_note_sequence', 'in_credit_note_sequence'):
+                if self.search(cursor, user, [
+                    (sequence, '=', fiscalyear[sequence].id),
+                    ('id', '!=', fiscalyear.id),
+                    ]):
+                    return False
+        return True
+
+    def write(self, cursor, user, ids, vals, context=None):
+        invoice_obj = self.pool.get('account.invoice')
+        for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
+                'out_credit_note_sequence', 'in_credit_note_sequence'):
+            if vals.get(sequence):
+                for fiscalyear in self.browse(cursor, user, ids,
+                        context=context):
+                    if fiscalyear[sequence] and \
+                            fiscalyear[sequence].id != \
+                            vals[sequence]:
+                        if invoice_obj.search(cursor, user, [
+                            ('invoice_date', '>=', fiscalyear.start_date),
+                            ('invoice_date', '<=', fiscalyear.end_date),
+                            ('number', '!=', False),
+                            ('type', '=', sequence[:-9]),
+                            ], context=context):
+                            self.raise_user_error(cursor,
+                                    'change_invoice_sequence', context=context)
+        return super(FiscalYear, self).write(cursor, user, ids, vals,
+                context=context)
+
+FiscalYear()
+
+
+class Period(ModelSQL, ModelView):
+    _name = 'account.period'
+    out_invoice_sequence = fields.Many2One('ir.sequence.strict',
+            'Customer Invoice Sequence',
+            domain="[('code', '=', 'account.invoice')]",
+            context="{'code': 'account.invoice'}",
+            states={
+                'required': "type == 'standard'",
+                'invisible': "type != 'standard'",
+            })
+    in_invoice_sequence = fields.Many2One('ir.sequence.strict',
+            'Supplier Invoice Sequence',
+            domain="[('code', '=', 'account.invoice')]",
+            context="{'code': 'account.invoice'}",
+            states={
+                'required': "type == 'standard'",
+                'invisible': "type != 'standard'",
+            })
+    out_credit_note_sequence = fields.Many2One('ir.sequence.strict',
+            'Customer Credit Note Sequence',
+            domain="[('code', '=', 'account.invoice')]",
+            context="{'code': 'account.invoice'}",
+            states={
+                'required': "type == 'standard'",
+                'invisible': "type != 'standard'",
+            })
+    in_credit_note_sequence = fields.Many2One('ir.sequence.strict',
+            'Supplier Credit Note Sequence',
+            domain="[('code', '=', 'account.invoice')]",
+            context="{'code': 'account.invoice'}",
+            states={
+                'required': "type == 'standard'",
+                'invisible': "type != 'standard'",
+            })
+
+    def __init__(self):
+        super(Period, self).__init__()
+        self._constraints += [
+            ('check_invoice_sequences', 'check_invoice_sequences'),
+        ]
+        self._error_messages.update({
+            'change_invoice_sequence': 'You can not change ' \
+                    'the invoice sequence if there is already ' \
+                    'an invoice opened in the period',
+            'check_invoice_sequences': 'You must have different ' \
+                    'invoice sequences per fiscal year and ' \
+                    'in the same company!',
+            })
+
+    def check_invoice_sequences(self, cursor, user, ids):
+        for period in self.browse(cursor, user, ids):
+            for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
+                    'out_credit_note_sequence', 'in_credit_note_sequence'):
+                if self.search(cursor, user, [
+                    (sequence, '=', period[sequence].id),
+                    ('fiscalyear', '!=', period.fiscalyear.id),
+                    ]):
+                    return False
+                if period[sequence].company \
+                        and period[sequence].company.id != \
+                        period.fiscalyear.company.id:
+                    return False
+        return True
+
+    def create(self, cursor, user, vals, context=None):
+        fiscalyear_obj = self.pool.get('account.fiscalyear')
+        vals = vals.copy()
+        if vals.get('fiscalyear'):
+            fiscalyear = fiscalyear_obj.browse(cursor, user, vals['fiscalyear'],
+                    context=context)
+            for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
+                    'out_credit_note_sequence', 'in_credit_note_sequence'):
+                if not vals.get(sequence):
+                    vals[sequence] = fiscalyear[sequence].id
+        return super(Period, self).create(cursor, user, vals, context=context)
+
+    def write(self, cursor, user, ids, vals, context=None):
+        invoice_obj = self.pool.get('account.invoice')
+
+        if isinstance(ids, (int, long)):
+            ids = [ids]
+
+        for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
+                'out_credit_note_sequence', 'in_credit_note_sequence'):
+            if vals.get(sequence):
+                for period in self.browse(cursor, user, ids, context=context):
+                    if period[sequence] and \
+                            period[sequence].id != \
+                            vals[sequence]:
+                        if invoice_obj.search(cursor, user, [
+                            ('date', '>=', period.start_date),
+                            ('date', '<=', period.end_date),
+                            ('number', '!=', False),
+                            ('type', '=', sequence[:-9]),
+                            ], context=context):
+                            self.raise_user_error(cursor,
+                                    'change_invoice_sequence', context=context)
+        return super(Period, self).write(cursor, user, ids, vals,
+                context=context)
+
+Period()
diff --git a/account.xml b/account.xml
new file mode 100644
index 0000000..275c1b2
--- /dev/null
+++ b/account.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<tryton>
+    <data>
+        <record model="ir.ui.view" id="fiscalyear_view_form">
+            <field name="model">account.fiscalyear</field>
+            <field name="inherit" ref="account.fiscalyear_view_form"/>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <data>
+                    <xpath
+                        expr="/form/notebook/page[@id="sequences"]/field[@name="post_move_sequence"]"
+                        position="after">
+                        <newline/>
+                        <label name="out_invoice_sequence"/>
+                        <field name="out_invoice_sequence"/>
+                        <label name="in_invoice_sequence"/>
+                        <field name="in_invoice_sequence"/>
+                        <label name="out_credit_note_sequence"/>
+                        <field name="out_credit_note_sequence"/>
+                        <label name="in_credit_note_sequence"/>
+                        <field name="in_credit_note_sequence"/>
+                    </xpath>
+                </data>
+                ]]>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="period_view_form">
+            <field name="model">account.period</field>
+            <field name="inherit" ref="account.period_view_form"/>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <data>
+                    <xpath
+                        expr="/form/field[@name="post_move_sequence"]"
+                        position="after">
+                        <newline/>
+                        <label name="out_invoice_sequence"/>
+                        <field name="out_invoice_sequence"/>
+                        <label name="in_invoice_sequence"/>
+                        <field name="in_invoice_sequence"/>
+                        <label name="out_credit_note_sequence"/>
+                        <field name="out_credit_note_sequence"/>
+                        <label name="in_credit_note_sequence"/>
+                        <field name="in_credit_note_sequence"/>
+                    </xpath>
+                </data>
+                ]]>
+            </field>
+        </record>
+    </data>
+</tryton>
diff --git a/de_DE.csv b/de_DE.csv
index 3de2537..dc58aed 100644
--- a/de_DE.csv
+++ b/de_DE.csv
@@ -1,2 +1,348 @@
 type,name,res_id,src,value,fuzzy
-field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Kostenstellen,0
+error,account.fiscalyear,0,You can not change the invoice sequence if there is already an invoice opened in the fiscalyear,"Sie können die Rechnungsnummern-Sequenz nicht ändern, wenn bereits eine Rechnung im laufenden Buchungsjahr eröffnet wurde.",0
+error,account.fiscalyear,0,You must have different invoice sequences per fiscal year!,Für unterschiedliche Geschäftsjahre müssen jeweils eigene Rechnungssequenzen erstellt werden!,0
+error,account.invoice,0,"Base taxes different from invoice lines!
+Re-compute the invoice.",Steuern stimmen nicht mit den Rechnungspositionen überein!,0
+error,account.invoice,0,"Taxes defined but not on invoice lines!
+Re-compute the invoice.","Es sind Steuern definiert, allerdings nicht in den Rechnungspositionen!
+Bitte lassen Sie die Rechnung erneut berechnen.",0
+error,account.invoice,0,"Taxes defined on invoice lines but not on invoice!
+Re-compute the invoice.","Steuern sind für die Rechnungspositionen definiert, allerdings nicht für die Rechnung selbst!
+",0
+error,account.invoice,0,The credit account on journal is missing!,Haben-Konto im Journal fehlt!,0
+error,account.invoice,0,The credit account on journal is the same than the invoice account!,Das Habenkonto des Journals ist das selbe wie das Rechnungskonto!,0
+error,account.invoice,0,The debit account on journal is missing!,Soll-Konto im Journal fehlt,0
+error,account.invoice,0,The debit account on journal is the same than the invoice account!,Das Sollkonto des Journals ist das selbe wie das Rechnungskonto!,0
+error,account.invoice,0,There is no invoice sequence on the period/fiscal year!,Rechnungsnummern-Sequenz für diese Periode oder dieses Buchungsjahr fehlt!,0
+error,account.invoice,0,"You can not create an invoice
+with account from a different invoice company!",Es können keine Rechnungen mit einem Konto von einer anderen rechnungsstellenden Firma angelegt werden,0
+error,account.invoice,0,"You can not modify an invoice that is open, paid or canceled!","Fakturierte, Bezahlte oder Annulierte Rechnungen können nicht geändert werden!",0
+error,account.invoice,0,You can not reset to draft an invoice that has move!,"Eine Rechnung, die Buchungen enthält, kann nicht auf Entwurf zurückgesetzt werden!",0
+error,account.invoice,0,"You can not use the same account
+as on invoice line!",Es kann nicht das selbe Konto verwendet werden!,0
+error,account.invoice.credit_invoice,0,You can not credit with refund an invoice that is not opened!,Die Verrechnung von nicht fakturierten Rechnungen ist nicht möglich!,0
+error,account.invoice.credit_invoice,0,You can not credit with refund an invoice with payments!,"Die Verrechnung einer Rechnung ist nicht möglich, wenn bereits Zahlungen für diese gebucht sind!",0
+error,account.invoice.line,0,"Line with ""line"" type must have an account!","Eine Zeile vom Typ ""Position"" muss einem Konto zugeordnet sein!",0
+error,account.invoice.line,0,"Line without ""line"" type must have an invoice!","Eine Zeile, die nicht vom Typ ""Position"" ist, muss einer Rechnung zugeordnet sein!",0
+error,account.invoice.line,0,"You can not add a line to an invoice that is open, paid or canceled!","Einer Rechnung mit dem Status Fakturiert, Bezahlt oder Annulliert kann keine neue Position hinzugefügt werden!",0
+error,account.invoice.line,0,"You can not create invoice line
+with account with a different invoice company!","Eine Rechnungszeile kann sich nicht
+auf ein Konto eines anderen Unternehmens beziehen!",0
+error,account.invoice.line,0,"You can not modify line from an invoice that is open, paid or canceled!","In einer Rechnung mit dem Status Fakturiert, Bezahlt oder Annulliert können Positionen nicht bearbeitet werden!",0
+error,account.invoice.line,0,"You can not use the same account
+as on the invoice!",Es kann nicht das selbe Konto verwendet werden!,0
+error,account.invoice.pay_invoice,0,You can not create a partial payment with an amount greater then the amount to pay!,Ein Teilbetrag kann nicht größer als der Gesamtbetrag der Rechnung sein!,0
+error,account.invoice.payment_term,0,Invalid payment term line!,Ungültige Position in Zahlungsbedingung!,0
+error,account.invoice.payment_term,0,Payment term missing a remainder line!,In der Zahlungsbedingung fehlt eine Restbetragszeile!,0
+error,account.invoice.payment_term.line.delay,0,The code must be unique!,Code kann nicht mehrfach vergeben werden!,0
+error,account.invoice.payment_term.line.type,0,The code must be unique!,Code kann nicht mehrfach vergeben werden!,0
+error,account.invoice.tax,0,"You can not add a line to an invoice that is open, paid or canceled!","Einer Rechnung mit dem Status Fakturiert, Bezahlt oder Annulliert kann keine neue Position hinzugefügt werden!",0
+error,account.invoice.tax,0,"You can not modify tax from an invoice that is open, paid or canceled!","In Rechnungen mit dem Status Fakturiert, Bezahlt oder Annulliert können Steuern nicht bearbeitet werden!",0
+error,account.period,0,You can not change the invoice sequence if there is already an invoice opened in the period,"Sie können die Rechnungsnummern-Sequenz nicht ändern, wenn bereits eine Rechnung in der laufenden Periode eröffnet wurde.",0
+error,account.period,0,You must have different invoice sequences per fiscal year and in the same company!,Verschiedene Geschäftsjahre eines Unternehmens erfordern unterschiedliche Rechnungssequenzen!,0
+field,"account.fiscalyear,in_credit_note_sequence",0,Supplier Credit Note Sequence,Sequenz Gutschriften Lieferanten,0
+field,"account.fiscalyear,in_invoice_sequence",0,Supplier Invoice Sequence,Sequenz Rechnungen Lieferanten,0
+field,"account.fiscalyear,out_credit_note_sequence",0,Customer Credit Note Sequence,Sequenz Gutschriften Kunden,0
+field,"account.fiscalyear,out_invoice_sequence",0,Customer Invoice Sequence,Sequenz Rechnungen Kunden,0
+field,"account.invoice,account",0,Account,Konto,0
+field,"account.invoice,accounting_date",0,Accounting Date,Buchungsdatum,0
+field,"account.invoice-account.move.line,invoice",0,Invoice,Rechnung,0
+field,"account.invoice-account.move.line,line",0,Payment Line,Zahlungsposition,0
+field,"account.invoice-account.move.line,rec_name",0,Name,Name,0
+field,"account.invoice,amount_to_pay",0,Amount to Pay,Zahlbarer Betrag,0
+field,"account.invoice,amount_to_pay_today",0,Amount to Pay Today,Zahlbarer Betrag (heute),0
+field,"account.invoice,comment",0,Comment,Kommentar,0
+field,"account.invoice,company",0,Company,Unternehmen,0
+field,"account.invoice.credit_invoice.init,with_refund",0,With Refund,Verrechnung,0
+field,"account.invoice,currency",0,Currency,Währung,0
+field,"account.invoice,currency_digits",0,Currency Digits,Währung (signifikante Stellen),0
+field,"account.invoice,description",0,Description,Beschreibung,0
+field,"account.invoice,invoice_address",0,Invoice Address,Rechnungsadresse,0
+field,"account.invoice,invoice_date",0,Invoice Date,Rechnungsdatum,0
+field,"account.invoice,invoice_report",0,Invoice Report,Rechnungsbericht,0
+field,"account.invoice,invoice_report_format",0,Invoice Report Format,Format Rechnungsbericht,0
+field,"account.invoice,journal",0,Journal,Journal,0
+field,"account.invoice.line,account",0,Account,Konto,0
+field,"account.invoice.line-account.tax,line",0,Invoice Line,Rechnungsposition,0
+field,"account.invoice.line-account.tax,rec_name",0,Name,Name,0
+field,"account.invoice.line-account.tax,tax",0,Tax,Steuer,0
+field,"account.invoice.line,amount",0,Amount,Betrag,0
+field,"account.invoice.line,company",0,Company,Unternehmen,0
+field,"account.invoice.line,currency",0,Currency,Währung,0
+field,"account.invoice.line,currency_digits",0,Currency Digits,Stellen Währung,0
+field,"account.invoice.line,description",0,Description,Bezeichnung,0
+field,"account.invoice.line,invoice",0,Invoice,Rechnung,0
+field,"account.invoice.line,invoice_taxes",0,Invoice Taxes,Steuern Rechnung,0
+field,"account.invoice.line,invoice_type",0,Invoice Type,Rechnungstyp,0
+field,"account.invoice.line,note",0,Note,Notiz,0
+field,"account.invoice.line,party",0,Party,Partei,0
+field,"account.invoice.line,product",0,Product,Artikel,0
+field,"account.invoice.line,quantity",0,Quantity,Anzahl,0
+field,"account.invoice.line,rec_name",0,Name,Name,0
+field,"account.invoice,lines",0,Lines,Positionen,0
+field,"account.invoice.line,sequence",0,Sequence,Sequenz,0
+field,"account.invoice,lines_to_pay",0,Lines to Pay,Zahlbare Positionen,0
+field,"account.invoice.line,taxes",0,Taxes,Steuern,0
+field,"account.invoice.line,type",0,Type,Typ,0
+field,"account.invoice.line,unit",0,Unit,Einheit,0
+field,"account.invoice.line,unit_digits",0,Unit Digits,Anzahl Stellen,0
+field,"account.invoice.line,unit_price",0,Unit Price,Einzelpreis,0
+field,"account.invoice,move",0,Move,Buchung,0
+field,"account.invoice,number",0,Number,Nummer,0
+field,"account.invoice,party",0,Party,Partei,0
+field,"account.invoice,party_lang",0,Party Language,Sprache Partei,0
+field,"account.invoice.pay_invoice.ask,account",0,Account,Konto,0
+field,"account.invoice.pay_invoice.ask,account_writeoff",0,Write-Off Account,Konto Ausbuchung,0
+field,"account.invoice.pay_invoice.ask,amount",0,Payment Amount,Betrag,0
+field,"account.invoice.pay_invoice.ask,amount_writeoff",0,Write-Off Amount,Betrag Ausbuchung,0
+field,"account.invoice.pay_invoice.ask,company",0,Company,Unternehmen,0
+field,"account.invoice.pay_invoice.ask,currency",0,Payment Currency,Währung,0
+field,"account.invoice.pay_invoice.ask,currency_digits",0,Payment Currency Digits,Stellen Währung,0
+field,"account.invoice.pay_invoice.ask,currency_digits_writeoff",0,Write-Off Currency Digits,Stellen Währung Ausbuchung,0
+field,"account.invoice.pay_invoice.ask,currency_writeoff",0,Write-Off Currency,Währung Ausbuchung,0
+field,"account.invoice.pay_invoice.ask,date",0,Date,Datum,0
+field,"account.invoice.pay_invoice.ask,description",0,Description,Beschreibung,0
+field,"account.invoice.pay_invoice.ask,invoice",0,Invoice,Rechnung,0
+field,"account.invoice.pay_invoice.ask,journal",0,Journal,Journal,0
+field,"account.invoice.pay_invoice.ask,journal_writeoff",0,Write-Off Journal,Journal Ausbuchung,0
+field,"account.invoice.pay_invoice.ask,lines",0,Lines,Positionen,0
+field,"account.invoice.pay_invoice.ask,lines_to_pay",0,Lines to Pay,Zahlbare Positionen,0
+field,"account.invoice.pay_invoice.ask,payment_lines",0,Payment Lines,Zahlungspositionen,0
+field,"account.invoice.pay_invoice.ask,type",0,Type,Typ,0
+field,"account.invoice.pay_invoice.init,amount",0,Amount,Betrag,0
+field,"account.invoice.pay_invoice.init,currency",0,Currency,Währung,0
+field,"account.invoice.pay_invoice.init,currency_digits",0,Currency Digits,Stellen Währung,0
+field,"account.invoice.pay_invoice.init,date",0,Date,Datum,0
+field,"account.invoice.pay_invoice.init,description",0,Description,Beschreibung,0
+field,"account.invoice.pay_invoice.init,journal",0,Journal,Journal,0
+field,"account.invoice,payment_lines",0,Payment Lines,Zahlungspositionen,0
+field,"account.invoice,payment_term",0,Payment Term,Zahlungsbedingung,0
+field,"account.invoice.payment_term,active",0,Active,Aktiv,0
+field,"account.invoice.payment_term,description",0,Description,Beschreibung,0
+field,"account.invoice.payment_term.line,amount",0,Amount,Betrag,0
+field,"account.invoice.payment_term.line,currency",0,Currency,Währung,0
+field,"account.invoice.payment_term.line,currency_digits",0,Currency Digits,Währung (signifikante Stellen),0
+field,"account.invoice.payment_term.line,days",0,Number of Days,Anzahl an Tagen,0
+field,"account.invoice.payment_term.line,delay",0,Condition,Bedingung,0
+field,"account.invoice.payment_term.line.delay,code",0,Code,Kundennummer,0
+field,"account.invoice.payment_term.line.delay,name",0,Name,Name,0
+field,"account.invoice.payment_term.line.delay,rec_name",0,Name,Name,0
+field,"account.invoice.payment_term.line,payment",0,Payment Term,Zahlungsbedingung,0
+field,"account.invoice.payment_term.line,percentage",0,Percentage,Prozentsatz,0
+field,"account.invoice.payment_term.line,rec_name",0,Name,Name,0
+field,"account.invoice.payment_term,lines",0,Lines,Positionen,0
+field,"account.invoice.payment_term.line,sequence",0,Sequence,Sequenz,0
+field,"account.invoice.payment_term.line,type",0,Type,Typ,0
+field,"account.invoice.payment_term.line.type,code",0,Code,Kundennummer,0
+field,"account.invoice.payment_term.line.type,name",0,Name,Name,0
+field,"account.invoice.payment_term.line.type,rec_name",0,Name,Name,0
+field,"account.invoice.payment_term,name",0,Payment Term,Zahlungsbedingung,0
+field,"account.invoice.payment_term,rec_name",0,Name,Name,0
+field,"account.invoice,rec_name",0,Name,Name,0
+field,"account.invoice,reconciled",0,Reconciled,Abgestimmt,0
+field,"account.invoice,reference",0,Reference,Referenz,0
+field,"account.invoice,state",0,State,Status,0
+field,"account.invoice.tax,account",0,Account,Konto,0
+field,"account.invoice,tax_amount",0,Tax,Steuer,0
+field,"account.invoice.tax,amount",0,Amount,Betrag,0
+field,"account.invoice.tax,base",0,Base,Netto,0
+field,"account.invoice.tax,base_code",0,Base Code,Code Netto,0
+field,"account.invoice.tax,base_sign",0,Base Sign,Vorzeichen (Netto),0
+field,"account.invoice.tax,description",0,Description,Beschreibung,0
+field,"account.invoice,taxes",0,Tax Lines,Steuerpositionen,0
+field,"account.invoice.tax,invoice",0,Invoice,Rechnung,0
+field,"account.invoice.tax,manual",0,Manual,Manuell,0
+field,"account.invoice.tax,rec_name",0,Name,Name,0
+field,"account.invoice.tax,sequence",0,Sequence,Sequenz,0
+field,"account.invoice.tax,sequence_number",0,Sequence Number,Nummer Sequenz,0
+field,"account.invoice.tax,tax",0,Tax,Steuer,0
+field,"account.invoice.tax,tax_code",0,Tax Code,Steuerkennziffer,0
+field,"account.invoice.tax,tax_sign",0,Tax Sign,Vorzeichen (Steuer),0
+field,"account.invoice,total_amount",0,Total,Brutto,0
+field,"account.invoice,type",0,Type,Typ,0
+field,"account.invoice,type_name",0,Type,Typ,0
+field,"account.invoice,untaxed_amount",0,Untaxed,Netto,0
+field,"account.period,in_credit_note_sequence",0,Supplier Credit Note Sequence,Sequenz Gutschriften Lieferanten,0
+field,"account.period,in_invoice_sequence",0,Supplier Invoice Sequence,Sequenz Rechnungen Lieferanten,0
+field,"account.period,out_credit_note_sequence",0,Customer Credit Note Sequence,Sequenz Gutschriften Kunden,0
+field,"account.period,out_invoice_sequence",0,Customer Invoice Sequence,Sequenz Rechnungen Kunden,0
+field,"party.address,invoice",0,Invoice,Rechnungsadresse,0
+field,"party.party,payment_term",0,Invoice Payment Term,Zahlungsbedingung Verkauf,0
+field,"party.party,supplier_payment_term",0,Supplier Payment Term,Zahlungsbedingung Einkauf,0
+help,"account.invoice.credit_invoice.init,with_refund",0,"If true, the current invoice(s) will be paid.",Bei Aktivierung werden die aktuelle(n ) Rechnung(en) und Gutschrift(en) bezahlt und abgestimmt.,0
+help,"account.invoice.payment_term.line,percentage",0,In %,Eingabe in %,0
+help,"account.invoice.payment_term.line,sequence",0,Use to order lines in ascending order,Ordnet Positionen in aufsteigender Reihenfolge,0
+model,"account.invoice-account.move.line,name",0,Invoice - Payment Line,Rechnung - Zahlungsposition,0
+model,"account.invoice.credit_invoice.init,name",0,Credit Invoice Init,Gutschrift Init,0
+model,"account.invoice.line-account.tax,name",0,Invoice Line - Tax,Rechnungsposition - Steuer,0
+model,"account.invoice.line,name",0,Invoice Line,Rechnungsposition,0
+model,"account.invoice,name",0,Invoice,Rechnung,0
+model,"account.invoice.pay_invoice.ask,name",0,Pay Invoice Ask,Zahlung Rechnung Nachfrage,0
+model,"account.invoice.pay_invoice.init,name",0,Pay Invoice Init,Zahlung Rechnung Init,0
+model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_end_month,End Month,Ende Monat,0
+model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_net_days,Net Days,Tage netto,0
+model,"account.invoice.payment_term.line.delay,name",0,Payment Term Line Delay,Zahlungsbedingung Position Frist,0
+model,"account.invoice.payment_term.line,name",0,Payment Term Line,Zahlungsbedingung,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_fixed,Fixed,Fix,0
+model,"account.invoice.payment_term.line.type,name",0,Payment Term Line Type,Zahlungsbedingung Position Typ,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_percent,Percentage,Prozentsatz,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_remainder,Remainder,Rest,0
+model,"account.invoice.payment_term,name",0,Payment Term,Zahlungsbedingung,0
+model,"account.invoice.print_invoice_report.warning,name",0,Print Invoice Report Warning,Druck Rechnung Warnung,0
+model,"account.invoice.tax,name",0,Invoice Tax,Rechnung Steuer,0
+model,"ir.action,name",act_invoice_form,All Invoices,Alle Rechnungen,0
+model,"ir.action,name",credit_invoice,Credit,Gutschrift erstellen,0
+model,"ir.action,name",act_invoice_out_credit_note_form,Credit Notes,Gutschriften an Kunden,0
+model,"ir.action,name",act_invoice_out_credit_note_form2,Credit Notes,Gutschriften,0
+model,"ir.action,name",act_invoice_out_credit_note_form3,Draft Credit Notes,Entwürfe Kundengutschriften,0
+model,"ir.action,name",act_invoice_out_invoice_form3,Draft Invoices,Entwürfe Kundenrechnungen,0
+model,"ir.action,name",act_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Entwürfe Lieferantengutschriften,0
+model,"ir.action,name",act_invoice_in_invoice_form3,Draft Supplier Invoices,Entwürfe Lieferantenrechnungen,0
+model,"ir.action,name",report_invoice,Invoice,Rechnung,0
+model,"ir.action,name",print_invoice_report,Invoice,Rechnung / Gutschrift drucken,0
+model,"ir.action,name",act_invoice_out_invoice_form,Invoices,Rechnungsausgang,0
+model,"ir.action,name",act_invoice_out_invoice_form2,Invoices,Kundenrechnungen,0
+model,"ir.action,name",act_invoice_form2,Invoices,Rechnungen,0
+model,"ir.action,name",act_invoice_out_credit_note_form5,Opened Credit Notes,Fakturierte Kundengutschriften,0
+model,"ir.action,name",act_invoice_out_invoice_form5,Opened Invoices,Fakturierte Kundenrechnungen,0
+model,"ir.action,name",act_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Fakturierte Lieferantengutschriften,0
+model,"ir.action,name",act_invoice_in_invoice_form5,Opened Supplier Invoices,Fakturierte Lieferantenrechnungen,0
+model,"ir.action,name",wizard_pay_invoice,Pay Invoice,Rechnung bezahlen,0
+model,"ir.action,name",act_payment_term_form,Payment Terms,Zahlungsbedingungen,0
+model,"ir.action,name",act_invoice_out_credit_note_form4,Pro Forma Credit Notes,Pro Forma Kundengutschriften,0
+model,"ir.action,name",act_invoice_out_invoice_form4,Pro Forma Invoices,Pro Forma Kundenrechnungen,0
+model,"ir.action,name",act_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Pro Forma Lieferantengutschriften,0
+model,"ir.action,name",act_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Pro Forma Lieferantenrechnungen,0
+model,"ir.action,name",act_invoice_in_credit_note_form,Supplier Credit Notes,Gutschriften von Lieferanten,0
+model,"ir.action,name",act_invoice_in_credit_note_form2,Supplier Credit Notes,Gutschriften von Lieferanten,0
+model,"ir.action,name",act_invoice_in_invoice_form,Supplier Invoices,Rechnungseingang,0
+model,"ir.action,name",act_invoice_in_invoice_form2,Supplier Invoices,Lieferantenrechnungen,0
+model,"ir.sequence.type,name",sequence_type_account_invoice,Invoice,Rechnung,0
+model,"ir.ui.menu,name",menu_invoice_form,All Invoices,Alle Rechnungen,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form,Credit Notes,Gutschriften an Kunden,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form3,Draft Credit Notes,Entwürfe Kundengutschriften,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form3,Draft Invoices,Entwürfe Kundenrechnungen,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Entwürfe Lieferantengutschriften,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form3,Draft Supplier Invoices,Entwürfe Lieferantenrechnungen,0
+model,"ir.ui.menu,name",menu_invoices,Invoices,Rechnungen,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form,Invoices,Rechnungsausgang,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form2,New Credit Note,Neue Gutschrift an Kunden,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form2,New Invoice,Neue Kundenrechnung,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form2,New Supplier Credit Note,Neue Gutschrift von Lieferant,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form2,New Supplier Invoice,Neue Lieferantenrechnung,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form5,Opened Credit Notes,Fakturierte Kundengutschriften,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form5,Opened Invoices,Fakturierte Kundenrechnungen,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Fakturierte Lieferantengutschriften,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form5,Opened Supplier Invoices,Fakturierte Lieferantenrechnungen,0
+model,"ir.ui.menu,name",menu_payment_terms_configuration,Payment Terms,Zahlungsbedingungen,0
+model,"ir.ui.menu,name",menu_payment_term_form,Payment Terms,Zahlungsbedingungen,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form4,Pro Forma Credit Notes,Pro Forma Kundengutschriften,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form4,Pro Forma Invoices,Pro Forma Kundenrechnungen,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Pro Forma Lieferantengutschriften,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Pro Forma Lieferantenrechnungen,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form,Supplier Credit Notes,Gutschriften von Lieferanten,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form,Supplier Invoices,Rechnungseingang,0
+model,"workflow.activity,name",invoice_activity_cancel,Canceled,Annulliert,0
+model,"workflow.activity,name",invoice_activity_draft,Draft,Entwurf,0
+model,"workflow.activity,name",invoice_activity_open,Open,Fakturieren,0
+model,"workflow.activity,name",invoice_activity_paid,Paid,Bezahlt,0
+model,"workflow.activity,name",invoice_activity_proforma,Pro forma,Pro Forma,0
+model,"workflow,name",invoice_workflow,Invoice workflow,Workflow Rechnung,0
+odt,account.invoice,0,Amount,Betrag,0
+odt,account.invoice,0,Base,Netto,0
+odt,account.invoice,0,Credit Note N°:,Gutschrift Nr.:,0
+odt,account.invoice,0,Date,Fällig am,0
+odt,account.invoice,0,Date:,Datum:,0
+odt,account.invoice,0,Description,Beschreibung,0
+odt,account.invoice,0,Description:,Beschreibung:,0
+odt,account.invoice,0,Draft Credit Note,Gutschrift (Entwurf),0
+odt,account.invoice,0,Draft Invoice,Rechnung (Entwurf),0
+odt,account.invoice,0,Draft Supplier Credit Note,Gutschrift (Entwurf),0
+odt,account.invoice,0,Draft Supplier Invoice,Rechnung (Entwurf),0
+odt,account.invoice,0,E-Mail:,E-Mail:,0
+odt,account.invoice,0,Invoice N°:,Rechnung Nr.:,0
+odt,account.invoice,0,Payment Term,Zahlungsbedingung,0
+odt,account.invoice,0,Phone:,Telefon:,0
+odt,account.invoice,0,Pro forma Credit Note,Gutschrift Pro Forma,0
+odt,account.invoice,0,Pro forma Invoice,Rechnung Pro Forma,0
+odt,account.invoice,0,Pro forma Supplier Credit Note,Gutschrift Pro Forma,0
+odt,account.invoice,0,Pro forma Supplier Invoice,Rechnung Pro Forma,0
+odt,account.invoice,0,Quantity,Anzahl,0
+odt,account.invoice,0,Supplier Credit Note N°:,Gutschrift Nr.:,0
+odt,account.invoice,0,Supplier Invoice N°:,Rechnung Nr.:,0
+odt,account.invoice,0,Tax,Steuer,0
+odt,account.invoice,0,Taxes,Steuern,0
+odt,account.invoice,0,Taxes:,Steuern:,0
+odt,account.invoice,0,Total:,Gesamt:,0
+odt,account.invoice,0,Total (excl. taxes):,Netto:,0
+odt,account.invoice,0,Unit Price,Einzelpreis,0
+odt,account.invoice,0,VAT:,USt-ID-Nr:,0
+selection,"account.invoice.line,invoice_type",0,Credit Note,Kundengutschrift,0
+selection,"account.invoice.line,invoice_type",0,Invoice,Lieferantenrechnung,0
+selection,"account.invoice.line,invoice_type",0,Supplier Credit Note,Lieferantengutschrift,0
+selection,"account.invoice.line,invoice_type",0,Supplier Invoice,Lieferantenrechnung,0
+selection,"account.invoice.line,type",0,Comment,Kommentar,0
+selection,"account.invoice.line,type",0,Line,Position,0
+selection,"account.invoice.line,type",0,Subtotal,Zwischensumme,0
+selection,"account.invoice.line,type",0,Title,Überschrift,0
+selection,"account.invoice.pay_invoice.ask,type",0,Partial Payment,Teilzahlung,0
+selection,"account.invoice.pay_invoice.ask,type",0,Write-Off,Ausbuchung,0
+selection,"account.invoice,state",0,Canceled,Annulliert,0
+selection,"account.invoice,state",0,Draft,Entwurf,0
+selection,"account.invoice,state",0,Opened,Fakturiert,0
+selection,"account.invoice,state",0,Paid,Bezahlt,0
+selection,"account.invoice,state",0,Pro forma,Pro Forma,0
+selection,"account.invoice,type",0,Credit Note,Gutschrift an Kunde,0
+selection,"account.invoice,type",0,Invoice,Kundenrechnung,0
+selection,"account.invoice,type",0,Supplier Credit Note,Gutschrift von Lieferant,0
+selection,"account.invoice,type",0,Supplier Invoice,Lieferantenrechnung,0
+view,account.invoice,0,Amount Second Currency,Betrag Zweitwährung,0
+view,account.invoice,0,_Cancel,_Annullieren,0
+view,account.invoice,0,Credit,Haben,0
+view,account.invoice,0,Debit,Soll,0
+view,account.invoice,0,_Draft,_Entwurf,0
+view,account.invoice,0,Invoice,Rechnung,0
+view,account.invoice,0,Invoices,Rechnungen,0
+view,account.invoice,0,Lines,Positionen,0
+view,account.invoice,0,_Open,_Fakturieren,0
+view,account.invoice,0,Other Info,Sonstiges,0
+view,account.invoice,0,_Pay,_Bezahlen,0
+view,account.invoice,0,Payment,Zahlung,0
+view,account.invoice,0,Payment Lines,Zahlungspositionen,0
+view,account.invoice,0,Pro For_ma,_Pro Forma,0
+view,account.invoice,0,_Reset to Draft,Auf Entwurf _Zurücksetzen,0
+view,account.invoice,0,Taxes,Steuern,0
+view,account.invoice.credit_invoice.init,0,Are you sure to credit those/this invoice(s)?,Wollen Sie diese Rechnungen wirklich gutschreiben?,0
+view,account.invoice.credit_invoice.init,0,Credit Invoice,Rechnung gutschreiben,0
+view,account.invoice.line,0,General,Allgemein,0
+view,account.invoice.line,0,Invoice Line,Rechnungsposition,0
+view,account.invoice.line,0,Invoice Lines,Rechnungspositionen,0
+view,account.invoice.line,0,Notes,Notizen,0
+view,account.invoice.line,0,Products,Artikel,0
+view,account.invoice.pay_invoice.ask,0,Amount Second Currency,Betrag Zweitwährung,0
+view,account.invoice.pay_invoice.ask,0,Credit,Haben,0
+view,account.invoice.pay_invoice.ask,0,Debit,Soll,0
+view,account.invoice.pay_invoice.ask,0,Lines to Pay,Zahlbare Positionen,0
+view,account.invoice.pay_invoice.ask,0,Pay Invoice,Rechnung bezahlen,0
+view,account.invoice.pay_invoice.ask,0,Payment Lines,Zahlungspositionen,0
+view,account.invoice.pay_invoice.init,0,Pay Invoice,Rechnung bezahlen,0
+view,account.invoice.payment_term,0,Payment Term,Zahlungsbedingung,0
+view,account.invoice.payment_term,0,Payment Term Line,Zahlungsbedingung,0
+view,account.invoice.payment_term,0,Payment Term Lines,Positionen Zahlungsbedingung,0
+view,account.invoice.payment_term,0,Payment Terms,Zahlungsbedingung,0
+view,account.invoice.print_invoice_report.warning,0,<b>Warning!</b>,<b>Warnung!</b>,0
+view,account.invoice.print_invoice_report.warning,0,Print Invoice,Rechnung / Gutschrift drucken,0
+view,account.invoice.print_invoice_report.warning,0,The invoices will be sent <i>directly</i> to the printer.,Die Rechnungen werden <i>direkt</i> an den Drucker gesendet.,0
+view,account.invoice.print_invoice_report.warning,0,You have selected more than one invoice to print.,Sie haben mehr als eine Rechnung zum ausdrucken gewählt.,0
+view,account.invoice.tax,0,Invoice Tax,Rechnungssteuer,0
+view,account.invoice.tax,0,Invoice Taxes,Rechnungssteuern,0
+view,account.invoice.tax,0,Tax Code,Steuerkennziffer,0
+view,party.party,0,Payment Terms,Zahlungsbedingungen,0
+wizard_button,"account.invoice.credit_invoice,init,credit",0,Credit,Gutschrift erstellen,0
+wizard_button,"account.invoice.credit_invoice,init,end",0,Cancel,Abbrechen,0
+wizard_button,"account.invoice.pay_invoice,ask,end",0,Cancel,Abbrechen,0
+wizard_button,"account.invoice.pay_invoice,ask,pay",0,Ok,OK,0
+wizard_button,"account.invoice.pay_invoice,init,choice",0,Ok,OK,0
+wizard_button,"account.invoice.pay_invoice,init,end",0,Cancel,Abbrechen,0
+wizard_button,"account.invoice.print_invoice_report,warning,end",0,Cancel,Abbrechen,0
+wizard_button,"account.invoice.print_invoice_report,warning,print",0,Print,Drucken,0
diff --git a/es_CO.csv b/es_CO.csv
index 0e71661..d6ba724 100644
--- a/es_CO.csv
+++ b/es_CO.csv
@@ -1,2 +1,349 @@
 type,name,res_id,src,value,fuzzy
-field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Cuentas Analíticas,0
+error,account.fiscalyear,0,You can not change the invoice sequence if there is already an invoice opened in the fiscalyear,No puede cambiar la secuencia de una factura si hay una factura abierta en el año fiscal,0
+error,account.fiscalyear,0,You must have different invoice sequences per fiscal year!,¡Debe tener una secuencia diferente de facturación por año fiscal!,0
+error,account.invoice,0,"Base taxes different from invoice lines!
+Re-compute the invoice.",Los Impuestos Base difieren de las líneas de factura!,0
+error,account.invoice,0,"Taxes defined but not on invoice lines!
+Re-compute the invoice.","Impuestos definidos pero no en líneas de factura!
+Recalcule la factura.",0
+error,account.invoice,0,"Taxes defined on invoice lines but not on invoice!
+Re-compute the invoice.",Impuestos definidos en factura pero no usados en las líneas!,0
+error,account.invoice,0,The credit account on journal is missing!,Falta la cuenta crédito del diario!,0
+error,account.invoice,0,The credit account on journal is the same than the invoice account!,¡La cuenta crédito en el diario es la misma que la cuenta facturada!,0
+error,account.invoice,0,The debit account on journal is missing!,Falta la cuenta débito del diario!,0
+error,account.invoice,0,The debit account on journal is the same than the invoice account!,¡La cuenta débito en el diario es la misma que la cuenta facturada!,0
+error,account.invoice,0,There is no invoice sequence on the period/fiscal year!,No hay una secuencia de facturaas para el período/año fiscal!,0
+error,account.invoice,0,"You can not create an invoice
+with account from a different invoice company!",No puede crear una factura,0
+error,account.invoice,0,"You can not modify an invoice that is open, paid or canceled!","¡No puede modificar una factura abierta, pagada o cancelada!",0
+error,account.invoice,0,You can not reset to draft an invoice that has move!,¡No puede poner en borrador una factura que ha sido movida!,0
+error,account.invoice,0,"You can not use the same account
+as on invoice line!","¡No puede usar la misma cuenta
+como línea en la factura!",0
+error,account.invoice.credit_invoice,0,You can not credit with refund an invoice that is not openned!,¡No puede acreditar una devolución de una factura que no está abierta!,0
+error,account.invoice.credit_invoice,0,You can not credit with refund an invoice with payments!,¡No puede acreditar una devolución de una factura con pagos!,0
+error,account.invoice.line,0,"Line with ""line"" type must have an account!","¡Una línea con tipo de ""línea"" debe tener una cuenta!",0
+error,account.invoice.line,0,"Line without ""line"" type must have an invoice!","¡Una línea sin tipo de ""línea"" debe tener una factura!",0
+error,account.invoice.line,0,"You can not add a line to an invoice that is open, paid or canceled!","No puede adicionar una línea a una factura que está abierta, pagada o cancelada!",0
+error,account.invoice.line,0,"You can not create invoice line
+with account with a different invoice company!","¡No puede crear una línea de factura
+con cuenta a partir de una factura de una compañía distinta!",0
+error,account.invoice.line,0,"You can not modify line from an invoice that is open, paid or canceled!","No puede modificar la línea de una factura que esté abierta, pagada o cancelada!",0
+error,account.invoice.line,0,"You can not use the same account
+as on the invoice!","No puede usar la misma cuenta
+que en la factura!",0
+error,account.invoice.pay_invoice,0,You can not create a partial payment with an amount greater then the amount to pay!,¡No puede crear un pago parcial con un monto mayor que el valor a pagar!,0
+error,account.invoice.payment_term,0,Invalid payment term line!,Línea de opción de pago inválida!,0
+error,account.invoice.payment_term,0,Payment term missing a remainder line!,Hace falta una línea final al término de pago!,0
+error,account.invoice.payment_term.line.delay,0,The code must be unique!,¡El código debe ser único!,0
+error,account.invoice.payment_term.line.type,0,The code must be unique!,¡El código debe ser único!,0
+error,account.invoice.tax,0,"You can not add a line to an invoice that is open, paid or canceled!","No puede adicionar una línea a una factura que está abierta, pagada o cancelada!",0
+error,account.invoice.tax,0,"You can not modify tax from an invoice that is open, paid or canceled!","No puede modificar impuestos de una factura abierta, pagada o cancelada!",0
+error,account.period,0,You can not change the invoice sequence if there is already an invoice opened in the period,No puede cambiar la secuencia de una factura si hay una factura abierta en el período,0
+error,account.period,0,You must have different invoice sequences per fiscal year and in the same company!,¡Debe tener secuencias diferentes de facturas por año fiscal en la misma compañía!,0
+field,"account.fiscalyear,in_credit_note_sequence",0,Supplier Credit Note Sequence,Secuencia de la Nota Crédito del Proveedor,0
+field,"account.fiscalyear,in_invoice_sequence",0,Supplier Invoice Sequence,Secuencia de Factura de Proveedor,0
+field,"account.fiscalyear,out_credit_note_sequence",0,Customer Credit Note Sequence,Secuencia de Nota Crédito de Cliente,0
+field,"account.fiscalyear,out_invoice_sequence",0,Customer Invoice Sequence,Secuencia de Facturas de Cliente,0
+field,"account.invoice,account",0,Account,Cuenta,0
+field,"account.invoice,accounting_date",0,Accounting Date,Fecha de contabilización,0
+field,"account.invoice-account.move.line,invoice",0,Invoice,Factura,0
+field,"account.invoice-account.move.line,line",0,Payment Line,Línea de pago,0
+field,"account.invoice-account.move.line,rec_name",0,Name,Nombre,0
+field,"account.invoice,amount_to_pay",0,Amount to Pay,Cantidad a pagar,0
+field,"account.invoice,amount_to_pay_today",0,Amount to Pay Today,Cantidad a pagar hoy,0
+field,"account.invoice,comment",0,Comment,Comentario,0
+field,"account.invoice,company",0,Company,Compañía,0
+field,"account.invoice.credit_invoice.init,with_refund",0,With Refund,Con devolución,0
+field,"account.invoice,currency",0,Currency,Moneda,0
+field,"account.invoice,currency_digits",0,Currency Digits,Dígitos de Moneda,0
+field,"account.invoice,description",0,Description,Descripción,0
+field,"account.invoice,invoice_address",0,Invoice Address,Dirección de Facturación,0
+field,"account.invoice,invoice_date",0,Invoice Date,Fecha de Factura,0
+field,"account.invoice,invoice_report",0,Invoice Report,Reporte de Facturación,0
+field,"account.invoice,invoice_report_format",0,Invoice Report Format,Formato de Reporte de Facturación,0
+field,"account.invoice,journal",0,Journal,Diario,0
+field,"account.invoice.line,account",0,Account,Cuenta,0
+field,"account.invoice.line-account.tax,line",0,Invoice Line,Línea de Factura,0
+field,"account.invoice.line-account.tax,rec_name",0,Name,Nombre,0
+field,"account.invoice.line-account.tax,tax",0,Tax,Impuesto,0
+field,"account.invoice.line,amount",0,Amount,Cantidad,0
+field,"account.invoice.line,company",0,Company,Compañía,0
+field,"account.invoice.line,currency",0,Currency,Moneda,0
+field,"account.invoice.line,currency_digits",0,Currency Digits,Dígitos de Moneda,0
+field,"account.invoice.line,description",0,Description,Descripción,0
+field,"account.invoice.line,invoice",0,Invoice,Factura,0
+field,"account.invoice.line,invoice_taxes",0,Invoice Taxes,Impuestos de Facturas,0
+field,"account.invoice.line,invoice_type",0,Invoice Type,Tipo de Factura,0
+field,"account.invoice.line,note",0,Note,Nota,0
+field,"account.invoice.line,party",0,Party,Terceros,0
+field,"account.invoice.line,product",0,Product,Producto,0
+field,"account.invoice.line,quantity",0,Quantity,Cantidad,0
+field,"account.invoice.line,rec_name",0,Name,Nombre,0
+field,"account.invoice,lines",0,Lines,Líneas,0
+field,"account.invoice.line,sequence",0,Sequence,Secuencia,0
+field,"account.invoice,lines_to_pay",0,Lines to Pay,Líneas a Pagar,0
+field,"account.invoice.line,taxes",0,Taxes,Impuestos,0
+field,"account.invoice.line,type",0,Type,Tipo,0
+field,"account.invoice.line,unit",0,Unit,Unidad,0
+field,"account.invoice.line,unit_digits",0,Unit Digits,Dígitos de Unidad,0
+field,"account.invoice.line,unit_price",0,Unit Price,Precio Unitario,0
+field,"account.invoice,move",0,Move,Movimiento,0
+field,"account.invoice,number",0,Number,Número,0
+field,"account.invoice,party",0,Party,Tercero,0
+field,"account.invoice,party_lang",0,Party Language,Idioma del Tercero,0
+field,"account.invoice.pay_invoice.ask,account",0,Account,Cuenta,0
+field,"account.invoice.pay_invoice.ask,account_writeoff",0,Write-Off Account,Cuenta de Ajustes,0
+field,"account.invoice.pay_invoice.ask,amount",0,Payment Amount,Valor del Pago,0
+field,"account.invoice.pay_invoice.ask,amount_writeoff",0,Write-Off Amount,Valor del Ajuste,0
+field,"account.invoice.pay_invoice.ask,company",0,Company,Compañía,0
+field,"account.invoice.pay_invoice.ask,currency",0,Payment Currency,Pago en Moneda,0
+field,"account.invoice.pay_invoice.ask,currency_digits",0,Payment Currency Digits,Dígitos de Pago de Moneda,0
+field,"account.invoice.pay_invoice.ask,currency_digits_writeoff",0,Write-Off Currency Digits,Ajuste de Dígitos de Moneda,0
+field,"account.invoice.pay_invoice.ask,currency_writeoff",0,Write-Off Currency,Ajuste de Moneda,0
+field,"account.invoice.pay_invoice.ask,date",0,Date,Fecha,0
+field,"account.invoice.pay_invoice.ask,description",0,Description,Descripción,0
+field,"account.invoice.pay_invoice.ask,invoice",0,Invoice,Factura,0
+field,"account.invoice.pay_invoice.ask,journal",0,Journal,Diario,0
+field,"account.invoice.pay_invoice.ask,journal_writeoff",0,Write-Off Journal,Diario de Ajuste,0
+field,"account.invoice.pay_invoice.ask,lines",0,Lines,Líneas,0
+field,"account.invoice.pay_invoice.ask,lines_to_pay",0,Lines to Pay,Líneas a Pagar,0
+field,"account.invoice.pay_invoice.ask,payment_lines",0,Payment Lines,Líneas de Pago,0
+field,"account.invoice.pay_invoice.ask,type",0,Type,Tipo,0
+field,"account.invoice.pay_invoice.init,amount",0,Amount,Cantidad,0
+field,"account.invoice.pay_invoice.init,currency",0,Currency,Moneda,0
+field,"account.invoice.pay_invoice.init,currency_digits",0,Currency Digits,Dígitos de Moneda,0
+field,"account.invoice.pay_invoice.init,date",0,Date,Fecha,0
+field,"account.invoice.pay_invoice.init,description",0,Description,Descripción,0
+field,"account.invoice.pay_invoice.init,journal",0,Journal,Diario,0
+field,"account.invoice,payment_lines",0,Payment Lines,Líneas de Pago,0
+field,"account.invoice,payment_term",0,Payment Term,Término de Pago,0
+field,"account.invoice.payment_term,active",0,Active,Activo,0
+field,"account.invoice.payment_term,description",0,Description,Descripción,0
+field,"account.invoice.payment_term.line,amount",0,Amount,Cantidad,0
+field,"account.invoice.payment_term.line,currency",0,Currency,Moneda,0
+field,"account.invoice.payment_term.line,currency_digits",0,Currency Digits,Dígitos de Moneda,0
+field,"account.invoice.payment_term.line,days",0,Number of Days,Cantidad de días,0
+field,"account.invoice.payment_term.line,delay",0,Condition,Condición,0
+field,"account.invoice.payment_term.line.delay,code",0,Code,Código,0
+field,"account.invoice.payment_term.line.delay,name",0,Name,Nombre,0
+field,"account.invoice.payment_term.line.delay,rec_name",0,Name,Nombre,0
+field,"account.invoice.payment_term.line,payment",0,Payment Term,Término de Pago,0
+field,"account.invoice.payment_term.line,percentage",0,Percentage,Porcentaje,0
+field,"account.invoice.payment_term.line,rec_name",0,Name,Nombre,0
+field,"account.invoice.payment_term,lines",0,Lines,Líneas,0
+field,"account.invoice.payment_term.line,sequence",0,Sequence,Secuencia,0
+field,"account.invoice.payment_term.line,type",0,Type,Tipo,0
+field,"account.invoice.payment_term.line.type,code",0,Code,Código,0
+field,"account.invoice.payment_term.line.type,name",0,Name,Nombre,0
+field,"account.invoice.payment_term.line.type,rec_name",0,Name,Nombre,0
+field,"account.invoice.payment_term,name",0,Payment Term,Término de Pago,0
+field,"account.invoice.payment_term,rec_name",0,Name,Nombre,0
+field,"account.invoice,rec_name",0,Name,Nombre,0
+field,"account.invoice,reconciled",0,Reconciled,Conciliado,0
+field,"account.invoice,reference",0,Reference,Referencia,0
+field,"account.invoice,state",0,State,Estado,0
+field,"account.invoice.tax,account",0,Account,Cuenta,0
+field,"account.invoice,tax_amount",0,Tax,Impuesto,0
+field,"account.invoice.tax,amount",0,Amount,Cantidad,0
+field,"account.invoice.tax,base",0,Base,Base,0
+field,"account.invoice.tax,base_code",0,Base Code,Código Base,0
+field,"account.invoice.tax,base_sign",0,Base Sign,Signo Base,0
+field,"account.invoice.tax,description",0,Description,Descripción,0
+field,"account.invoice,taxes",0,Tax Lines,Líneas de Impuestos,0
+field,"account.invoice.tax,invoice",0,Invoice,Factura,0
+field,"account.invoice.tax,manual",0,Manual,Manual,0
+field,"account.invoice.tax,rec_name",0,Name,Nombre,0
+field,"account.invoice.tax,sequence",0,Sequence,Secuencia,0
+field,"account.invoice.tax,sequence_number",0,Sequence Number,Número de Secuencia,0
+field,"account.invoice.tax,tax",0,Tax,Impuesto,0
+field,"account.invoice.tax,tax_code",0,Tax Code,Código de Impuesto,0
+field,"account.invoice.tax,tax_sign",0,Tax Sign,Signo del Impuesto,0
+field,"account.invoice,total_amount",0,Total,Total,0
+field,"account.invoice,type",0,Type,Tipo,0
+field,"account.invoice,type_name",0,Type,Tipo,0
+field,"account.invoice,untaxed_amount",0,Untaxed,Sin Impuesto,0
+field,"account.period,in_credit_note_sequence",0,Supplier Credit Note Sequence,Secuencia de la Nota Crédito del Proveedor,0
+field,"account.period,in_invoice_sequence",0,Supplier Invoice Sequence,Secuencia de Factura de Proveedor,0
+field,"account.period,out_credit_note_sequence",0,Customer Credit Note Sequence,Secuencia de Nota Crédito de Cliente,0
+field,"account.period,out_invoice_sequence",0,Customer Invoice Sequence,Secuencia de Facturas de Cliente,0
+field,"party.address,invoice",0,Invoice,Factura,0
+field,"party.party,payment_term",0,Invoice Payment Term,Término de Pago de la Factura,0
+field,"party.party,supplier_payment_term",0,Supplier Payment Term,Término de Pago a Proveedor,0
+help,"account.invoice.credit_invoice.init,with_refund",0,"If true, the current invoice(s) will be paid.","Si cierto, la(s) factura(s) actuales se pagarán.",0
+help,"account.invoice.payment_term.line,percentage",0,In %,En %,0
+help,"account.invoice.payment_term.line,sequence",0,Use to order lines in ascending order,Para ordenar las líneas ascendentemente,0
+model,"account.invoice-account.move.line,name",0,Invoice - Payment Line,Factura - Línea de pago,0
+model,"account.invoice.credit_invoice.init,name",0,Credit Invoice Init,Inicio de Factura Crédito,0
+model,"account.invoice.line-account.tax,name",0,Invoice Line - Tax,Línea de Factura - Impuesto,0
+model,"account.invoice.line,name",0,Invoice Line,Línea de Factura,0
+model,"account.invoice,name",0,Invoice,Factura,0
+model,"account.invoice.pay_invoice.ask,name",0,Pay Invoice Ask,Solicitud de Pago de Factura,0
+model,"account.invoice.pay_invoice.init,name",0,Pay Invoice Init,Inicio de Pago de Factura,0
+model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_end_month,End Month,Mes Final,0
+model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_net_days,Net Days,Días Netos,0
+model,"account.invoice.payment_term.line.delay,name",0,Payment Term Line Delay,Línea de Pago Tardío,0
+model,"account.invoice.payment_term.line,name",0,Payment Term Line,Línea de Término de Pago,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_fixed,Fixed,Fijo,0
+model,"account.invoice.payment_term.line.type,name",0,Payment Term Line Type,Tipo Pago de Término,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_percent,Percentage,Porcentaje,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_remainder,Remainder,Diferencia,0
+model,"account.invoice.payment_term,name",0,Payment Term,Término de Pago,0
+model,"account.invoice.print_invoice_report.warning,name",0,Print Invoice Report Warning,Imprimir Advertencia de Pago de Factura,0
+model,"account.invoice.tax,name",0,Invoice Tax,Impuesto en Factura,0
+model,"ir.action,name",act_invoice_form,All Invoices,Todas las facturas,0
+model,"ir.action,name",credit_invoice,Credit,Crédito,0
+model,"ir.action,name",act_invoice_out_credit_note_form,Credit Notes,Notas Crédito,0
+model,"ir.action,name",act_invoice_out_credit_note_form2,Credit Notes,Notas Crédito,0
+model,"ir.action,name",act_invoice_out_credit_note_form3,Draft Credit Notes,Notas Crédito en Borrador,0
+model,"ir.action,name",act_invoice_out_invoice_form3,Draft Invoices,Factura en Borrador,0
+model,"ir.action,name",act_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Borrador Nota Crédito del Proveedor,0
+model,"ir.action,name",act_invoice_in_invoice_form3,Draft Supplier Invoices,Borrador de Factura de Proveedor,0
+model,"ir.action,name",report_invoice,Invoice,Factura,0
+model,"ir.action,name",print_invoice_report,Invoice,Factura,0
+model,"ir.action,name",act_invoice_out_invoice_form,Invoices,Facturas,0
+model,"ir.action,name",act_invoice_out_invoice_form2,Invoices,Facturas,0
+model,"ir.action,name",act_invoice_form2,Invoices,Facturas,0
+model,"ir.action,name",act_invoice_out_credit_note_form5,Opened Credit Notes,Nota Crédito Abierta,0
+model,"ir.action,name",act_invoice_out_invoice_form5,Opened Invoices,Factura Abierta,0
+model,"ir.action,name",act_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Nota Crédito de Proveedor Abierta,0
+model,"ir.action,name",act_invoice_in_invoice_form5,Opened Supplier Invoices,Factura de Proveedor Abierta,0
+model,"ir.action,name",wizard_pay_invoice,Pay Invoice,Pagar Factura,0
+model,"ir.action,name",act_payment_term_form,Payment Terms,Términos de Pago,0
+model,"ir.action,name",act_invoice_out_credit_note_form4,Pro Forma Credit Notes,Nota Crédito Proforma,0
+model,"ir.action,name",act_invoice_out_invoice_form4,Pro Forma Invoices,Factura Proforma,0
+model,"ir.action,name",act_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Nota Crédito de Proveedor Proforma,0
+model,"ir.action,name",act_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Factura del Proveedor Proforma,0
+model,"ir.action,name",act_invoice_in_credit_note_form,Supplier Credit Notes,Notas Crédito del Proveedor,0
+model,"ir.action,name",act_invoice_in_credit_note_form2,Supplier Credit Notes,Notas Crédito del Proveedor,0
+model,"ir.action,name",act_invoice_in_invoice_form,Supplier Invoices,Facturas de Proveedor,0
+model,"ir.action,name",act_invoice_in_invoice_form2,Supplier Invoices,Facturas de Proveedor,0
+model,"ir.sequence.type,name",sequence_type_account_invoice,Invoice,Factura,0
+model,"ir.ui.menu,name",menu_invoice_form,All Invoices,Todas las facturas,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form,Credit Notes,Notas Crédito,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form3,Draft Credit Notes,Borrador Nota Crédito,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form3,Draft Invoices,Borrador Factura,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Borrador Nota Crédito Proveedor,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form3,Draft Supplier Invoices,Borrador Factura Proveedor,0
+model,"ir.ui.menu,name",menu_invoices,Invoices,Facturas,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form,Invoices,Facturas,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form2,New Credit Note,Nueva Nota Crédito,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form2,New Invoice,Nueva Factura,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form2,New Supplier Credit Note,Nueva Nota Crédito Proveedor,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form2,New Supplier Invoice,Factura Nuevo Proveedor,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form5,Opened Credit Notes,Nota Crédito Abierta,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form5,Opened Invoices,Factura Abierta,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Nota Crédito Proveedor Abierta,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form5,Opened Supplier Invoices,Factura Proveedor Abierta,0
+model,"ir.ui.menu,name",menu_payment_terms_configuration,Payment Terms,Términos de Pago,0
+model,"ir.ui.menu,name",menu_payment_term_form,Payment Terms,Términos de Pago,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form4,Pro Forma Credit Notes,Nota Crédito Proforma,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form4,Pro Forma Invoices,Factura Proforma,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Nota Crédito Proveedor Proforma,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Factura Proveedor Proforma,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form,Supplier Credit Notes,Notas Crédito del Proveedor,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form,Supplier Invoices,Facturas de Proveedor,0
+model,"workflow.activity,name",invoice_activity_cancel,Canceled,Cancelado,0
+model,"workflow.activity,name",invoice_activity_draft,Draft,Borrador,0
+model,"workflow.activity,name",invoice_activity_open,Open,Abrir,0
+model,"workflow.activity,name",invoice_activity_paid,Paid,Pagado,0
+model,"workflow.activity,name",invoice_activity_proforma,Pro forma,Pro forma,0
+model,"workflow,name",invoice_workflow,Invoice workflow,Flujo de Trabajo Factura,0
+odt,account.invoice,0,Amount,Cantidad,0
+odt,account.invoice,0,Base,Base,0
+odt,account.invoice,0,Credit Note N°:,Nota Crédito N°:,0
+odt,account.invoice,0,Date,Fecha,0
+odt,account.invoice,0,Date:,Fecha:,0
+odt,account.invoice,0,Description,Descripción,0
+odt,account.invoice,0,Description:,Descripción:,0
+odt,account.invoice,0,Draft Credit Note,Borrador de Nota Crédito,0
+odt,account.invoice,0,Draft Invoice,Borrador de Factura,0
+odt,account.invoice,0,Draft Supplier Credit Note,Borrador de Nota Crédito del Proveedor,0
+odt,account.invoice,0,Draft Supplier Invoice,Borrador de Factura del Proveedor,0
+odt,account.invoice,0,E-Mail:,Correo electrónico:,0
+odt,account.invoice,0,Invoice N°:,Factura N°:,0
+odt,account.invoice,0,Payment Term,Término de Pago,0
+odt,account.invoice,0,Phone:,Teléfono:,0
+odt,account.invoice,0,Pro forma Credit Note,Nota Crédito Proforma,0
+odt,account.invoice,0,Pro forma Invoice,Factura Proforma,0
+odt,account.invoice,0,Pro forma Supplier Credit Note,Nota Crédito del Proveedor Proforma,0
+odt,account.invoice,0,Pro forma Supplier Invoice,Factura del Proveedor Proforma,0
+odt,account.invoice,0,Quantity,Cantidad,0
+odt,account.invoice,0,Supplier Credit Note N°:,Nota Crédito del Proveedor N°:,0
+odt,account.invoice,0,Supplier Invoice N°:,Factura del Proveedor N°:,0
+odt,account.invoice,0,Tax,Impuesto,0
+odt,account.invoice,0,Taxes,Impuestos,0
+odt,account.invoice,0,Taxes:,Impuestos:,0
+odt,account.invoice,0,Total:,Total:,0
+odt,account.invoice,0,Total (excl. taxes):,Total (sin impuestos):,0
+odt,account.invoice,0,Unit Price,Precio Unitario,0
+odt,account.invoice,0,VAT:,IVA:,0
+selection,"account.invoice.line,invoice_type",0,Credit Note,Nota Crédito,0
+selection,"account.invoice.line,invoice_type",0,Invoice,Factura,0
+selection,"account.invoice.line,invoice_type",0,Supplier Credit Note,Nota Crédito del Proveedor,0
+selection,"account.invoice.line,invoice_type",0,Supplier Invoice,Factura de Proveedor,0
+selection,"account.invoice.line,type",0,Comment,Comentario,0
+selection,"account.invoice.line,type",0,Line,Línea,0
+selection,"account.invoice.line,type",0,Subtotal,Subtotal,0
+selection,"account.invoice.line,type",0,Title,Título,0
+selection,"account.invoice.pay_invoice.ask,type",0,Partial Payment,Pago Parcial,0
+selection,"account.invoice.pay_invoice.ask,type",0,Write-Off,Ajuste,0
+selection,"account.invoice,state",0,Canceled,Cancelado,0
+selection,"account.invoice,state",0,Draft,Borrador,0
+selection,"account.invoice,state",0,Opened,Abierto,0
+selection,"account.invoice,state",0,Paid,Pagado,0
+selection,"account.invoice,state",0,Pro forma,Pro forma,0
+selection,"account.invoice,type",0,Credit Note,Nota de Crédito,0
+selection,"account.invoice,type",0,Invoice,Factura,0
+selection,"account.invoice,type",0,Supplier Credit Note,Nota Crédito del Proveedor,0
+selection,"account.invoice,type",0,Supplier Invoice,Factura de Proveedor,0
+view,account.invoice,0,Amount Second Currency,Cantidad en la Moneda Secundaria,0
+view,account.invoice,0,_Cancel,_Cancelar,0
+view,account.invoice,0,Credit,Crédito,0
+view,account.invoice,0,Debit,Débito,0
+view,account.invoice,0,_Draft,_Borrador,0
+view,account.invoice,0,Invoice,Factura,0
+view,account.invoice,0,Invoices,Facturas,0
+view,account.invoice,0,Lines,Líneas,0
+view,account.invoice,0,_Open,_Abrir,0
+view,account.invoice,0,Other Info,Información Adicional,0
+view,account.invoice,0,_Pay,_Pago,0
+view,account.invoice,0,Payment,Pago,0
+view,account.invoice,0,Payment Lines,Líneas de Pago,0
+view,account.invoice,0,Pro For_ma,Pro For_ma,0
+view,account.invoice,0,_Reset to Draft,_Revertir a Borrador,0
+view,account.invoice,0,Taxes,Impuestos,0
+view,account.invoice.credit_invoice.init,0,Are you sure to credit those/this invoice(s)?,Segur@ desea acreditar la(s) factura(s)?,0
+view,account.invoice.credit_invoice.init,0,Credit Invoice,Factura Crédito,0
+view,account.invoice.line,0,General,General,0
+view,account.invoice.line,0,Invoice Line,Línea de Factura,0
+view,account.invoice.line,0,Invoice Lines,Líneas de Factura,0
+view,account.invoice.line,0,Notes,Notas,0
+view,account.invoice.line,0,Products,Productos,0
+view,account.invoice.pay_invoice.ask,0,Amount Second Currency,Cantidad en la Moneda Secundaria,0
+view,account.invoice.pay_invoice.ask,0,Credit,Crédito,0
+view,account.invoice.pay_invoice.ask,0,Debit,Débito,0
+view,account.invoice.pay_invoice.ask,0,Lines to Pay,Líneas a Pagar,0
+view,account.invoice.pay_invoice.ask,0,Pay Invoice,Pagar Factura,0
+view,account.invoice.pay_invoice.ask,0,Payment Lines,Líneas de Pago,0
+view,account.invoice.pay_invoice.init,0,Pay Invoice,Pagar Factura,0
+view,account.invoice.payment_term,0,Payment Term,Término de Pago,0
+view,account.invoice.payment_term,0,Payment Term Line,Línea de Término de Pago,0
+view,account.invoice.payment_term,0,Payment Term Lines,Líneas de Término de Pago,0
+view,account.invoice.payment_term,0,Payment Terms,Términos de Pago,0
+view,account.invoice.print_invoice_report.warning,0,<b>Warning!</b>,<b>Advertencia!</b>,0
+view,account.invoice.print_invoice_report.warning,0,Print Invoice,Imprimir Factura,0
+view,account.invoice.print_invoice_report.warning,0,The invoices will be sent <i>directly</i> to the printer.,Las facturas serán enviadas <i>directamente</i> a la impresora.,0
+view,account.invoice.print_invoice_report.warning,0,You have selected more than one invoice to print.,Ha elegido más de una factura para imprimir,0
+view,account.invoice.tax,0,Invoice Tax,Impuesto en Factura,0
+view,account.invoice.tax,0,Invoice Taxes,Impuestos de Facturas,0
+view,account.invoice.tax,0,Tax Code,Código de Impuesto,0
+view,party.party,0,Payment Terms,Términos de Pago,0
+wizard_button,"account.invoice.credit_invoice,init,credit",0,Credit,Crédito,0
+wizard_button,"account.invoice.credit_invoice,init,end",0,Cancel,Cancelar,0
+wizard_button,"account.invoice.pay_invoice,ask,end",0,Cancel,Cancelar,0
+wizard_button,"account.invoice.pay_invoice,ask,pay",0,Ok,Aceptar,0
+wizard_button,"account.invoice.pay_invoice,init,choice",0,Ok,Aceptar,0
+wizard_button,"account.invoice.pay_invoice,init,end",0,Cancel,Cancelar,0
+wizard_button,"account.invoice.print_invoice_report,warning,end",0,Cancel,Cancelar,0
+wizard_button,"account.invoice.print_invoice_report,warning,print",0,Print,Imprimir,0
diff --git a/es_ES.csv b/es_ES.csv
index 8750e2e..eb8c2db 100644
--- a/es_ES.csv
+++ b/es_ES.csv
@@ -1,2 +1,352 @@
 type,name,res_id,src,value,fuzzy
-field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Cuentas analíticas,0
+error,account.fiscalyear,0,You can not change the invoice sequence if there is already an invoice opened in the fiscalyear,No puede cambiar la secuencia de una factura si hay una factura abierta en el año fiscal,0
+error,account.fiscalyear,0,You must have different invoice sequences per fiscal year!,Debe tener una secuencia diferente de facturación por año fiscal,0
+error,account.invoice,0,"Base taxes different from invoice lines!
+Re-compute the invoice.","Los Impuestos base son distintos de las líneas de la factura.
+Recalcule la factura.",0
+error,account.invoice,0,"Taxes defined but not on invoice lines!
+Re-compute the invoice.","Tiene impuestos definidos pero ninguno en las líneas de la factura
+Recalcule la factura.",0
+error,account.invoice,0,"Taxes defined on invoice lines but not on invoice!
+Re-compute the invoice.","Los impuestos están definidos en las lineas de la factura pero no en la factura.
+Recalcule la factura.",0
+error,account.invoice,0,The credit account on journal is missing!,Falta la cuenta crédito del diario,0
+error,account.invoice,0,The credit account on journal is the same than the invoice account!,La cuenta de crédito en el diario es la misma que la cuenta facturada,0
+error,account.invoice,0,The debit account on journal is missing!,Falta la cuenta débito del diario,0
+error,account.invoice,0,The debit account on journal is the same than the invoice account!,La cuenta de débito en el diario es la misma que la cuenta facturada,0
+error,account.invoice,0,There is no invoice sequence on the period/fiscal year!,No hay una secuencia de factura para el período/año fiscal,0
+error,account.invoice,0,"You can not create an invoice
+with account from a different invoice company!","No puede crear una factura
+con una cuenta de una compañía distinta a la que factura",0
+error,account.invoice,0,"You can not modify an invoice that is open, paid or canceled!","No puede modificar una factura abierta, pagada o cancelada",0
+error,account.invoice,0,You can not reset to draft an invoice that has move!,No puede poner en borrador una factura que tiene asientos,0
+error,account.invoice,0,"You can not use the same account
+as on invoice line!","No puede usar la misma cuenta
+que la línea de la factura",0
+error,account.invoice.credit_invoice,0,You can not credit with refund an invoice that is not opened!,,0
+error,account.invoice.credit_invoice,0,You can not credit with refund an invoice with payments!,No puede acreditar una devolución de una factura con pagos,0
+error,account.invoice.line,0,"Line with ""line"" type must have an account!",Una línea con tipo «línea» debe tener una cuenta,0
+error,account.invoice.line,0,"Line without ""line"" type must have an invoice!",Una línea sin tipo «línea» debe tener una factura,0
+error,account.invoice.line,0,"You can not add a line to an invoice that is open, paid or canceled!","No puede añadir una línea a una factura que está abierta, pagada o cancelada",0
+error,account.invoice.line,0,"You can not create invoice line
+with account with a different invoice company!","No puede crear una línea de factura
+con una cuenta de una empresa distinta a la que factura",0
+error,account.invoice.line,0,"You can not modify line from an invoice that is open, paid or canceled!","No puede modificar la línea de una factura que esté abierta, pagada o cancelada",0
+error,account.invoice.line,0,"You can not use the same account
+as on the invoice!","No puede usar la misma cuenta
+que en la factura",0
+error,account.invoice.pay_invoice,0,You can not create a partial payment with an amount greater then the amount to pay!,No puede crear un pago parcial con una cantidad mayor de la que hay que pagar,0
+error,account.invoice.payment_term,0,Invalid payment term line!,La línea de término de pago no es válida,0
+error,account.invoice.payment_term,0,Payment term missing a remainder line!,Al término de pago le una línea final,0
+error,account.invoice.payment_term.line.delay,0,The code must be unique!,El código debe ser único,0
+error,account.invoice.payment_term.line.type,0,The code must be unique!,El código debe ser único,0
+error,account.invoice.tax,0,"You can not add a line to an invoice that is open, paid or canceled!","No puede añadir una línea a una factura que está abierta, pagada o cancelada",0
+error,account.invoice.tax,0,"You can not modify tax from an invoice that is open, paid or canceled!","No puede modificar impuestos de una factura abierta, pagada o cancelada",0
+error,account.period,0,You can not change the invoice sequence if there is already an invoice opened in the period,No puede cambiar la secuencia de una factura si hay una factura abierta en el período,0
+error,account.period,0,You must have different invoice sequences per fiscal year and in the same company!,Debe tener secuencias diferentes de facturas por año fiscal en la misma empresa,0
+field,"account.fiscalyear,in_credit_note_sequence",0,Supplier Credit Note Sequence,Secuencia de abono de proveedor,0
+field,"account.fiscalyear,in_invoice_sequence",0,Supplier Invoice Sequence,Secuencia de factura de proveedor,0
+field,"account.fiscalyear,out_credit_note_sequence",0,Customer Credit Note Sequence,Secuencia de abono a cliente,0
+field,"account.fiscalyear,out_invoice_sequence",0,Customer Invoice Sequence,Secuencia de facturas a cliente,0
+field,"account.invoice,account",0,Account,Cuenta,0
+field,"account.invoice,accounting_date",0,Accounting Date,Fecha de contabilización,0
+field,"account.invoice-account.move.line,invoice",0,Invoice,Factura,0
+field,"account.invoice-account.move.line,line",0,Payment Line,Línea de pago,0
+field,"account.invoice-account.move.line,rec_name",0,Name,Nombre,0
+field,"account.invoice,amount_to_pay",0,Amount to Pay,Cantidad a pagar,0
+field,"account.invoice,amount_to_pay_today",0,Amount to Pay Today,Cantidad a pagar hoy,0
+field,"account.invoice,comment",0,Comment,Comentario,0
+field,"account.invoice,company",0,Company,Empresa,0
+field,"account.invoice.credit_invoice.init,with_refund",0,With Refund,Con devolución,0
+field,"account.invoice,currency",0,Currency,Divisa,0
+field,"account.invoice,currency_digits",0,Currency Digits,Dígitos de la divisa,0
+field,"account.invoice,description",0,Description,Descripción,0
+field,"account.invoice,invoice_address",0,Invoice Address,Dirección de facturación,0
+field,"account.invoice,invoice_date",0,Invoice Date,Fecha de factura,0
+field,"account.invoice,invoice_report",0,Invoice Report,Informe de facturación,0
+field,"account.invoice,invoice_report_format",0,Invoice Report Format,Formato del informe de facturación,0
+field,"account.invoice,journal",0,Journal,Diario,0
+field,"account.invoice.line,account",0,Account,Cuenta,0
+field,"account.invoice.line-account.tax,line",0,Invoice Line,Línea de factura,0
+field,"account.invoice.line-account.tax,rec_name",0,Name,Nombre,0
+field,"account.invoice.line-account.tax,tax",0,Tax,Impuesto,0
+field,"account.invoice.line,amount",0,Amount,Cantidad,0
+field,"account.invoice.line,company",0,Company,Empresa,0
+field,"account.invoice.line,currency",0,Currency,Divisa,0
+field,"account.invoice.line,currency_digits",0,Currency Digits,Dígitos de la divisa,0
+field,"account.invoice.line,description",0,Description,Descripción,0
+field,"account.invoice.line,invoice",0,Invoice,Factura,0
+field,"account.invoice.line,invoice_taxes",0,Invoice Taxes,Impuestos de la factura,0
+field,"account.invoice.line,invoice_type",0,Invoice Type,Tipo de factura,0
+field,"account.invoice.line,note",0,Note,Nota,0
+field,"account.invoice.line,party",0,Party,Terceros,0
+field,"account.invoice.line,product",0,Product,Producto,0
+field,"account.invoice.line,quantity",0,Quantity,Cantidad,0
+field,"account.invoice.line,rec_name",0,Name,Nombre,0
+field,"account.invoice,lines",0,Lines,Líneas,0
+field,"account.invoice.line,sequence",0,Sequence,Secuencia,0
+field,"account.invoice,lines_to_pay",0,Lines to Pay,Líneas a pagar,0
+field,"account.invoice.line,taxes",0,Taxes,Impuestos,0
+field,"account.invoice.line,type",0,Type,Tipo,0
+field,"account.invoice.line,unit",0,Unit,Unidad,0
+field,"account.invoice.line,unit_digits",0,Unit Digits,Dígitos de unidad,0
+field,"account.invoice.line,unit_price",0,Unit Price,Precio unitario,0
+field,"account.invoice,move",0,Move,Asiento,0
+field,"account.invoice,number",0,Number,Número,0
+field,"account.invoice,party",0,Party,Tercero,0
+field,"account.invoice,party_lang",0,Party Language,Idioma del tercero,0
+field,"account.invoice.pay_invoice.ask,account",0,Account,Cuenta,0
+field,"account.invoice.pay_invoice.ask,account_writeoff",0,Write-Off Account,Cuenta de pérdidas,0
+field,"account.invoice.pay_invoice.ask,amount",0,Payment Amount,Cantidad del pago,0
+field,"account.invoice.pay_invoice.ask,amount_writeoff",0,Write-Off Amount,Valor de la pérdida,0
+field,"account.invoice.pay_invoice.ask,company",0,Company,Empresa,0
+field,"account.invoice.pay_invoice.ask,currency",0,Payment Currency,Divisa de pago,0
+field,"account.invoice.pay_invoice.ask,currency_digits",0,Payment Currency Digits,Decimales del pago de divisa,0
+field,"account.invoice.pay_invoice.ask,currency_digits_writeoff",0,Write-Off Currency Digits,Pérdida por decimales de divisa,0
+field,"account.invoice.pay_invoice.ask,currency_writeoff",0,Write-Off Currency,Divisa de la pérdida,0
+field,"account.invoice.pay_invoice.ask,date",0,Date,Fecha,0
+field,"account.invoice.pay_invoice.ask,description",0,Description,Descripción,0
+field,"account.invoice.pay_invoice.ask,invoice",0,Invoice,Factura,0
+field,"account.invoice.pay_invoice.ask,journal",0,Journal,Diario,0
+field,"account.invoice.pay_invoice.ask,journal_writeoff",0,Write-Off Journal,Diario de pérdidas,0
+field,"account.invoice.pay_invoice.ask,lines",0,Lines,Líneas,0
+field,"account.invoice.pay_invoice.ask,lines_to_pay",0,Lines to Pay,Líneas a pagar,0
+field,"account.invoice.pay_invoice.ask,payment_lines",0,Payment Lines,Líneas de pago,0
+field,"account.invoice.pay_invoice.ask,type",0,Type,Tipo,0
+field,"account.invoice.pay_invoice.init,amount",0,Amount,Cantidad,0
+field,"account.invoice.pay_invoice.init,currency",0,Currency,Divisa,0
+field,"account.invoice.pay_invoice.init,currency_digits",0,Currency Digits,Decimales de la divisa,0
+field,"account.invoice.pay_invoice.init,date",0,Date,Fecha,0
+field,"account.invoice.pay_invoice.init,description",0,Description,Descripción,0
+field,"account.invoice.pay_invoice.init,journal",0,Journal,Diario,0
+field,"account.invoice,payment_lines",0,Payment Lines,Líneas de pago,0
+field,"account.invoice,payment_term",0,Payment Term,Término de pago,0
+field,"account.invoice.payment_term,active",0,Active,Activo,0
+field,"account.invoice.payment_term,description",0,Description,Descripción,0
+field,"account.invoice.payment_term.line,amount",0,Amount,Cantidad,0
+field,"account.invoice.payment_term.line,currency",0,Currency,Divisa,0
+field,"account.invoice.payment_term.line,currency_digits",0,Currency Digits,Dígitos de la divisa,0
+field,"account.invoice.payment_term.line,days",0,Number of Days,Cantidad de días,0
+field,"account.invoice.payment_term.line,delay",0,Condition,Condición,0
+field,"account.invoice.payment_term.line.delay,code",0,Code,Código,0
+field,"account.invoice.payment_term.line.delay,name",0,Name,Nombre,0
+field,"account.invoice.payment_term.line.delay,rec_name",0,Name,Nombre,0
+field,"account.invoice.payment_term.line,payment",0,Payment Term,Término de pago,0
+field,"account.invoice.payment_term.line,percentage",0,Percentage,Porcentaje,0
+field,"account.invoice.payment_term.line,rec_name",0,Name,Nombre,0
+field,"account.invoice.payment_term,lines",0,Lines,Líneas,0
+field,"account.invoice.payment_term.line,sequence",0,Sequence,Secuencia,0
+field,"account.invoice.payment_term.line,type",0,Type,Tipo,0
+field,"account.invoice.payment_term.line.type,code",0,Code,Código,0
+field,"account.invoice.payment_term.line.type,name",0,Name,Nombre,0
+field,"account.invoice.payment_term.line.type,rec_name",0,Name,Nombre,0
+field,"account.invoice.payment_term,name",0,Payment Term,Término de pago,0
+field,"account.invoice.payment_term,rec_name",0,Name,Nombre,0
+field,"account.invoice,rec_name",0,Name,Nombre,0
+field,"account.invoice,reconciled",0,Reconciled,Conciliado,0
+field,"account.invoice,reference",0,Reference,Referencia,0
+field,"account.invoice,state",0,State,Estado,0
+field,"account.invoice.tax,account",0,Account,Cuenta,0
+field,"account.invoice,tax_amount",0,Tax,Impuesto,0
+field,"account.invoice.tax,amount",0,Amount,Cantidad,0
+field,"account.invoice.tax,base",0,Base,Base,0
+field,"account.invoice.tax,base_code",0,Base Code,Código base,0
+field,"account.invoice.tax,base_sign",0,Base Sign,Signo de la base,0
+field,"account.invoice.tax,description",0,Description,Descripción,0
+field,"account.invoice,taxes",0,Tax Lines,Líneas de impuestos,0
+field,"account.invoice.tax,invoice",0,Invoice,Factura,0
+field,"account.invoice.tax,manual",0,Manual,Manual,0
+field,"account.invoice.tax,rec_name",0,Name,Nombre,0
+field,"account.invoice.tax,sequence",0,Sequence,Secuencia,0
+field,"account.invoice.tax,sequence_number",0,Sequence Number,Número de secuencia,0
+field,"account.invoice.tax,tax",0,Tax,Impuesto,0
+field,"account.invoice.tax,tax_code",0,Tax Code,Código de impuesto,0
+field,"account.invoice.tax,tax_sign",0,Tax Sign,Signo del impuesto,0
+field,"account.invoice,total_amount",0,Total,Total,0
+field,"account.invoice,type",0,Type,Tipo,0
+field,"account.invoice,type_name",0,Type,Tipo,0
+field,"account.invoice,untaxed_amount",0,Untaxed,Sin impuesto,0
+field,"account.period,in_credit_note_sequence",0,Supplier Credit Note Sequence,Secuencia del abono de proveedor,0
+field,"account.period,in_invoice_sequence",0,Supplier Invoice Sequence,Secuencia de factura de proveedor,0
+field,"account.period,out_credit_note_sequence",0,Customer Credit Note Sequence,Secuencia de abono a cliente,0
+field,"account.period,out_invoice_sequence",0,Customer Invoice Sequence,Secuencia de factura a cliente,0
+field,"party.address,invoice",0,Invoice,Factura,0
+field,"party.party,payment_term",0,Invoice Payment Term,Término de pago de la factura,0
+field,"party.party,supplier_payment_term",0,Supplier Payment Term,Término de pago al proveedor,0
+help,"account.invoice.credit_invoice.init,with_refund",0,"If true, the current invoice(s) will be paid.","Si es cierto, la(s) factura(s) actuales se pagarán.",0
+help,"account.invoice.payment_term.line,percentage",0,In %,En %,0
+help,"account.invoice.payment_term.line,sequence",0,Use to order lines in ascending order,Empleado para ordenar las líneas ascendentemente,0
+model,"account.invoice-account.move.line,name",0,Invoice - Payment Line,Factura - Línea de pago,0
+model,"account.invoice.credit_invoice.init,name",0,Credit Invoice Init,Inicio de factura de crédito,0
+model,"account.invoice.line-account.tax,name",0,Invoice Line - Tax,Línea de factura - Impuesto,0
+model,"account.invoice.line,name",0,Invoice Line,Línea de factura,0
+model,"account.invoice,name",0,Invoice,Factura,0
+model,"account.invoice.pay_invoice.ask,name",0,Pay Invoice Ask,Solicitud de pago de factura,0
+model,"account.invoice.pay_invoice.init,name",0,Pay Invoice Init,Inicio de pago de factura,0
+model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_end_month,End Month,Mes final,0
+model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_net_days,Net Days,Días netos,0
+model,"account.invoice.payment_term.line.delay,name",0,Payment Term Line Delay,Línea de término de pago retrasado,0
+model,"account.invoice.payment_term.line,name",0,Payment Term Line,Línea de término de pago,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_fixed,Fixed,Fijo,0
+model,"account.invoice.payment_term.line.type,name",0,Payment Term Line Type,Línea de tipo de término de pago,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_percent,Percentage,Porcentaje,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_remainder,Remainder,Resto,0
+model,"account.invoice.payment_term,name",0,Payment Term,Término de pago,0
+model,"account.invoice.print_invoice_report.warning,name",0,Print Invoice Report Warning,Imprimir informe de aviso de facturas,0
+model,"account.invoice.tax,name",0,Invoice Tax,Impuesto en factura,0
+model,"ir.action,name",act_invoice_form,All Invoices,Todas las facturas,0
+model,"ir.action,name",credit_invoice,Credit,Haber,0
+model,"ir.action,name",act_invoice_out_credit_note_form,Credit Notes,Abonos,0
+model,"ir.action,name",act_invoice_out_credit_note_form2,Credit Notes,Abonos,0
+model,"ir.action,name",act_invoice_out_credit_note_form3,Draft Credit Notes,Abonos borrador,0
+model,"ir.action,name",act_invoice_out_invoice_form3,Draft Invoices,Facturas borrador,0
+model,"ir.action,name",act_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Borrador de abonos de proveedor,0
+model,"ir.action,name",act_invoice_in_invoice_form3,Draft Supplier Invoices,Borrador de facturas de proveedor,0
+model,"ir.action,name",report_invoice,Invoice,Factura,0
+model,"ir.action,name",print_invoice_report,Invoice,Factura,0
+model,"ir.action,name",act_invoice_out_invoice_form,Invoices,Facturas,0
+model,"ir.action,name",act_invoice_out_invoice_form2,Invoices,Facturas,0
+model,"ir.action,name",act_invoice_form2,Invoices,Facturas,0
+model,"ir.action,name",act_invoice_out_credit_note_form5,Opened Credit Notes,Abonos abiertos,0
+model,"ir.action,name",act_invoice_out_invoice_form5,Opened Invoices,Facturas abiertas,0
+model,"ir.action,name",act_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Abonos de proveedor abiertos,0
+model,"ir.action,name",act_invoice_in_invoice_form5,Opened Supplier Invoices,Facturas de proveedor abiertas,0
+model,"ir.action,name",wizard_pay_invoice,Pay Invoice,Pagar factura,0
+model,"ir.action,name",act_payment_term_form,Payment Terms,Términos de pago,0
+model,"ir.action,name",act_invoice_out_credit_note_form4,Pro Forma Credit Notes,Abonos pro forma,0
+model,"ir.action,name",act_invoice_out_invoice_form4,Pro Forma Invoices,Facturas pro forma,0
+model,"ir.action,name",act_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Abonos de proveedor pro forma,0
+model,"ir.action,name",act_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Facturas de proveedor pro forma,0
+model,"ir.action,name",act_invoice_in_credit_note_form,Supplier Credit Notes,Abonos de proveedor,0
+model,"ir.action,name",act_invoice_in_credit_note_form2,Supplier Credit Notes,Abonos de proveedor,0
+model,"ir.action,name",act_invoice_in_invoice_form,Supplier Invoices,Facturas de proveedor,0
+model,"ir.action,name",act_invoice_in_invoice_form2,Supplier Invoices,Facturas de proveedor,0
+model,"ir.sequence.type,name",sequence_type_account_invoice,Invoice,Factura,0
+model,"ir.ui.menu,name",menu_invoice_form,All Invoices,Todas las facturas,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form,Credit Notes,Abonos,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form3,Draft Credit Notes,Abono borrador,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form3,Draft Invoices,Facturas borrador,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Abonos de proveedor borrador,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form3,Draft Supplier Invoices,Facturas de proveedor borrador,0
+model,"ir.ui.menu,name",menu_invoices,Invoices,Facturas,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form,Invoices,Facturas,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form2,New Credit Note,Nuevo abono,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form2,New Invoice,Nueva factura,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form2,New Supplier Credit Note,Nuevo abono de proveedor,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form2,New Supplier Invoice,Nueva factura de proveedor,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form5,Opened Credit Notes,Abonos abiertos,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form5,Opened Invoices,Facturas abiertas,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Abonos de proveedor abiertos,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form5,Opened Supplier Invoices,Facturas de proveedor abiertas,0
+model,"ir.ui.menu,name",menu_payment_terms_configuration,Payment Terms,Términos de pago,0
+model,"ir.ui.menu,name",menu_payment_term_form,Payment Terms,Términos de pago,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form4,Pro Forma Credit Notes,Abonos pro forma,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form4,Pro Forma Invoices,Facturas pro forma,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Abonos de proveedor pro forma,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Facturas de proveedor pro forma,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form,Supplier Credit Notes,Abonos del proveedor,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form,Supplier Invoices,Facturas de proveedor,0
+model,"workflow.activity,name",invoice_activity_cancel,Canceled,Cancelado,0
+model,"workflow.activity,name",invoice_activity_draft,Draft,Borrador,0
+model,"workflow.activity,name",invoice_activity_open,Open,Abierto,0
+model,"workflow.activity,name",invoice_activity_paid,Paid,Pagado,0
+model,"workflow.activity,name",invoice_activity_proforma,Pro forma,Pro forma,0
+model,"workflow,name",invoice_workflow,Invoice workflow,Flujo de trabajo de la factura,0
+odt,account.invoice,0,Amount,Cantidad,0
+odt,account.invoice,0,Base,Base,0
+odt,account.invoice,0,Credit Note N°:,Abono Nº:,0
+odt,account.invoice,0,Date,Fecha,0
+odt,account.invoice,0,Date:,Fecha:,0
+odt,account.invoice,0,Description,Descripción,0
+odt,account.invoice,0,Description:,Descripción:,0
+odt,account.invoice,0,Draft Credit Note,Abono borrador,0
+odt,account.invoice,0,Draft Invoice,Factura borrador,0
+odt,account.invoice,0,Draft Supplier Credit Note,Borrador de abono de proveedor,0
+odt,account.invoice,0,Draft Supplier Invoice,Borrador de factura de proveedor,0
+odt,account.invoice,0,E-Mail:,Correo electrónico:,0
+odt,account.invoice,0,Invoice N°:,Factura Nº:,0
+odt,account.invoice,0,Payment Term,Término de pago,0
+odt,account.invoice,0,Phone:,Teléfono:,0
+odt,account.invoice,0,Pro forma Credit Note,Abono pro forma,0
+odt,account.invoice,0,Pro forma Invoice,Factura pro forma,0
+odt,account.invoice,0,Pro forma Supplier Credit Note,Abono de proveedor pro forma,0
+odt,account.invoice,0,Pro forma Supplier Invoice,Factura de proveedor pro forma,0
+odt,account.invoice,0,Quantity,Cantidad,0
+odt,account.invoice,0,Supplier Credit Note N°:,Abono de proveedor Nº:,0
+odt,account.invoice,0,Supplier Invoice N°:,Factura de proveedor Nº:,0
+odt,account.invoice,0,Tax,Impuesto,0
+odt,account.invoice,0,Taxes,Impuestos,0
+odt,account.invoice,0,Taxes:,Impuestos:,0
+odt,account.invoice,0,Total:,Total:,0
+odt,account.invoice,0,Total (excl. taxes):,Total (sin impuestos):,0
+odt,account.invoice,0,Unit Price,Precio unitario,0
+odt,account.invoice,0,VAT:,IVA:,0
+selection,"account.invoice.line,invoice_type",0,Credit Note,Abono,0
+selection,"account.invoice.line,invoice_type",0,Invoice,Factura,0
+selection,"account.invoice.line,invoice_type",0,Supplier Credit Note,Abono de proveedor,0
+selection,"account.invoice.line,invoice_type",0,Supplier Invoice,Factura de proveedor,0
+selection,"account.invoice.line,type",0,Comment,Comentario,0
+selection,"account.invoice.line,type",0,Line,Línea,0
+selection,"account.invoice.line,type",0,Subtotal,Subtotal,0
+selection,"account.invoice.line,type",0,Title,Título,0
+selection,"account.invoice.pay_invoice.ask,type",0,Partial Payment,Pago parcial,0
+selection,"account.invoice.pay_invoice.ask,type",0,Write-Off,Pérdida,0
+selection,"account.invoice,state",0,Canceled,Cancelada,0
+selection,"account.invoice,state",0,Draft,Borrador,0
+selection,"account.invoice,state",0,Opened,Abierto,0
+selection,"account.invoice,state",0,Paid,Pagada,0
+selection,"account.invoice,state",0,Pro forma,Pro forma,0
+selection,"account.invoice,type",0,Credit Note,Abono,0
+selection,"account.invoice,type",0,Invoice,Factura,0
+selection,"account.invoice,type",0,Supplier Credit Note,Abono del proveedor,0
+selection,"account.invoice,type",0,Supplier Invoice,Factura de proveedor,0
+view,account.invoice,0,Amount Second Currency,Cantidad en la divisa secundaria,0
+view,account.invoice,0,_Cancel,_Cancelar,0
+view,account.invoice,0,Credit,Haber,0
+view,account.invoice,0,Debit,Debe,0
+view,account.invoice,0,_Draft,_Borrador,0
+view,account.invoice,0,Invoice,Factura,0
+view,account.invoice,0,Invoices,Facturas,0
+view,account.invoice,0,Lines,Líneas,0
+view,account.invoice,0,_Open,_Abrir,0
+view,account.invoice,0,Other Info,Información adicional,0
+view,account.invoice,0,_Pay,_Pagar,0
+view,account.invoice,0,Payment,Pago,0
+view,account.invoice,0,Payment Lines,Líneas de pago,0
+view,account.invoice,0,Pro For_ma,Pro for_ma,0
+view,account.invoice,0,_Reset to Draft,_Restablecer a borrador,0
+view,account.invoice,0,Taxes,Impuestos,0
+view,account.invoice.credit_invoice.init,0,Are you sure to credit those/this invoice(s)?,¿Está seguro que quiere acreditar esas/esta factura(s)?,0
+view,account.invoice.credit_invoice.init,0,Credit Invoice,Factura crédito,0
+view,account.invoice.line,0,General,General,0
+view,account.invoice.line,0,Invoice Line,Línea de factura,0
+view,account.invoice.line,0,Invoice Lines,Líneas de factura,0
+view,account.invoice.line,0,Notes,Notas,0
+view,account.invoice.line,0,Products,Productos,0
+view,account.invoice.pay_invoice.ask,0,Amount Second Currency,Cantidad en la divisa secundaria,0
+view,account.invoice.pay_invoice.ask,0,Credit,Haber,0
+view,account.invoice.pay_invoice.ask,0,Debit,Debe,0
+view,account.invoice.pay_invoice.ask,0,Lines to Pay,Líneas a pagar,0
+view,account.invoice.pay_invoice.ask,0,Pay Invoice,Pagar factura,0
+view,account.invoice.pay_invoice.ask,0,Payment Lines,Líneas de pago,0
+view,account.invoice.pay_invoice.init,0,Pay Invoice,Pagar factura,0
+view,account.invoice.payment_term,0,Payment Term,Término de pago,0
+view,account.invoice.payment_term,0,Payment Term Line,Línea de término de pago,0
+view,account.invoice.payment_term,0,Payment Term Lines,Líneas de término de pago,0
+view,account.invoice.payment_term,0,Payment Terms,Términos de pago,0
+view,account.invoice.print_invoice_report.warning,0,<b>Warning!</b>,<b>Atención</b>,0
+view,account.invoice.print_invoice_report.warning,0,Print Invoice,Imprimir factura,0
+view,account.invoice.print_invoice_report.warning,0,The invoices will be sent <i>directly</i> to the printer.,Las facturas se enviarán <i>directamente</i> a la impresora.,0
+view,account.invoice.print_invoice_report.warning,0,You have selected more than one invoice to print.,Ha elegido más de una factura para imprimir.,0
+view,account.invoice.tax,0,Invoice Tax,Impuesto de factura,0
+view,account.invoice.tax,0,Invoice Taxes,Impuestos de factura,0
+view,account.invoice.tax,0,Tax Code,Código de impuesto,0
+view,party.party,0,Payment Terms,Términos de pago,0
+wizard_button,"account.invoice.credit_invoice,init,credit",0,Credit,Haber,0
+wizard_button,"account.invoice.credit_invoice,init,end",0,Cancel,Cancelar,0
+wizard_button,"account.invoice.pay_invoice,ask,end",0,Cancel,Cancelar,0
+wizard_button,"account.invoice.pay_invoice,ask,pay",0,Ok,Aceptar,0
+wizard_button,"account.invoice.pay_invoice,init,choice",0,Ok,Aceptar,0
+wizard_button,"account.invoice.pay_invoice,init,end",0,Cancel,Cancelar,0
+wizard_button,"account.invoice.print_invoice_report,warning,end",0,Cancel,Cancelar,0
+wizard_button,"account.invoice.print_invoice_report,warning,print",0,Print,Imprimir,0
diff --git a/fr_FR.csv b/fr_FR.csv
index a64dce4..708712f 100644
--- a/fr_FR.csv
+++ b/fr_FR.csv
@@ -1,2 +1,353 @@
 type,name,res_id,src,value,fuzzy
-field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Comptes analytiques,0
+error,account.fiscalyear,0,You can not change the invoice sequence if there is already an invoice opened in the fiscalyear,Vous ne pouvez pas changer la séquence de facture si il y a déjà une facture ouverte dans l'année fiscale,0
+error,account.fiscalyear,0,You must have different invoice sequences per fiscal year!,Vous devez utiliser des séquences de facture différentes par année fiscale !,0
+error,account.invoice,0,"Base taxes different from invoice lines!
+Re-compute the invoice.","Le montant de base des taxes sont différents des lignes de facture !
+Re-calculez la facture.",0
+error,account.invoice,0,"Taxes defined but not on invoice lines!
+Re-compute the invoice.","Des taxes sont définies mais pas sur les lignes de facture !
+Re-calculez la facture.",0
+error,account.invoice,0,"Taxes defined on invoice lines but not on invoice!
+Re-compute the invoice.","Des taxes sont définies sur les lignes de facture mais pas sur la facture !
+Re-calculez la facture.",0
+error,account.invoice,0,The credit account on journal is missing!,Le compte de crédit sur le journal est manquant !,0
+error,account.invoice,0,The credit account on journal is the same than the invoice account!,Le compte de crébit sur le journal est le même que le compte de la facture !,0
+error,account.invoice,0,The debit account on journal is missing!,Le compte de débit sur le journal est manquant !,0
+error,account.invoice,0,The debit account on journal is the same than the invoice account!,Le compte de débit sur le journal est le même que le compte de la facture !,0
+error,account.invoice,0,There is no invoice sequence on the period/fiscal year!,Il n'y a pas de séquence de facture sur la période/année fiscale !,0
+error,account.invoice,0,"You can not create an invoice
+with account from a different invoice company!","Vous ne pouvez pas créer une facture
+avec un compte d'une société de facturation différente !",0
+error,account.invoice,0,"You can not modify an invoice that is open, paid or canceled!","Vous ne pouvez pas modifier une facture qui est ouverte, payée ou annulée !",0
+error,account.invoice,0,You can not reset to draft an invoice that has move!,Vous ne pouvez pas remettre en brouillon une facture qui a un mouvement !,0
+error,account.invoice,0,"You can not use the same account
+as on invoice line!","Vous ne pouvez pas utiliser le même compte
+que sur la ligne de facture !",0
+error,account.invoice.credit_invoice,0,You can not credit with refund an invoice that is not opened!,Vous ne pouvez pas créditer avec un remboursement une facture qui n'est pas ouverte !,0
+error,account.invoice.credit_invoice,0,You can not credit with refund an invoice with payments!,Vous ne pouvez pas créditer avec un remboursement une facture avec paiements !,0
+error,account.invoice.line,0,"Line with ""line"" type must have an account!","Ligne de type ""ligne"" doit avoir un compte !",0
+error,account.invoice.line,0,"Line without ""line"" type must have an invoice!","Ligne sans type ""ligne"" doit avoir une facture !",0
+error,account.invoice.line,0,"You can not add a line to an invoice that is open, paid or canceled!","Vous ne pouvez pas ajouter une ligne à une facture qui est ouverte, payée our annulée !",0
+error,account.invoice.line,0,"You can not create invoice line
+with account with a different invoice company!","Vous ne pouvez pas créer de ligne de facture
+avec un compte d'une différente société que celle de la  facture !",0
+error,account.invoice.line,0,"You can not modify line from an invoice that is open, paid or canceled!","Vous ne pouvez pas modifier de ligne d'une facture qui est ouverte, payée our annulée !",0
+error,account.invoice.line,0,"You can not use the same account
+as on the invoice!","Vous ne pouvez pas utilier le même compte
+que celui de la factiure !",0
+error,account.invoice.pay_invoice,0,You can not create a partial payment with an amount greater then the amount to pay!,Vous ne pouvez pas créer un paiement partiel dont le montant est supérieur au montant qu'il reste à payer !,0
+error,account.invoice.payment_term,0,Invalid payment term line!,Ligne de condition de paiement non-valide !,0
+error,account.invoice.payment_term,0,Payment term missing a remainder line!,La condition de paiement manque une ligne de reste !,0
+error,account.invoice.payment_term.line.delay,0,The code must be unique!,Le code doit être unique !,0
+error,account.invoice.payment_term.line.type,0,The code must be unique!,Le code doit être unique !,0
+error,account.invoice.tax,0,"You can not add a line to an invoice that is open, paid or canceled!","Vous ne pouvez pas ajouter une ligne à une facture qui est ouverte, payée ou annulée !",0
+error,account.invoice.tax,0,"You can not modify tax from an invoice that is open, paid or canceled!","Vous ne pouvez pas modifier les taxes d'une facture qui est ouverte, payée ou annulée !",0
+error,account.period,0,You can not change the invoice sequence if there is already an invoice opened in the period,Vous ne pouvez pas changer la séquence de facture s'il y a déjà une facture ouverte dans la période,0
+error,account.period,0,You must have different invoice sequences per fiscal year and in the same company!,Vous devez avoir des séquences de facture différentes par année fiscale et dans la même société !,0
+field,"account.fiscalyear,in_credit_note_sequence",0,Supplier Credit Note Sequence,Séquence des notes de crédit fournisseur,0
+field,"account.fiscalyear,in_invoice_sequence",0,Supplier Invoice Sequence,Séquence de facture fournisseur,0
+field,"account.fiscalyear,out_credit_note_sequence",0,Customer Credit Note Sequence,Séquence des notes de crédit client,0
+field,"account.fiscalyear,out_invoice_sequence",0,Customer Invoice Sequence,Séquence de facture client,0
+field,"account.invoice,account",0,Account,Compte,0
+field,"account.invoice,accounting_date",0,Accounting Date,Date comptable,0
+field,"account.invoice-account.move.line,invoice",0,Invoice,Facture,0
+field,"account.invoice-account.move.line,line",0,Payment Line,Ligne de paiement,0
+field,"account.invoice-account.move.line,rec_name",0,Name,Nom,0
+field,"account.invoice,amount_to_pay",0,Amount to Pay,Montant à payer,0
+field,"account.invoice,amount_to_pay_today",0,Amount to Pay Today,Montant à payer aujourd'hui,0
+field,"account.invoice,comment",0,Comment,Commentaire,0
+field,"account.invoice,company",0,Company,Société,0
+field,"account.invoice.credit_invoice.init,with_refund",0,With Refund,Avec remboursement,0
+field,"account.invoice,currency",0,Currency,Devise,0
+field,"account.invoice,currency_digits",0,Currency Digits,Décimales de la devise,0
+field,"account.invoice,description",0,Description,Description,0
+field,"account.invoice,invoice_address",0,Invoice Address,Adresse de facturation,0
+field,"account.invoice,invoice_date",0,Invoice Date,Date de facturation,0
+field,"account.invoice,invoice_report",0,Invoice Report,Rapport de facturation,0
+field,"account.invoice,invoice_report_format",0,Invoice Report Format,Format du rapport de facturation,0
+field,"account.invoice,journal",0,Journal,Journal,0
+field,"account.invoice.line,account",0,Account,Compte,0
+field,"account.invoice.line-account.tax,line",0,Invoice Line,Ligne de facture,0
+field,"account.invoice.line-account.tax,rec_name",0,Name,Nom,0
+field,"account.invoice.line-account.tax,tax",0,Tax,Taxe,0
+field,"account.invoice.line,amount",0,Amount,Montant,0
+field,"account.invoice.line,company",0,Company,Société,0
+field,"account.invoice.line,currency",0,Currency,Devise,0
+field,"account.invoice.line,currency_digits",0,Currency Digits,Décimales de la devise,0
+field,"account.invoice.line,description",0,Description,Description,0
+field,"account.invoice.line,invoice",0,Invoice,Facture,0
+field,"account.invoice.line,invoice_taxes",0,Invoice Taxes,Taxes de le facture,0
+field,"account.invoice.line,invoice_type",0,Invoice Type,Type de facture,0
+field,"account.invoice.line,note",0,Note,Note,0
+field,"account.invoice.line,party",0,Party,Tiers,0
+field,"account.invoice.line,product",0,Product,Produit,0
+field,"account.invoice.line,quantity",0,Quantity,Quantité,0
+field,"account.invoice.line,rec_name",0,Name,Nom,0
+field,"account.invoice,lines",0,Lines,Lignes,0
+field,"account.invoice.line,sequence",0,Sequence,Séquence,0
+field,"account.invoice,lines_to_pay",0,Lines to Pay,Lignes à payer,0
+field,"account.invoice.line,taxes",0,Taxes,Taxes,0
+field,"account.invoice.line,type",0,Type,Type,0
+field,"account.invoice.line,unit",0,Unit,Unité,0
+field,"account.invoice.line,unit_digits",0,Unit Digits,Décimales de l'unité,0
+field,"account.invoice.line,unit_price",0,Unit Price,Prix unitaire,0
+field,"account.invoice,move",0,Move,Mouvement,0
+field,"account.invoice,number",0,Number,Numéro,0
+field,"account.invoice,party",0,Party,Tiers,0
+field,"account.invoice,party_lang",0,Party Language,Langue du tiers,0
+field,"account.invoice.pay_invoice.ask,account",0,Account,Compte,0
+field,"account.invoice.pay_invoice.ask,account_writeoff",0,Write-Off Account,Compte de pertes et profits,0
+field,"account.invoice.pay_invoice.ask,amount",0,Payment Amount,Montant,0
+field,"account.invoice.pay_invoice.ask,amount_writeoff",0,Write-Off Amount,Montant de pertes et profits,0
+field,"account.invoice.pay_invoice.ask,company",0,Company,Société,0
+field,"account.invoice.pay_invoice.ask,currency",0,Payment Currency,Devise,0
+field,"account.invoice.pay_invoice.ask,currency_digits",0,Payment Currency Digits,Décimales de la devise,0
+field,"account.invoice.pay_invoice.ask,currency_digits_writeoff",0,Write-Off Currency Digits,Décimales de la devise de pertes et profits,0
+field,"account.invoice.pay_invoice.ask,currency_writeoff",0,Write-Off Currency,Devise pertes et profits,0
+field,"account.invoice.pay_invoice.ask,date",0,Date,Date,0
+field,"account.invoice.pay_invoice.ask,description",0,Description,Description,0
+field,"account.invoice.pay_invoice.ask,invoice",0,Invoice,Facture,0
+field,"account.invoice.pay_invoice.ask,journal",0,Journal,Journal,0
+field,"account.invoice.pay_invoice.ask,journal_writeoff",0,Write-Off Journal,Journal,0
+field,"account.invoice.pay_invoice.ask,lines",0,Lines,Lignes,0
+field,"account.invoice.pay_invoice.ask,lines_to_pay",0,Lines to Pay,Lignes à payer,0
+field,"account.invoice.pay_invoice.ask,payment_lines",0,Payment Lines,Lignes de paiement,0
+field,"account.invoice.pay_invoice.ask,type",0,Type,Type,0
+field,"account.invoice.pay_invoice.init,amount",0,Amount,Montant,0
+field,"account.invoice.pay_invoice.init,currency",0,Currency,Devise,0
+field,"account.invoice.pay_invoice.init,currency_digits",0,Currency Digits,Décimales de la devise,0
+field,"account.invoice.pay_invoice.init,date",0,Date,date,0
+field,"account.invoice.pay_invoice.init,description",0,Description,Description,0
+field,"account.invoice.pay_invoice.init,journal",0,Journal,Journal,0
+field,"account.invoice,payment_lines",0,Payment Lines,Lignes de paiement,0
+field,"account.invoice,payment_term",0,Payment Term,Condition de paiement,0
+field,"account.invoice.payment_term,active",0,Active,Actif,0
+field,"account.invoice.payment_term,description",0,Description,Description,0
+field,"account.invoice.payment_term.line,amount",0,Amount,Montant,0
+field,"account.invoice.payment_term.line,currency",0,Currency,Devise,0
+field,"account.invoice.payment_term.line,currency_digits",0,Currency Digits,Décimales de la devise,0
+field,"account.invoice.payment_term.line,days",0,Number of Days,Nombre de jours,0
+field,"account.invoice.payment_term.line,delay",0,Condition,Condition,0
+field,"account.invoice.payment_term.line.delay,code",0,Code,Code,0
+field,"account.invoice.payment_term.line.delay,name",0,Name,Nom,0
+field,"account.invoice.payment_term.line.delay,rec_name",0,Name,Nom,0
+field,"account.invoice.payment_term.line,payment",0,Payment Term,Condition de paiement,0
+field,"account.invoice.payment_term.line,percentage",0,Percentage,Pourcentage,0
+field,"account.invoice.payment_term.line,rec_name",0,Name,Nom,0
+field,"account.invoice.payment_term,lines",0,Lines,Lignes,0
+field,"account.invoice.payment_term.line,sequence",0,Sequence,Séquence,0
+field,"account.invoice.payment_term.line,type",0,Type,Type,0
+field,"account.invoice.payment_term.line.type,code",0,Code,Code,0
+field,"account.invoice.payment_term.line.type,name",0,Name,Nom,0
+field,"account.invoice.payment_term.line.type,rec_name",0,Name,Nom,0
+field,"account.invoice.payment_term,name",0,Payment Term,Condition de paiement,0
+field,"account.invoice.payment_term,rec_name",0,Name,Nom,0
+field,"account.invoice,rec_name",0,Name,Nom,0
+field,"account.invoice,reconciled",0,Reconciled,Réconcilié,0
+field,"account.invoice,reference",0,Reference,Référence,0
+field,"account.invoice,state",0,State,État,0
+field,"account.invoice.tax,account",0,Account,Compte,0
+field,"account.invoice,tax_amount",0,Tax,Taxe,0
+field,"account.invoice.tax,amount",0,Amount,Montant,0
+field,"account.invoice.tax,base",0,Base,Base,0
+field,"account.invoice.tax,base_code",0,Base Code,Code de base,0
+field,"account.invoice.tax,base_sign",0,Base Sign,Signe de base,0
+field,"account.invoice.tax,description",0,Description,Description,0
+field,"account.invoice,taxes",0,Tax Lines,Lignes de taxe,0
+field,"account.invoice.tax,invoice",0,Invoice,Facture,0
+field,"account.invoice.tax,manual",0,Manual,Manuel,0
+field,"account.invoice.tax,rec_name",0,Name,Nom,0
+field,"account.invoice.tax,sequence",0,Sequence,Séquence,0
+field,"account.invoice.tax,sequence_number",0,Sequence Number,Numéro de séquence,0
+field,"account.invoice.tax,tax",0,Tax,Taxe,0
+field,"account.invoice.tax,tax_code",0,Tax Code,Code de taxe,0
+field,"account.invoice.tax,tax_sign",0,Tax Sign,Signe de taxe,0
+field,"account.invoice,total_amount",0,Total,Total,0
+field,"account.invoice,type",0,Type,Type,0
+field,"account.invoice,type_name",0,Type,Type,0
+field,"account.invoice,untaxed_amount",0,Untaxed,Hors taxe,0
+field,"account.period,in_credit_note_sequence",0,Supplier Credit Note Sequence,Séquence des notes de crédit fournisseur,0
+field,"account.period,in_invoice_sequence",0,Supplier Invoice Sequence,Séquence de facture fournisseur,0
+field,"account.period,out_credit_note_sequence",0,Customer Credit Note Sequence,Séquence des notes de crédit client,0
+field,"account.period,out_invoice_sequence",0,Customer Invoice Sequence,Séquence de facture client,0
+field,"party.address,invoice",0,Invoice,Facture,0
+field,"party.party,payment_term",0,Invoice Payment Term,Conditions de paiement du client,0
+field,"party.party,supplier_payment_term",0,Supplier Payment Term,Conditions de paiement du fournisseur,0
+help,"account.invoice.credit_invoice.init,with_refund",0,"If true, the current invoice(s) will be paid.","Si vrai, les factures seront payées.",0
+help,"account.invoice.payment_term.line,percentage",0,In %,En %,0
+help,"account.invoice.payment_term.line,sequence",0,Use to order lines in ascending order,Utilisé pour trier les lignes en ordre croissant,0
+model,"account.invoice-account.move.line,name",0,Invoice - Payment Line,Facture - Ligne de paiement,0
+model,"account.invoice.credit_invoice.init,name",0,Credit Invoice Init,Crediter la facture - Init,0
+model,"account.invoice.line-account.tax,name",0,Invoice Line - Tax,Ligne de facture - Taxe,0
+model,"account.invoice.line,name",0,Invoice Line,Ligne de Facture,0
+model,"account.invoice,name",0,Invoice,Facture,0
+model,"account.invoice.pay_invoice.ask,name",0,Pay Invoice Ask,Payer la facture - Demande,0
+model,"account.invoice.pay_invoice.init,name",0,Pay Invoice Init,Payer la facture - Init,0
+model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_end_month,End Month,fin du mois,0
+model,"account.invoice.payment_term.line.delay,name",payment_term_line_delay_net_days,Net Days,Jours,0
+model,"account.invoice.payment_term.line.delay,name",0,Payment Term Line Delay,Délai de ligne de condition de paiement,0
+model,"account.invoice.payment_term.line,name",0,Payment Term Line,Ligne de condition de paiement,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_fixed,Fixed,Fixe,0
+model,"account.invoice.payment_term.line.type,name",0,Payment Term Line Type,Type de line de condition de paiement,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_percent,Percentage,Pourcentage,0
+model,"account.invoice.payment_term.line.type,name",payment_term_line_type_remainder,Remainder,Reste,0
+model,"account.invoice.payment_term,name",0,Payment Term,Conditions de paiement,0
+model,"account.invoice.print_invoice_report.warning,name",0,Print Invoice Report Warning,Imprimer de la factures - Avertissement,0
+model,"account.invoice.tax,name",0,Invoice Tax,Tax de facture,0
+model,"ir.action,name",act_invoice_form,All Invoices,Toutes les factures,0
+model,"ir.action,name",credit_invoice,Credit,Crédit,0
+model,"ir.action,name",act_invoice_out_credit_note_form,Credit Notes,Notes de crédit,0
+model,"ir.action,name",act_invoice_out_credit_note_form2,Credit Notes,Notes de crédit,0
+model,"ir.action,name",act_invoice_out_credit_note_form3,Draft Credit Notes,Notes de crédit en brouillon,0
+model,"ir.action,name",act_invoice_out_invoice_form3,Draft Invoices,Factures en brouillon,0
+model,"ir.action,name",act_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Notes de crédit fournisseurs en brouillon,0
+model,"ir.action,name",act_invoice_in_invoice_form3,Draft Supplier Invoices,Factures fournisseurs ouvertes,0
+model,"ir.action,name",report_invoice,Invoice,Facture,0
+model,"ir.action,name",print_invoice_report,Invoice,Facture,0
+model,"ir.action,name",act_invoice_out_invoice_form,Invoices,Factures,0
+model,"ir.action,name",act_invoice_out_invoice_form2,Invoices,Factures,0
+model,"ir.action,name",act_invoice_form2,Invoices,Factures,0
+model,"ir.action,name",act_invoice_out_credit_note_form5,Opened Credit Notes,Notes de crédit ouvertes,0
+model,"ir.action,name",act_invoice_out_invoice_form5,Opened Invoices,Factures ouvertes,0
+model,"ir.action,name",act_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Notes de crédit fournisseurs ouvertes,0
+model,"ir.action,name",act_invoice_in_invoice_form5,Opened Supplier Invoices,Factures fournisseurs ouvertes,0
+model,"ir.action,name",wizard_pay_invoice,Pay Invoice,Payer facture,0
+model,"ir.action,name",act_payment_term_form,Payment Terms,Conditions de paiement,0
+model,"ir.action,name",act_invoice_out_credit_note_form4,Pro Forma Credit Notes,Notes de crédit pro forma,0
+model,"ir.action,name",act_invoice_out_invoice_form4,Pro Forma Invoices,Factures pro forma,0
+model,"ir.action,name",act_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Notes de crédit fournisseurs pro forma,0
+model,"ir.action,name",act_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Factures fournisseurs pro forma,0
+model,"ir.action,name",act_invoice_in_credit_note_form,Supplier Credit Notes,Notes de crédit fournisseur,0
+model,"ir.action,name",act_invoice_in_credit_note_form2,Supplier Credit Notes,Notes de crédit fournisseurs,0
+model,"ir.action,name",act_invoice_in_invoice_form,Supplier Invoices,Factures fournisseurs,0
+model,"ir.action,name",act_invoice_in_invoice_form2,Supplier Invoices,Factures fournisseurs,0
+model,"ir.sequence.type,name",sequence_type_account_invoice,Invoice,Facture,0
+model,"ir.ui.menu,name",menu_invoice_form,All Invoices,Toutes les factures,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form,Credit Notes,Notes de crédit,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form3,Draft Credit Notes,Notes de crédit en brouillon,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form3,Draft Invoices,Factures en brouillon,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form3,Draft Supplier Credit Notes,Notes de crédit fournisseur en brouillon,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form3,Draft Supplier Invoices,Factures fournisseurs en brouillon,0
+model,"ir.ui.menu,name",menu_invoices,Invoices,Factures,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form,Invoices,Factures,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form2,New Credit Note,Nouvelle note de crédit,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form2,New Invoice,Nouvelle facture,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form2,New Supplier Credit Note,Nouvelle note de crédit fournisseur,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form2,New Supplier Invoice,Nouvelle facture fournisseur,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form5,Opened Credit Notes,Notes de crédit ouvertes,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form5,Opened Invoices,Factures ouvertes,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form5,Opened Supplier Credit Notes,Notes de crédit fournisseur ouvertes,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form5,Opened Supplier Invoices,Factures fournisseurs ouvertes,0
+model,"ir.ui.menu,name",menu_payment_terms_configuration,Payment Terms,Conditions de paiement,0
+model,"ir.ui.menu,name",menu_payment_term_form,Payment Terms,Conditions de paiement,0
+model,"ir.ui.menu,name",menu_invoice_out_credit_note_form4,Pro Forma Credit Notes,Notes de crédit pro forma,0
+model,"ir.ui.menu,name",menu_invoice_out_invoice_form4,Pro Forma Invoices,Factures pro forma,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form4,Pro Forma Supplier Credit Notes,Notes de crédit fournisseur pro forma,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form4,Pro Forma Supplier Invoices,Factures fournisseurs pro forma,0
+model,"ir.ui.menu,name",menu_invoice_in_credit_note_form,Supplier Credit Notes,Notes de crédit fournisseur,0
+model,"ir.ui.menu,name",menu_invoice_in_invoice_form,Supplier Invoices,Factures fournisseurs,0
+model,"workflow.activity,name",invoice_activity_cancel,Canceled,Annulé,0
+model,"workflow.activity,name",invoice_activity_draft,Draft,Brouillon,0
+model,"workflow.activity,name",invoice_activity_open,Open,Ouvert,0
+model,"workflow.activity,name",invoice_activity_paid,Paid,Payé,0
+model,"workflow.activity,name",invoice_activity_proforma,Pro forma,Pro forma,0
+model,"workflow,name",invoice_workflow,Invoice workflow,Workflow facture,0
+odt,account.invoice,0,Amount,Montant,0
+odt,account.invoice,0,Base,Base,0
+odt,account.invoice,0,Credit Note N°:,N° de note de crédit :,0
+odt,account.invoice,0,Date,Date,0
+odt,account.invoice,0,Date:,Date :,0
+odt,account.invoice,0,Description,Description,0
+odt,account.invoice,0,Description:,Description :,0
+odt,account.invoice,0,Draft Credit Note,Note de crédit brouillon,0
+odt,account.invoice,0,Draft Invoice,Facture brouillon,0
+odt,account.invoice,0,Draft Supplier Credit Note,Note de crédit fournisseur brouillon,0
+odt,account.invoice,0,Draft Supplier Invoice,Facture fournisseur brouillon,0
+odt,account.invoice,0,E-Mail:,E-Mail:,0
+odt,account.invoice,0,Invoice N°:,N° de facture :,0
+odt,account.invoice,0,Payment Term,Condition de paiement,0
+odt,account.invoice,0,Phone:,Téléphone,0
+odt,account.invoice,0,Pro forma Credit Note,Note de crédit pro forma,0
+odt,account.invoice,0,Pro forma Invoice,Facture pro forma,0
+odt,account.invoice,0,Pro forma Supplier Credit Note,Note de crédit fournisseur pro forma,0
+odt,account.invoice,0,Pro forma Supplier Invoice,Facture fournisseur pro forma,0
+odt,account.invoice,0,Quantity,Quantité,0
+odt,account.invoice,0,Supplier Credit Note N°:,N° de note de crédit fournisseur :,0
+odt,account.invoice,0,Supplier Invoice N°:,N° de facture fournisseur :,0
+odt,account.invoice,0,Tax,Taxe,0
+odt,account.invoice,0,Taxes,Taxes,0
+odt,account.invoice,0,Taxes:,Taxes :,0
+odt,account.invoice,0,Total:,Total :,0
+odt,account.invoice,0,Total (excl. taxes):,Total (hors-taxes) :,0
+odt,account.invoice,0,Unit Price,Prix unitaire,0
+odt,account.invoice,0,VAT:,TVA :,0
+selection,"account.invoice.line,invoice_type",0,Credit Note,Note de crédit,0
+selection,"account.invoice.line,invoice_type",0,Invoice,Facture,0
+selection,"account.invoice.line,invoice_type",0,Supplier Credit Note,Note de crédit fournisseur,0
+selection,"account.invoice.line,invoice_type",0,Supplier Invoice,Facture fournisseur,0
+selection,"account.invoice.line,type",0,Comment,Commentaire,0
+selection,"account.invoice.line,type",0,Line,Ligne,0
+selection,"account.invoice.line,type",0,Subtotal,Sous-total,0
+selection,"account.invoice.line,type",0,Title,Titre,0
+selection,"account.invoice.pay_invoice.ask,type",0,Partial Payment,Paiement partiel,0
+selection,"account.invoice.pay_invoice.ask,type",0,Write-Off,Pertes et profits,0
+selection,"account.invoice,state",0,Canceled,Annulé,0
+selection,"account.invoice,state",0,Draft,Brouillon,0
+selection,"account.invoice,state",0,Opened,Ouvert,0
+selection,"account.invoice,state",0,Paid,Payée,0
+selection,"account.invoice,state",0,Pro forma,Pro forma,0
+selection,"account.invoice,type",0,Credit Note,Note de crédit,0
+selection,"account.invoice,type",0,Invoice,Facture,0
+selection,"account.invoice,type",0,Supplier Credit Note,Note de crédit fournisseur,0
+selection,"account.invoice,type",0,Supplier Invoice,Facture fournisseur,0
+view,account.invoice,0,Amount Second Currency,Montant de devise secondaire,0
+view,account.invoice,0,_Cancel,_Annuler,0
+view,account.invoice,0,Credit,Crédit,0
+view,account.invoice,0,Debit,Débit,0
+view,account.invoice,0,_Draft,_Brouillon,0
+view,account.invoice,0,Invoice,Facture,0
+view,account.invoice,0,Invoices,Factures,0
+view,account.invoice,0,Lines,Lignes,0
+view,account.invoice,0,_Open,_Ouvrir,0
+view,account.invoice,0,Other Info,Autre information,0
+view,account.invoice,0,_Pay,_Payer,0
+view,account.invoice,0,Payment,Paiement,0
+view,account.invoice,0,Payment Lines,Lignes de paiement,0
+view,account.invoice,0,Pro For_ma,Pro For_ma,0
+view,account.invoice,0,_Reset to Draft,_Remettre en brouillon,0
+view,account.invoice,0,Taxes,Taxes,0
+view,account.invoice.credit_invoice.init,0,Are you sure to credit those/this invoice(s)?,Etes-vous sûr de vouloir créditer cette/ces factures ?,0
+view,account.invoice.credit_invoice.init,0,Credit Invoice,Facture de crédit,0
+view,account.invoice.line,0,General,Général,0
+view,account.invoice.line,0,Invoice Line,Ligne de facture,0
+view,account.invoice.line,0,Invoice Lines,Lignes de facture,0
+view,account.invoice.line,0,Notes,Notes,0
+view,account.invoice.line,0,Products,Produits,0
+view,account.invoice.pay_invoice.ask,0,Amount Second Currency,Montant en devise secondaire,0
+view,account.invoice.pay_invoice.ask,0,Credit,Crédit,0
+view,account.invoice.pay_invoice.ask,0,Debit,Débit,0
+view,account.invoice.pay_invoice.ask,0,Lines to Pay,Lignes à payer,0
+view,account.invoice.pay_invoice.ask,0,Pay Invoice,Payer la facture,0
+view,account.invoice.pay_invoice.ask,0,Payment Lines,Lignes de paiement,0
+view,account.invoice.pay_invoice.init,0,Pay Invoice,Payer la facture,0
+view,account.invoice.payment_term,0,Payment Term,Conditions de paiement,0
+view,account.invoice.payment_term,0,Payment Term Line,Ligne de condition de paiement,0
+view,account.invoice.payment_term,0,Payment Term Lines,Lignes de condition de paiement,0
+view,account.invoice.payment_term,0,Payment Terms,Conditions de paiement,0
+view,account.invoice.print_invoice_report.warning,0,<b>Warning!</b>,<b>Attention!</b>,0
+view,account.invoice.print_invoice_report.warning,0,Print Invoice,Imprimer la facture,0
+view,account.invoice.print_invoice_report.warning,0,The invoices will be sent <i>directly</i> to the printer.,Les factures seront envoyées <i>directement</i> à l'imprimante.,0
+view,account.invoice.print_invoice_report.warning,0,You have selected more than one invoice to print.,Vous avez sélectionné plus d'une facture à imprimer.,0
+view,account.invoice.tax,0,Invoice Tax,Taxes de le facture,0
+view,account.invoice.tax,0,Invoice Taxes,Taxes de le facture,0
+view,account.invoice.tax,0,Tax Code,Code de taxe,0
+view,party.party,0,Payment Terms,Conditions de paiement,0
+view,product.product,0,Taxes,Taxes,0
+wizard_button,"account.invoice.credit_invoice,init,credit",0,Credit,Créditer,0
+wizard_button,"account.invoice.credit_invoice,init,end",0,Cancel,Annuler,0
+wizard_button,"account.invoice.pay_invoice,ask,end",0,Cancel,Annuler,0
+wizard_button,"account.invoice.pay_invoice,ask,pay",0,Ok,Ok,0
+wizard_button,"account.invoice.pay_invoice,init,choice",0,Ok,Ok,0
+wizard_button,"account.invoice.pay_invoice,init,end",0,Cancel,Annuler,0
+wizard_button,"account.invoice.print_invoice_report,warning,end",0,Cancel,Annuler,0
+wizard_button,"account.invoice.print_invoice_report,warning,print",0,Print,Imprimer,0
diff --git a/invoice.odt b/invoice.odt
new file mode 100644
index 0000000..f49be6f
Binary files /dev/null and b/invoice.odt differ
diff --git a/invoice.py b/invoice.py
index ef9ec77..c1dc25a 100644
--- a/invoice.py
+++ b/invoice.py
@@ -1,232 +1,2518 @@
-#This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
 "Invoice"
-from trytond.model import ModelView, ModelSQL, fields
+from trytond.model import ModelWorkflow, ModelView, ModelSQL, fields
+from trytond.report import Report
+from trytond.wizard import Wizard
+from trytond.backend import TableHandler
+from decimal import Decimal
+import base64
 
+_STATES = {
+    'readonly': "state != 'draft'",
+}
 
-class InvoiceLine(ModelSQL, ModelView):
-    _name = 'account.invoice.line'
+_TYPE = [
+    ('out_invoice', 'Invoice'),
+    ('in_invoice', 'Supplier Invoice'),
+    ('out_credit_note', 'Credit Note'),
+    ('in_credit_note', 'Supplier Credit Note'),
+]
 
-    analytic_accounts = fields.Many2One('analytic_account.account.selection',
-            'Analytic Accounts',
-            states={
-                'invisible': "type != 'line'",
+_TYPE2JOURNAL = {
+    'out_invoice': 'revenue',
+    'in_invoice': 'expense',
+    'out_credit_note': 'revenue',
+    'in_credit_note': 'expense',
+}
+
+
+class Invoice(ModelWorkflow, ModelSQL, ModelView):
+    'Invoice'
+    _name = 'account.invoice'
+    _description = __doc__
+    _order_name = 'number'
+    company = fields.Many2One('company.company', 'Company', required=True,
+            states=_STATES, domain="[('id', '=', context.get('company', 0))]")
+    type = fields.Selection(_TYPE, 'Type', select=1, on_change=['type'],
+            required=True, states={
+                'readonly': "state != 'draft' or context.get('type', False)" \
+                        " or (bool(lines) and bool(type))",
+            })
+    type_name = fields.Function('get_type_name', type='char', string='Type')
+    number = fields.Char('Number', size=None, readonly=True, select=1)
+    reference = fields.Char('Reference', size=None)
+    description = fields.Char('Description', size=None, states=_STATES)
+    state = fields.Selection([
+        ('draft', 'Draft'),
+        ('proforma', 'Pro forma'),
+        ('open', 'Opened'),
+        ('paid', 'Paid'),
+        ('cancel', 'Canceled'),
+        ], 'State', readonly=True)
+    invoice_date = fields.Date('Invoice Date', required=True,
+        states=_STATES)
+    accounting_date = fields.Date('Accounting Date', states=_STATES)
+    party = fields.Many2One('party.party', 'Party', change_default=True,
+        required=True, states=_STATES, on_change=['party', 'payment_term',
+            'type', 'company'])
+    party_lang = fields.Function('get_party_language', type='char',
+            string='Party Language', on_change_with=['party'])
+    invoice_address = fields.Many2One('party.address', 'Invoice Address',
+        required=True, states=_STATES, domain="[('party', '=', party)]")
+    currency = fields.Many2One('currency.currency', 'Currency', required=True,
+        states={
+            'readonly': "state != 'draft' or (bool(lines) and bool(currency))",
+        })
+    currency_digits = fields.Function('get_currency_digits', type='integer',
+            string='Currency Digits', on_change_with=['currency'])
+    journal = fields.Many2One('account.journal', 'Journal', required=True,
+        states=_STATES, domain=[('centralised', '=', False)])
+    move = fields.Many2One('account.move', 'Move', readonly=True)
+    account = fields.Many2One('account.account', 'Account', required=True,
+        states=_STATES,
+        domain="[('company', '=', company), ('kind', '!=', 'view')]")
+    payment_term = fields.Many2One('account.invoice.payment_term',
+        'Payment Term', required=True, states=_STATES)
+    lines = fields.One2Many('account.invoice.line', 'invoice', 'Lines',
+        states=_STATES, on_change=['lines', 'taxes', 'currency', 'party', 'type'])
+    taxes = fields.One2Many('account.invoice.tax', 'invoice', 'Tax Lines',
+        states=_STATES, on_change=['lines', 'taxes', 'currency', 'party', 'type'])
+    comment = fields.Text('Comment')
+    untaxed_amount = fields.Function('get_untaxed_amount', type='numeric',
+            digits="(16, currency_digits)", string='Untaxed',
+            fnct_search='search_untaxed_amount')
+    tax_amount = fields.Function('get_tax_amount', type='numeric',
+            digits="(16, currency_digits)", string='Tax',
+            fnct_search='search_tax_amount')
+    total_amount = fields.Function('get_total_amount', type='numeric',
+            digits="(16, currency_digits)", string='Total',
+            fnct_search='search_total_amount')
+    reconciled = fields.Function('get_reconciled', type='boolean',
+            string='Reconciled')
+    lines_to_pay = fields.Function('get_lines_to_pay', type='one2many',
+            relation='account.move.line', string='Lines to Pay')
+    payment_lines = fields.Many2Many('account.invoice-account.move.line',
+            'invoice', 'line', readonly=True, string='Payment Lines')
+    amount_to_pay_today = fields.Function('get_amount_to_pay',
+            type='numeric', digits="(16, currency_digits)",
+            string='Amount to Pay Today')
+    amount_to_pay = fields.Function('get_amount_to_pay',
+            type='numeric', digits="(16, currency_digits)",
+            string='Amount to Pay')
+    invoice_report = fields.Binary('Invoice Report', readonly=True)
+    invoice_report_format = fields.Char('Invoice Report Format', readonly=True)
+
+    def __init__(self):
+        super(Invoice, self).__init__()
+        self._rpc.update({
+            'button_draft': True,
+        })
+        self._constraints += [
+            ('check_account', 'account_different_company'),
+            ('check_account2', 'same_account_on_line'),
+        ]
+        self._order.insert(0, ('number', 'DESC'))
+        self._order.insert(1, ('id', 'DESC'))
+        self._error_messages.update({
+            'reset_draft': 'You can not reset to draft ' \
+                    'an invoice that has move!',
+            'missing_tax_line': 'Taxes defined ' \
+                    'but not on invoice lines!\n' \
+                    'Re-compute the invoice.',
+            'diff_tax_line': 'Base taxes ' \
+                    'different from invoice lines!\n' \
+                    'Re-compute the invoice.',
+            'missing_tax_line2': 'Taxes defined ' \
+                    'on invoice lines but not on invoice!\n' \
+                    'Re-compute the invoice.',
+            'no_invoice_sequence': 'There is no invoice sequence ' \
+                    'on the period/fiscal year!',
+            'modify_invoice': 'You can not modify an invoice that is ' \
+                    'open, paid or canceled!',
+            'same_debit_account': 'The debit account on journal is ' \
+                    'the same than the invoice account!',
+            'missing_debit_account': 'The debit account on journal is ' \
+                    'missing!',
+            'same_credit_account': 'The credit account on journal is ' \
+                    'the same than the invoice account!',
+            'missing_credit_account': 'The credit account on journal is ' \
+                    'missing!',
+            'account_different_company': 'You can not create an invoice\n' \
+                    'with account from a different invoice company!',
+            'same_account_on_line': 'You can not use the same account\n' \
+                    'as on invoice line!',
             })
 
-    def _view_look_dom_arch(self, cursor, user, tree, type, context=None):
-        analytic_account_obj = self.pool.get('analytic_account.account')
-        analytic_account_obj.convert_view(cursor, user, tree, context=context)
-        arch, fields = super(InvoiceLine, self)._view_look_dom_arch(cursor,
-                user, tree, type, context=context)
-        return arch, fields
+    def default_type(self, cursor, user, context=None):
+        if context is None:
+            context = {}
+        return context.get('type', 'out_invoice')
+
+    def default_state(self, cursor, user, context=None):
+        return 'draft'
+
+    def default_invoice_date(self, cursor, user, context=None):
+        date_obj = self.pool.get('ir.date')
+        return date_obj.today(cursor, user, context=context)
+
+    def default_currency(self, cursor, user, context=None):
+        company_obj = self.pool.get('company.company')
+        currency_obj = self.pool.get('currency.currency')
+        if context is None:
+            context = {}
+        if context.get('company'):
+            company = company_obj.browse(cursor, user, context['company'],
+                    context=context)
+            return company.currency.id
+        return False
+
+    def default_currency_digits(self, cursor, user, context=None):
+        company_obj = self.pool.get('company.company')
+        if context is None:
+            context = {}
+        if context.get('company'):
+            company = company_obj.browse(cursor, user, context['company'],
+                    context=context)
+            return company.currency.digits
+        return 2
+
+    def default_company(self, cursor, user, context=None):
+        company_obj = self.pool.get('company.company')
+        if context is None:
+            context = {}
+        if context.get('company'):
+            return context['company']
+        return False
+
+    def default_payment_term(self, cursor, user, context=None):
+        payment_term_obj = self.pool.get('account.invoice.payment_term')
+        payment_term_ids = payment_term_obj.search(cursor, user,
+                self.payment_term.domain, context=context)
+        if len(payment_term_ids) == 1:
+            return payment_term_ids[0]
+        return False
+
+    def on_change_type(self, cursor, user, ids, vals, context=None):
+        journal_obj = self.pool.get('account.journal')
+        res = {}
+        journal_ids = journal_obj.search(cursor, user, [
+            ('type', '=', _TYPE2JOURNAL.get(vals.get('type', 'out_invoice'),
+                'revenue')),
+            ], limit=1, context=context)
+        if journal_ids:
+            journal = journal_obj.browse(cursor, user, journal_ids[0],
+                    context=context)
+            res['journal'] = journal.id
+            res['journal.rec_name'] = journal.rec_name
+        return res
+
+    def on_change_party(self, cursor, user, ids, vals, context=None):
+        party_obj = self.pool.get('party.party')
+        address_obj = self.pool.get('party.address')
+        account_obj = self.pool.get('account.account')
+        payment_term_obj = self.pool.get('account.invoice.payment_term')
+        company_obj = self.pool.get('company.company')
+        res = {
+            'invoice_address': False,
+            'account': False,
+        }
+        if vals.get('party'):
+            party = party_obj.browse(cursor, user, vals['party'],
+                    context=context)
+            res['invoice_address'] = party_obj.address_get(cursor, user,
+                    party.id, type='invoice', context=context)
+            if vals.get('type') in ('out_invoice', 'out_credit_note'):
+                res['account'] = party.account_receivable.id
+                if vals['type'] == 'out_invoice' and party.payment_term:
+                    res['payment_term'] = party.payment_term.id
+            elif vals.get('type') in ('in_invoice', 'in_credit_note'):
+                res['account'] = party.account_payable.id
+                if vals['type'] == 'in_invoice' and party.supplier_payment_term:
+                    res['payment_term'] = party.supplier_payment_term.id
+
+        if vals.get('company'):
+            company = company_obj.browse(cursor, user, vals['company'],
+                    context=context)
+            if vals.get('type') == 'out_credit_note':
+                res['payment_term'] = company.payment_term.id
+            elif vals.get('type') == 'in_credit_note':
+                res['payment_term'] = company.supplier_payment_term.id
+
+        if res['invoice_address']:
+            res['invoice_address.rec_name'] = address_obj.browse(cursor, user,
+                    res['invoice_address'], context=context).rec_name
+        if res['account']:
+            res['account.rec_name'] = account_obj.browse(cursor, user,
+                    res['account'], context=context).rec_name
+        if res.get('payment_term'):
+            res['payment_term.rec_name'] = payment_term_obj.browse(cursor, user,
+                    res['payment_term'], context=context).rec_name
+        return res
+
+    def on_change_with_currency_digits(self, cursor, user, ids, vals,
+            context=None):
+        currency_obj = self.pool.get('currency.currency')
+        if vals.get('currency'):
+            currency = currency_obj.browse(cursor, user, vals['currency'],
+                    context=context)
+            return currency.digits
+        return 2
+
+    def get_currency_digits(self, cursor, user, ids, name, arg, context=None):
+        res = {}
+        for invoice in self.browse(cursor, user, ids, context=context):
+            res[invoice.id] = invoice.currency.digits
+        return res
+
+    def on_change_with_party_lang(self, cursor, user, ids, vals, context=None):
+        party_obj = self.pool.get('party.party')
+        if vals.get('party'):
+            party = party_obj.browse(cursor, user, vals['party'],
+                    context=context)
+            if party.lang:
+                return party.lang.code
+        return 'en_US'
+
+    def get_party_language(self, cursor, user, ids, name, arg, context=None):
+        '''
+        Return the language code of the party of each invoice
+
+        :param cursor: the database cursor
+        :param user: the user id
+        :param ids: the ids of the invoices
+        :param context: the context
+        :return: a dictionary with invoice id as key and
+            language code as value
+        '''
+        res = {}
+        for invoice in self.browse(cursor, user, ids, context=context):
+            if invoice.party.lang:
+                res[invoice.id] = invoice.party.lang.code
+            else:
+                res[invoice.id] = 'en_US'
+        return res
+
+    def get_type_name(self, cursor, user, ids, name, arg, context=None):
+        res = {}
+        type2name = {}
+        for type, name in self.fields_get(cursor, user, fields_names=['type'],
+                context=context)['type']['selection']:
+            type2name[type] = name
+        for invoice in self.browse(cursor, user, ids, context=context):
+            res[invoice.id] = type2name[invoice.type]
+        return res
+
+    def on_change_lines(self, cursor, user, ids, vals, context=None):
+        return self._on_change_lines_taxes(cursor, user, ids, vals, context=context)
+
+    def on_change_taxes(self, cursor, user, ids, vals, context=None):
+        return self._on_change_lines_taxes(cursor, user, ids, vals, context=context)
+
+    def _on_change_lines_taxes(self, cursor, user, ids, vals, context=None):
+        currency_obj = self.pool.get('currency.currency')
+        tax_obj = self.pool.get('account.tax')
+        if context is None:
+            context = {}
+        res = {
+            'untaxed_amount': Decimal('0.0'),
+            'tax_amount': Decimal('0.0'),
+            'total_amount': Decimal('0.0'),
+            'taxes': {},
+        }
+        currency = None
+        if vals.get('currency'):
+            currency = currency_obj.browse(cursor, user, vals['currency'],
+                    context=context)
+        computed_taxes = {}
+        if vals.get('lines'):
+            ctx = context.copy()
+            ctx.update(self.get_tax_context(cursor, user, vals,
+                context=context))
+            for line in vals['lines']:
+                if line.get('type', 'line') != 'line':
+                    continue
+                res['untaxed_amount'] += line.get('amount', Decimal('0.0'))
+
+                for tax in tax_obj.compute(cursor, user, line.get('taxes', []),
+                        line.get('unit_price', Decimal('0.0')),
+                        line.get('quantity', 0.0), context=context):
+                    key, val = self._compute_tax(cursor, user, tax,
+                            vals.get('type', 'out_invoice'), context=context)
+                    if not key in computed_taxes:
+                        computed_taxes[key] = val
+                    else:
+                        computed_taxes[key]['base'] += val['base']
+                        computed_taxes[key]['amount'] += val['amount']
+        if currency:
+            for key in computed_taxes:
+                for field in ('base', 'amount'):
+                    computed_taxes[key][field] = currency_obj.round(cursor,
+                            user, currency, computed_taxes[key][field])
+        tax_keys = []
+        for tax in vals.get('taxes', []):
+            if tax.get('manual', False):
+                res['tax_amount'] += tax.get('amount', Decimal('0.0'))
+                continue
+            key = (tax.get('base_code'), tax.get('base_sign'),
+                    tax.get('tax_code'), tax.get('tax_sign'),
+                    tax.get('account'), tax.get('tax'))
+            if (key not in computed_taxes) or (key in tax_keys):
+                res['taxes'].setdefault('remove', [])
+                res['taxes']['remove'].append(tax.get('id'))
+                continue
+            tax_keys.append(key)
+            if currency:
+                if not currency_obj.is_zero(cursor, user, currency,
+                        computed_taxes[key]['base'] - \
+                                tax.get('base', Decimal('0.0'))):
+                    res['tax_amount'] += computed_taxes[key]['amount']
+                    res['taxes'].setdefault('update', [])
+                    res['taxes']['update'].append({
+                        'id': tax.get('id'),
+                        'amount': computed_taxes[key]['amount'],
+                        'base': computed_taxes[key]['base'],
+                        })
+                else:
+                    res['tax_amount'] += tax.get('amount', Decimal('0.0'))
+            else:
+                if computed_taxes[key]['base'] - \
+                        tax.get('base', Decimal('0.0')) != Decimal('0.0'):
+                    res['tax_amount'] += computed_taxes[key]['amount']
+                    res['taxes'].setdefault('update', [])
+                    res['taxes']['update'].append({
+                        'id': tax.get('id'),
+                        'amount': computed_taxes[key]['amount'],
+                        'base': computed_taxes[key]['base'],
+                        })
+                else:
+                    res['tax_amount'] += tax.get('amount', Decimal('0.0'))
+        for key in computed_taxes:
+            if key not in tax_keys:
+                res['tax_amount'] += computed_taxes[key]['amount']
+                res['taxes'].setdefault('add', [])
+                res['taxes']['add'].append(computed_taxes[key])
+        if currency:
+            res['untaxed_amount'] = currency_obj.round(cursor, user, currency,
+                    res['untaxed_amount'])
+            res['tax_amount'] = currency_obj.round(cursor, user, currency,
+                    res['tax_amount'])
+        res['total_amount'] = res['untaxed_amount'] + res['tax_amount']
+        if currency:
+            res['total_amount'] = currency_obj.round(cursor, user, currency,
+                    res['total_amount'])
+        return res
+
+    def get_untaxed_amount(self, cursor, user, ids, name, arg, context=None):
+        currency_obj = self.pool.get('currency.currency')
+        res = {}
+        for invoice in self.browse(cursor, user, ids, context=context):
+            res.setdefault(invoice.id, Decimal('0.0'))
+            for line in invoice.lines:
+                if line.type != 'line':
+                    continue
+                res[invoice.id] += line.amount
+            res[invoice.id] = currency_obj.round(cursor, user, invoice.currency,
+                    res[invoice.id])
+        return res
+
+    def get_tax_amount(self, cursor, user, ids, name, arg, context=None):
+        currency_obj = self.pool.get('currency.currency')
+        res = {}
+        cursor.execute('SELECT invoice, ' \
+                    'COALESCE(SUM(amount), 0)::DECIMAL ' \
+                'FROM account_invoice_tax ' \
+                'WHERE invoice IN (' + ','.join(['%s' for x in ids]) + ') ' \
+                'GROUP BY invoice', ids)
+        for invoice_id, sum in cursor.fetchall():
+            res[invoice_id] = sum
+
+        for invoice in self.browse(cursor, user, ids, context=context):
+            res.setdefault(invoice.id, Decimal('0.0'))
+            res[invoice.id] = currency_obj.round(cursor, user, invoice.currency,
+                    res[invoice.id])
+        return res
+
+    def get_total_amount(self, cursor, user, ids, name, arg, context=None):
+        currency_obj = self.pool.get('currency.currency')
+        res = {}
+        for invoice in self.browse(cursor, user, ids, context=context):
+            res[invoice.id] = currency_obj.round(cursor, user, invoice.currency,
+                    invoice.untaxed_amount + invoice.tax_amount)
+        return res
+
+    def get_reconciled(self, cursor, user, ids, name, arg, context=None):
+        res = {}
+        for invoice in self.browse(cursor, user, ids, context=context):
+            res[invoice.id] = True
+            if not invoice.lines_to_pay:
+                res[invoice.id] = False
+                continue
+            for line in invoice.lines_to_pay:
+                if not line.reconciliation:
+                    res[invoice.id] = False
+                    break
+        return res
+
+    def get_lines_to_pay(self, cursor, user, ids, name, args, context=None):
+        res = {}
+        for invoice in self.browse(cursor, user, ids, context=context):
+            lines = []
+            if invoice.move:
+                for line in invoice.move.lines:
+                    if line.account.id == invoice.account.id \
+                            and line.maturity_date:
+                        lines.append(line)
+            lines.sort(lambda x, y: cmp(x.maturity_date, y.maturity_date))
+            res[invoice.id] = [x.id for x in lines]
+        return res
+
+    def get_amount_to_pay(self, cursor, user, ids, name, arg,
+            context=None):
+        currency_obj = self.pool.get('currency.currency')
+        date_obj = self.pool.get('ir.date')
+
+        res = {}
+        for invoice in self.browse(cursor, user, ids, context=context):
+            amount = Decimal('0.0')
+            amount_currency = Decimal('0.0')
+            for line in invoice.lines_to_pay:
+                if line.reconciliation:
+                    continue
+                if name == 'amount_to_pay_today' \
+                        and line.maturity_date > date_obj.today(cursor, user,
+                                context=context):
+                    continue
+                if line.second_currency.id == invoice.currency.id:
+                    if line.debit - line.credit > Decimal('0.0'):
+                        amount_currency += line.amount_second_currency
+                    else:
+                        amount_currency -= line.amount_second_currency
+                else:
+                    amount += line.debit - line.credit
+            for line in invoice.payment_lines:
+                if line.reconciliation:
+                    continue
+                if line.second_currency.id == invoice.currency.id:
+                    if line.debit - line.credit > Decimal('0.0'):
+                        amount_currency += line.amount_second_currency
+                    else:
+                        amount_currency -= line.amount_second_currency
+                else:
+                    amount += line.debit - line.credit
+            if invoice.type in ('in_invoice', 'out_credit_note'):
+                amount = - amount
+                amount_currency = - amount_currency
+            if amount != Decimal('0.0'):
+                amount_currency += currency_obj.compute(cursor, user,
+                        invoice.company.currency, amount, invoice.currency,
+                        context=context)
+            if amount_currency < Decimal('0.0'):
+                amount_currency = Decimal('0.0')
+            res[invoice.id] = amount_currency
+        return res
+
+    def search_total_amount(self, cursor, user, name, args, context=None):
+        rule_obj = self.pool.get('ir.rule')
+        line_obj = self.pool.get('account.invoice.line')
+        tax_obj = self.pool.get('account.invoice.tax')
+
+        if not len(args):
+            return []
+
+        if context is None:
+            context = {}
+
+        invoice_query, invoice_val = rule_obj.domain_get(
+            cursor, user, 'account.invoice', context=context)
+
+        cursor.execute(
+            'SELECT invoice '\
+            'FROM ( '\
+               'SELECT invoice, COALESCE(SUM(quantity * unit_price), 0) as total_amount '\
+               'FROM "' + line_obj._table + '" '\
+                 'JOIN "' + self._table + '" on '\
+                     '("' + self._table + '".id = "' + line_obj._table + '".invoice) '\
+               'WHERE ' + invoice_query + ' '\
+               'GROUP BY invoice  '\
+             'UNION '\
+               'SELECT invoice, COALESCE(SUM(amount), 0) as total_amount '\
+               'FROM "' + tax_obj._table + '" '\
+                 'JOIN "' + self._table + '" on '\
+                     '("' + self._table + '".id = "' + tax_obj._table + '".invoice) '\
+               'WHERE ' + invoice_query + ' '\
+               'GROUP BY invoice  '\
+              ') as u '\
+             'GROUP BY u.invoice '\
+             'HAVING ' + \
+                'AND '.join(('(SUM(u.total_amount) ' + arg[1] + ' %s) ' \
+                                for arg in args)),
+            invoice_val + invoice_val + [arg[2] for arg in args])
+
+        if not cursor.rowcount:
+            return [('id', '=', 0)]
+        return [('id', 'in', [x[0] for x in cursor.fetchall()])]
+
+    def search_untaxed_amount(self, cursor, user, name, args, context=None):
+        rule_obj = self.pool.get('ir.rule')
+        line_obj = self.pool.get('account.invoice.line')
+        tax_obj = self.pool.get('account.invoice.tax')
+
+        if not len(args):
+            return []
+
+        if context is None:
+            context = {}
+
+        invoice_query, invoice_val = rule_obj.domain_get(
+            cursor, user, 'account.invoice', context=context)
+
+        cursor.execute(
+            'SELECT invoice '\
+            'FROM "' + line_obj._table + '" '\
+               'JOIN "' + self._table + '" on '\
+                   '("' + self._table + '".id = "' + line_obj._table + '".invoice) '\
+            'WHERE ' + invoice_query + ' '\
+            'GROUP BY invoice  '\
+            'HAVING ' + \
+              'AND '.join(('(COALESCE(SUM(quantity * unit_price), 0) ' + \
+                                arg[1] + ' %s) ' for arg in args)),
+            invoice_val + [arg[2] for arg in args])
+
+        if not cursor.rowcount:
+            return [('id', '=', 0)]
+        return [('id', 'in', [x[0] for x in cursor.fetchall()])]
+
+    def search_tax_amount(self, cursor, user, name, args, context=None):
+        rule_obj = self.pool.get('ir.rule')
+        line_obj = self.pool.get('account.invoice.line')
+        tax_obj = self.pool.get('account.invoice.tax')
+
+        if not len(args):
+            return []
+
+        if context is None:
+            context = {}
+
+        invoice_query, invoice_val = rule_obj.domain_get(
+            cursor, user, 'account.invoice', context=context)
 
-    def fields_get(self, cursor, user, fields_names=None, context=None):
-        analytic_account_obj = self.pool.get('analytic_account.account')
+        cursor.execute(
+            'SELECT invoice '\
+            'FROM "' + tax_obj._table + '" '\
+             'JOIN "' + self._table + '" on '\
+                   '("' + self._table + '".id = "' + tax_obj._table + '".invoice) '\
+            'WHERE ' + invoice_query + ' '\
+            'GROUP BY invoice  '\
+            'HAVING ' + \
+              'AND '.join(('(COALESCE(SUM(amount), 0) ' + arg[1] + ' %s) ' \
+                                for arg in args)),
+            invoice_val + [arg[2] for arg in args])
 
-        res = super(InvoiceLine, self).fields_get(cursor, user, fields_names,
+        if not cursor.rowcount:
+            return [('id', '=', 0)]
+        return [('id', 'in', [x[0] for x in cursor.fetchall()])]
+
+    def button_draft(self, cursor, user, ids, context=None):
+        invoices = self.browse(cursor, user, ids, context=context)
+        for invoice in invoices:
+            if invoice.move:
+                self.raise_user_error(cursor, 'reset_draft',
+                        context=context)
+        self.workflow_trigger_create(cursor, user,
+                [x.id for x in invoices], context=context)
+        self.write(cursor, user, ids, {'state': 'draft'})
+        return True
+
+    def get_tax_context(self, cursor, user, invoice, context=None):
+        party_obj = self.pool.get('party.party')
+        res = {}
+        if isinstance(invoice, dict):
+            if invoice.get('party'):
+                party = party_obj.browse(cursor, user, invoice['party'],
+                        context=context)
+                if party.lang:
+                    res['language'] = party.lang.code
+        else:
+            if invoice.party.lang:
+                res['language'] = invoice.party.lang.code
+        return res
+
+    def _compute_tax(self, cursor, user, tax, invoice_type, context=None):
+        val = {}
+        val['manual'] = False
+        val['description'] = tax['tax'].description
+        val['base'] = tax['base']
+        val['amount'] = tax['amount']
+        val['tax'] = tax['tax'].id
+
+        if invoice_type in ('out_invoice', 'in_invoice'):
+            val['base_code'] = tax['tax'].invoice_base_code.id
+            val['base_sign'] = tax['tax'].invoice_base_sign
+            val['tax_code'] = tax['tax'].invoice_tax_code.id
+            val['tax_sign'] = tax['tax'].invoice_tax_sign
+            val['account'] = tax['tax'].invoice_account.id
+        else:
+            val['base_code'] = tax['tax'].credit_note_base_code.id
+            val['base_sign'] = tax['tax'].credit_note_base_sign
+            val['tax_code'] = tax['tax'].credit_note_tax_code.id
+            val['tax_sign'] = tax['tax'].credit_note_tax_sign
+            val['account'] = tax['tax'].credit_note_account.id
+        key = (val['base_code'], val['base_sign'],
+                val['tax_code'], val['tax_sign'],
+                val['account'], val['tax'])
+        return key, val
+
+    def _compute_taxes(self, cursor, user, invoice, context=None):
+        tax_obj = self.pool.get('account.tax')
+        currency_obj = self.pool.get('currency.currency')
+        if context is None:
+            context = {}
+
+        ctx = context.copy()
+        ctx.update(self.get_tax_context(cursor, user, invoice,
+            context=context))
+
+        res = {}
+        for line in invoice.lines:
+            # Don't round on each line to handle rounding error
+            if line.type != 'line':
+                continue
+            tax_ids = [x.id for x in line.taxes]
+            for tax in tax_obj.compute(cursor, user, tax_ids, line.unit_price,
+                    line.quantity, context=ctx):
+                key, val = self._compute_tax(cursor, user, tax, invoice.type,
+                        context=context)
+                val['invoice'] = invoice.id
+                if not key in res:
+                    res[key] = val
+                else:
+                    res[key]['base'] += val['base']
+                    res[key]['amount'] += val['amount']
+        for key in res:
+            for field in ('base', 'amount'):
+                res[key][field] = currency_obj.round(cursor,
+                        user, invoice.currency, res[key][field])
+        return res
+
+    def update_taxes(self, cursor, user, ids, context=None, exception=False):
+        tax_obj = self.pool.get('account.invoice.tax')
+        currency_obj = self.pool.get('currency.currency')
+        for invoice in self.browse(cursor, user, ids, context=context):
+            if invoice.state in ('open', 'paid', 'cancel'):
+                continue
+            computed_taxes = self._compute_taxes(cursor, user, invoice,
+                    context=context)
+            if not invoice.taxes:
+                for tax in computed_taxes.values():
+                    tax_obj.create(cursor, user, tax, context=context)
+            else:
+                tax_keys = []
+                for tax in invoice.taxes:
+                    if tax.manual:
+                        continue
+                    key = (tax.base_code.id, tax.base_sign,
+                            tax.tax_code.id, tax.tax_sign,
+                            tax.account.id, tax.tax.id)
+                    if (not key in computed_taxes) or (key in tax_keys):
+                        if exception:
+                            self.raise_user_error(cursor, 'missing_tax_line',
+                                    context=context)
+                        tax_obj.delete(cursor, user, tax.id,
+                                context=context)
+                        continue
+                    tax_keys.append(key)
+                    if not currency_obj.is_zero(cursor, user,
+                            invoice.currency,
+                            computed_taxes[key]['base'] - tax.base):
+                        if exception:
+                            self.raise_user_error(cursor, 'diff_tax_line',
+                                    context=context)
+                        tax_obj.write(cursor, user, tax.id,
+                                computed_taxes[key], context=context)
+                for key in computed_taxes:
+                    if not key in tax_keys:
+                        if exception:
+                            self.raise_user_error(cursor, 'missing_tax_line',
+                                    context=context)
+                        tax_obj.create(cursor, user, computed_taxes[key],
+                                context=context)
+        return True
+
+    def _get_move_line_invoice_line(self, cursor, user, invoice, context=None):
+        '''
+        Return list of move line values for each invoice lines
+        '''
+        line_obj = self.pool.get('account.invoice.line')
+        res = []
+        for line in invoice.lines:
+            val = line_obj.get_move_line(cursor, user, line,
+                    context=context)
+            if val:
+                res.append(val)
+        return res
+
+    def _get_move_line_invoice_tax(self, cursor, user, invoice, context=None):
+        '''
+        Return list of move line values for each invoice taxes
+        '''
+        tax_obj = self.pool.get('account.invoice.tax')
+        res = []
+        for tax in invoice.taxes:
+            val = tax_obj.get_move_line(cursor, user, tax,
+                    context=context)
+            res.append(val)
+        return res
+
+    def _get_move_line(self, cursor, user, invoice, date, amount, context=None):
+        '''
+        Return move line
+        '''
+        currency_obj = self.pool.get('currency.currency')
+        res = {}
+        if invoice.currency.id != invoice.company.currency.id:
+            res['amount_second_currency'] = currency_obj.compute(cursor, user,
+                    invoice.company.currency, amount,
+                    invoice.currency, context=context)
+            res['amount_second_currency'] = abs(res['amount_second_currency'])
+            res['second_currency'] = invoice.currency.id
+        else:
+            res['amount_second_currency'] = Decimal('0.0')
+            res['second_currency'] = False
+        if amount >= Decimal('0.0'):
+            res['debit'] = Decimal('0.0')
+            res['credit'] = amount
+        else:
+            res['debit'] = - amount
+            res['credit'] = Decimal('0.0')
+        res['account'] = invoice.account.id
+        res['maturity_date'] = date
+        res['reference'] = invoice.reference
+        res['name'] = invoice.number
+        res['party'] = invoice.party.id
+        return res
+
+    def create_move(self, cursor, user, invoice_id, context=None):
+        tax_obj = self.pool.get('account.invoice.tax')
+        payment_term_obj = self.pool.get('account.invoice.payment_term')
+        currency_obj = self.pool.get('currency.currency')
+        move_obj = self.pool.get('account.move')
+        period_obj = self.pool.get('account.period')
+
+        invoice = self.browse(cursor, user, invoice_id, context=context)
+        if invoice.move:
+            return True
+        self.update_taxes(cursor, user, [invoice.id], context=context,
+                exception=True)
+        move_lines = self._get_move_line_invoice_line(cursor, user, invoice,
+                context=context)
+        move_lines += self._get_move_line_invoice_tax(cursor, user, invoice,
                 context=context)
 
-        analytic_accounts_field = super(InvoiceLine, self).fields_get(cursor,
-                user, ['analytic_accounts'],
-                context=context)['analytic_accounts']
+        total = Decimal('0.0')
+        total_currency = Decimal('0.0')
+        for line in move_lines:
+            total += line['debit'] - line['credit']
+            total_currency += line['amount_second_currency']
+
+        term_lines = payment_term_obj.compute(cursor, user, total,
+                invoice.company.currency, invoice.payment_term,
+                invoice.invoice_date, context=context)
+        remainder_total_currency = total_currency
+        for date, amount in term_lines:
+            val = self._get_move_line(cursor, user, invoice, date, amount,
+                    context=None)
+            remainder_total_currency -= val['amount_second_currency']
+            move_lines.append(val)
+        if not currency_obj.is_zero(cursor, user, invoice.currency,
+                remainder_total_currency):
+            move_lines[-1]['amount_second_currency'] += remainder_total_currency
 
-        res.update(analytic_account_obj.analytic_accounts_fields_get(cursor,
-            user, analytic_accounts_field, fields_names, context=context))
+        accounting_date = invoice.accounting_date or invoice.invoice_date
+        period_id = period_obj.find(cursor, user, invoice.company.id,
+                date=accounting_date, context=context)
+
+        move_id = move_obj.create(cursor, user, {
+            'journal': invoice.journal.id,
+            'period': period_id,
+            'date': accounting_date,
+            'lines': [('create', x) for x in move_lines],
+            }, context=context)
+        self.write(cursor, user, invoice.id, {
+            'move': move_id,
+            }, context=context)
+        move_obj.post(cursor, user, move_id, context=context)
+        return move_id
+
+    def set_number(self, cursor, user, invoice_id, context=None):
+        period_obj = self.pool.get('account.period')
+        sequence_obj = self.pool.get('ir.sequence.strict')
+
+        if context is None:
+            context = {}
+
+        invoice = self.browse(cursor, user, invoice_id, context=context)
+
+        if invoice.number:
+            return True
+
+        test_state = True
+        if invoice.type in ('in_invoice', 'in_credit_note'):
+            test_state = False
+
+        period_id = period_obj.find(cursor, user, invoice.company.id,
+                date=invoice.invoice_date, test_state=test_state,
+                context=context)
+        period = period_obj.browse(cursor, user, period_id, context=context)
+        sequence_id = period[invoice.type + '_sequence'].id
+        if not sequence_id:
+            self.raise_user_error(cursor, 'no_invoice_sequence',
+                    context=context)
+        ctx = context.copy()
+        ctx['date'] = invoice.invoice_date
+        number = sequence_obj.get_id(cursor, user, sequence_id, context=ctx)
+        self.write(cursor, user, invoice_id, {
+            'number': number,
+            }, context=context)
+        return True
+
+    def check_modify(self, cursor, user, ids, context=None):
+        '''
+        Check if the invoices can be modified
+        '''
+        for invoice in self.browse(cursor, user, ids, context=context):
+            if invoice.state in ('open', 'paid'):
+                self.raise_user_error(cursor, 'modify_invoice',
+                        context=context)
+        return
+
+    def get_rec_name(self, cursor, user, ids, name, arg, context=None):
+        if not ids:
+            return {}
+        res = {}
+        for invoice in self.browse(cursor, user, ids, context=context):
+            res[invoice.id] = invoice.number or unicode(invoice.id) + \
+                    (invoice.reference and (' ' + invoice.reference) or '') + \
+                    ' ' + invoice.party.rec_name
         return res
 
-    def read(self, cursor, user, ids, fields_names=None, context=None):
-        selection_obj = self.pool.get('analytic_account.account.selection')
+    def search_rec_name(self, cursor, user, name, args, context=None):
+        args2 = []
+        i = 0
+        while i < len(args):
+            ids = self.search(cursor, user, ['OR',
+                ('number', args[i][1], args[i][2]),
+                ('reference', args[i][1], args[i][2]),
+                ], limit=1, context=context)
+            if ids:
+                args2.append(('number', args[i][1], args[i][2]))
+            else:
+                args2.append(('party', args[i][1], args[i][2]))
+            i += 1
+        return args2
+
+    def delete(self, cursor, user, ids, context=None):
+        if not ids:
+            return True
+        if isinstance(ids, (int, long)):
+            ids = [ids]
+        self.check_modify(cursor, user, ids, context=context)
+        return super(Invoice, self).delete(cursor, user, ids,
+                context=context)
+
+    def write(self, cursor, user, ids, vals, context=None):
+        if isinstance(ids, (int, long)):
+            ids = [ids]
+        keys = vals.keys()
+        for key in ('state', 'payment_lines',
+                'invoice_report', 'invoice_report_format'):
+            if key in keys:
+                keys.remove(key)
+        if len(keys):
+            self.check_modify(cursor, user, ids, context=context)
+        update_tax_ids = [x.id for x in self.browse(cursor, user, ids,
+            context=context) if x.state == 'draft']
+        res = super(Invoice, self).write(cursor, user, ids, vals,
+                context=context)
+        if update_tax_ids:
+            self.update_taxes(cursor, user, update_tax_ids, context=context)
+        if 'state' in vals and vals['state'] in ('paid', 'cancel'):
+            self.workflow_trigger_trigger(cursor, user, ids, context=context)
+        return res
+
+    def copy(self, cursor, user, ids, default=None, context=None):
+        line_obj = self.pool.get('account.invoice.line')
+        tax_obj = self.pool.get('account.invoice.tax')
+        date_obj = self.pool.get('ir.date')
 
         int_id = False
         if isinstance(ids, (int, long)):
             int_id = True
             ids = [ids]
 
-        if fields_names:
-            fields_names2 = [x for x in fields_names
-                    if not x.startswith('analytic_account_')]
-        else:
-            fields_names2 = fields_names
-
-        res = super(InvoiceLine, self).read(cursor, user, ids,
-                fields_names=fields_names2, context=context)
-
-        if not fields_names:
-            fields_names = list(set(self._columns.keys() \
-                    + self._inherit_fields.keys()))
-
-        root_ids = []
-        for field in fields_names:
-            if field.startswith('analytic_account_') and '.' not in field:
-                root_ids.append(int(field[len('analytic_account_'):]))
-        if root_ids:
-            id2record = {}
-            for record in res:
-                id2record[record['id']] = record
-            lines = self.browse(cursor, user, ids, context=context)
-            for line in lines:
-                if line.type != 'line':
-                    continue
-                if not line.analytic_accounts:
-                    continue
-                for account in line.analytic_accounts.accounts:
-                    if account.root.id in root_ids:
-                        id2record[line.id]['analytic_account_' \
-                                + str(account.root.id)] = account.id
-                        for field in fields_names:
-                            if field.startswith('analytic_account_' + \
-                                    str(account.root.id) + '.'):
-                                ham, field2 = field.split('.', 1)
-                                id2record[line.id][field] = account[field2]
+        if default is None:
+            default = {}
+        default = default.copy()
+        default['state'] = 'draft'
+        default['number'] = False
+        default['move'] = False
+        default['invoice_report'] = False
+        default['invoice_report_format'] = False
+        default['payment_lines'] = False
+        default['lines'] = False
+        default['taxes'] = False
+        default['invoice_date'] = date_obj.today(cursor, user, context=context)
+        default['accounting_date'] = False
+        default['lines_to_pay'] = False
+
+        new_ids = []
+        for invoice in self.browse(cursor, user, ids, context=context):
+            new_id = super(Invoice, self).copy(cursor, user, invoice.id,
+                    default=default, context=context)
+            line_obj.copy(cursor, user, [x.id for x in invoice.lines], default={
+                'invoice': new_id,
+                }, context=context)
+            tax_obj.copy(cursor, user, [x.id for x in invoice.taxes], default={
+                'invoice': new_id,
+                }, context=context)
+            new_ids.append(new_id)
+
         if int_id:
-            return res[0]
+            return new_ids[0]
+        return new_ids
+
+    def check_account(self, cursor, user, ids):
+        for invoice in self.browse(cursor, user, ids):
+            if invoice.account.company.id != invoice.company.id:
+                return False
+        return True
+
+    def check_account2(self, cursor, user, ids):
+        for invoice in self.browse(cursor, user, ids):
+            for line in invoice.lines:
+                if line.type == 'line' \
+                        and line.account.id == invoice.account.id:
+                    return False
+        return True
+
+    def get_reconcile_lines_for_amount(self, cursor, user, invoice, amount,
+            exclude_ids=None, context=None):
+        '''
+        Return list of line ids and the remainder to make reconciliation.
+        '''
+        currency_obj = self.pool.get('currency.currency')
+
+        if exclude_ids is None:
+            exclude_ids = []
+        payment_amount = Decimal('0.0')
+        remainder = invoice.total_amount
+        lines = []
+        payment_lines = []
+
+        for line in invoice.payment_lines:
+            if line.reconciliation:
+                continue
+            payment_amount += line.debit - line.credit
+            payment_lines.append(line.id)
+
+        if invoice.type in ('out_invoice', 'in_credit_note'):
+            amount = - abs(amount)
+        else:
+            amount = abs(amount)
+
+        for line in invoice.lines_to_pay:
+
+            if line.reconciliation:
+                continue
+            if line.id in exclude_ids:
+                continue
+
+            test_amount = amount + (line.debit - line.credit)
+            if currency_obj.is_zero(cursor, user, invoice.currency,
+                    test_amount):
+                return ([line.id], Decimal('0.0'))
+            if abs(test_amount) < abs(remainder):
+                lines = [line.id]
+                remainder = test_amount
+
+            test_amount = (amount + payment_amount) + (line.debit - line.credit)
+            if currency_obj.is_zero(cursor, user, invoice.currency,
+                    test_amount):
+                return ([line.id] + payment_lines, Decimal('0.0'))
+            if abs(test_amount) < abs(remainder):
+                lines = [line.id] + payment_lines
+                remainder = test_amount
+
+            exclude_ids2 = exclude_ids[:]
+            exclude_ids2.append(line.id)
+            res = self.get_reconcile_lines_for_amount(cursor, user, invoice,
+                    (amount + (line.debit - line.credit)),
+                    exclude_ids=exclude_ids2, context=context)
+            if res[1] == Decimal('0.0'):
+                res[0].append(line.id)
+                return res
+            if abs(res[1]) < abs(remainder):
+                res[0].append(line.id)
+                lines = res[0]
+                remainder = res[1]
+
+        return (lines, remainder)
+
+    def pay_invoice(self, cursor, user, invoice_id, amount, journal_id, date,
+            description, amount_second_currency=False, second_currency=False,
+            context=None):
+        '''
+        Add a payment to an invoice
+
+        :param cursor: the database cursor
+        :param invoice_id: the invoice id
+        :param amount: the amount to pay
+        :param journal_id: the journal id for the move
+        :param date: the date of the move
+        :param description: the description of the move
+        :param amount_second_currency: the amount in the second currenry if one
+        :param second_currency: the id of the second currency
+        :param context: the context
+        :return: the id of the payment line
+        '''
+        journal_obj = self.pool.get('account.journal')
+        move_obj = self.pool.get('account.move')
+        period_obj = self.pool.get('account.period')
+
+        lines = []
+        invoice = self.browse(cursor, user, invoice_id, context=context)
+        journal = journal_obj.browse(cursor, user, journal_id, context=context)
+
+        if invoice.type in ('out_invoice', 'in_credit_note'):
+            lines.append({
+                'name': description,
+                'account': invoice.account.id,
+                'party': invoice.party.id,
+                'debit': Decimal('0.0'),
+                'credit': amount,
+                'amount_second_currency': amount_second_currency,
+                'second_currency': second_currency,
+            })
+            lines.append({
+                'name': description,
+                'account': journal.debit_account.id,
+                'party': invoice.party.id,
+                'debit': amount,
+                'credit': Decimal('0.0'),
+                'amount_second_currency': amount_second_currency,
+                'second_currency': second_currency,
+            })
+            if invoice.account.id == journal.debit_account.id:
+                self.raise_user_error(cursor, 'same_debit_account',
+                        context=context)
+            if not journal.debit_account:
+                self.raise_user_error(cursor, 'missing_debit_account',
+                        context=context)
+        else:
+            lines.append({
+                'name': description,
+                'account': invoice.account.id,
+                'party': invoice.party.id,
+                'debit': amount,
+                'credit': Decimal('0.0'),
+                'amount_second_currency': amount_second_currency,
+                'second_currency': second_currency,
+            })
+            lines.append({
+                'name': description,
+                'account': journal.credit_account.id,
+                'party': invoice.party.id,
+                'debit': Decimal('0.0'),
+                'credit': amount,
+                'amount_second_currency': amount_second_currency,
+                'second_currency': second_currency,
+            })
+            if invoice.account.id == journal.debit_account.id:
+                self.raise_user_error(cursor, 'same_credit_account',
+                        context=context)
+            if not journal.credit_account:
+                self.raise_user_error(cursor, 'missing_credit_account',
+                        context=context)
+
+        period_id = period_obj.find(cursor, user, invoice.company.id,
+                date=date, context=context)
+
+        move_id = move_obj.create(cursor, user, {
+            'journal': journal.id,
+            'period': period_id,
+            'date': date,
+            'lines': [('create', x) for x in lines],
+            }, context=context)
+
+        move = move_obj.browse(cursor, user, move_id, context=context)
+
+        for line in move.lines:
+            if line.account.id == invoice.account.id:
+                self.write(cursor, user, invoice.id, {
+                    'payment_lines': [('add', line.id)],
+                    }, context=context)
+                return line.id
+        raise Exception('Missing account')
+
+    def print_invoice(self, cursor, user, invoice_id, context=None):
+        '''
+        Generate invoice report and store it in invoice_report field.
+        '''
+        invoice_report = self.pool.get('account.invoice', type='report')
+        val = invoice_report.execute(cursor, user, [invoice_id],
+                {'id': invoice_id}, context=context)
+        self.write(cursor, user, invoice_id, {
+            'invoice_report_format': val[0],
+            'invoice_report': val[1],
+            }, context=context)
+        return
+
+    def _credit(self, cursor, user, invoice, context=None):
+        '''
+        Return values to credit invoice.
+        '''
+        invoice_line_obj = self.pool.get('account.invoice.line')
+        invoice_tax_obj = self.pool.get('account.invoice.tax')
+
+        res = {}
+        if invoice.type == 'out_invoice':
+            res['type'] = 'out_credit_note'
+        elif invoice.type == 'in_invoice':
+            res['type'] = 'in_credit_note'
+        elif invoice.type == 'out_credit_note':
+            res['type'] = 'out_invoice'
+        elif invoice.type == 'in_credit_note':
+            res['type'] = 'in_invoice'
+
+        for field in ('description', 'comment'):
+            res[field] = invoice[field]
+
+        res['reference'] = invoice.number or invoice.reference
+
+        for field in ('company', 'party', 'invoice_address', 'currency',
+                'journal', 'account', 'payment_term'):
+            res[field] = invoice[field].id
+
+        res['lines'] = []
+        for line in invoice.lines:
+            value = invoice_line_obj._credit(cursor, user, line,
+                    context=context)
+            res['lines'].append(('create', value))
+
+        res['taxes'] = []
+        for tax in invoice.taxes:
+            if not tax.manual:
+                continue
+            value = invoice_tax_obj._credit(cursor, user, tax,
+                    context=context)
+            res[taxes].append(('create', value))
         return res
 
-    def create(self, cursor, user, vals, context=None):
-        selection_obj = self.pool.get('analytic_account.account.selection')
+    def credit(self, cursor, user, ids, refund=False, context=None):
+        '''
+        Credit invoices and return ids of new invoices.
+
+        :param cursor: the database cursor
+        :param user: the user id
+        :param ids: a list of invoice id
+        :param refund: a boolean to specify the refund
+        :param context: the context
+        :return: the list of new invoice id
+        '''
+        move_line_obj = self.pool.get('account.move.line')
+
+        new_ids = []
+        for invoice in self.browse(cursor, user, ids, context=context):
+            vals = self._credit(cursor, user, invoice, context=context)
+            new_id = self.create(cursor, user, vals, context=context)
+            new_ids.append(new_id)
+            if refund:
+                self.workflow_trigger_validate(cursor, user, new_id, 'open',
+                        context=context)
+                new_invoice = self.browse(cursor, user, new_id, context=context)
+                if new_invoice.state == 'open':
+                    line_ids = [x.id for x in invoice.lines_to_pay
+                            if not x.reconciliation] + \
+                                    [x.id for x in new_invoice.lines_to_pay
+                                            if not x.reconciliation]
+                    move_line_obj.reconcile(cursor, user, line_ids,
+                            context=context)
+        return new_ids
+
+Invoice()
+
+
+class InvoicePaymentLine(ModelSQL):
+    'Invoice - Payment Line'
+    _name = 'account.invoice-account.move.line'
+    _description = __doc__
+    invoice = fields.Many2One('account.invoice', 'Invoice', ondelete='CASCADE',
+            select=1, required=True)
+    line = fields.Many2One('account.move.line', 'Payment Line',
+            ondelete='CASCADE', select=1, required=True)
+
+InvoicePaymentLine()
+
+
+class InvoiceLine(ModelSQL, ModelView):
+    'Invoice Line'
+    _name = 'account.invoice.line'
+    _rec_name = 'description'
+    _description = __doc__
+
+    invoice = fields.Many2One('account.invoice', 'Invoice', ondelete='CASCADE',
+            select=1, states={
+            'required': "not bool(globals().get('invoice_type')) " \
+                    "and bool(globals().get('party')) " \
+                    "and bool(globals().get('currency')) " \
+                    "and bool(globals().get('company'))",
+            'invisible': "context.get('standalone', False)",
+        })
+    invoice_type = fields.Selection(_TYPE, 'Invoice Type', select=1, states={
+        'readonly': "context.get('type', False) or bool(type)",
+        'required': "not bool(invoice)",
+        })
+    party = fields.Many2One('party.party', 'Party', select=1, states={
+        'required': "not bool(invoice)",
+        })
+    currency = fields.Many2One('currency.currency', 'Currency', states={
+        'required': "not bool(invoice)",
+        })
+    currency_digits = fields.Function('get_currency_digits', type='integer',
+            string='Currency Digits', on_change_with=['currency'])
+    company = fields.Many2One('company.company', 'Company', states={
+        'required': "not bool(invoice)",
+        }, domain="[('id', '=', context.get('company', 0))]")
+
+    sequence = fields.Integer('Sequence', states={
+            'invisible': "context.get('standalone', False)",
+        })
+    type = fields.Selection([
+        ('line', 'Line'),
+        ('subtotal', 'Subtotal'),
+        ('title', 'Title'),
+        ('comment', 'Comment'),
+        ], 'Type', select=1, required=True, states={
+            'invisible': "context.get('standalone', False)",
+        })
+    quantity = fields.Float('Quantity',
+            digits="(16, unit_digits)",
+            states={
+                'invisible': "type != 'line'",
+                'required': "type == 'line'",
+            })
+    unit = fields.Many2One('product.uom', 'Unit',
+            states={
+                'required': "product",
+                'invisible': "type != 'line'",
+            }, domain="[('category', '=', " \
+                    "(product, 'product.default_uom.category'))]",
+            context="{'category': (product, 'product.default_uom.category')}")
+    unit_digits = fields.Function('get_unit_digits', type='integer',
+            string='Unit Digits', on_change_with=['unit'])
+    product = fields.Many2One('product.product', 'Product',
+            states={
+                'invisible': "type != 'line'",
+            }, on_change=['product', 'unit', 'quantity', 'description',
+                '_parent_invoice.type', '_parent_invoice.party',
+                '_parent_invoice.currency', 'party', 'currency'])
+    account = fields.Many2One('account.account', 'Account',
+            domain="[('kind', '!=', 'view'), " \
+                    "('company', '=', " \
+                        "globals().get('_parent_invoice') and " \
+                        "globals().get('_parent_invoice').company or " \
+                        "globals()['company']), " \
+                    "('id', '!=', globals().get('_parent_invoice') and " \
+                        "globals().get('_parent_invoice').account or 0)]",
+            states={
+                'invisible': "type != 'line'",
+                'required': "type == 'line'",
+            })
+    unit_price = fields.Numeric('Unit Price', digits=(16, 4),
+            states={
+                'invisible': "type != 'line'",
+                'required': "type == 'line'",
+            })
+    amount = fields.Function('get_amount', type='numeric', string='Amount',
+            digits="(16, globals().get('_parent_invoice') and " \
+                        "globals().get('_parent_invoice').currency_digits or " \
+                        "globals()['currency_digits'])",
+            states={
+                'invisible': "type not in ('line', 'subtotal')",
+            }, on_change_with=['type', 'quantity', 'unit_price',
+                '_parent_invoice.currency', 'currency'])
+    description = fields.Text('Description', size=None, required=True)
+    note = fields.Text('Note')
+    taxes = fields.Many2Many('account.invoice.line-account.tax',
+            'line', 'tax', 'Taxes', domain=[('parent', '=', False)],
+            states={
+                'invisible': "type != 'line'",
+            })
+    invoice_taxes = fields.Function('get_invoice_taxes', type='many2many',
+            relation='account.invoice.tax', string='Invoice Taxes')
+
+    def __init__(self):
+        super(InvoiceLine, self).__init__()
+        self._sql_constraints += [
+            ('type_account',
+                'CHECK((type = \'line\' AND account IS NOT NULL) ' \
+                        'OR (type != \'line\'))',
+                'Line with "line" type must have an account!'),
+            ('type_invoice',
+                'CHECK((type != \'line\' AND invoice IS NOT NULL) ' \
+                        'OR (type = \'line\'))',
+                'Line without "line" type must have an invoice!'),
+        ]
+        self._constraints += [
+            ('check_account', 'account_different_company'),
+            ('check_account2', 'same_account_on_invoice'),
+        ]
+        self._order.insert(0, ('sequence', 'ASC'))
+        self._error_messages.update({
+            'modify': 'You can not modify line from an invoice ' \
+                    'that is open, paid or canceled!',
+            'create': 'You can not add a line to an invoice ' \
+                    'that is open, paid or canceled!',
+            'account_different_company': 'You can not create invoice line\n' \
+                    'with account with a different invoice company!',
+            'same_account_on_invoice': 'You can not use the same account\n' \
+                    'as on the invoice!',
+            })
+
+    def init(self, cursor, module_name):
+        super(InvoiceLine, self).init(cursor, module_name)
+        table = TableHandler(cursor, self, module_name)
+
+        # Migration from 1.0 invoice is no more required
+        table.not_null_action('invoice', action='remove')
+
+    def default_invoice_type(self, cursor, user, context=None):
+        if context is None:
+            context = {}
+        return context.get('invoice_type', 'out_invoice')
+
+    def default_currency(self, cursor, user, context=None):
+        company_obj = self.pool.get('company.company')
+        currency_obj = self.pool.get('currency.currency')
+        if context is None:
+            context = {}
+        if context.get('company'):
+            company = company_obj.browse(cursor, user, context['company'],
+                    context=context)
+            return company.currency.id
+        return False
+
+    def default_currency_digits(self, cursor, user, context=None):
+        company_obj = self.pool.get('company.company')
+        if context is None:
+            context = {}
+        if context.get('company'):
+            company = company_obj.browse(cursor, user, context['company'],
+                    context=context)
+            return company.currency.digits
+        return 2
+
+    def default_company(self, cursor, user, context=None):
+        company_obj = self.pool.get('company.company')
+        if context is None:
+            context = {}
+        if context.get('company'):
+            return context['company']
+        return False
+
+    def default_type(self, cursor, user, context=None):
+        return 'line'
+
+    def default_quantity(self, cursor, user, context=None):
+        return 0.0
+
+    def default_unit_price(self, cursor, user, context=None):
+        return Decimal('0.0')
+
+    def on_change_with_amount(self, cursor, user, ids, vals, context=None):
+        currency_obj = self.pool.get('currency.currency')
+        if vals.get('type') == 'line':
+            currency = vals.get('_parent_invoice.currency', vals.get('currency'))
+            if isinstance(currency, (int, long)):
+                currency = currency_obj.browse(cursor, user, currency,
+                        context=context)
+            amount = Decimal(str(vals.get('quantity') or '0.0')) * \
+                    (vals.get('unit_price') or Decimal('0.0'))
+            if currency:
+                return currency_obj.round(cursor, user, currency, amount)
+            return amount
+        return Decimal('0.0')
+
+    def on_change_with_unit_digits(self, cursor, user, ids, vals,
+            context=None):
+        uom_obj = self.pool.get('product.uom')
+        if vals.get('unit'):
+            uom = uom_obj.browse(cursor, user, vals['unit'],
+                    context=context)
+            return uom.digits
+        return 2
+
+    def get_unit_digits(self, cursor, user, ids, name, arg, context=None):
+        res = {}
+        for line in self.browse(cursor, user, ids, context=context):
+            if line.unit:
+                res[line.id] = line.unit.digits
+            else:
+                res[line.id] = 2
+        return res
+
+    def on_change_with_currency_digits(self, cursor, user, ids, vals,
+            context=None):
+        currency_obj = self.pool.get('currency.currency')
+        if vals.get('currency'):
+            currency = currency_obj.browse(cursor, user, vals['currency'],
+                    context=context)
+            return currency.digits
+        return 2
+
+    def get_currency_digits(self, cursor, user, ids, name, arg, context=None):
+        res = {}
+        for line in self.browse(cursor, user, ids, context=context):
+            res[line.id] = line.currency and line.currency.digits or 2
+        return res
+
+    def get_amount(self, cursor, user, ids, name, arg, context=None):
+        currency_obj = self.pool.get('currency.currency')
+        res = {}
+        for line in self.browse(cursor, user, ids, context=context):
+            if line.type == 'line':
+                currency = line.invoice and line.invoice.currency \
+                        or line.currency
+                res[line.id] = currency_obj.round(cursor, user, currency,
+                        Decimal(str(line.quantity)) * line.unit_price)
+            elif line.type == 'subtotal':
+                res[line.id] = Decimal('0.0')
+                for line2 in line.invoice.lines:
+                    if line2.type == 'line':
+                        res[line.id] += currency_obj.round(cursor, user,
+                                line2.invoice.currency,
+                                Decimal(str(line2.quantity)) * line2.unit_price)
+                    elif line2.type == 'subtotal':
+                        if line.id == line2.id:
+                            break
+                        res[line.id] = Decimal('0.0')
+            else:
+                res[line.id] = Decimal('0.0')
+        return res
+
+    def get_invoice_taxes(self, cursor, user, ids, name, arg, context=None):
+        tax_obj = self.pool.get('account.tax')
+        invoice_obj = self.pool.get('account.invoice')
+
+        if context is None:
+            context = {}
+
+        res = {}
+        for line in self.browse(cursor, user, ids, context=context):
+            ctx = context.copy()
+            ctx.update(invoice_obj.get_tax_context(cursor, user, line.invoice,
+                context=context))
+            tax_ids = [x.id for x in line.taxes]
+            taxes_keys = []
+            for tax in tax_obj.compute(cursor, user, tax_ids, line.unit_price,
+                    line.quantity, context=ctx):
+                key, _ = invoice_obj._compute_tax(cursor, user, tax,
+                        line.invoice.type, context=context)
+                taxes_keys.append(key)
+            res[line.id] = []
+            for tax in line.invoice.taxes:
+                if tax.manual:
+                    continue
+                key = (tax.base_code.id, tax.base_sign,
+                        tax.tax_code.id, tax.tax_sign,
+                        tax.account.id, tax.tax.id)
+                if key in taxes_keys:
+                    res[line.id].append(tax.id)
+        return res
+
+    def _get_tax_rule_pattern(self, cursor, user, party, vals, context=None):
+        '''
+        Get tax rule pattern
+
+        :param cursor: the database cursor
+        :param user: the user id
+        :param party: the BrowseRecord of the party
+        :param vals: a dictionary with value from on_change
+        :param context: the context
+        :return: a dictionary to use as pattern for tax rule
+        '''
+        res = {}
+        return res
+
+    def on_change_product(self, cursor, user, ids, vals, context=None):
+        product_obj = self.pool.get('product.product')
+        party_obj = self.pool.get('party.party')
+        account_obj = self.pool.get('account.account')
+        uom_obj = self.pool.get('product.uom')
+        company_obj = self.pool.get('company.company')
+        currency_obj = self.pool.get('currency.currency')
+        tax_rule_obj = self.pool.get('account.tax.rule')
+
+        if context is None:
+            context = {}
+        if not vals.get('product'):
+            return {}
+        res = {}
+
+        ctx = context.copy()
+        party = None
+        if vals.get('_parent_invoice.party', vals.get('party')):
+            party = party_obj.browse(cursor, user, vals.get('_parent_invoice.party',
+                    vals.get('party')),
+                    context=context)
+            if party.lang:
+                ctx['language'] = party.lang.code
+
+        product = product_obj.browse(cursor, user, vals['product'],
+                context=context)
+
+        company = None
+        if context.get('company'):
+            company = company_obj.browse(cursor, user, context['company'],
+                    context=context)
+        currency = None
+        if vals.get('_parent_invoice.currency', vals.get('currency')):
+            #TODO check if today date is correct
+            currency = currency_obj.browse(cursor, user,
+                    vals.get('_parent_invoice.currency', vals.get('currency')),
+                    context=context)
+
+        if vals.get('_parent_invoice.type', vals.get('invoice_type')) \
+                in ('in_invoice', 'in_credit_note'):
+            if company and currency:
+                res['unit_price'] = currency_obj.compute(cursor, user,
+                        company.currency, product.cost_price, currency,
+                        round=False, context=context)
+            else:
+                res['unit_price'] = product.cost_price
+            try:
+                res['account'] = product.account_expense_used.id
+                res['account.rec_name'] = product.account_expense_used.rec_name
+            except:
+                pass
+            res['taxes'] = []
+            pattern = self._get_tax_rule_pattern(cursor, user, party, vals,
+                    context=context)
+            for tax in product.supplier_taxes_used:
+                if party and party.supplier_tax_rule:
+                    tax_ids = tax_rule_obj.apply(cursor, user,
+                            party.supplier_tax_rule, tax, pattern,
+                            context=context)
+                    if tax_ids:
+                        res['taxes'].extend(tax_ids)
+                    continue
+                res['taxes'].append(tax.id)
+            if party and party.supplier_tax_rule:
+                tax_ids = tax_rule_obj.apply(cursor, user,
+                        party.supplier_tax_rule, False, pattern,
+                        context=context)
+                if tax_ids:
+                    res['taxes'].extend(tax_ids)
+        else:
+            if company and currency:
+                res['unit_price'] = currency_obj.compute(cursor, user,
+                        company.currency, product.list_price, currency,
+                        round=False, context=context)
+            else:
+                res['unit_price'] = product.list_price
+            try:
+                res['account'] = product.account_revenue_used.id
+                res['account.rec_name'] = product.account_revenue_used.rec_name
+            except:
+                pass
+            res['taxes'] = []
+            pattern = self._get_tax_rule_pattern(cursor, user, party, vals,
+                    context=context)
+            for tax in product.customer_taxes_used:
+                if party and party.customer_tax_rule:
+                    tax_ids = tax_rule_obj.apply(cursor, user,
+                            party.customer_tax_rule, tax, pattern,
+                            context=context)
+                    if tax_ids:
+                        res['taxes'].extend(tax_ids)
+                    continue
+                res['taxes'].append(tax.id)
+            if party and party.customer_tax_rule:
+                tax_ids = tax_rule_obj.apply(cursor, user,
+                        party.customer_tax_rule, False, pattern,
+                        context=context)
+                if tax_ids:
+                    res['taxes'].extend(tax_ids)
+
+        if not vals.get('description'):
+            res['description'] = product_obj.browse(cursor, user, product.id,
+                    context=ctx).rec_name
+
+        category = product.default_uom.category
+        if not vals.get('unit') \
+                or vals.get('unit') not in [x.id for x in category.uoms]:
+            res['unit'] = product.default_uom.id
+            res['unit.rec_name'] = product.default_uom.rec_name
+            res['unit_digits'] = product.default_uom.digits
+
         vals = vals.copy()
-        selection_vals = {}
-        for field in vals.keys():
-            if field.startswith('analytic_account_'):
-                if vals[field]:
-                    selection_vals.setdefault('accounts', [])
-                    selection_vals['accounts'].append(('add', vals[field]))
-                del vals[field]
-        if vals.get('analytic_accounts'):
-            selection_obj.write(cursor, user, vals['analytic_accounts'],
-                    selection_vals, context=context)
-        elif vals.get('type', 'line') == 'line':
-            selection_id = selection_obj.create(cursor, user, selection_vals,
-                    context=context)
-            vals['analytic_accounts'] = selection_id
-        return super(InvoiceLine, self).create(cursor, user, vals,
+        vals['unit_price'] = res['unit_price']
+        vals['type'] = 'line'
+        res['amount'] = self.on_change_with_amount(cursor, user, ids,
+                vals, context=context)
+        return res
+
+    def check_modify(self, cursor, user, ids, context=None):
+        '''
+        Check if the lines can be modified
+        '''
+        for line in self.browse(cursor, user, ids, context=context):
+            if line.invoice and \
+                    line.invoice.state in ('open', 'paid'):
+                self.raise_user_error(cursor, 'modify', context=context)
+        return
+
+    def delete(self, cursor, user, ids, context=None):
+        if isinstance(ids, (int, long)):
+            ids = [ids]
+        self.check_modify(cursor, user, ids, context=context)
+        return super(InvoiceLine, self).delete(cursor, user, ids,
                 context=context)
 
     def write(self, cursor, user, ids, vals, context=None):
-        selection_obj = self.pool.get('analytic_account.account.selection')
-        vals = vals.copy()
         if isinstance(ids, (int, long)):
             ids = [ids]
-        selection_vals = {}
-        for field in vals.keys():
-            if field.startswith('analytic_account_'):
-                root_id = int(field[len('analytic_account_'):])
-                selection_vals[root_id] = vals[field]
-                del vals[field]
-        if selection_vals:
-            lines = self.browse(cursor, user, ids, context=context)
-            for line in lines:
-                if line.type != 'line':
-                    continue
-                accounts = []
-                if not line.analytic_accounts:
-                    # Create missing selection
-                    selection_id = selection_obj.create(cursor, 0, {},
-                            context=context)
-                    self.write(cursor, user, line.id, {
-                        'analytic_accounts': selection_id,
-                        }, context=context)
-                    line = self.browse(cursor, user, line.id, context=context)
-                for account in line.analytic_accounts.accounts:
-                    if account.root.id in selection_vals:
-                        value = selection_vals[account.root.id]
-                        if value:
-                            accounts.append(value)
-                    else:
-                        accounts.append(account.id)
-                for account_id in selection_vals.values():
-                    if account_id \
-                            and account_id not in accounts:
-                        accounts.append(account_id)
-                selection_obj.write(cursor, user, line.analytic_accounts.id, {
-                    'accounts': [('set', accounts)],
-                    }, context=context)
+        self.check_modify(cursor, user, ids, context=context)
         return super(InvoiceLine, self).write(cursor, user, ids, vals,
                 context=context)
 
+    def create(self, cursor, user, vals, context=None):
+        invoice_obj = self.pool.get('account.invoice')
+        if vals.get('invoice'):
+            invoice = invoice_obj.browse(cursor, user, vals['invoice'],
+                    context=context)
+            if invoice.state in ('open', 'paid', 'cancel'):
+                self.raise_user_error(cursor, 'create', context=context)
+        return super(InvoiceLine, self).create(cursor, user, vals,
+                context=context)
+
+    def check_account(self, cursor, user, ids):
+        for line in self.browse(cursor, user, ids):
+            if line.type == 'line':
+                if line.invoice:
+                    if line.account.company.id != line.invoice.company.id:
+                        return False
+                elif line.company:
+                    if line.account.company.id != line.company.id:
+                        return False
+        return True
+
+    def check_account2(self, cursor, user, ids):
+        for line in self.browse(cursor, user, ids):
+            if line.type == 'line':
+                if line.invoice \
+                        and line.account.id == line.invoice.account.id:
+                    return False
+        return True
+
+    def _compute_taxes(self, cursor, user, line, context=None):
+        tax_obj = self.pool.get('account.tax')
+        currency_obj = self.pool.get('currency.currency')
+        invoice_obj = self.pool.get('account.invoice')
+        if context is None:
+            context = {}
+
+        ctx = context.copy()
+        ctx.update(invoice_obj.get_tax_context(cursor, user, line.invoice,
+            context=context))
+        res = []
+        if line.type != 'line':
+            return res
+        tax_ids = [x.id for x in line.taxes]
+        for tax in tax_obj.compute(cursor, user, tax_ids, line.unit_price,
+                line.quantity, context=ctx):
+            if line.invoice.type in ('out_invoice', 'in_invoice'):
+                base_code_id = tax['tax'].invoice_base_code.id
+                amount = tax['base'] * tax['tax'].invoice_base_sign
+            else:
+                base_code_id = tax['tax'].credit_note_base_code.id
+                amount = tax['base'] * tax['tax'].credit_note_base_sign
+            if base_code_id:
+                amount = currency_obj.compute(cursor, user,
+                        line.invoice.currency, amount,
+                        line.invoice.company.currency, context=context)
+                res.append({
+                    'code': base_code_id,
+                    'amount': amount,
+                })
+        return res
+
+    def get_move_line(self, cursor, user, line, context=None):
+        '''
+        Return move line value for invoice line
+        '''
+        currency_obj = self.pool.get('currency.currency')
+        res = {}
+        if line.type != 'line':
+            return res
+        res['name'] = line.description
+        if line.invoice.currency.id != line.invoice.company.currency.id:
+            amount = currency_obj.compute(cursor, user,
+                    line.invoice.currency, line.amount,
+                    line.invoice.company.currency, context=context)
+            res['amount_second_currency'] = line.amount
+            res['second_currency'] = line.invoice.currency.id
+        else:
+            amount = line.amount
+            res['amount_second_currency'] = Decimal('0.0')
+            res['second_currency'] = False
+        if line.invoice.type in ('in_invoice', 'out_credit_note'):
+            if amount >= Decimal('0.0'):
+                res['debit'] = amount
+                res['credit'] = Decimal('0.0')
+            else:
+                res['debit'] = Decimal('0.0')
+                res['credit'] = - amount
+                res['amount_second_currency'] = - res['amount_second_currency']
+        else:
+            if amount >= Decimal('0.0'):
+                res['debit'] = Decimal('0.0')
+                res['credit'] = amount
+                res['amount_second_currency'] = - res['amount_second_currency']
+            else:
+                res['debit'] = - amount
+                res['credit'] = Decimal('0.0')
+        res['account'] = line.account.id
+        res['party'] = line.invoice.party.id
+        computed_taxes = self._compute_taxes(cursor, user, line,
+                context=context)
+        for tax in computed_taxes:
+            res.setdefault('tax_lines', [])
+            res['tax_lines'].append(('create', tax))
+        return res
+
+    def _credit(self, cursor, user, line, context=None):
+        '''
+        Return values to credit line.
+        '''
+        res = {}
+
+        for field in ('sequence', 'type', 'quantity', 'unit_price',
+                'description'):
+            res[field] = line[field]
+
+        for field in ('unit', 'product', 'account'):
+            res[field] = line[field].id
+
+        res['taxes'] = []
+        for tax in line.taxes:
+            res['taxes'].append(('add', tax.id))
+        return res
+
+InvoiceLine()
+
+
+class InvoiceLineTax(ModelSQL):
+    'Invoice Line - Tax'
+    _name = 'account.invoice.line-account.tax'
+    _table = 'account_invoice_line_account_tax'
+    _description = __doc__
+    line = fields.Many2One('account.invoice.line', 'Invoice Line',
+            ondelete='CASCADE', select=1, required=True)
+    tax = fields.Many2One('account.tax', 'Tax', ondelete='RESTRICT',
+            required=True)
+
+InvoiceLineTax()
+
+
+class InvoiceTax(ModelSQL, ModelView):
+    'Invoice Tax'
+    _name = 'account.invoice.tax'
+    _rec_name = 'description'
+    _description = __doc__
+
+    invoice = fields.Many2One('account.invoice', 'Invoice', ondelete='CASCADE',
+            select=1)
+    description = fields.Char('Description', size=None, required=True)
+    sequence = fields.Integer('Sequence')
+    sequence_number = fields.Function('get_sequence_number', type='integer',
+            string='Sequence Number')
+    account = fields.Many2One('account.account', 'Account', required=True,
+            domain="[('kind', '!=', 'view'), " \
+                "('company', '=', _parent_invoice.company)]")
+    base = fields.Numeric('Base', digits="(16, _parent_invoice.currency_digits)")
+    amount = fields.Numeric('Amount', digits="(16, _parent_invoice.currency_digits)")
+    manual = fields.Boolean('Manual')
+    base_code = fields.Many2One('account.tax.code', 'Base Code',
+            domain="[('company', '=', _parent_invoice.company)]")
+    base_sign = fields.Numeric('Base Sign', digits=(2, 0))
+    tax_code = fields.Many2One('account.tax.code', 'Tax Code',
+            domain="[('company', '=', _parent_invoice.company)]")
+    tax_sign = fields.Numeric('Tax Sign', digits=(2, 0))
+    tax = fields.Many2One('account.tax', 'Tax')
+
+    def __init__(self):
+        super(InvoiceTax, self).__init__()
+        self._constraints += [
+            ('check_company', 'You can not create invoice tax \n' \
+                    'with account or code from a different invoice company!',
+                    ['account', 'base_code', 'tax_code']),
+        ]
+        self._order.insert(0, ('sequence', 'ASC'))
+        self._error_messages.update({
+            'modify': 'You can not modify tax from an invoice ' \
+                    'that is open, paid or canceled!',
+            'create': 'You can not add a line to an invoice ' \
+                    'that is open, paid or canceled!',
+            })
+
+    def default_base(self, cursor, user, context=None):
+        return Decimal('0.0')
+
+    def default_amount(self, cursor, user, context=None):
+        return Decimal('0.0')
+
+    def default_manual(self, cursor, user, context=None):
+        return True
+
+    def default_base_sign(self, cursor, user, context=None):
+        return Decimal('1')
+
+    def default_tax_sign(self, cursor, user, context=None):
+        return Decimal('1')
+
+    def check_modify(self, cursor, user, ids, context=None):
+        '''
+        Check if the taxes can be modified
+        '''
+        for tax in self.browse(cursor, user, ids, context=context):
+            if tax.invoice.state in ('open', 'paid', 'cancel'):
+                self.raise_user_error(cursor, 'modify',
+                        context=context)
+        return
+
+    def get_sequence_number(self, cursor, user, ids, name, arg, context=None):
+        res = {}
+        for tax in self.browse(cursor, user, ids, context=context):
+            res[tax.id] = 0
+            i = 1
+            for tax2 in tax.invoice.taxes:
+                if tax2.id == tax.id:
+                    res[tax.id] = i
+                    break
+                i += 1
+        return res
+
     def delete(self, cursor, user, ids, context=None):
-        selection_obj = self.pool.get('analytic_account.account.selection')
+        if isinstance(ids, (int, long)):
+            ids = [ids]
+        self.check_modify(cursor, user, ids, context=context)
+        return super(InvoiceTax, self).delete(cursor, user, ids,
+                context=context)
 
+    def write(self, cursor, user, ids, vals, context=None):
         if isinstance(ids, (int, long)):
             ids = [ids]
-        selection_ids = []
-        lines = self.browse(cursor, user, ids, context=context)
-        for line in lines:
-            if line.analytic_accounts:
-                selection_ids.append(line.analytic_accounts.id)
+        self.check_modify(cursor, user, ids, context=context)
+        return super(InvoiceTax, self).write(cursor, user, ids, vals,
+                context=context)
+
+    def create(self, cursor, user, vals, context=None):
+        invoice_obj = self.pool.get('account.invoice')
+        if vals.get('invoice'):
+            invoice = invoice_obj.browse(cursor, user, vals['invoice'],
+                    context=context)
+            if invoice.state in ('open', 'paid', 'cancel'):
+                self.raise_user_error(cursor, 'create', context=context)
+        return super(InvoiceTax, self).create(cursor, user, vals,
+                context=context)
+
+    def check_company(self, cursor, user, ids):
+        for tax in self.browse(cursor, user, ids):
+            company = tax.invoice.company
+            if tax.account.company.id != company.id:
+                return False
+            if tax.base_code:
+                if tax.base_code.company.id != company.id:
+                    return False
+            if tax.tax_code:
+                if tax.tax_code.company.id != company.id:
+                    return False
+        return True
 
-        res = super(InvoiceLine, self).delete(cursor, user, ids,
+    def get_move_line(self, cursor, user, tax, context=None):
+        '''
+        Return move line value for invoice tax
+        '''
+        currency_obj = self.pool.get('currency.currency')
+        res = {}
+        res['name'] = tax.description
+        if tax.invoice.currency.id != tax.invoice.company.currency.id:
+            amount = currency_obj.compute(cursor, user,
+                    tax.invoice.currency, tax.amount,
+                    tax.invoice.company.currency, context=context)
+            res['amount_second_currency'] = tax.amount
+            res['second_currency'] = tax.invoice.currency.id
+        else:
+            amount = tax.amount
+            res['amount_second_currency'] = Decimal('0.0')
+            res['second_currency'] = False
+        if tax.invoice.type in ('in_invoice', 'out_credit_note'):
+            if amount >= Decimal('0.0'):
+                res['debit'] = amount
+                res['credit'] = Decimal('0.0')
+            else:
+                res['debit'] = Decimal('0.0')
+                res['credit'] = - amount
+                res['amount_second_currency'] = - res['amount_second_currency']
+        else:
+            if amount >= Decimal('0.0'):
+                res['debit'] = Decimal('0.0')
+                res['credit'] = amount
+                res['amount_second_currency'] = - res['amount_second_currency']
+            else:
+                res['debit'] = - amount
+                res['credit'] = Decimal('0.0')
+        res['account'] = tax.account.id
+        res['party'] = tax.invoice.party.id
+        if tax.tax_code:
+            res['tax_lines'] = [('create', {
+                'code': tax.tax_code.id,
+                'amount': amount * tax.tax_sign,
+            })]
+        return res
+
+    def _credit(self, cursor, user, tax, context=None):
+        '''
+        Return values to credit tax.
+        '''
+        res = {}
+
+        for field in ('description', 'sequence', 'base', 'amount',
+                'manual', 'base_sign', 'tax_sign'):
+            res[field] = tax[field]
+
+        for field in ('account', 'base_code', 'tax_code', 'tax'):
+            res[field] = tax[field].id
+        return res
+
+InvoiceTax()
+
+
+class PrintInvoiceReportWarning(ModelView):
+    'Print Invoice Report Warning'
+    _name = 'account.invoice.print_invoice_report.warning'
+    _description = __doc__
+
+PrintInvoiceReportWarning()
+
+
+class PrintInvoiceReport(Wizard):
+    'Print Invoice Report'
+    _name = 'account.invoice.print_invoice_report'
+    states = {
+        'init': {
+            'result': {
+                'type': 'choice',
+                'next_state': '_choice',
+            },
+        },
+        'warning': {
+            'result': {
+                'type': 'form',
+                'object': 'account.invoice.print_invoice_report.warning',
+                'state': [
+                    ('end', 'Cancel', 'tryton-cancel'),
+                    ('print', 'Print', 'tryton-ok', True),
+                ],
+            },
+        },
+        'print': {
+            'actions': ['_print_init'],
+            'result': {
+                'type': 'print',
+                'report': 'account.invoice',
+                'state': 'print_next',
+                'get_id_from_action': True,
+            },
+        },
+        'print_next': {
+            'actions': ['_next_id'],
+            'result': {
+                'type': 'choice',
+                'next_state': '_print_next',
+            },
+        }
+    }
+
+    def _choice(self, cursor, user, data, context=None):
+        if len(data['ids']) > 1:
+            return 'warning'
+        return 'print'
+
+    def _print_init(self, cursor, user, data, context=None):
+        res = {}
+        if 'ids' in data['form']:
+            res['ids'] = data['form']['ids']
+        else:
+            res['ids'] = data['ids']
+        return res
+
+    def _next_id(self, cursor, user, data, context=None):
+        res = {}
+        if data['form']['ids']:
+            data['form']['ids'].pop(0)
+        res['ids'] = data['form']['ids']
+        return res
+
+    def _print_next(self, cursor, user, data, context=None):
+        if not data['form']['ids']:
+            return 'end'
+        return 'print'
+
+PrintInvoiceReport()
+
+
+class InvoiceReport(Report):
+    _name = 'account.invoice'
+
+    def execute(self, cursor, user, ids, datas, context=None):
+        if context is None:
+            context = {}
+        res = super(InvoiceReport, self).execute(cursor, user, ids, datas,
                 context=context)
-        selection_obj.delete(cursor, user, selection_ids, context=context)
+        if len(ids) > 1 or datas['id'] != ids[0]:
+            res = (res[0], res[1], True)
         return res
 
-    def copy(self, cursor, user, ids, default=None, context=None):
-        selection_obj = self.pool.get('analytic_account.account.selection')
+    def _get_objects(self, cursor, user_id, ids, model, datas, context):
+        invoice_obj = self.pool.get('account.invoice')
 
-        new_ids = super(InvoiceLine, self).copy(cursor, user, ids,
-                default=default, context=context)
+        if context is None:
+            context = {}
 
-        int_id = False
-        if isinstance(new_ids, (int, long)):
-            int_id = True
-            new_ids = [new_ids]
-
-        for line in self.browse(cursor, user, new_ids, context=context):
-            if line.analytic_accounts:
-                selection_id = selection_obj.copy(cursor, user,
-                        line.analytic_accounts.id, context=context)
-                self.write(cursor, user, line.id, {
-                    'analytic_accounts': selection_id,
-                    }, context=context)
+        context = context.copy()
+        if 'language' in context:
+            del context['language']
+        return invoice_obj.browse(cursor, user_id, [ids[0]], context=context)
 
-        if int_id:
-            return new_ids[0]
-        return new_ids
+    def parse(self, cursor, user_id, report, objects, datas, context):
+        user_obj = self.pool.get('res.user')
+        invoice_obj = self.pool.get('account.invoice')
 
-    def get_move_line(self, cursor, user, line, context=None):
-        res = super(InvoiceLine, self).get_move_line(cursor, user, line,
-                context=context)
-        if line.analytic_accounts and line.analytic_accounts.accounts:
-            res['analytic_lines'] = []
-            for account in line.analytic_accounts.accounts:
-                vals = {}
-                vals['name'] = line.description
-                vals['debit'] = res['debit']
-                vals['credit'] = res['credit']
-                vals['currency'] = line.invoice.currency.id
-                vals['account'] = account.id
-                vals['journal'] = line.invoice.journal.id
-                vals['date'] = line.invoice.invoice_date
-                vals['reference'] = line.invoice.reference
-                vals['party'] = line.invoice.party.id
-                res['analytic_lines'].append(('create', vals))
+        invoice = objects[0]
+
+        if invoice.invoice_report:
+            return (invoice.invoice_report_format,
+                    base64.decodestring(invoice.invoice_report))
+
+        user = user_obj.browse(cursor, user_id, user_id, context)
+        if context is None:
+            context = {}
+        context = context.copy()
+        context['company'] = user.company
+        res = super(InvoiceReport, self).parse(cursor, user_id, report, objects,
+                datas, context)
+        #If the invoice is open or paid and the report not saved in invoice_report
+        #there was an error somewhere. So we save it now in invoice_report
+        if invoice.state in ('open', 'paid'):
+            invoice_obj.write(cursor, user_id, invoice.id, {
+                'invoice_report_format': res[0],
+                'invoice_report': base64.encodestring(res[1]),
+                }, context=context)
         return res
 
-InvoiceLine()
+InvoiceReport()
 
 
-class Account(ModelSQL, ModelView):
-    _name = 'analytic_account.account'
+class PayInvoiceInit(ModelView):
+    'Pay Invoice Init'
+    _name = 'account.invoice.pay_invoice.init'
+    _description = __doc__
+    amount = fields.Numeric('Amount', digits="(16, currency_digits)")
+    currency = fields.Many2One('currency.currency', 'Currency', required=True)
+    currency_digits = fields.Integer('Currency Digits', readonly=True,
+            on_change_with=['currency'])
+    description = fields.Char('Description', size=None, required=True)
+    journal = fields.Many2One('account.journal', 'Journal', required=True,
+            domain=[('type', '=', 'cash')])
+    date = fields.Date('Date', required=True)
 
-    def delete(self, cursor, user, ids, context=None):
-        account_invoice_line_obj = self.pool.get('account.invoice.line')
-        res = super(Account, self).delete(cursor, user, ids, context=context)
-        # Restart the cache on the fields_view_get method of account.invoice.line
-        account_invoice_line_obj.fields_view_get(cursor.dbname)
+    def default_date(self, cursor, user, context=None):
+        date_obj = self.pool.get('ir.date')
+        return date_obj.today(cursor, user, context=context)
+
+    def on_change_with_currency_digits(self, cursor, user, ids, vals,
+            context=None):
+        currency_obj = self.pool.get('currency.currency')
+        if vals.get('currency'):
+            currency = currency_obj.browse(cursor, user, vals['currency'],
+                    context=context)
+            return currency.digits
+        return 2
+
+PayInvoiceInit()
+
+
+class PayInvoiceAsk(ModelView):
+    'Pay Invoice Ask'
+    _name = 'account.invoice.pay_invoice.ask'
+    _description = __doc__
+    type = fields.Selection([
+        ('writeoff', 'Write-Off'),
+        ('partial', 'Partial Payment'),
+        ], 'Type', required=True)
+    journal_writeoff = fields.Many2One('account.journal', 'Write-Off Journal',
+            states={
+                'invisible': "type != 'writeoff'",
+                'required': "type == 'writeoff'",
+            })
+    account_writeoff = fields.Many2One('account.account', 'Write-Off Account',
+            domain="[('kind', '!=', 'view'), ('company', '=', company)]",
+            states={
+                'invisible': "type != 'writeoff'",
+                'required': "type == 'writeoff'",
+            })
+    amount = fields.Numeric('Payment Amount', digits="(16, currency_digits)",
+            readonly=True, depends=['currency_digits'])
+    currency = fields.Many2One('currency.currency', 'Payment Currency',
+            readonly=True)
+    currency_digits = fields.Integer('Payment Currency Digits', readonly=True)
+    amount_writeoff = fields.Numeric('Write-Off Amount',
+            digits="(16, currency_digits_writeoff)", readonly=True,
+            depends=['currency_digits_writeoff'], states={
+                'invisible': "type != 'writeoff'",
+            })
+    currency_writeoff = fields.Many2One('currency.currency',
+            'Write-Off Currency', readonly=True, states={
+                'invisible': "type != 'writeoff'",
+            })
+    currency_digits_writeoff = fields.Integer('Write-Off Currency Digits',
+            readonly=True)
+    lines_to_pay = fields.Many2Many('account.move.line', None, None,
+            'Lines to Pay', readonly=True)
+    lines = fields.Many2Many('account.move.line', None, None, 'Lines',
+            domain="[('id', 'in', lines_to_pay), " \
+                    "('reconciliation', '=', False)]",
+            states={
+                'invisible': "type != 'writeoff'",
+            }, on_change=['lines', 'amount', 'currency', 'currency_writeoff',
+                'invoice'],
+            depends=['lines_to_pay'])
+    payment_lines = fields.Many2Many('account.move.line', None, None,
+            'Payment Lines', readonly=True,
+            states={
+                'invisible': "type != 'writeoff'",
+            })
+    description = fields.Char('Description', size=None, readonly=True)
+    journal = fields.Many2One('account.journal', 'Journal', readonly=True,
+            domain=[('type', '=', 'cash')])
+    date = fields.Date('Date', readonly=True)
+    company = fields.Many2One('company.company', 'Company', readonly=True)
+    account = fields.Many2One('account.account', 'Account', readonly=True)
+    invoice = fields.Many2One('account.invoice', 'Invoice', readonly=True)
+
+    def default_type(self, cursor, user, context=None):
+        return 'partial'
+
+    def on_change_lines(self, cursor, user, ids, vals, context=None):
+        currency_obj = self.pool.get('currency.currency')
+        line_obj = self.pool.get('account.move.line')
+        invoice_obj = self.pool.get('account.invoice')
+
+        res = {}
+        invoice = invoice_obj.browse(cursor, user, vals['invoice'],
+                context=context)
+        amount = currency_obj.compute(cursor, user, vals['currency'],
+                vals['amount'], vals['currency_writeoff'], context=context)
+
+        res['amount_writeoff'] = Decimal('0.0')
+        for line in line_obj.browse(cursor, user, vals['lines'],
+                context=context):
+            res['amount_writeoff'] += line.debit - line.credit
+        if invoice.type in ('in_invoice', 'out_credit_note'):
+            res['amount_writeoff'] = - res['amount_writeoff'] - amount
+        else:
+            res['amount_writeoff'] = res['amount_writeoff'] - amount
         return res
 
-    def create(self, cursor, user, vals, context=None):
-        account_invoice_line_obj = self.pool.get('account.invoice.line')
-        res = super(Account, self).create(cursor, user, vals, context=context)
-        # Restart the cache on the fields_view_get method of account.invoice.line
-        account_invoice_line_obj.fields_view_get(cursor.dbname)
+PayInvoiceAsk()
+
+
+class PayInvoice(Wizard):
+    'Pay Invoice'
+    _name = 'account.invoice.pay_invoice'
+    states = {
+        'init': {
+            'actions': ['_init'],
+            'result': {
+                'type': 'form',
+                'object': 'account.invoice.pay_invoice.init',
+                'state': [
+                    ('end', 'Cancel', 'tryton-cancel'),
+                    ('choice', 'Ok', 'tryton-ok', True),
+                ],
+            },
+        },
+        'choice': {
+            'result': {
+                'type': 'choice',
+                'next_state': '_choice',
+            },
+        },
+        'ask': {
+            'actions': ['_ask'],
+            'result': {
+                'type': 'form',
+                'object': 'account.invoice.pay_invoice.ask',
+                'state': [
+                    ('end', 'Cancel', 'tryton-cancel'),
+                    ('pay', 'Ok', 'tryton-ok', True),
+                ],
+            },
+        },
+        'pay': {
+            'result': {
+                'type': 'action',
+                'action': '_action_pay',
+                'state': 'end',
+            },
+        },
+    }
+
+    def __init__(self):
+        super(PayInvoice, self).__init__()
+        self._error_messages.update({
+            'amount_greater_amount_to_pay': 'You can not create a partial ' \
+                    'payment with an amount greater then the amount to pay!',
+            })
+
+    def _init(self, cursor, user, data, context=None):
+        invoice_obj = self.pool.get('account.invoice')
+        res = {}
+        invoice = invoice_obj.browse(cursor, user, data['id'], context=context)
+        res['currency'] = invoice.currency.id
+        res['currency_digits'] = invoice.currency.digits
+        res['amount'] = invoice.amount_to_pay_today or invoice.amount_to_pay
+        res['description'] = invoice.number
         return res
 
-    def write(self, cursor, user, ids, vals, context=None):
-        account_invoice_line_obj = self.pool.get('account.invoice.line')
-        res = super(Account, self).write(cursor, user, ids, vals,
+    def _choice(self, cursor, user, data, context=None):
+        invoice_obj = self.pool.get('account.invoice')
+        currency_obj = self.pool.get('currency.currency')
+
+        invoice = invoice_obj.browse(cursor, user, data['id'], context=context)
+
+        ctx = context.copy()
+        ctx['date'] = data['form']['date']
+        amount = currency_obj.compute(cursor, user, data['form']['currency'],
+                data['form']['amount'], invoice.company.currency,
+                context=context)
+        res = invoice_obj.get_reconcile_lines_for_amount(cursor, user, invoice,
+                amount)
+        if res[1] == Decimal('0.0') and amount <= invoice.amount_to_pay:
+            return 'pay'
+        return 'ask'
+
+    def _ask(self, cursor, user, data, context=None):
+        invoice_obj = self.pool.get('account.invoice')
+        currency_obj = self.pool.get('currency.currency')
+        line_obj = self.pool.get('account.move.line')
+
+        res = {}
+        invoice = invoice_obj.browse(cursor, user, data['id'], context=context)
+        res['lines_to_pay'] = [x.id for x in invoice.lines_to_pay
+                if not x.reconciliation]
+
+        res['amount'] = data['form']['amount']
+        res['currency'] = data['form']['currency']
+        res['currency_digits'] = data['form']['currency_digits']
+        res['description'] = data['form']['description']
+        res['journal'] = data['form']['journal']
+        res['date'] = data['form']['date']
+        res['company'] = invoice.company.id
+
+        amount = currency_obj.compute(cursor, user, data['form']['currency'],
+                data['form']['amount'], invoice.company.currency,
+                context=context)
+
+        if currency_obj.is_zero(cursor, user, invoice.company.currency,
+                amount):
+            res['lines'] = [x.id for x in invoice.lines_to_pay]
+        else:
+            res['lines'] = invoice_obj.get_reconcile_lines_for_amount(cursor,
+                    user, invoice, amount)[0]
+        for line_id in res['lines'][:]:
+            if line_id not in res['lines_to_pay']:
+                res['lines'].remove(line_id)
+
+        res['amount_writeoff'] = Decimal('0.0')
+        for line in line_obj.browse(cursor, user, res['lines'], context=context):
+            res['amount_writeoff'] += line.debit - line.credit
+        for line in invoice.payment_lines:
+            res['amount_writeoff'] += line.debit - line.credit
+        if invoice.type in ('in_invoice', 'out_credit_note'):
+            res['amount_writeoff'] = - res['amount_writeoff'] - amount
+        else:
+            res['amount_writeoff'] = res['amount_writeoff'] - amount
+
+        res['currency_writeoff'] = invoice.company.currency.id
+        res['currency_digits_writeoff'] = invoice.company.currency.digits
+        res['invoice'] = invoice.id
+        res['payment_lines'] = [x.id for x in invoice.payment_lines
+                if not x.reconciliation]
+
+        if amount > invoice.amount_to_pay \
+                or currency_obj.is_zero(cursor, user, invoice.company.currency,
+                        amount):
+            res['type'] = 'writeoff'
+        return res
+
+    def _action_pay(self, cursor, user, data, context=None):
+        invoice_obj = self.pool.get('account.invoice')
+        currency_obj = self.pool.get('currency.currency')
+        move_line_obj = self.pool.get('account.move.line')
+
+        invoice = invoice_obj.browse(cursor, user, data['id'], context=context)
+
+        ctx = context.copy()
+        ctx['date'] = data['form']['date']
+        amount = currency_obj.compute(cursor, user, data['form']['currency'],
+                data['form']['amount'], invoice.company.currency,
+                context=context)
+
+        reconcile_lines = invoice_obj.get_reconcile_lines_for_amount(cursor,
+                user, invoice, amount)
+
+        amount_second_currency = False
+        second_currency = False
+        if data['form']['currency'] != invoice.company.currency.id:
+            amount_second_currency = data['form']['amount']
+            second_currency = data['form']['currency']
+
+        if amount > invoice.amount_to_pay and \
+                data['form'].get('type') != 'writeoff':
+            self.raise_user_error(cursor, 'amount_greater_amount_to_pay',
+                    context=context)
+
+        line_id = False
+        if not currency_obj.is_zero(cursor, user, invoice.company.currency,
+                amount):
+            line_id = invoice_obj.pay_invoice(cursor, user, data['id'], amount,
+                    data['form']['journal'], data['form']['date'],
+                    data['form']['description'], amount_second_currency,
+                    second_currency, context=context)
+
+        if reconcile_lines[1] != Decimal('0.0'):
+            if data['form'].get('type') == 'writeoff':
+                line_ids = data['form']['lines'][0][1] + \
+                        [x.id for x in invoice.payment_lines
+                                if not x.reconciliation]
+                if line_id:
+                    line_ids += [line_id]
+                if line_ids:
+                    move_line_obj.reconcile(cursor, user, line_ids,
+                            journal_id=data['form']['journal_writeoff'],
+                            date=data['form']['date'],
+                            account_id=data['form']['account_writeoff'],
+                            context=context)
+        else:
+            line_ids = reconcile_lines[0]
+            if line_id:
+                line_ids += [line_id]
+            if line_ids:
+                move_line_obj.reconcile(cursor, user, line_ids, context=context)
+        return {}
+
+PayInvoice()
+
+
+class CreditInvoiceInit(ModelView):
+    'Credit Invoice Init'
+    _name = 'account.invoice.credit_invoice.init'
+    _description = __doc__
+    with_refund = fields.Boolean('With Refund', help='If true, ' \
+            'the current invoice(s) will be paid.')
+
+CreditInvoiceInit()
+
+
+class CreditInvoice(Wizard):
+    'Credit Invoice'
+    _name = 'account.invoice.credit_invoice'
+    states = {
+        'init': {
+            'actions': ['_init'],
+            'result': {
+                'type': 'form',
+                'object': 'account.invoice.credit_invoice.init',
+                'state': [
+                    ('end', 'Cancel', 'tryton-cancel'),
+                    ('credit', 'Credit', 'tryton-ok', True),
+                ],
+            }
+        },
+        'credit': {
+            'result': {
+                'type': 'action',
+                'action': '_action_credit',
+                'state': 'end',
+            },
+        },
+    }
+
+    def __init__(self):
+        super(CreditInvoice, self).__init__()
+        self._error_messages.update({
+            'refund_non_open': 'You can not credit with refund ' \
+                    'an invoice that is not opened!',
+            'refund_with_payement': 'You can not credit with refund ' \
+                    'an invoice with payments!',
+            })
+
+    def _init(self, cursor, user, data, context=None):
+        invoice_obj = self.pool.get('account.invoice')
+        res = {
+            'with_refund': True,
+        }
+        for invoice in invoice_obj.browse(cursor, user, data['ids'],
+                context=context):
+            if invoice.state != 'open' or invoice.payment_lines:
+                res['with_refund'] = False
+                break
+        return res
+
+    def _action_credit(self, cursor, user, data, context=None):
+        model_data_obj = self.pool.get('ir.model.data')
+        act_window_obj = self.pool.get('ir.action.act_window')
+        invoice_obj = self.pool.get('account.invoice')
+
+        refund = data['form']['with_refund']
+
+        if refund:
+            for invoice in invoice_obj.browse(cursor, user, data['ids'],
+                    context=context):
+                if invoice.state != 'open':
+                    self.raise_user_error(cursor, 'refund_non_open',
+                            context=context)
+                if invoice.payment_lines:
+                    self.raise_user_error(cursor, 'refund_with_payement',
+                            context=context)
+
+        invoice_ids = invoice_obj.credit(cursor, user, data['ids'],
+                refund=refund, context=context)
+
+        model_data_ids = model_data_obj.search(cursor, user, [
+            ('fs_id', '=', 'act_invoice_form'),
+            ('module', '=', 'account_invoice'),
+            ('inherit', '=', False),
+            ], limit=1, context=context)
+        model_data = model_data_obj.browse(cursor, user, model_data_ids[0],
                 context=context)
-        # Restart the cache on the fields_view_get method of account.invoice.line
-        account_invoice_line_obj.fields_view_get(cursor.dbname)
+        res = act_window_obj.read(cursor, user, model_data.db_id, context=context)
+        res['res_id'] = invoice_ids
+        if len(invoice_ids) == 1:
+            res['views'].reverse()
         return res
 
-Account()
+CreditInvoice()
diff --git a/invoice.xml b/invoice.xml
index 2a476ca..3df7d21 100644
--- a/invoice.xml
+++ b/invoice.xml
@@ -3,22 +3,1024 @@
 this repository contains the full copyright notices and license terms. -->
 <tryton>
     <data>
+        <menuitem name="Payment Terms" parent="account.menu_account_configuration"
+            id="menu_payment_terms_configuration"/>
+        <menuitem name="Invoices" parent="account.menu_account"
+            id="menu_invoices" sequence="20"/>
+
+        <record model="ir.action.wizard" id="wizard_pay_invoice">
+            <field name="name">Pay Invoice</field>
+            <field name="wiz_name">account.invoice.pay_invoice</field>
+            <field name="model">account.invoice</field>
+        </record>
+
+        <record model="ir.ui.view" id="invoice_view_form">
+            <field name="model">account.invoice</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <form string="Invoice" col="6" cursor="party">
+                    <label name="type"/>
+                    <field name="type"/>
+                    <label name="journal"/>
+                    <field name="journal"/>
+                    <label name="number"/>
+                    <field name="number"/>
+                    <label name="party"/>
+                    <field name="party"/>
+                    <label name="invoice_address"/>
+                    <field name="invoice_address"/>
+                    <newline/>
+                    <label name="description"/>
+                    <field name="description" colspan="3"/>
+                    <label name="reference"/>
+                    <field name="reference"/>
+                    <notebook colspan="6">
+                        <page string="Invoice" id="invoice" col="6">
+                            <label name="invoice_date"/>
+                            <field name="invoice_date"/>
+                            <label name="payment_term"/>
+                            <field name="payment_term"/>
+                            <label name="currency"/>
+                            <field name="currency"/>
+                            <field name="lines" colspan="6">
+                                <tree string="Lines" sequence="sequence" fill="1">
+                                    <field name="type"/>
+                                    <field name="product" select="1"/>
+                                    <field name="account" tree_invisible="1"/>
+                                    <field name="description"/>
+                                    <field name="quantity" select="1"/>
+                                    <field name="unit" select="2"/>
+                                    <field name="unit_price" select="2"/>
+                                    <field name="taxes"/>
+                                    <field name="amount"/>
+                                    <field name="sequence" tree_invisible="1"/>
+                                    <field name="unit_digits" tree_invisible="1"/>
+                                    <field name="currency_digits" tree_invisible="1"/>
+                                </tree>
+                            </field>
+                            <group col="2" colspan="6" id="taxes_amount_state_buttons">
+                                <group col="1" colspan="1" id="taxes">
+                                    <field name="taxes">
+                                        <tree string="Taxes" sequence="sequence" fill="1">
+                                            <field name="description"/>
+                                            <field name="base"/>
+                                            <field name="amount"/>
+                                            <field name="sequence" tree_invisible="1"/>
+                                            <field name="manual" tree_invisible="1"/>
+                                            <field name="base_code" tree_invisible="1"/>
+                                            <field name="base_sign" tree_invisible="1"/>
+                                            <field name="tax_code" tree_invisible="1"/>
+                                            <field name="tax_sign" tree_invisible="1"/>
+                                            <field name="account" tree_invisible="1"/>
+                                        </tree>
+                                    </field>
+                                </group>
+                                <group col="2" colspan="1" id="amount_state_buttons">
+                                    <label name="untaxed_amount"/>
+                                    <field name="untaxed_amount"/>
+                                    <label name="tax_amount"/>
+                                    <field name="tax_amount"/>
+                                    <label name="total_amount"/>
+                                    <field name="total_amount"/>
+                                    <group col="4" colspan="2" id="reconciled_state">
+                                        <label name="reconciled"/>
+                                        <field name="reconciled" xexpand="0"/>
+                                        <label name="state"/>
+                                        <field name="state"/>
+                                    </group>
+                                    <group col="5" colspan="2" id="buttons">
+                                        <button name="cancel" string="_Cancel"
+                                            states="{'invisible': '''state not in ('draft', 'proforma') ''', 'readonly': ''' %(account.group_account)d not in groups '''}"
+                                            icon="tryton-cancel"/>
+                                        <button name="button_draft" string="_Reset to Draft"
+                                            type="object"
+                                            states="{'invisible': '''state != 'cancel' '''}"
+                                            icon="tryton-clear"/>
+                                        <button name="draft" string="_Draft"
+                                            states="{'invisible': '''state != 'proforma' '''}"
+                                            icon="tryton-go-previous"/>
+                                        <button name="proforma" string="Pro For_ma"
+                                            states="{'invisible': '''state != 'draft' '''}"
+                                            icon="tryton-go-next"/>
+                                        <button name="open" string="_Open"
+                                            states="{'invisible': '''state not in ('draft', 'proforma') ''', 'readonly': ''' %(account.group_account)d not in groups '''}"
+                                            icon="tryton-ok"/>
+                                        <button name="%(wizard_pay_invoice)d" string="_Pay"
+                                            type="action"
+                                            states="{'invisible': '''state != 'open' ''', 'readonly': ''' %(account.group_account)d not in groups '''}"
+                                            icon="tryton-go-next"/>
+                                    </group>
+                                </group>
+                            </group>
+                        </page>
+                        <page string="Other Info" id="info">
+                            <label name="company"/>
+                            <field name="company"/>
+                            <label name="account"/>
+                            <field name="account"/>
+                            <label name="accounting_date"/>
+                            <field name="accounting_date"/>
+                            <label name="move"/>
+                            <field name="move"/>
+                            <label name="invoice_report"/>
+                            <field name="invoice_report"/>
+                            <separator name="comment" colspan="4"/>
+                            <field name="comment" colspan="4" spell="party_lang"/>
+                        </page>
+                        <page string="Payment" id="payment">
+                            <label name="amount_to_pay_today"/>
+                            <field name="amount_to_pay_today"/>
+                            <label name="amount_to_pay"/>
+                            <field name="amount_to_pay"/>
+                            <separator name="payment_lines" colspan="4"/>
+                            <field name="payment_lines" colspan="4">
+                                <tree string="Payment Lines">
+                                    <field name="date"/>
+                                    <field name="debit" sum="Debit"/>
+                                    <field name="credit" sum="Credit"/>
+                                    <field name="amount_second_currency"
+                                        sum="Amount Second Currency"/>
+                                    <field name="second_currency"/>
+                                    <field name="currency_digits" tree_invisible="1"/>
+                                    <field name="second_currency_digits" tree_invisible="1"/>
+                                </tree>
+                            </field>
+                        </page>
+                    </notebook>
+                    <field name="currency_digits" invisible="1" colspan="6"/>
+                    <field name="party_lang" invisible="1" colspan="6"/>
+                </form>
+                ]]>
+            </field>
+        </record>
+        <record model="ir.ui.view" id="invoice_view_tree">
+            <field name="model">account.invoice</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <tree string="Invoices">
+                    <field name="type" select="2"/>
+                    <field name="number" select="1"/>
+                    <field name="reference" select="1"/>
+                    <field name="invoice_date" select="2"/>
+                    <field name="party" select="1"/>
+                    <field name="currency" select="2"/>
+                    <field name="untaxed_amount" select="2"/>
+                    <field name="tax_amount" select="2"/>
+                    <field name="total_amount" select="2"/>
+                    <field name="state" select="2"/>
+                    <field name="amount_to_pay_today"/>
+                    <field name="description" select="2"/>
+                    <field name="currency_digits" tree_invisible="1"/>
+                </tree>
+                ]]>
+            </field>
+        </record>
+        <record model="ir.action.act_window" id="act_invoice_form">
+            <field name="name">All Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_form_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_form"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_form_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_form"/>
+        </record>
+        <menuitem parent="menu_invoices" action="act_invoice_form"
+            id="menu_invoice_form" sequence="5"/>
+
+        <record model="ir.action.act_window" id="act_invoice_out_invoice_form">
+            <field name="name">Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'out_invoice')]</field>
+            <field name="context">{'type': 'out_invoice'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_out_invoice_form"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_out_invoice_form"/>
+        </record>
+        <menuitem parent="menu_invoices" action="act_invoice_out_invoice_form"
+            id="menu_invoice_out_invoice_form" sequence="1"/>
+
+        <record model="ir.action.act_window" id="act_invoice_out_invoice_form2">
+            <field name="name">Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'out_invoice')]</field>
+            <field name="context">{'type': 'out_invoice'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form2_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_out_invoice_form2"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form2_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_out_invoice_form2"/>
+        </record>
+        <menuitem name="New Invoice" parent="menu_invoice_out_invoice_form"
+            action="act_invoice_out_invoice_form2"
+            id="menu_invoice_out_invoice_form2" sequence="1"/>
+
+        <record model="ir.action.act_window" id="act_invoice_out_invoice_form3">
+            <field name="name">Draft Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'out_invoice'), ('state', '=', 'draft')]</field>
+            <field name="context">{'type': 'out_invoice'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form3_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_out_invoice_form3"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form3_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_out_invoice_form3"/>
+        </record>
+        <menuitem parent="menu_invoice_out_invoice_form" action="act_invoice_out_invoice_form3"
+            id="menu_invoice_out_invoice_form3" sequence="2"/>
+
+        <record model="ir.action.act_window" id="act_invoice_out_invoice_form4">
+            <field name="name">Pro Forma Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'out_invoice'), ('state', '=', 'proforma')]</field>
+            <field name="context">{'type': 'out_invoice'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form4_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_out_invoice_form4"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form4_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_out_invoice_form4"/>
+        </record>
+        <menuitem parent="menu_invoice_out_invoice_form" action="act_invoice_out_invoice_form4"
+            id="menu_invoice_out_invoice_form4" sequence="3"/>
+
+        <record model="ir.action.act_window" id="act_invoice_out_invoice_form5">
+            <field name="name">Opened Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'out_invoice'), ('state', '=', 'open')]</field>
+            <field name="context">{'type': 'out_invoice'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form5_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_out_invoice_form5"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_invoice_form5_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_out_invoice_form5"/>
+        </record>
+        <menuitem parent="menu_invoice_out_invoice_form" action="act_invoice_out_invoice_form5"
+            id="menu_invoice_out_invoice_form5" sequence="4"/>
+
+        <record model="ir.action.act_window" id="act_invoice_out_credit_note_form">
+            <field name="name">Credit Notes</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'out_credit_note')]</field>
+            <field name="context">{'type': 'out_credit_note'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_out_credit_note_form"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_out_credit_note_form"/>
+        </record>
+        <menuitem parent="menu_invoices" action="act_invoice_out_credit_note_form"
+            id="menu_invoice_out_credit_note_form" sequence="2"/>
+
+        <record model="ir.action.act_window" id="act_invoice_out_credit_note_form2">
+            <field name="name">Credit Notes</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'out_credit_note')]</field>
+            <field name="context">{'type': 'out_credit_note'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form2_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_out_credit_note_form2"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form2_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_out_credit_note_form2"/>
+        </record>
+        <menuitem name="New Credit Note" parent="menu_invoice_out_credit_note_form"
+            action="act_invoice_out_credit_note_form2"
+            id="menu_invoice_out_credit_note_form2" sequence="1"/>
+
+        <record model="ir.action.act_window" id="act_invoice_out_credit_note_form3">
+            <field name="name">Draft Credit Notes</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'out_credit_note'), ('domain', '=', 'draft')]</field>
+            <field name="context">{'type': 'out_credit_note'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form3_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_out_credit_note_form3"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form3_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_out_credit_note_form3"/>
+        </record>
+        <menuitem parent="menu_invoice_out_credit_note_form" action="act_invoice_out_credit_note_form3"
+            id="menu_invoice_out_credit_note_form3" sequence="2"/>
+
+        <record model="ir.action.act_window" id="act_invoice_out_credit_note_form4">
+            <field name="name">Pro Forma Credit Notes</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'out_credit_note'), ('domain', '=', 'proforma')]</field>
+            <field name="context">{'type': 'out_credit_note'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form4_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_out_credit_note_form4"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form4_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_out_credit_note_form4"/>
+        </record>
+        <menuitem parent="menu_invoice_out_credit_note_form" action="act_invoice_out_credit_note_form4"
+            id="menu_invoice_out_credit_note_form4" sequence="3"/>
+
+        <record model="ir.action.act_window" id="act_invoice_out_credit_note_form5">
+            <field name="name">Opened Credit Notes</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'out_credit_note'), ('domain', '=', 'open')]</field>
+            <field name="context">{'type': 'out_credit_note'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form5_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_out_credit_note_form5"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_out_credit_note_form5_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_out_credit_note_form5"/>
+        </record>
+        <menuitem parent="menu_invoice_out_credit_note_form" action="act_invoice_out_credit_note_form5"
+            id="menu_invoice_out_credit_note_form5" sequence="4"/>
+
+        <record model="ir.action.act_window" id="act_invoice_in_invoice_form">
+            <field name="name">Supplier Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'in_invoice')]</field>
+            <field name="context">{'type': 'in_invoice'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_in_invoice_form"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_in_invoice_form"/>
+        </record>
+        <menuitem parent="menu_invoices" action="act_invoice_in_invoice_form"
+            id="menu_invoice_in_invoice_form" sequence="3"/>
+
+        <record model="ir.action.act_window" id="act_invoice_in_invoice_form2">
+            <field name="name">Supplier Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'in_invoice')]</field>
+            <field name="context">{'type': 'in_invoice'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form2_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_in_invoice_form2"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form2_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_in_invoice_form2"/>
+        </record>
+        <menuitem name="New Supplier Invoice" parent="menu_invoice_in_invoice_form"
+            action="act_invoice_in_invoice_form2"
+            id="menu_invoice_in_invoice_form2" sequence="1"/>
+
+        <record model="ir.action.act_window" id="act_invoice_in_invoice_form3">
+            <field name="name">Draft Supplier Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'in_invoice'), ('state', '=', 'draft')]</field>
+            <field name="context">{'type': 'in_invoice'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form3_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_in_invoice_form3"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form3_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_in_invoice_form3"/>
+        </record>
+        <menuitem parent="menu_invoice_in_invoice_form" action="act_invoice_in_invoice_form3"
+            id="menu_invoice_in_invoice_form3" sequence="2"/>
+
+        <record model="ir.action.act_window" id="act_invoice_in_invoice_form4">
+            <field name="name">Pro Forma Supplier Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'in_invoice'), ('state', '=', 'proforma')]</field>
+            <field name="context">{'type': 'in_invoice'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form4_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_in_invoice_form4"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form4_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_in_invoice_form4"/>
+        </record>
+        <menuitem parent="menu_invoice_in_invoice_form" action="act_invoice_in_invoice_form4"
+            id="menu_invoice_in_invoice_form4" sequence="3"/>
+
+        <record model="ir.action.act_window" id="act_invoice_in_invoice_form5">
+            <field name="name">Opened Supplier Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'in_invoice'), ('state', '=', 'open')]</field>
+            <field name="context">{'type': 'in_invoice'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form5_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_in_invoice_form5"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_invoice_form5_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_in_invoice_form5"/>
+        </record>
+        <menuitem parent="menu_invoice_in_invoice_form" action="act_invoice_in_invoice_form5"
+            id="menu_invoice_in_invoice_form5" sequence="4"/>
+
+        <record model="ir.action.act_window" id="act_invoice_in_credit_note_form">
+            <field name="name">Supplier Credit Notes</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'in_credit_note')]</field>
+            <field name="context">{'type': 'in_credit_note'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_in_credit_note_form"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_in_credit_note_form"/>
+        </record>
+        <menuitem parent="menu_invoices" action="act_invoice_in_credit_note_form"
+            id="menu_invoice_in_credit_note_form" sequence="4"/>
+
+        <record model="ir.action.act_window" id="act_invoice_in_credit_note_form2">
+            <field name="name">Supplier Credit Notes</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'in_credit_note')]</field>
+            <field name="context">{'type': 'in_credit_note'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form2_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_in_credit_note_form2"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form2_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_in_credit_note_form2"/>
+        </record>
+        <menuitem name="New Supplier Credit Note" parent="menu_invoice_in_credit_note_form"
+            action="act_invoice_in_credit_note_form2"
+            id="menu_invoice_in_credit_note_form2" sequence="1"/>
+
+        <record model="ir.action.act_window" id="act_invoice_in_credit_note_form3">
+            <field name="name">Draft Supplier Credit Notes</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'in_credit_note'), ('state', '=', 'draft')]</field>
+            <field name="context">{'type': 'in_credit_note'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form3_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_in_credit_note_form3"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form3_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_in_credit_note_form3"/>
+        </record>
+        <menuitem parent="menu_invoice_in_credit_note_form" action="act_invoice_in_credit_note_form3"
+            id="menu_invoice_in_credit_note_form3" sequence="2"/>
+
+        <record model="ir.action.act_window" id="act_invoice_in_credit_note_form4">
+            <field name="name">Pro Forma Supplier Credit Notes</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'in_credit_note'), ('state', '=', 'proforma')]</field>
+            <field name="context">{'type': 'in_credit_note'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form4_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_in_credit_note_form4"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form4_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_in_credit_note_form4"/>
+        </record>
+        <menuitem parent="menu_invoice_in_credit_note_form" action="act_invoice_in_credit_note_form4"
+            id="menu_invoice_in_credit_note_form4" sequence="3"/>
+
+        <record model="ir.action.act_window" id="act_invoice_in_credit_note_form5">
+            <field name="name">Opened Supplier Credit Notes</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[('type', '=', 'in_credit_note'), ('state', '=', 'open')]</field>
+            <field name="context">{'type': 'in_credit_note'}</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form5_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="invoice_view_tree"/>
+            <field name="act_window" ref="act_invoice_in_credit_note_form5"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_invoice_in_credit_note_form5_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="invoice_view_form"/>
+            <field name="act_window" ref="act_invoice_in_credit_note_form5"/>
+        </record>
+        <menuitem parent="menu_invoice_in_credit_note_form" action="act_invoice_in_credit_note_form5"
+            id="menu_invoice_in_credit_note_form5" sequence="4"/>
+
+        <record model="ir.model.access" id="access_invoice">
+            <field name="model" search="[('model', '=', 'account.invoice')]"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="False"/>
+            <field name="perm_create" eval="True"/>
+            <field name="perm_delete" eval="False"/>
+        </record>
+        <record model="ir.model.access" id="access_invoice_account">
+            <field name="model" search="[('model', '=', 'account.invoice')]"/>
+            <field name="group" ref="account.group_account"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="True"/>
+            <field name="perm_create" eval="True"/>
+            <field name="perm_delete" eval="True"/>
+        </record>
+        <record model="ir.action.report" id="report_invoice">
+            <field name="name">Invoice</field>
+            <field name="model">account.invoice</field>
+            <field name="report_name">account.invoice</field>
+            <field name="report">account_invoice/invoice.odt</field>
+            <field name="style">company/header_A4.odt</field>
+        </record>
+        <record model="ir.sequence.type" id="sequence_type_account_invoice">
+            <field name="name">Invoice</field>
+            <field name="code">account.invoice</field>
+        </record>
+        <record model="workflow" id="invoice_workflow">
+            <field name="name">Invoice workflow</field>
+            <field name="osv">account.invoice</field>
+            <field name="on_create" eval="True"/>
+        </record>
+        <record model="workflow.activity" id="invoice_activity_draft">
+            <field name="name">Draft</field>
+            <field name="workflow" ref="invoice_workflow"/>
+            <field name="kind">function</field>
+            <field name="action">write({'state': 'draft'})</field>
+            <field name="flow_start" eval="True"/>
+        </record>
+        <record model="workflow.activity" id="invoice_activity_proforma">
+            <field name="name">Pro forma</field>
+            <field name="workflow" ref="invoice_workflow"/>
+            <field name="kind">function</field>
+            <field name="action">write({'state': 'proforma'})</field>
+        </record>
+        <record model="workflow.activity" id="invoice_activity_open">
+            <field name="name">Open</field>
+            <field name="workflow" ref="invoice_workflow"/>
+            <field name="kind">function</field>
+            <field name="action">set_number()
create_move()
write({'state': 'open'})
print_invoice()</field>
+        </record>
+        <record model="workflow.activity" id="invoice_activity_paid">
+            <field name="name">Paid</field>
+            <field name="workflow" ref="invoice_workflow"/>
+            <field name="kind">function</field>
+            <field name="action">write({'state': 'paid'})</field>
+            <field name="flow_stop" eval="True"/>
+        </record>
+        <record model="workflow.activity" id="invoice_activity_cancel">
+            <field name="name">Canceled</field>
+            <field name="workflow" ref="invoice_workflow"/>
+            <field name="kind">function</field>
+            <field name="action">write({'state': 'cancel'})</field>
+            <field name="flow_stop" eval="True"/>
+        </record>
+        <record model="workflow.transition" id="invoice_transition_draft_proforma">
+            <field name="act_from" ref="invoice_activity_draft"/>
+            <field name="act_to" ref="invoice_activity_proforma"/>
+            <field name="signal">proforma</field>
+        </record>
+        <record model="workflow.transition" id="invoice_transition_proforma_draft">
+            <field name="act_from" ref="invoice_activity_proforma"/>
+            <field name="act_to" ref="invoice_activity_draft"/>
+            <field name="signal">draft</field>
+        </record>
+        <record model="workflow.transition" id="invoice_transition_draft_open">
+            <field name="act_from" ref="invoice_activity_draft"/>
+            <field name="act_to" ref="invoice_activity_open"/>
+            <field name="signal">open</field>
+            <field name="group" ref="account.group_account"/>
+        </record>
+        <record model="workflow.transition" id="invoice_transition_proforma_open">
+            <field name="act_from" ref="invoice_activity_proforma"/>
+            <field name="act_to" ref="invoice_activity_open"/>
+            <field name="signal">open</field>
+            <field name="group" ref="account.group_account"/>
+        </record>
+        <record model="workflow.transition" id="invoice_transition_open_paid">
+            <field name="act_from" ref="invoice_activity_open"/>
+            <field name="act_to" ref="invoice_activity_paid"/>
+            <field name="trigger_model">account.move.line</field>
+            <field name="trigger_expr_id">[x.id for x in lines_to_pay]</field>
+            <field name="condition">reconciled</field>
+        </record>
+        <record model="workflow.transition" id="invoice_transition_draft_cancel">
+            <field name="act_from" ref="invoice_activity_draft"/>
+            <field name="act_to" ref="invoice_activity_cancel"/>
+            <field name="signal">cancel</field>
+            <field name="group" ref="account.group_account"/>
+        </record>
+        <record model="workflow.transition" id="invoice_transition_proforma_cancel">
+            <field name="act_from" ref="invoice_activity_proforma"/>
+            <field name="act_to" ref="invoice_activity_cancel"/>
+            <field name="signal">cancel</field>
+            <field name="group" ref="account.group_account"/>
+        </record>
+
         <record model="ir.ui.view" id="invoice_line_view_form">
             <field name="model">account.invoice.line</field>
-            <field name="inherit" ref="account_invoice.invoice_line_view_form"/>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <form string="Invoice Line" cursor="product">
+                    <label name="invoice"/>
+                    <field name="invoice" colspan="3"/>
+                    <notebook colspan="4">
+                        <page string="General" id="general">
+                            <label name="type"/>
+                            <field name="type"/>
+                            <label name="sequence"/>
+                            <field name="sequence"/>
+                            <label name="product"/>
+                            <field name="product">
+                                <tree string="Products">
+                                    <field name="name" select="1"/>
+                                    <field name="code" select="1"/>
+                                    <field name="list_price_uom" select="2"/>
+                                    <field name="cost_price_uom" select="2"/>
+                                    <field name="default_uom" select="2"/>
+                                    <field name="active" select="2"/>
+                                </tree>
+                            </field>
+                            <label name="account"/>
+                            <field name="account"/>
+                            <newline/>
+                            <label name="description"/>
+                            <field name="description" colspan="3"
+                                spell="_parent_invoice.party_lang"/>
+                            <label name="quantity"/>
+                            <field name="quantity"/>
+                            <label name="unit"/>
+                            <field name="unit"/>
+                            <label name="unit_price"/>
+                            <field name="unit_price"/>
+                            <label name="amount"/>
+                            <field name="amount"/>
+                            <separator name="taxes" colspan="4"/>
+                            <field name="taxes" colspan="4"/>
+                        </page>
+                        <page string="Notes" id="notes">
+                            <separator name="note" colspan="4"/>
+                            <field name="note" colspan="4"
+                                spell="_parent_invoice.party_lang"/>
+                        </page>
+                    </notebook>
+                    <field name="unit_digits" invisible="1" colspan="4"/>
+                    <field name="currency_digits" invisible="1" colspan="4"/>
+                </form>
+                ]]>
+            </field>
+        </record>
+        <record model="ir.ui.view" id="invoice_line_view_tree">
+            <field name="model">account.invoice.line</field>
+            <field name="type">tree</field>
             <field name="arch" type="xml">
                 <![CDATA[
-                <data>
-                    <xpath
-                        expr="/form/notebook/page/separator[@name="taxes"]"
-                        position="before">
-                        <group col="4" colspan="4" name="analytic_accounts">
-                            <field name="analytic_accounts"/>
-                        </group>
-                    </xpath>
-                </data>
+                <tree string="Invoice Lines">
+                    <field name="invoice" select="1"/>
+                    <field name="type" select="1"/>
+                    <field name="product" select="1"/>
+                    <field name="account" select="2"/>
+                    <field name="description" select="1"/>
+                    <field name="quantity" select="2"/>
+                    <field name="unit" select="2"/>
+                    <field name="unit_price" select="2"/>
+                    <field name="taxes"/>
+                    <field name="amount"/>
+                    <field name="unit_digits" tree_invisible="1"/>
+                    <field name="currency_digits" tree_invisible="1"/>
+                </tree>
                 ]]>
             </field>
         </record>
+        <record model="ir.model.access" id="access_invoice_line">
+            <field name="model" search="[('model', '=', 'account.invoice.line')]"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="False"/>
+            <field name="perm_create" eval="True"/>
+            <field name="perm_delete" eval="False"/>
+        </record>
+        <record model="ir.model.access" id="access_invoice_line_account">
+            <field name="model" search="[('model', '=', 'account.invoice.line')]"/>
+            <field name="group" ref="account.group_account"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="True"/>
+            <field name="perm_create" eval="True"/>
+            <field name="perm_delete" eval="True"/>
+        </record>
+
+        <record model="ir.ui.view" id="invoice_tax_view_form">
+            <field name="model">account.invoice.tax</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <form string="Invoice Tax">
+                    <label name="invoice"/>
+                    <field name="invoice" colspan="3"/>
+                    <label name="description"/>
+                    <field name="description"/>
+                    <label name="sequence"/>
+                    <field name="sequence"/>
+                    <label name="account"/>
+                    <field name="account"/>
+                    <label name="manual"/>
+                    <field name="manual"/>
+                    <group col="6" colspan="4" string="Tax Code" id="tax_code">
+                        <label name="amount"/>
+                        <field name="amount"/>
+                        <label name="tax_code"/>
+                        <field name="tax_code"/>
+                        <label name="tax_sign"/>
+                        <field name="tax_sign"/>
+                        <label name="base"/>
+                        <field name="base"/>
+                        <label name="base_code"/>
+                        <field name="base_code"/>
+                        <label name="base_sign"/>
+                        <field name="base_sign"/>
+                    </group>
+                    <field name="tax" colspan="4" invisible="1"/>
+                </form>
+                ]]>
+            </field>
+        </record>
+        <record model="ir.ui.view" id="invoice_tax_view_tree">
+            <field name="model">account.invoice.tax</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <tree string="Invoice Taxes">
+                    <field name="invoice" select="1"/>
+                    <field name="description" select="1"/>
+                    <field name="account" select="1"/>
+                    <field name="manual" select="2"/>
+                    <field name="base"/>
+                    <field name="amount"/>
+                    <field name="tax" tree_invisible="1"/>
+                </tree>
+                ]]>
+            </field>
+        </record>
+        <record model="ir.model.access" id="access_invoice_tax">
+            <field name="model" search="[('model', '=', 'account.invoice.tax')]"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="False"/>
+            <field name="perm_create" eval="True"/>
+            <field name="perm_delete" eval="False"/>
+        </record>
+        <record model="ir.model.access" id="access_invoice_tax_account">
+            <field name="model" search="[('model', '=', 'account.invoice.tax')]"/>
+            <field name="group" ref="account.group_account"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="True"/>
+            <field name="perm_create" eval="True"/>
+            <field name="perm_delete" eval="True"/>
+        </record>
+
+        <record model="ir.ui.view" id="pay_invoice_init_view_form">
+            <field name="model">account.invoice.pay_invoice.init</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <form string="Pay Invoice">
+                    <label name="amount"/>
+                    <field name="amount"/>
+                    <label name="currency"/>
+                    <field name="currency"/>
+                    <label name="description"/>
+                    <field name="description" colspan="3"/>
+                    <label name="journal"/>
+                    <field name="journal"/>
+                    <label name="date"/>
+                    <field name="date"/>
+                    <field name="currency_digits" colspan="4" invisible="1"/>
+                </form>
+                ]]>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="pay_invoice_ask_view_form">
+            <field name="model">account.invoice.pay_invoice.ask</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <form string="Pay Invoice">
+                    <label name="type"/>
+                    <field name="type" colspan="3"/>
+                    <label name="amount"/>
+                    <field name="amount"/>
+                    <label name="currency"/>
+                    <field name="currency"/>
+                    <label name="amount_writeoff"/>
+                    <field name="amount_writeoff"/>
+                    <label name="currency_writeoff"/>
+                    <field name="currency_writeoff"/>
+                    <label name="account_writeoff"/>
+                    <field name="account_writeoff"/>
+                    <label name="journal_writeoff"/>
+                    <field name="journal_writeoff"/>
+                    <separator name="lines" colspan="4"/>
+                    <field name="lines" colspan="4">
+                        <tree string="Lines to Pay" fill="1">
+                            <field name="maturity_date"/>
+                            <field name="debit" sum="Debit"/>
+                            <field name="credit" sum="Credit"/>
+                            <field name="amount_second_currency" sum="Amount Second Currency"/>
+                            <field name="second_currency"/>
+                            <field name="currency_digits" tree_invisible="1"/>
+                            <field name="second_currency_digits" tree_invisible="1"/>
+                        </tree>
+                    </field>
+                    <separator name="payment_lines" colspan="4"/>
+                    <field name="payment_lines" colspan="4">
+                        <tree string="Payment Lines" fill="1">
+                            <field name="date"/>
+                            <field name="debit" sum="Debit"/>
+                            <field name="credit" sum="Credit"/>
+                            <field name="amount_second_currency" sum="Amount Second Currency"/>
+                            <field name="second_currency"/>
+                            <field name="currency_digits" tree_invisible="1"/>
+                            <field name="second_currency_digits" tree_invisible="1"/>
+                        </tree>
+                    </field>
+                    <field name="description" colspan="4" invisible="1"/>
+                    <field name="journal" colspan="4" invisible="1"/>
+                    <field name="date" colspan="4" invisible="1"/>
+                    <field name="company" colspan="4" invisible="1"/>
+                    <field name="invoice" colspan="4" invisible="1"/>
+                </form>
+                ]]>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="print_invoice_report_warning_view_form">
+            <field name="model">account.invoice.print_invoice_report.warning</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <form string="Print Invoice" col="2">
+                    <separator string="<b>Warning!</b>" colspan="2"
+                        align="0.5" id="warning"/>
+                    <image name="tryton-dialog-information"/>
+                    <group col="1" id="labels">
+                        <label string="You have selected more than one invoice to print."
+                            align="0.0" id="selected"/>
+                        <label string="The invoices will be sent <i>directly</i> to the printer."
+                            align="0.0" id="printer"/>
+                    </group>
+                </form>
+                ]]>
+            </field>
+        </record>
+
+        <record model="ir.action.wizard" id="print_invoice_report">
+            <field name="name">Invoice</field>
+            <field name="wiz_name">account.invoice.print_invoice_report</field>
+            <field name="model">account.invoice</field>
+        </record>
+        <record model="ir.action.keyword" id="print_invoice_report_keyword">
+            <field name="keyword">form_print</field>
+            <field name="model">account.invoice,0</field>
+            <field name="action" ref="print_invoice_report"/>
+        </record>
+
+        <record model="ir.ui.view" id="credit_invoice_init_view_form">
+            <field name="model">account.invoice.credit_invoice.init</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <form string="Credit Invoice" col="2">
+                    <image name="tryton-dialog-information"/>
+                    <group col="2" id="credit_refund">
+                        <label string="Are you sure to credit those/this invoice(s)?"
+                            align="0.0" id="credit" colspan="2"/>
+                        <label name="with_refund"/>
+                        <field name="with_refund"/>
+                    </group>
+                </form>
+                ]]>
+            </field>
+        </record>
+
+        <record model="ir.action.wizard" id="credit_invoice">
+            <field name="name">Credit</field>
+            <field name="wiz_name">account.invoice.credit_invoice</field>
+            <field name="model">account.invoice</field>
+        </record>
+        <record model="ir.action.keyword" id="credit_invoice_keyword">
+            <field name="keyword">form_action</field>
+            <field name="model">account.invoice,0</field>
+            <field name="action" ref="credit_invoice"/>
+        </record>
+
+        <record model="ir.rule.group" id="rule_group_invoice">
+            <field name="model" search="[('model', '=', 'account.invoice')]"/>
+            <field name="global_p" eval="True"/>
+        </record>
+        <record model="ir.rule" id="rule_invoice1">
+            <field name="field" search="[('name', '=', 'company'), ('model.model', '=', 'account.invoice')]"/>
+            <field name="operator">=</field>
+            <field name="operand">User/Current Company</field>
+            <field name="rule_group" ref="rule_group_invoice"/>
+        </record>
+
+        <record model="ir.rule.group" id="rule_group_invoice_line">
+            <field name="model" search="[('model', '=', 'account.invoice.line')]"/>
+            <field name="global_p" eval="True"/>
+        </record>
+        <record model="ir.rule" id="rule_invoice_line1">
+            <field name="field" search="[('name', '=', 'company'), ('model.model', '=', 'account.invoice.line')]"/>
+            <field name="operator">=</field>
+            <field name="operand">User/Current Company</field>
+            <field name="rule_group" ref="rule_group_invoice_line"/>
+        </record>
     </data>
 </tryton>
diff --git a/party.py b/party.py
new file mode 100644
index 0000000..fba7dfc
--- /dev/null
+++ b/party.py
@@ -0,0 +1,22 @@
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
+from trytond.model import ModelView, ModelSQL, fields
+
+
+class Address(ModelSQL, ModelView):
+    _name = 'party.address'
+    invoice = fields.Boolean('Invoice')
+
+Address()
+
+
+class Party(ModelSQL, ModelView):
+    _name = 'party.party'
+    payment_term = fields.Property(type='many2one',
+            relation='account.invoice.payment_term',
+            string='Invoice Payment Term')
+    supplier_payment_term = fields.Property(type='many2one',
+            relation='account.invoice.payment_term',
+            string='Supplier Payment Term')
+
+Party()
diff --git a/party.xml b/party.xml
new file mode 100644
index 0000000..4d89ade
--- /dev/null
+++ b/party.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<tryton>
+    <data>
+        <record model="ir.ui.view" id="address_view_tree">
+            <field name="model">party.address</field>
+            <field name="inherit" ref="party.address_view_tree"/>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <data>
+                    <xpath
+                        expr="/tree/field[@name="active"]" position="after">
+                        <field name="invoice" select="2"/>
+                    </xpath>
+                </data>
+                ]]>
+            </field>
+        </record>
+        <record model="ir.ui.view" id="address_view_form">
+            <field name="model">party.address</field>
+            <field name="inherit" ref="party.address_view_form"/>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <data>
+                    <xpath
+                        expr="/form/group/field[@name="active"]"
+                        position="after">
+                        <label name="invoice"/>
+                        <field name="invoice" xexpand="0" width="25"/>
+                    </xpath>
+                </data>
+                ]]>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="party_view_form">
+            <field name="model">party.party</field>
+            <field name="inherit" ref="party.party_view_form"/>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <data>
+                    <xpath
+                        expr="/form/notebook/page[@id="accounting"]/field[@name="vat_number"]"
+                        position="after">
+                        <separator string="Payment Terms" colspan="4" id="payment_terms"/>
+                        <label name="payment_term"/>
+                        <field name="payment_term"/>
+                        <label name="supplier_payment_term"/>
+                        <field name="supplier_payment_term"/>
+                    </xpath>
+                </data>
+                ]]>
+            </field>
+        </record>
+
+        <record model="ir.action.act_window" id="act_invoice_form2">
+            <field name="name">Invoices</field>
+            <field name="res_model">account.invoice</field>
+            <field name="view_type">form</field>
+            <field name="domain">[("party", "=", active_id)]</field>
+        </record>
+        <record model="ir.action.keyword"
+                id="act_open_invoice_keyword1">
+            <field name="keyword">form_relate</field>
+            <field name="model">party.party,0</field>
+            <field name="action" ref="act_invoice_form2"/>
+        </record>
+
+    </data>
+</tryton>
diff --git a/payment_term.py b/payment_term.py
new file mode 100644
index 0000000..8640332
--- /dev/null
+++ b/payment_term.py
@@ -0,0 +1,221 @@
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
+from trytond.model import ModelView, ModelSQL, fields
+from trytond.backend import TableHandler
+from decimal import Decimal
+import datetime
+import mx.DateTime
+
+
+class PaymentTerm(ModelSQL, ModelView):
+    'Payment Term'
+    _name = 'account.invoice.payment_term'
+    _description = __doc__
+    name = fields.Char('Payment Term', size=None, required=True, translate=True)
+    active = fields.Boolean('Active')
+    description = fields.Text('Description', translate=True)
+    lines = fields.One2Many('account.invoice.payment_term.line', 'payment',
+            'Lines')
+
+    def __init__(self):
+        super(PaymentTerm, self).__init__()
+        self._order.insert(0, ('name', 'ASC'))
+        self._error_messages.update({
+            'invalid_line': 'Invalid payment term line!',
+            'missing_remainder': 'Payment term missing a remainder line!',
+            })
+
+    def default_active(self, cursor, user, context=None):
+        return True
+
+    def compute(self, cursor, user, amount, currency, payment_term, date=None,
+            context=None):
+        '''
+        Return list with (date, amount) for each payment term lines
+        '''
+        #TODO implement business_days
+        # http://pypi.python.org/pypi/BusinessHours/
+        type_obj = self.pool.get('account.invoice.payment_term.line.type')
+        delay_obj = self.pool.get(
+                'account.invoice.payment_term.line.delay')
+        currency_obj = self.pool.get('currency.currency')
+        date_obj = self.pool.get('ir.date')
+
+        res = []
+        if date is None:
+            date = date_obj.today(cursor, user, context=context)
+        remainder = amount
+        for line in payment_term.lines:
+            value = type_obj.get_value(cursor, user, line, remainder, currency,
+                    context)
+            value_date = delay_obj.get_date(cursor, user, line, date, context)
+            if not value or not value_date:
+                if (not remainder) and line.amount:
+                    self.raise_user_error(cursor, 'invalid_line',
+                            context=context)
+                else:
+                    continue
+            res.append((value_date, value))
+            remainder -= value
+        if not currency_obj.is_zero(cursor, user, currency, remainder):
+            self.raise_user_error(cursor, 'missing_remainder',
+                    context=context)
+        return res
+
+PaymentTerm()
+
+
+class PaymentTermLineType(ModelSQL, ModelView):
+    'Payment Term Line Type'
+    _name = 'account.invoice.payment_term.line.type'
+    _description = __doc__
+    name = fields.Char('Name', size=None, translate=True, required=True)
+    code = fields.Char('Code', size=None, required=True)
+
+    def __init__(self):
+        super(PaymentTermLineType, self).__init__()
+        self._sql_constraints += [
+            ('code_uniq', 'UNIQUE(code)', 'The code must be unique!'),
+        ]
+        self._order.insert(0, ('name', 'ASC'))
+
+    def get_value(self, cursor, user, line, amount, currency, context=None):
+        currency_obj = self.pool.get('currency.currency')
+        if line.type == 'fixed':
+            return currency_obj.compute(cursor, user, line.currency,
+                    line.amount, currency, context=context)
+        elif line.type == 'percent':
+            return currency_obj.round(cursor, user, currency,
+                    amount * line.percentage / Decimal('100'))
+        elif line.type == 'remainder':
+            return currency_obj.round(cursor, user, currency, amount)
+        return None
+
+PaymentTermLineType()
+
+
+class PaymentTermLineDelay(ModelSQL, ModelView):
+    'Payment Term Line Delay'
+    _name = 'account.invoice.payment_term.line.delay'
+    _description = __doc__
+    name = fields.Char('Name', size=None, translate=True, required=True)
+    code = fields.Char('Code', size=None, required=True)
+
+    def __init__(self):
+        super(PaymentTermLineDelay, self).__init__()
+        self._sql_constraints += [
+            ('code_uniq', 'UNIQUE(code)', 'The code must be unique!'),
+        ]
+        self._order.insert(0, ('name', 'ASC'))
+
+    def get_date(self, cursor, user, line, date, context=None):
+        value = None
+        if line.delay == 'net_days':
+            value = mx.DateTime.strptime(str(date), '%Y-%m-%d') + \
+                    mx.DateTime.RelativeDateTime(days=line.days)
+        elif line.delay == 'end_month':
+            value = mx.DateTime.strptime(str(date), '%Y-%m-%d') + \
+                    mx.DateTime.RelativeDateTime(days=line.days) + \
+                    mx.DateTime.RelativeDateTime(day=-1)
+        if value:
+            return datetime.date(value.year, value.month, value.day)
+        return None
+
+PaymentTermLineDelay()
+
+
+class PaymentTermLine(ModelSQL, ModelView):
+    'Payment Term Line'
+    _name = 'account.invoice.payment_term.line'
+    _description = __doc__
+    sequence = fields.Integer('Sequence',
+            help='Use to order lines in ascending order')
+    payment = fields.Many2One('account.invoice.payment_term', 'Payment Term',
+            required=True, ondelete="CASCADE")
+    type = fields.Selection('get_type', 'Type', required=True,
+            on_change=['type'])
+    percentage = fields.Numeric('Percentage', digits=(16, 8),
+            states={
+                'invisible': "type != 'percent'",
+                'required': "type == 'percent'",
+            }, help='In %')
+    amount = fields.Numeric('Amount', digits="(16, currency_digits)",
+            states={
+                'invisible': "type != 'fixed'",
+                'required': "type == 'fixed'",
+            })
+    currency = fields.Many2One('currency.currency', 'Currency',
+            states={
+                'invisible': "type != 'fixed'",
+                'required': "type == 'fixed'",
+            })
+    currency_digits = fields.Function('get_currency_digits', type='integer',
+            string='Currency Digits', on_change_with=['currency'])
+    days = fields.Integer('Number of Days')
+    delay = fields.Selection('get_delay', 'Condition', required=True)
+
+    def __init__(self):
+        super(PaymentTermLine, self).__init__()
+        self._order.insert(0, ('sequence', 'ASC'))
+
+    def init(self, cursor, module_name):
+        super(PaymentTermLine, self).init(cursor, module_name)
+        table = TableHandler(cursor, self, module_name)
+
+        # Migration from 1.0 percent change into percentage
+        if table.column_exist('percent'):
+            cursor.execute('UPDATE "' + self._table + '" ' \
+                    'SET percentage = percent * 100')
+            table.drop_column('percent', exception=True)
+
+    def default_type(self, cursor, user, context=None):
+        return 'remainder'
+
+    def default_delay(self, cursor, user, context=None):
+        return 'net_days'
+
+    def get_type(self, cursor, user, context=None):
+        type_obj = self.pool.get('account.invoice.payment_term.line.type')
+        type_ids = type_obj.search(cursor, user, [], context=context)
+        types = type_obj.browse(cursor, user, type_ids, context=context)
+        return [(x.code, x.name) for x in types]
+
+    def get_delay(self, cursor, user, context=None):
+        delay_obj = self.pool.get('account.invoice.payment_term.line.delay')
+        delay_ids = delay_obj.search(cursor, user, [], context=context)
+        delays = delay_obj.browse(cursor, user, delay_ids,
+                context=context)
+        return [(x.code, x.name) for x in delays]
+
+    def on_change_type(self, cursor, user, ids, vals, context=None):
+        if not 'type' in vals:
+            return {}
+        res = {}
+        if vals['type'] != 'fixed':
+            res['amount'] = Decimal('0.0')
+            res['currency'] =  False
+        if vals['type'] != 'percent':
+            res['percentage'] =  Decimal('0.0')
+        return res
+
+    def on_change_with_currency_digits(self, cursor, user, ids, vals,
+            context=None):
+        currency_obj = self.pool.get('currency.currency')
+        if vals.get('currency'):
+            currency = currency_obj.browse(cursor, user, vals['currency'],
+                    context=context)
+            return currency.digits
+        return 2
+
+    def get_currency_digits(self, cursor, user, ids, name, arg, context=None):
+        res = {}
+        for line in self.browse(cursor, user, ids, context=context):
+            if line.currency:
+                res[line.id] = line.currency.digits
+            else:
+                res[line.id] = 2
+        return res
+
+PaymentTermLine()
+
+
diff --git a/payment_term.xml b/payment_term.xml
new file mode 100644
index 0000000..449b414
--- /dev/null
+++ b/payment_term.xml
@@ -0,0 +1,149 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<tryton>
+    <data>
+        <record model="ir.ui.view" id="payment_term_view_form">
+            <field name="model">account.invoice.payment_term</field>
+            <field name="type">form</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <form string="Payment Term">
+                    <label name="name"/>
+                    <field name="name"/>
+                    <label name="active"/>
+                    <field name="active" xexpand="0" width="100"/>
+                    <field name="description" colspan="4"/>
+                    <field name="lines" colspan="4">
+                        <tree string="Payment Term Line" sequence="sequence">
+                            <field name="type"/>
+                            <field name="percentage"/>
+                            <field name="amount"/>
+                            <field name="currency"/>
+                            <field name="days"/>
+                            <field name="delay"/>
+                            <field name="sequence" tree_invisible="1"/>
+                            <field name="currency_digits" tree_invisible="1"/>
+                        </tree>
+                        <form string="Payment Term Lines">
+                            <label name="type"/>
+                            <field name="type"/>
+                            <group col="1" id="label_amount_percent">
+                                <label name="percentage" fill="1" xexpand="1" expand="1"/>
+                                <label name="amount" fill="1" xexpand="1" expand="1"/>
+                            </group>
+                            <group col="3" id="amount_percent">
+                                <field name="percentage" colspan="3"/>
+                                <field name="amount"/>
+                                <label name="currency"/>
+                                <field name="currency"/>
+                            </group>
+                            <label name="days"/>
+                            <field name="days"/>
+                            <label name="delay"/>
+                            <field name="delay"/>
+                            <field name="currency_digits" invisible="1"/>
+                        </form>
+                    </field>
+                </form>
+                ]]>
+            </field>
+        </record>
+        <record model="ir.ui.view" id="payment_term_view_tree">
+            <field name="model">account.invoice.payment_term</field>
+            <field name="type">tree</field>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <tree string="Payment Terms">
+                    <field name="name" select="1"/>
+                    <field name="active" select="1"/>
+                </tree>
+                ]]>
+            </field>
+        </record>
+        <record model="ir.action.act_window" id="act_payment_term_form">
+            <field name="name">Payment Terms</field>
+            <field name="res_model">account.invoice.payment_term</field>
+            <field name="view_type">form</field>
+        </record>
+        <record model="ir.action.act_window.view" id="act_payment_term_form_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="payment_term_view_tree"/>
+            <field name="act_window" ref="act_payment_term_form"/>
+        </record>
+        <record model="ir.action.act_window.view" id="act_payment_term_form_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="payment_term_view_form"/>
+            <field name="act_window" ref="act_payment_term_form"/>
+        </record>
+        <record model="ir.model.access" id="access_payment_term">
+            <field name="model" search="[('model', '=', 'account.invoice.payment_term')]"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="False"/>
+            <field name="perm_create" eval="False"/>
+            <field name="perm_delete" eval="False"/>
+        </record>
+        <record model="ir.model.access" id="access_payment_term_account_admin">
+            <field name="model" search="[('model', '=', 'account.invoice.payment_term')]"/>
+            <field name="group" ref="account.group_account_admin"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="True"/>
+            <field name="perm_create" eval="True"/>
+            <field name="perm_delete" eval="True"/>
+        </record>
+        <record model="ir.model.access" id="access_payment_term_line">
+            <field name="model" search="[('model', '=', 'account.invoice.payment_term.line')]"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="False"/>
+            <field name="perm_create" eval="False"/>
+            <field name="perm_delete" eval="False"/>
+        </record>
+        <record model="ir.model.access" id="access_payment_term_line_account_admin">
+            <field name="model"
+                search="[('model', '=', 'account.invoice.payment_term.line')]"/>
+            <field name="group" ref="account.group_account_admin"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="True"/>
+            <field name="perm_create" eval="True"/>
+            <field name="perm_delete" eval="True"/>
+        </record>
+
+        <menuitem parent="menu_payment_terms_configuration"
+            action="act_payment_term_form" id="menu_payment_term_form"/>
+
+        <record model="account.invoice.payment_term.line.type"
+            id="payment_term_line_type_fixed">
+            <field name="name">Fixed</field>
+            <field name="code">fixed</field>
+        </record>
+        <record model="account.invoice.payment_term.line.type"
+            id="payment_term_line_type_percent">
+            <field name="name">Percentage</field>
+            <field name="code">percent</field>
+        </record>
+        <record model="account.invoice.payment_term.line.type"
+            id="payment_term_line_type_remainder">
+            <field name="name">Remainder</field>
+            <field name="code">remainder</field>
+        </record>
+
+        <record model="account.invoice.payment_term.line.delay"
+            id="payment_term_line_delay_net_days">
+            <field name="name">Net Days</field>
+            <field name="code">net_days</field>
+        </record>
+        <record model="account.invoice.payment_term.line.delay"
+            id="payment_term_line_delay_end_month">
+            <field name="name">End Month</field>
+            <field name="code">end_month</field>
+        </record>
+        <record model="ir.model.access" id="access_payment_term_line_type">
+            <field name="model"
+                search="[('model', '=', 'account.invoice.payment_term.line.type')]"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="False"/>
+            <field name="perm_create" eval="False"/>
+            <field name="perm_delete" eval="False"/>
+        </record>
+    </data>
+</tryton>
diff --git a/setup.py b/setup.py
index b0e0eec..0c8de7e 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ import re
 
 info = eval(file('__tryton__.py').read())
 
-requires = []
+requires = ['egenix-mx-base']
 for dep in info.get('depends', []):
     match = re.compile(
             '(ir|res|workflow|webdav)((\s|$|<|>|<=|>=|==|!=).*?$)').match(dep)
@@ -21,7 +21,7 @@ major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
 requires.append('trytond >= %s.%s' % (major_version, minor_version))
 requires.append('trytond < %s.%s' % (major_version, str(int(minor_version) + 1)))
 
-setup(name='trytond_analytic_invoice',
+setup(name='trytond_account_invoice',
     version=info.get('version', '0.0.1'),
     description=info.get('description', ''),
     author=info.get('author', ''),
@@ -29,13 +29,14 @@ setup(name='trytond_analytic_invoice',
     url=info.get('website', ''),
     download_url="http://downloads.tryton.org/" + \
             info.get('version', '0.0.1').rsplit('.', 1)[0] + '/',
-    package_dir={'trytond.modules.analytic_invoice': '.'},
+    package_dir={'trytond.modules.account_invoice': '.'},
     packages=[
-        'trytond.modules.analytic_invoice',
+        'trytond.modules.account_invoice',
     ],
     package_data={
-        'trytond.modules.analytic_invoice': info.get('xml', []) \
-                + info.get('translation', []),
+        'trytond.modules.account_invoice': info.get('xml', []) \
+                + info.get('translation', []) \
+                + ['invoice.odt'],
     },
     classifiers=[
         'Development Status :: 5 - Production/Stable',
@@ -58,6 +59,6 @@ setup(name='trytond_analytic_invoice',
     zip_safe=False,
     entry_points="""
     [trytond.modules]
-    analytic_invoice = trytond.modules.analytic_invoice
+    account_invoice = trytond.modules.account_invoice
     """,
 )
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_account_invoice.egg-info/PKG-INFO
similarity index 71%
rename from trytond_analytic_invoice.egg-info/PKG-INFO
rename to trytond_account_invoice.egg-info/PKG-INFO
index 0aa6af9..258b2a5 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_account_invoice.egg-info/PKG-INFO
@@ -1,7 +1,15 @@
 Metadata-Version: 1.0
-Name: trytond-analytic-invoice
-Version: 1.2.0
-Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
+Name: trytond-account-invoice
+Version: 1.2.1
+Summary: Financial and Accounting Module with:
+    - Payment Term
+    - Invoice / Credit Note
+    - Supplier Invoice / Supplier Credit Note
+
+With the possibilities:
+    - to follow the payment of the invoices.
+    - to define invoice sequences on fiscal year or period.
+    - to credit any invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/trytond_account_invoice.egg-info/SOURCES.txt b/trytond_account_invoice.egg-info/SOURCES.txt
new file mode 100644
index 0000000..ecd4482
--- /dev/null
+++ b/trytond_account_invoice.egg-info/SOURCES.txt
@@ -0,0 +1,30 @@
+CHANGELOG
+COPYRIGHT
+INSTALL
+LICENSE
+MANIFEST.in
+README
+TODO
+account.xml
+de_DE.csv
+es_CO.csv
+es_ES.csv
+fr_FR.csv
+invoice.odt
+invoice.xml
+party.xml
+payment_term.xml
+setup.py
+./__init__.py
+./__tryton__.py
+./account.py
+./invoice.py
+./party.py
+./payment_term.py
+trytond_account_invoice.egg-info/PKG-INFO
+trytond_account_invoice.egg-info/SOURCES.txt
+trytond_account_invoice.egg-info/dependency_links.txt
+trytond_account_invoice.egg-info/entry_points.txt
+trytond_account_invoice.egg-info/not-zip-safe
+trytond_account_invoice.egg-info/requires.txt
+trytond_account_invoice.egg-info/top_level.txt
\ No newline at end of file
diff --git a/trytond_analytic_invoice.egg-info/dependency_links.txt b/trytond_account_invoice.egg-info/dependency_links.txt
similarity index 100%
rename from trytond_analytic_invoice.egg-info/dependency_links.txt
rename to trytond_account_invoice.egg-info/dependency_links.txt
diff --git a/trytond_account_invoice.egg-info/entry_points.txt b/trytond_account_invoice.egg-info/entry_points.txt
new file mode 100644
index 0000000..b324fbd
--- /dev/null
+++ b/trytond_account_invoice.egg-info/entry_points.txt
@@ -0,0 +1,4 @@
+
+    [trytond.modules]
+    account_invoice = trytond.modules.account_invoice
+    
\ No newline at end of file
diff --git a/trytond_analytic_invoice.egg-info/not-zip-safe b/trytond_account_invoice.egg-info/not-zip-safe
similarity index 100%
rename from trytond_analytic_invoice.egg-info/not-zip-safe
rename to trytond_account_invoice.egg-info/not-zip-safe
diff --git a/trytond_account_invoice.egg-info/requires.txt b/trytond_account_invoice.egg-info/requires.txt
new file mode 100644
index 0000000..3ba4229
--- /dev/null
+++ b/trytond_account_invoice.egg-info/requires.txt
@@ -0,0 +1,9 @@
+egenix-mx-base
+trytond_account
+trytond_company
+trytond_party
+trytond_product
+trytond_currency
+trytond_account_product
+trytond >= 1.2
+trytond < 1.3
\ No newline at end of file
diff --git a/trytond_analytic_invoice.egg-info/top_level.txt b/trytond_account_invoice.egg-info/top_level.txt
similarity index 100%
rename from trytond_analytic_invoice.egg-info/top_level.txt
rename to trytond_account_invoice.egg-info/top_level.txt
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
deleted file mode 100644
index bfe7099..0000000
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-CHANGELOG
-COPYRIGHT
-INSTALL
-LICENSE
-MANIFEST.in
-README
-de_DE.csv
-es_CO.csv
-es_ES.csv
-fr_FR.csv
-invoice.xml
-setup.py
-./__init__.py
-./__tryton__.py
-./invoice.py
-trytond_analytic_invoice.egg-info/PKG-INFO
-trytond_analytic_invoice.egg-info/SOURCES.txt
-trytond_analytic_invoice.egg-info/dependency_links.txt
-trytond_analytic_invoice.egg-info/entry_points.txt
-trytond_analytic_invoice.egg-info/not-zip-safe
-trytond_analytic_invoice.egg-info/requires.txt
-trytond_analytic_invoice.egg-info/top_level.txt
\ No newline at end of file
diff --git a/trytond_analytic_invoice.egg-info/entry_points.txt b/trytond_analytic_invoice.egg-info/entry_points.txt
deleted file mode 100644
index f92f1a3..0000000
--- a/trytond_analytic_invoice.egg-info/entry_points.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-    [trytond.modules]
-    analytic_invoice = trytond.modules.analytic_invoice
-    
\ No newline at end of file
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
deleted file mode 100644
index b1fdc3d..0000000
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-trytond_account_invoice
-trytond_analytic_account
-trytond >= 1.2
-trytond < 1.3
\ No newline at end of file
commit f4face3a5b2e76b34b33e922696eaaad27789a88
Author: Daniel Baumann <daniel at debian.org>
Date:   Fri Jul 10 14:09:15 2009 +0200

    Updating package to standards version 3.8.2.

diff --git a/debian/control b/debian/control
index b9b03e7..8ed93e5 100644
--- a/debian/control
+++ b/debian/control
@@ -5,7 +5,7 @@ Maintainer: Daniel Baumann <daniel at debian.org>
 Uploaders: Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
 Build-Depends:
  debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
-Standards-Version: 3.8.1
+Standards-Version: 3.8.2
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian.net/?p=debian/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian.net/git/debian/tryton-modules-analytic-invoice.git
commit 6d49f4a61eb72aad2117bda441a4a36df92ba600
Author: Daniel Baumann <daniel at debian.org>
Date:   Tue Apr 21 20:35:53 2009 +0200

    Releasing debian version 1.2.0-1.

diff --git a/debian/changelog b/debian/changelog
index 6fff2eb..d489671 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+tryton-modules-analytic-invoice (1.2.0-1) unstable; urgency=low
+
+  [ Daniel Baumann ]
+  * Merging upstream version 1.2.0.
+  * Tidy rules file.
+  * Updating copyright file for new upstream release.
+
+  [ Mathias Behrle ]
+  * Updating application and package description.
+
+  [ Daniel Baumann ]
+  * Correcting wrapping of control file.
+
+ -- Daniel Baumann <daniel at debian.org>  Tue, 21 Apr 2009 20:35:00 +0200
+
 tryton-modules-analytic-invoice (1.0.2-2) unstable; urgency=low
 
   * Adding Mathias to uploaders.
commit 8c9c82f2337b4d1f0207cda742164bf952f83632
Author: Daniel Baumann <daniel at debian.org>
Date:   Tue Apr 21 20:35:41 2009 +0200

    Correcting wrapping of control file.

diff --git a/debian/control b/debian/control
index 627760b..b9b03e7 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,8 @@ Section: python
 Priority: optional
 Maintainer: Daniel Baumann <daniel at debian.org>
 Uploaders: Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
-Build-Depends: debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
+Build-Depends:
+ debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
 Standards-Version: 3.8.1
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian.net/?p=debian/tryton-modules-analytic-invoice.git
@@ -11,11 +12,16 @@ Vcs-Git: git://git.debian.net/git/debian/tryton-modules-analytic-invoice.git
 
 Package: tryton-modules-analytic-invoice
 Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, tryton-server, tryton-modules-account-invoice, tryton-modules-analytic-account, python-pkg-resources
+Depends:
+ ${misc:Depends}, ${python:Depends}, tryton-server,
+ tryton-modules-account-invoice, tryton-modules-analytic-account,
+ python-pkg-resources
 XB-Python-Version: ${python:Versions}
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
- and using PostgreSQL as database engine. It is the core base of a complete business solution.
+ and using PostgreSQL as database engine. It is the core base of a complete
+ business solution.
  .
  This package contains the financial and accounting module adding analytic
- accounts on invoice lines and generating analytic lines on the moves of invoices.
+ accounts on invoice lines and generating analytic lines on the moves of
+ invoices.
commit 1a187082f3598e68bd7ef798b7281dd8af7cd665
Author: Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
Date:   Tue Apr 21 17:20:19 2009 +0200

    Updating application and package description.

diff --git a/debian/control b/debian/control
index 4bf9a77..627760b 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,7 @@ Depends: ${misc:Depends}, ${python:Depends}, tryton-server, tryton-modules-accou
 XB-Python-Version: ${python:Versions}
 Description: Tryton Application Platform (Financial and Accounting Module)
  Tryton is a high-level general purpose application platform written in Python
- and using PostgreSQL as database engine. It is the core base of an ERP.
+ and using PostgreSQL as database engine. It is the core base of a complete business solution.
  .
  This package contains the financial and accounting module adding analytic
- account on invoice lines and generate analytic lines on the moves of invoice.
+ accounts on invoice lines and generating analytic lines on the moves of invoices.
commit 6b74ea15c83f1b51053d31e8a43744363e806e0b
Author: Daniel Baumann <daniel at debian.org>
Date:   Tue Apr 21 11:42:47 2009 +0200

    Updating copyright file for new upstream release.

diff --git a/debian/copyright b/debian/copyright
index 9f5c20c..d1603bc 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -3,8 +3,8 @@ Download: http://www.tryton.org/downloads.html
 
 Files: *
 Copyright:
- (C) 2008 Cedric Krier
- (C) 2008 B2CK SPRL
+ (C) 2008-2009 Cédric Krier
+ (C) 2008-2009 B2CK SPRL
 License: GPL-3+
  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
commit fb4e374c584d9428e2760037ebf563f6a53b8ed2
Author: Daniel Baumann <daniel at debian.org>
Date:   Tue Apr 21 11:35:46 2009 +0200

    Tidy rules file.

diff --git a/debian/rules b/debian/rules
index 360f2b7..d082f67 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,7 +16,6 @@ install:
 	dh_testdir
 	dh_testroot
 	dh_prep
-	dh_installdirs
 
 	python setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tryton-modules-analytic-invoice --install-lib /usr/share/python-support/tryton-modules-analytic-invoice
 
commit f0e91a8874f079d997331504ed4703fb30bc0c42
Author: Daniel Baumann <daniel at debian.org>
Date:   Tue Apr 21 11:09:30 2009 +0200

    Merging upstream version 1.2.0.

diff --git a/CHANGELOG b/CHANGELOG
index 2521948..d28f483 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,7 +1,5 @@
-Version 1.0.2 - 2009-03-02
-* Some bug fixes (see mercurial logs for details)
-
-Version 1.0.1 - 2008-12-01
+Version 1.2.0 - 2009-04-20
+* Bug fixes (see mercurial logs for details)
 * Allow egg installation
 
 Version 1.0.0 - 2008-11-17
diff --git a/INSTALL b/INSTALL
index a90daf6..895fbf8 100644
--- a/INSTALL
+++ b/INSTALL
@@ -5,14 +5,14 @@ Prerequisites
 -------------
 
  * Python 2.4 or later (http://www.python.org/)
- * trytond 0.0.x (http://www.tryton.org/)
+ * trytond 1.1.x (http://www.tryton.org/)
  * trytond_account_invoice (http://www.tryton.org/)
  * trytond_analytic_account (http://www.tryton.org/)
 
 Installation
 ------------
 
-Once you've downloaded and unpacked a trytond_analytic_invoice source release, enter the
+Once you've downloaded and unpacked the trytond_analytic_invoice source release, enter the
 directory where the archive was unpacked, and run:
 
     python setup.py install
diff --git a/PKG-INFO b/PKG-INFO
index 5fb568b..f98d718 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 1.0.2
+Version: 1.2.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/1.0/
+Download-URL: http://downloads.tryton.org/1.2/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/__tryton__.py b/__tryton__.py
index 874f09a..55c768c 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -3,9 +3,10 @@
 {
     'name': 'Analytic Invoice',
     'name_de_DE': 'Kostenstellen Rechnungsstellung',
-    'name_fr_FR': 'Facturation analytique',
+    'name_es_CO': 'Facturación Analítica',
     'name_es_ES': 'Facturación Analítica',
-    'version': '1.0.2',
+    'name_fr_FR': 'Facturation analytique',
+    'version': '1.2.0',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
@@ -14,6 +15,9 @@
     'description_de_DE': ''' - Fügt Kostenstellen zu Rechnungszeilen hinzu
  - Erstellt Positionen für Kostenstellen bei Buchung von Rechnungen
 ''',
+    'description_es_CO': ''' - Adición de contabilidad analítica a las líneas de facturación 
+ -  Generación de líneas analíticas en la factura.
+''',
     'description_es_ES': ''' - Adición de contabilidad analítica a las líneas de facturación 
  -  Generación de líneas analíticas en la factura.
 ''',
@@ -30,6 +34,7 @@
     ],
     'translation': [
         'de_DE.csv',
+        'es_CO.csv',
         'es_ES.csv',
         'fr_FR.csv',
     ],
diff --git a/es_ES.csv b/es_CO.csv
similarity index 100%
copy from es_ES.csv
copy to es_CO.csv
diff --git a/es_ES.csv b/es_ES.csv
index 0e71661..8750e2e 100644
--- a/es_ES.csv
+++ b/es_ES.csv
@@ -1,2 +1,2 @@
 type,name,res_id,src,value,fuzzy
-field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Cuentas Analíticas,0
+field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Cuentas analíticas,0
diff --git a/invoice.py b/invoice.py
index db6b6be..ef9ec77 100644
--- a/invoice.py
+++ b/invoice.py
@@ -1,10 +1,9 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
 "Invoice"
+from trytond.model import ModelView, ModelSQL, fields
 
-from trytond.osv import fields, OSV
 
-
-class InvoiceLine(OSV):
+class InvoiceLine(ModelSQL, ModelView):
     _name = 'account.invoice.line'
 
     analytic_accounts = fields.Many2One('analytic_account.account.selection',
@@ -34,15 +33,30 @@ class InvoiceLine(OSV):
             user, analytic_accounts_field, fields_names, context=context))
         return res
 
-    def _read_flat(self, cursor, user, ids, fields_names, context=None,
-            load='_classic_read'):
+    def read(self, cursor, user, ids, fields_names=None, context=None):
         selection_obj = self.pool.get('analytic_account.account.selection')
-        res = super(InvoiceLine, self)._read_flat(cursor, user, ids,
-                fields_names, context=context, load=load)
+
+        int_id = False
+        if isinstance(ids, (int, long)):
+            int_id = True
+            ids = [ids]
+
+        if fields_names:
+            fields_names2 = [x for x in fields_names
+                    if not x.startswith('analytic_account_')]
+        else:
+            fields_names2 = fields_names
+
+        res = super(InvoiceLine, self).read(cursor, user, ids,
+                fields_names=fields_names2, context=context)
+
+        if not fields_names:
+            fields_names = list(set(self._columns.keys() \
+                    + self._inherit_fields.keys()))
 
         root_ids = []
         for field in fields_names:
-            if field.startswith('analytic_account_'):
+            if field.startswith('analytic_account_') and '.' not in field:
                 root_ids.append(int(field[len('analytic_account_'):]))
         if root_ids:
             id2record = {}
@@ -52,10 +66,19 @@ class InvoiceLine(OSV):
             for line in lines:
                 if line.type != 'line':
                     continue
+                if not line.analytic_accounts:
+                    continue
                 for account in line.analytic_accounts.accounts:
                     if account.root.id in root_ids:
                         id2record[line.id]['analytic_account_' \
                                 + str(account.root.id)] = account.id
+                        for field in fields_names:
+                            if field.startswith('analytic_account_' + \
+                                    str(account.root.id) + '.'):
+                                ham, field2 = field.split('.', 1)
+                                id2record[line.id][field] = account[field2]
+        if int_id:
+            return res[0]
         return res
 
     def create(self, cursor, user, vals, context=None):
@@ -95,6 +118,14 @@ class InvoiceLine(OSV):
                 if line.type != 'line':
                     continue
                 accounts = []
+                if not line.analytic_accounts:
+                    # Create missing selection
+                    selection_id = selection_obj.create(cursor, 0, {},
+                            context=context)
+                    self.write(cursor, user, line.id, {
+                        'analytic_accounts': selection_id,
+                        }, context=context)
+                    line = self.browse(cursor, user, line.id, context=context)
                 for account in line.analytic_accounts.accounts:
                     if account.root.id in selection_vals:
                         value = selection_vals[account.root.id]
@@ -128,21 +159,29 @@ class InvoiceLine(OSV):
         selection_obj.delete(cursor, user, selection_ids, context=context)
         return res
 
-    def copy(self, cursor, user, line_id, default=None, context=None):
+    def copy(self, cursor, user, ids, default=None, context=None):
         selection_obj = self.pool.get('analytic_account.account.selection')
 
-        if default is None:
-            default = {}
-        default = default.copy()
-        line = self.browse(cursor, user, line_id, context=context)
-        selection_id = False
-        if line.analytic_accounts:
-            selection_id = selection_obj.copy(cursor, user,
-                    line.analytic_accounts.id, context=context)
-        default['analytic_accounts'] = selection_id
-        return super(InvoiceLine, self).copy(cursor, user, line_id,
+        new_ids = super(InvoiceLine, self).copy(cursor, user, ids,
                 default=default, context=context)
 
+        int_id = False
+        if isinstance(new_ids, (int, long)):
+            int_id = True
+            new_ids = [new_ids]
+
+        for line in self.browse(cursor, user, new_ids, context=context):
+            if line.analytic_accounts:
+                selection_id = selection_obj.copy(cursor, user,
+                        line.analytic_accounts.id, context=context)
+                self.write(cursor, user, line.id, {
+                    'analytic_accounts': selection_id,
+                    }, context=context)
+
+        if int_id:
+            return new_ids[0]
+        return new_ids
+
     def get_move_line(self, cursor, user, line, context=None):
         res = super(InvoiceLine, self).get_move_line(cursor, user, line,
                 context=context)
@@ -165,7 +204,7 @@ class InvoiceLine(OSV):
 InvoiceLine()
 
 
-class Account(OSV):
+class Account(ModelSQL, ModelView):
     _name = 'analytic_account.account'
 
     def delete(self, cursor, user, ids, context=None):
diff --git a/invoice.xml b/invoice.xml
index bb0a738..2a476ca 100644
--- a/invoice.xml
+++ b/invoice.xml
@@ -1,5 +1,6 @@
 <?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
 <tryton>
     <data>
         <record model="ir.ui.view" id="invoice_line_view_form">
@@ -9,7 +10,7 @@
                 <![CDATA[
                 <data>
                     <xpath
-                        expr="/form/separator[@name="taxes"]"
+                        expr="/form/notebook/page/separator[@name="taxes"]"
                         position="before">
                         <group col="4" colspan="4" name="analytic_accounts">
                             <field name="analytic_accounts"/>
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index 18e5cbd..0aa6af9 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,13 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 1.0.2
+Version: 1.2.0
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
-Download-URL: http://downloads.tryton.org/1.0/
+Download-URL: http://downloads.tryton.org/1.2/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
index 02fde67..bfe7099 100644
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -5,6 +5,7 @@ LICENSE
 MANIFEST.in
 README
 de_DE.csv
+es_CO.csv
 es_ES.csv
 fr_FR.csv
 invoice.xml
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
index 462f165..b1fdc3d 100644
--- a/trytond_analytic_invoice.egg-info/requires.txt
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -1,4 +1,4 @@
 trytond_account_invoice
 trytond_analytic_account
-trytond >= 1.0
-trytond < 1.1
\ No newline at end of file
+trytond >= 1.2
+trytond < 1.3
\ No newline at end of file
commit 36f0e71202da7a92a7f5d792666afb9c5039f2ce
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Mar 28 16:23:55 2009 +0100

    Releasing debian version 1.0.2-2.

diff --git a/debian/changelog b/debian/changelog
index 200b8f6..6fff2eb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-modules-analytic-invoice (1.0.2-2) unstable; urgency=low
+
+  * Adding Mathias to uploaders.
+
+ -- Daniel Baumann <daniel at debian.org>  Sat, 28 Mar 2009 16:23:00 +0100
+
 tryton-modules-analytic-invoice (1.0.2-1) unstable; urgency=low
 
   * Merging upstream version 1.0.2.
commit 564b4e1a2783db8f3fec4ea097890c17aa9f7428
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Mar 28 16:13:17 2009 +0100

    Adding Mathias to uploaders.

diff --git a/debian/control b/debian/control
index 818337c..4bf9a77 100644
--- a/debian/control
+++ b/debian/control
@@ -2,6 +2,7 @@ Source: tryton-modules-analytic-invoice
 Section: python
 Priority: optional
 Maintainer: Daniel Baumann <daniel at debian.org>
+Uploaders: Mathias Behrle <mathiasb at mbsolutions.selfip.biz>
 Build-Depends: debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
 Standards-Version: 3.8.1
 Homepage: http://www.tryton.org/
commit f406ae1d6c585695211ef28967a9fbace8ac276b
Author: Daniel Baumann <daniel at debian.org>
Date:   Mon Mar 23 06:46:39 2009 +0100

    Releasing debian version 1.0.2-1.

diff --git a/debian/changelog b/debian/changelog
index 022f018..200b8f6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-modules-analytic-invoice (1.0.2-1) unstable; urgency=low
+
+  * Merging upstream version 1.0.2.
+
+ -- Daniel Baumann <daniel at debian.org>  Mon, 23 Mar 2009 06:46:00 +0100
+
 tryton-modules-analytic-invoice (1.0.1-1) unstable; urgency=low
 
   * Merging upstream version 1.0.1.
commit 8f06b95b872972ebc9a376dc068a37226ddd9c73
Author: Daniel Baumann <daniel at debian.org>
Date:   Mon Mar 23 06:45:30 2009 +0100

    Merging upstream version 1.0.2.

diff --git a/CHANGELOG b/CHANGELOG
index 9801fce..2521948 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 1.0.2 - 2009-03-02
+* Some bug fixes (see mercurial logs for details)
+
 Version 1.0.1 - 2008-12-01
 * Allow egg installation
 
diff --git a/COPYRIGHT b/COPYRIGHT
index 2afd2a7..853f1f7 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,5 +1,5 @@
-Copyright (C) 2008 Cédric Krier.
-Copyright (C) 2008 B2CK SPRL.
+Copyright (C) 2008-2009 Cédric Krier.
+Copyright (C) 2008-2009 B2CK SPRL.
 
 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
diff --git a/PKG-INFO b/PKG-INFO
index cdae81b..5fb568b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 1.0.1
+Version: 1.0.2
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
diff --git a/__tryton__.py b/__tryton__.py
index afd2c20..874f09a 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -5,7 +5,7 @@
     'name_de_DE': 'Kostenstellen Rechnungsstellung',
     'name_fr_FR': 'Facturation analytique',
     'name_es_ES': 'Facturación Analítica',
-    'version': '1.0.1',
+    'version': '1.0.2',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
diff --git a/invoice.py b/invoice.py
index 67ad867..db6b6be 100644
--- a/invoice.py
+++ b/invoice.py
@@ -50,6 +50,8 @@ class InvoiceLine(OSV):
                 id2record[record['id']] = record
             lines = self.browse(cursor, user, ids, context=context)
             for line in lines:
+                if line.type != 'line':
+                    continue
                 for account in line.analytic_accounts.accounts:
                     if account.root.id in root_ids:
                         id2record[line.id]['analytic_account_' \
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index d422688..18e5cbd 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 1.0.1
+Version: 1.0.2
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
commit 44aba469910d5a2e86e444f23c02bf58fb442beb
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Mar 22 23:00:40 2009 +0100

    Releasing debian version 1.0.1-1.

diff --git a/debian/changelog b/debian/changelog
index c9a672f..022f018 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+tryton-modules-analytic-invoice (1.0.1-1) unstable; urgency=low
+
+  * Merging upstream version 1.0.1.
+  * Updating standards to 3.8.1.
+  * Making package arch all as it should be (Closes: #520813).
+
+ -- Daniel Baumann <daniel at debian.org>  Sun, 22 Mar 2009 23:00:00 +0100
+
 tryton-modules-analytic-invoice (1.0.0-1) unstable; urgency=low
 
   * Initial release (Closes: #506095).
commit 8dc34c75838b0ff7d6a8f2eb4757abec3eac134f
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Mar 22 23:00:14 2009 +0100

    Making package arch all as it should be (Closes: #520813).

diff --git a/debian/control b/debian/control
index 166f5cb..818337c 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Vcs-Browser: http://git.debian.net/?p=debian/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian.net/git/debian/tryton-modules-analytic-invoice.git
 
 Package: tryton-modules-analytic-invoice
-Architecture: any
+Architecture: all
 Depends: ${misc:Depends}, ${python:Depends}, tryton-server, tryton-modules-account-invoice, tryton-modules-analytic-account, python-pkg-resources
 XB-Python-Version: ${python:Versions}
 Description: Tryton Application Platform (Financial and Accounting Module)
commit f12b2149cfd90d7ff998efc0e04b5f7b0379c049
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Mar 22 22:59:00 2009 +0100

    Updating standards to 3.8.1.

diff --git a/debian/control b/debian/control
index 079c047..166f5cb 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: python
 Priority: optional
 Maintainer: Daniel Baumann <daniel at debian.org>
 Build-Depends: debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
-Standards-Version: 3.8.0
+Standards-Version: 3.8.1
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://git.debian.net/?p=debian/tryton-modules-analytic-invoice.git
 Vcs-Git: git://git.debian.net/git/debian/tryton-modules-analytic-invoice.git
commit 350b96fefff7d7b1922a0afb9ee6b43288ff7fef
Author: Daniel Baumann <daniel at debian.org>
Date:   Wed Jan 28 14:03:43 2009 +0100

    Merging upstream version 1.0.1.

diff --git a/CHANGELOG b/CHANGELOG
index eacaaef..9801fce 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,2 +1,5 @@
+Version 1.0.1 - 2008-12-01
+* Allow egg installation
+
 Version 1.0.0 - 2008-11-17
 * Initial release
diff --git a/PKG-INFO b/PKG-INFO
index ad3fab3..cdae81b 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond_analytic_invoice
-Version: 1.0.0
+Version: 1.0.1
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
+Download-URL: http://downloads.tryton.org/1.0/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/__tryton__.py b/__tryton__.py
index 9c71493..afd2c20 100644
--- a/__tryton__.py
+++ b/__tryton__.py
@@ -5,7 +5,7 @@
     'name_de_DE': 'Kostenstellen Rechnungsstellung',
     'name_fr_FR': 'Facturation analytique',
     'name_es_ES': 'Facturación Analítica',
-    'version': '1.0.0',
+    'version': '1.0.1',
     'author': 'B2CK',
     'email': 'info at b2ck.com',
     'website': 'http://www.tryton.org/',
diff --git a/setup.py b/setup.py
index b353051..b0e0eec 100644
--- a/setup.py
+++ b/setup.py
@@ -27,6 +27,8 @@ setup(name='trytond_analytic_invoice',
     author=info.get('author', ''),
     author_email=info.get('email', ''),
     url=info.get('website', ''),
+    download_url="http://downloads.tryton.org/" + \
+            info.get('version', '0.0.1').rsplit('.', 1)[0] + '/',
     package_dir={'trytond.modules.analytic_invoice': '.'},
     packages=[
         'trytond.modules.analytic_invoice',
@@ -53,4 +55,9 @@ setup(name='trytond_analytic_invoice',
     ],
     license='GPL-3',
     install_requires=requires,
+    zip_safe=False,
+    entry_points="""
+    [trytond.modules]
+    analytic_invoice = trytond.modules.analytic_invoice
+    """,
 )
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
index 23b3524..d422688 100644
--- a/trytond_analytic_invoice.egg-info/PKG-INFO
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -1,12 +1,13 @@
 Metadata-Version: 1.0
 Name: trytond-analytic-invoice
-Version: 1.0.0
+Version: 1.0.1
 Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
 
 Home-page: http://www.tryton.org/
 Author: B2CK
 Author-email: info at b2ck.com
 License: GPL-3
+Download-URL: http://downloads.tryton.org/1.0/
 Description: UNKNOWN
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
index 71bd9db..02fde67 100644
--- a/trytond_analytic_invoice.egg-info/SOURCES.txt
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -15,5 +15,7 @@ setup.py
 trytond_analytic_invoice.egg-info/PKG-INFO
 trytond_analytic_invoice.egg-info/SOURCES.txt
 trytond_analytic_invoice.egg-info/dependency_links.txt
+trytond_analytic_invoice.egg-info/entry_points.txt
+trytond_analytic_invoice.egg-info/not-zip-safe
 trytond_analytic_invoice.egg-info/requires.txt
 trytond_analytic_invoice.egg-info/top_level.txt
\ No newline at end of file
diff --git a/trytond_analytic_invoice.egg-info/entry_points.txt b/trytond_analytic_invoice.egg-info/entry_points.txt
new file mode 100644
index 0000000..f92f1a3
--- /dev/null
+++ b/trytond_analytic_invoice.egg-info/entry_points.txt
@@ -0,0 +1,4 @@
+
+    [trytond.modules]
+    analytic_invoice = trytond.modules.analytic_invoice
+    
\ No newline at end of file
diff --git a/trytond_analytic_invoice.egg-info/not-zip-safe b/trytond_analytic_invoice.egg-info/not-zip-safe
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/trytond_analytic_invoice.egg-info/not-zip-safe
@@ -0,0 +1 @@
+
commit f0278cd846499a903fe5d203e2999b1709ed7f19
Author: Daniel Baumann <daniel at debian.org>
Date:   Tue Nov 18 13:05:54 2008 +0100

    Adding debian version 1.0.0-1.

diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
index 0000000..eacaaef
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,2 @@
+Version 1.0.0 - 2008-11-17
+* Initial release
diff --git a/COPYRIGHT b/COPYRIGHT
new file mode 100644
index 0000000..2afd2a7
--- /dev/null
+++ b/COPYRIGHT
@@ -0,0 +1,15 @@
+Copyright (C) 2008 Cédric Krier.
+Copyright (C) 2008 B2CK SPRL.
+
+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 <http://www.gnu.org/licenses/>.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..a90daf6
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,31 @@
+Installing trytond_analytic_invoice
+===================================
+
+Prerequisites
+-------------
+
+ * Python 2.4 or later (http://www.python.org/)
+ * trytond 0.0.x (http://www.tryton.org/)
+ * trytond_account_invoice (http://www.tryton.org/)
+ * trytond_analytic_account (http://www.tryton.org/)
+
+Installation
+------------
+
+Once you've downloaded and unpacked a trytond_analytic_invoice source release, enter the
+directory where the archive was unpacked, and run:
+
+    python setup.py install
+
+Note that you may need administrator/root privileges for this step, as
+this command will by default attempt to install module to the Python
+site-packages directory on your system.
+
+For advanced options, please refer to the easy_install and/or the distutils
+documentation:
+
+  http://peak.telecommunity.com/DevCenter/EasyInstall
+  http://docs.python.org/inst/inst.html
+
+To use without installation, extract the archive into ``trytond/modules`` with
+the directory name analytic_invoice.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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 <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..5343ad8
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,9 @@
+include INSTALL
+include README
+include TODO
+include COPYRIGHT
+include CHANGELOG
+include LICENSE
+include *.xml
+include *.odt
+include *.csv
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..ad3fab3
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,25 @@
+Metadata-Version: 1.0
+Name: trytond_analytic_invoice
+Version: 1.0.0
+Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
+
+Home-page: http://www.tryton.org/
+Author: B2CK
+Author-email: info at b2ck.com
+License: GPL-3
+Description: UNKNOWN
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Environment :: Plugins
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: Financial and Insurance Industry
+Classifier: Intended Audience :: Legal Industry
+Classifier: License :: OSI Approved :: GNU General Public License (GPL)
+Classifier: Natural Language :: English
+Classifier: Natural Language :: French
+Classifier: Natural Language :: German
+Classifier: Natural Language :: Spanish
+Classifier: Operating System :: OS Independent
+Classifier: Programming Language :: Python
+Classifier: Topic :: Office/Business
+Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/README b/README
new file mode 100644
index 0000000..27ef5eb
--- /dev/null
+++ b/README
@@ -0,0 +1,36 @@
+trytond_analytic_invoice
+========================
+
+The analytic_invoice module of the Tryton application platform.
+See __tryton__.py
+
+Installing
+----------
+
+See INSTALL
+
+Support
+-------
+
+If you encounter any problems with Tryton, please don't hesitate to ask
+questions on the Tryton bug tracker, mailing list, wiki or IRC channel:
+
+  http://bugs.tryton.org/
+  http://groups.tryton.org/
+  http://wiki.tryton.org/
+  irc://irc.freenode.net/tryton
+
+License
+-------
+
+See LICENSE
+
+Copyright
+---------
+
+See COPYRIGHT
+
+
+For more information please visit the Tryton web site:
+
+  http://www.tryton.org/
diff --git a/__init__.py b/__init__.py
new file mode 100644
index 0000000..646e21a
--- /dev/null
+++ b/__init__.py
@@ -0,0 +1,3 @@
+#This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
+
+from invoice import *
diff --git a/__tryton__.py b/__tryton__.py
new file mode 100644
index 0000000..9c71493
--- /dev/null
+++ b/__tryton__.py
@@ -0,0 +1,36 @@
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
+{
+    'name': 'Analytic Invoice',
+    'name_de_DE': 'Kostenstellen Rechnungsstellung',
+    'name_fr_FR': 'Facturation analytique',
+    'name_es_ES': 'Facturación Analítica',
+    'version': '1.0.0',
+    'author': 'B2CK',
+    'email': 'info at b2ck.com',
+    'website': 'http://www.tryton.org/',
+    'description': '''Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
+''',
+    'description_de_DE': ''' - Fügt Kostenstellen zu Rechnungszeilen hinzu
+ - Erstellt Positionen für Kostenstellen bei Buchung von Rechnungen
+''',
+    'description_es_ES': ''' - Adición de contabilidad analítica a las líneas de facturación 
+ -  Generación de líneas analíticas en la factura.
+''',
+    'description_fr_FR': '''Ajoute la comptabilité analytique sur les lignes '''
+    '''de facture et génère les lignes analytiques sur les mouvements de la '''
+    '''facture.''',
+
+    'depends': [
+        'account_invoice',
+        'analytic_account',
+    ],
+    'xml': [
+        'invoice.xml',
+    ],
+    'translation': [
+        'de_DE.csv',
+        'es_ES.csv',
+        'fr_FR.csv',
+    ],
+}
diff --git a/de_DE.csv b/de_DE.csv
new file mode 100644
index 0000000..3de2537
--- /dev/null
+++ b/de_DE.csv
@@ -0,0 +1,2 @@
+type,name,res_id,src,value,fuzzy
+field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Kostenstellen,0
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..c9a672f
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+tryton-modules-analytic-invoice (1.0.0-1) unstable; urgency=low
+
+  * Initial release (Closes: #506095).
+
+ -- Daniel Baumann <daniel at debian.org>  Mon, 12 Jan 2009 15:49:00 -0500
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..079c047
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,20 @@
+Source: tryton-modules-analytic-invoice
+Section: python
+Priority: optional
+Maintainer: Daniel Baumann <daniel at debian.org>
+Build-Depends: debhelper (>= 7), python, python-all-dev, python-setuptools, python-support
+Standards-Version: 3.8.0
+Homepage: http://www.tryton.org/
+Vcs-Browser: http://git.debian.net/?p=debian/tryton-modules-analytic-invoice.git
+Vcs-Git: git://git.debian.net/git/debian/tryton-modules-analytic-invoice.git
+
+Package: tryton-modules-analytic-invoice
+Architecture: any
+Depends: ${misc:Depends}, ${python:Depends}, tryton-server, tryton-modules-account-invoice, tryton-modules-analytic-account, python-pkg-resources
+XB-Python-Version: ${python:Versions}
+Description: Tryton Application Platform (Financial and Accounting Module)
+ Tryton is a high-level general purpose application platform written in Python
+ and using PostgreSQL as database engine. It is the core base of an ERP.
+ .
+ This package contains the financial and accounting module adding analytic
+ account on invoice lines and generate analytic lines on the moves of invoice.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..9f5c20c
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,42 @@
+Author: Tryton Project <http://www.tryton.org/>
+Download: http://www.tryton.org/downloads.html
+
+Files: *
+Copyright:
+ (C) 2008 Cedric Krier
+ (C) 2008 B2CK SPRL
+License: GPL-3+
+ 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 <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General Public License
+ can be found in /usr/share/common-licenses/GPL-3 file.
+
+Files: debian/*
+Copyright: (C) 2009 Daniel Baumann <daniel at debian.org>
+License: GPL-3+
+ 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 <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General Public License
+ can be found in /usr/share/common-licenses/GPL-3 file.
diff --git a/debian/pycompat b/debian/pycompat
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/debian/pycompat
@@ -0,0 +1 @@
+2
diff --git a/debian/pyversions b/debian/pyversions
new file mode 100644
index 0000000..8b253bc
--- /dev/null
+++ b/debian/pyversions
@@ -0,0 +1 @@
+2.4-
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..360f2b7
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,42 @@
+#!/usr/bin/make -f
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+
+	python setup.py clean
+	rm -rf dist build trytond_analytic_invoice.egg-info
+
+	dh_clean
+
+build:
+
+install:
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+
+	python setup.py install --single-version-externally-managed --root=$(CURDIR)/debian/tryton-modules-analytic-invoice --install-lib /usr/share/python-support/tryton-modules-analytic-invoice
+
+	find debian/tryton-modules-analytic-invoice -type f -name "*.pyc" | xargs rm -f
+
+binary: binary-indep
+
+binary-arch:
+
+binary-indep: install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs CHANGELOG
+	dh_installdocs
+	dh_pysupport
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+.PHONY: clean build install binary binary-arch binary-indep
diff --git a/es_ES.csv b/es_ES.csv
new file mode 100644
index 0000000..0e71661
--- /dev/null
+++ b/es_ES.csv
@@ -0,0 +1,2 @@
+type,name,res_id,src,value,fuzzy
+field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Cuentas Analíticas,0
diff --git a/fr_FR.csv b/fr_FR.csv
new file mode 100644
index 0000000..a64dce4
--- /dev/null
+++ b/fr_FR.csv
@@ -0,0 +1,2 @@
+type,name,res_id,src,value,fuzzy
+field,"account.invoice.line,analytic_accounts",0,Analytic Accounts,Comptes analytiques,0
diff --git a/invoice.py b/invoice.py
new file mode 100644
index 0000000..67ad867
--- /dev/null
+++ b/invoice.py
@@ -0,0 +1,191 @@
+#This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
+"Invoice"
+
+from trytond.osv import fields, OSV
+
+
+class InvoiceLine(OSV):
+    _name = 'account.invoice.line'
+
+    analytic_accounts = fields.Many2One('analytic_account.account.selection',
+            'Analytic Accounts',
+            states={
+                'invisible': "type != 'line'",
+            })
+
+    def _view_look_dom_arch(self, cursor, user, tree, type, context=None):
+        analytic_account_obj = self.pool.get('analytic_account.account')
+        analytic_account_obj.convert_view(cursor, user, tree, context=context)
+        arch, fields = super(InvoiceLine, self)._view_look_dom_arch(cursor,
+                user, tree, type, context=context)
+        return arch, fields
+
+    def fields_get(self, cursor, user, fields_names=None, context=None):
+        analytic_account_obj = self.pool.get('analytic_account.account')
+
+        res = super(InvoiceLine, self).fields_get(cursor, user, fields_names,
+                context=context)
+
+        analytic_accounts_field = super(InvoiceLine, self).fields_get(cursor,
+                user, ['analytic_accounts'],
+                context=context)['analytic_accounts']
+
+        res.update(analytic_account_obj.analytic_accounts_fields_get(cursor,
+            user, analytic_accounts_field, fields_names, context=context))
+        return res
+
+    def _read_flat(self, cursor, user, ids, fields_names, context=None,
+            load='_classic_read'):
+        selection_obj = self.pool.get('analytic_account.account.selection')
+        res = super(InvoiceLine, self)._read_flat(cursor, user, ids,
+                fields_names, context=context, load=load)
+
+        root_ids = []
+        for field in fields_names:
+            if field.startswith('analytic_account_'):
+                root_ids.append(int(field[len('analytic_account_'):]))
+        if root_ids:
+            id2record = {}
+            for record in res:
+                id2record[record['id']] = record
+            lines = self.browse(cursor, user, ids, context=context)
+            for line in lines:
+                for account in line.analytic_accounts.accounts:
+                    if account.root.id in root_ids:
+                        id2record[line.id]['analytic_account_' \
+                                + str(account.root.id)] = account.id
+        return res
+
+    def create(self, cursor, user, vals, context=None):
+        selection_obj = self.pool.get('analytic_account.account.selection')
+        vals = vals.copy()
+        selection_vals = {}
+        for field in vals.keys():
+            if field.startswith('analytic_account_'):
+                if vals[field]:
+                    selection_vals.setdefault('accounts', [])
+                    selection_vals['accounts'].append(('add', vals[field]))
+                del vals[field]
+        if vals.get('analytic_accounts'):
+            selection_obj.write(cursor, user, vals['analytic_accounts'],
+                    selection_vals, context=context)
+        elif vals.get('type', 'line') == 'line':
+            selection_id = selection_obj.create(cursor, user, selection_vals,
+                    context=context)
+            vals['analytic_accounts'] = selection_id
+        return super(InvoiceLine, self).create(cursor, user, vals,
+                context=context)
+
+    def write(self, cursor, user, ids, vals, context=None):
+        selection_obj = self.pool.get('analytic_account.account.selection')
+        vals = vals.copy()
+        if isinstance(ids, (int, long)):
+            ids = [ids]
+        selection_vals = {}
+        for field in vals.keys():
+            if field.startswith('analytic_account_'):
+                root_id = int(field[len('analytic_account_'):])
+                selection_vals[root_id] = vals[field]
+                del vals[field]
+        if selection_vals:
+            lines = self.browse(cursor, user, ids, context=context)
+            for line in lines:
+                if line.type != 'line':
+                    continue
+                accounts = []
+                for account in line.analytic_accounts.accounts:
+                    if account.root.id in selection_vals:
+                        value = selection_vals[account.root.id]
+                        if value:
+                            accounts.append(value)
+                    else:
+                        accounts.append(account.id)
+                for account_id in selection_vals.values():
+                    if account_id \
+                            and account_id not in accounts:
+                        accounts.append(account_id)
+                selection_obj.write(cursor, user, line.analytic_accounts.id, {
+                    'accounts': [('set', accounts)],
+                    }, context=context)
+        return super(InvoiceLine, self).write(cursor, user, ids, vals,
+                context=context)
+
+    def delete(self, cursor, user, ids, context=None):
+        selection_obj = self.pool.get('analytic_account.account.selection')
+
+        if isinstance(ids, (int, long)):
+            ids = [ids]
+        selection_ids = []
+        lines = self.browse(cursor, user, ids, context=context)
+        for line in lines:
+            if line.analytic_accounts:
+                selection_ids.append(line.analytic_accounts.id)
+
+        res = super(InvoiceLine, self).delete(cursor, user, ids,
+                context=context)
+        selection_obj.delete(cursor, user, selection_ids, context=context)
+        return res
+
+    def copy(self, cursor, user, line_id, default=None, context=None):
+        selection_obj = self.pool.get('analytic_account.account.selection')
+
+        if default is None:
+            default = {}
+        default = default.copy()
+        line = self.browse(cursor, user, line_id, context=context)
+        selection_id = False
+        if line.analytic_accounts:
+            selection_id = selection_obj.copy(cursor, user,
+                    line.analytic_accounts.id, context=context)
+        default['analytic_accounts'] = selection_id
+        return super(InvoiceLine, self).copy(cursor, user, line_id,
+                default=default, context=context)
+
+    def get_move_line(self, cursor, user, line, context=None):
+        res = super(InvoiceLine, self).get_move_line(cursor, user, line,
+                context=context)
+        if line.analytic_accounts and line.analytic_accounts.accounts:
+            res['analytic_lines'] = []
+            for account in line.analytic_accounts.accounts:
+                vals = {}
+                vals['name'] = line.description
+                vals['debit'] = res['debit']
+                vals['credit'] = res['credit']
+                vals['currency'] = line.invoice.currency.id
+                vals['account'] = account.id
+                vals['journal'] = line.invoice.journal.id
+                vals['date'] = line.invoice.invoice_date
+                vals['reference'] = line.invoice.reference
+                vals['party'] = line.invoice.party.id
+                res['analytic_lines'].append(('create', vals))
+        return res
+
+InvoiceLine()
+
+
+class Account(OSV):
+    _name = 'analytic_account.account'
+
+    def delete(self, cursor, user, ids, context=None):
+        account_invoice_line_obj = self.pool.get('account.invoice.line')
+        res = super(Account, self).delete(cursor, user, ids, context=context)
+        # Restart the cache on the fields_view_get method of account.invoice.line
+        account_invoice_line_obj.fields_view_get(cursor.dbname)
+        return res
+
+    def create(self, cursor, user, vals, context=None):
+        account_invoice_line_obj = self.pool.get('account.invoice.line')
+        res = super(Account, self).create(cursor, user, vals, context=context)
+        # Restart the cache on the fields_view_get method of account.invoice.line
+        account_invoice_line_obj.fields_view_get(cursor.dbname)
+        return res
+
+    def write(self, cursor, user, ids, vals, context=None):
+        account_invoice_line_obj = self.pool.get('account.invoice.line')
+        res = super(Account, self).write(cursor, user, ids, vals,
+                context=context)
+        # Restart the cache on the fields_view_get method of account.invoice.line
+        account_invoice_line_obj.fields_view_get(cursor.dbname)
+        return res
+
+Account()
diff --git a/invoice.xml b/invoice.xml
new file mode 100644
index 0000000..bb0a738
--- /dev/null
+++ b/invoice.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
+<tryton>
+    <data>
+        <record model="ir.ui.view" id="invoice_line_view_form">
+            <field name="model">account.invoice.line</field>
+            <field name="inherit" ref="account_invoice.invoice_line_view_form"/>
+            <field name="arch" type="xml">
+                <![CDATA[
+                <data>
+                    <xpath
+                        expr="/form/separator[@name="taxes"]"
+                        position="before">
+                        <group col="4" colspan="4" name="analytic_accounts">
+                            <field name="analytic_accounts"/>
+                        </group>
+                    </xpath>
+                </data>
+                ]]>
+            </field>
+        </record>
+    </data>
+</tryton>
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..861a9f5
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,5 @@
+[egg_info]
+tag_build = 
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..b353051
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python
+#This file is part of Tryton.  The COPYRIGHT file at the top level of
+#this repository contains the full copyright notices and license terms.
+
+from setuptools import setup, find_packages
+import re
+
+info = eval(file('__tryton__.py').read())
+
+requires = []
+for dep in info.get('depends', []):
+    match = re.compile(
+            '(ir|res|workflow|webdav)((\s|$|<|>|<=|>=|==|!=).*?$)').match(dep)
+    if match:
+        continue
+    else:
+        dep = 'trytond_' + dep
+    requires.append(dep)
+
+major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
+requires.append('trytond >= %s.%s' % (major_version, minor_version))
+requires.append('trytond < %s.%s' % (major_version, str(int(minor_version) + 1)))
+
+setup(name='trytond_analytic_invoice',
+    version=info.get('version', '0.0.1'),
+    description=info.get('description', ''),
+    author=info.get('author', ''),
+    author_email=info.get('email', ''),
+    url=info.get('website', ''),
+    package_dir={'trytond.modules.analytic_invoice': '.'},
+    packages=[
+        'trytond.modules.analytic_invoice',
+    ],
+    package_data={
+        'trytond.modules.analytic_invoice': info.get('xml', []) \
+                + info.get('translation', []),
+    },
+    classifiers=[
+        'Development Status :: 5 - Production/Stable',
+        'Environment :: Plugins',
+        'Intended Audience :: Developers',
+        'Intended Audience :: Financial and Insurance Industry',
+        'Intended Audience :: Legal Industry',
+        'License :: OSI Approved :: GNU General Public License (GPL)',
+        'Natural Language :: English',
+        'Natural Language :: French',
+        'Natural Language :: German',
+        'Natural Language :: Spanish',
+        'Operating System :: OS Independent',
+        'Programming Language :: Python',
+        'Topic :: Office/Business',
+        'Topic :: Office/Business :: Financial :: Accounting',
+    ],
+    license='GPL-3',
+    install_requires=requires,
+)
diff --git a/trytond_analytic_invoice.egg-info/PKG-INFO b/trytond_analytic_invoice.egg-info/PKG-INFO
new file mode 100644
index 0000000..23b3524
--- /dev/null
+++ b/trytond_analytic_invoice.egg-info/PKG-INFO
@@ -0,0 +1,25 @@
+Metadata-Version: 1.0
+Name: trytond-analytic-invoice
+Version: 1.0.0
+Summary: Add analytic account on invoice lines and generate analytic lines on the moves of invoice.
+
+Home-page: http://www.tryton.org/
+Author: B2CK
+Author-email: info at b2ck.com
+License: GPL-3
+Description: UNKNOWN
+Platform: UNKNOWN
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Environment :: Plugins
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: Financial and Insurance Industry
+Classifier: Intended Audience :: Legal Industry
+Classifier: License :: OSI Approved :: GNU General Public License (GPL)
+Classifier: Natural Language :: English
+Classifier: Natural Language :: French
+Classifier: Natural Language :: German
+Classifier: Natural Language :: Spanish
+Classifier: Operating System :: OS Independent
+Classifier: Programming Language :: Python
+Classifier: Topic :: Office/Business
+Classifier: Topic :: Office/Business :: Financial :: Accounting
diff --git a/trytond_analytic_invoice.egg-info/SOURCES.txt b/trytond_analytic_invoice.egg-info/SOURCES.txt
new file mode 100644
index 0000000..71bd9db
--- /dev/null
+++ b/trytond_analytic_invoice.egg-info/SOURCES.txt
@@ -0,0 +1,19 @@
+CHANGELOG
+COPYRIGHT
+INSTALL
+LICENSE
+MANIFEST.in
+README
+de_DE.csv
+es_ES.csv
+fr_FR.csv
+invoice.xml
+setup.py
+./__init__.py
+./__tryton__.py
+./invoice.py
+trytond_analytic_invoice.egg-info/PKG-INFO
+trytond_analytic_invoice.egg-info/SOURCES.txt
+trytond_analytic_invoice.egg-info/dependency_links.txt
+trytond_analytic_invoice.egg-info/requires.txt
+trytond_analytic_invoice.egg-info/top_level.txt
\ No newline at end of file
diff --git a/trytond_analytic_invoice.egg-info/dependency_links.txt b/trytond_analytic_invoice.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/trytond_analytic_invoice.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/trytond_analytic_invoice.egg-info/requires.txt b/trytond_analytic_invoice.egg-info/requires.txt
new file mode 100644
index 0000000..462f165
--- /dev/null
+++ b/trytond_analytic_invoice.egg-info/requires.txt
@@ -0,0 +1,4 @@
+trytond_account_invoice
+trytond_analytic_account
+trytond >= 1.0
+trytond < 1.1
\ No newline at end of file
diff --git a/trytond_analytic_invoice.egg-info/top_level.txt b/trytond_analytic_invoice.egg-info/top_level.txt
new file mode 100644
index 0000000..93df119
--- /dev/null
+++ b/trytond_analytic_invoice.egg-info/top_level.txt
@@ -0,0 +1 @@
+trytond
-- 
tryton-modules-analytic-invoice



More information about the tryton-debian-vcs mailing list