[tryton-debian-vcs] tryton-modules-account-invoice branch debian updated. debian/3.0.2-1-2-g07a56a6

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Apr 22 13:05:18 UTC 2014


The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-account-invoice.git;a=commitdiff;h=debian/3.0.2-1-2-g07a56a6

commit 07a56a61ec104d0b824ad2a4cb68844085cfc0ae
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:59:34 2014 +0200

    Bumping minimal required Python version to 2.7.

diff --git a/debian/control b/debian/control
index 673b0cb..c681862 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Standards-Version: 3.9.5
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=tryton/tryton-modules-account-invoice.git
 Vcs-Git: git://anonscm.debian.org/tryton/tryton-modules-account-invoice.git
-X-Python-Version: >= 2.6
+X-Python-Version: >= 2.7
 
 Package: tryton-modules-account-invoice
 Architecture: all
commit e33f911c624a401bfe4cbb110a3d5be1f05e00da
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Apr 22 14:20:44 2014 +0200

    Merging upstream version 3.2.0.

diff --git a/CHANGELOG b/CHANGELOG
index 45083f3..c1b4b55 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,8 +1,6 @@
-Version 3.0.2 - 2014-03-22
-* Bug fixes (see mercurial logs for details)
-
-Version 3.0.1 - 2014-01-18
+Version 3.2.0 - 2014-04-21
 * Bug fixes (see mercurial logs for details)
+* Use account of write-off journal as default
 
 Version 3.0.0 - 2013-10-21
 * Bug fixes (see mercurial logs for details)
diff --git a/INSTALL b/INSTALL
index 9c44742..2bc60dc 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Installing trytond_account_invoice
 Prerequisites
 -------------
 
- * Python 2.6 or later (http://www.python.org/)
+ * Python 2.7 or later (http://www.python.org/)
  * python-dateutil (http://labix.org/python-dateutil)
  * python-sql (http://code.google.com/p/python-sql/)
  * trytond (http://www.tryton.org/)
diff --git a/MANIFEST.in b/MANIFEST.in
index 2f9d677..ae867cc 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,5 @@
 include INSTALL
 include README
-include TODO
 include COPYRIGHT
 include CHANGELOG
 include LICENSE
diff --git a/PKG-INFO b/PKG-INFO
index ef65c39..3bf3aee 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_account_invoice
-Version: 3.0.2
+Version: 3.2.0
 Summary: Tryton module for invoicing
 Home-page: http://www.tryton.org/
 Author: Tryton
-Author-email: UNKNOWN
+Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.0/
+Download-URL: http://downloads.tryton.org/3.2/
 Description: trytond_account_invoice
         =======================
         
@@ -43,6 +43,7 @@ Description: trytond_account_invoice
         
           http://www.tryton.org/
         
+Keywords: tryton account invoice
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
@@ -62,7 +63,6 @@ Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-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/account.py b/account.py
index 58ec2de..9c6bb23 100644
--- a/account.py
+++ b/account.py
@@ -96,27 +96,30 @@ class FiscalYear:
                         })
 
     @classmethod
-    def write(cls, fiscalyears, vals):
+    def write(cls, *args):
         Invoice = 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 fiscalyears:
-                    if (getattr(fiscalyear, sequence)
-                            and (getattr(fiscalyear, sequence).id !=
-                                vals[sequence])):
-                        if Invoice.search([
-                                    ('invoice_date', '>=',
-                                        fiscalyear.start_date),
-                                    ('invoice_date', '<=',
-                                        fiscalyear.end_date),
-                                    ('number', '!=', None),
-                                    ('type', '=', sequence[:-9]),
-                                    ]):
-                            cls.raise_user_error('change_invoice_sequence',
-                                (fiscalyear.rec_name,))
-        super(FiscalYear, cls).write(fiscalyears, vals)
+        actions = iter(args)
+        for fiscalyears, values in zip(actions, actions):
+            for sequence in ('out_invoice_sequence', 'in_invoice_sequence',
+                    'out_credit_note_sequence', 'in_credit_note_sequence'):
+                    if not values.get(sequence):
+                        continue
+                    for fiscalyear in fiscalyears:
+                        if (getattr(fiscalyear, sequence)
+                                and (getattr(fiscalyear, sequence).id !=
+                                    values[sequence])):
+                            if Invoice.search([
+                                        ('invoice_date', '>=',
+                                            fiscalyear.start_date),
+                                        ('invoice_date', '<=',
+                                            fiscalyear.end_date),
+                                        ('number', '!=', None),
+                                        ('type', '=', sequence[:-9]),
+                                        ]):
+                                cls.raise_user_error('change_invoice_sequence',
+                                    (fiscalyear.rec_name,))
+        super(FiscalYear, cls).write(*args)
 
 
 class Period:
@@ -210,16 +213,19 @@ class Period:
         return super(Period, cls).create(vlist)
 
     @classmethod
-    def write(cls, periods, vals):
+    def write(cls, *args):
         Invoice = Pool().get('account.invoice')
 
-        for sequence_name in ('out_invoice_sequence', 'in_invoice_sequence',
-                'out_credit_note_sequence', 'in_credit_note_sequence'):
-            if vals.get(sequence_name):
+        actions = iter(args)
+        for periods, values in zip(actions, actions):
+            for sequence_name in ('out_invoice_sequence',
+                    'in_invoice_sequence', 'out_credit_note_sequence',
+                    'in_credit_note_sequence'):
+                if not values.get(sequence_name):
+                    continue
                 for period in periods:
                     sequence = getattr(period, sequence_name)
-                    if (sequence and
-                            sequence.id != vals[sequence_name]):
+                    if (sequence and sequence.id != values[sequence_name]):
                         if Invoice.search([
                                     ('invoice_date', '>=', period.start_date),
                                     ('invoice_date', '<=', period.end_date),
@@ -228,7 +234,7 @@ class Period:
                                     ]):
                             cls.raise_user_error('change_invoice_sequence',
                                 (period.rec_name,))
-        super(Period, cls).write(periods, vals)
+        super(Period, cls).write(*args)
 
     def get_invoice_sequence(self, invoice_type):
         sequence = getattr(self, invoice_type + '_sequence')
diff --git a/invoice.py b/invoice.py
index ce05309..6f9cc15 100644
--- a/invoice.py
+++ b/invoice.py
@@ -7,7 +7,7 @@ import operator
 from sql import Literal
 from sql.aggregate import Count, Sum
 from sql.conditionals import Coalesce, Case
-from sql.functions import Abs
+from sql.functions import Abs, Sign
 
 from trytond.model import Workflow, ModelView, ModelSQL, fields
 from trytond.report import Report
@@ -66,13 +66,12 @@ class Invoice(Workflow, ModelSQL, ModelView):
                 Eval('context', {}).get('company', -1)),
             ],
         depends=_DEPENDS)
-    type = fields.Selection(_TYPE, 'Type', select=True, on_change=['type',
-            'party', 'company'],
+    type = fields.Selection(_TYPE, 'Type', select=True,
         required=True, states={
             'readonly': ((Eval('state') != 'draft')
                 | Eval('context', {}).get('type')
-                | (Eval('lines') & Eval('type'))),
-            }, depends=['state', 'lines'])
+                | (Eval('lines', [0]) & Eval('type'))),
+            }, depends=['state'])
     type_name = fields.Function(fields.Char('Type'), 'get_type_name')
     number = fields.Char('Number', size=None, readonly=True, select=True)
     reference = fields.Char('Reference', size=None, states=_STATES,
@@ -98,22 +97,21 @@ class Invoice(Workflow, ModelSQL, ModelView):
     accounting_date = fields.Date('Accounting Date', states=_STATES,
         depends=_DEPENDS)
     party = fields.Many2One('party.party', 'Party',
-        required=True, states=_STATES, depends=_DEPENDS,
-        on_change=['party', 'payment_term', 'type', 'company'])
-    party_lang = fields.Function(fields.Char('Party Language',
-        on_change_with=['party']), 'on_change_with_party_lang')
+        required=True, states=_STATES, depends=_DEPENDS)
+    party_lang = fields.Function(fields.Char('Party Language'),
+        'on_change_with_party_lang')
     invoice_address = fields.Many2One('party.address', 'Invoice Address',
         required=True, states=_STATES, depends=['state', 'party'],
         domain=[('party', '=', Eval('party'))])
     currency = fields.Many2One('currency.currency', 'Currency', required=True,
         states={
             'readonly': ((Eval('state') != 'draft')
-                | (Eval('lines') & Eval('currency'))),
-            }, depends=['state', 'lines'])
-    currency_digits = fields.Function(fields.Integer('Currency Digits',
-        on_change_with=['currency']), 'on_change_with_currency_digits')
-    currency_date = fields.Function(fields.Date('Currency Date',
-        on_change_with=['invoice_date']), 'on_change_with_currency_date',)
+                | (Eval('lines', [0]) & Eval('currency'))),
+            }, depends=['state'])
+    currency_digits = fields.Function(fields.Integer('Currency Digits'),
+        'on_change_with_currency_digits')
+    currency_date = fields.Function(fields.Date('Currency Date'),
+        'on_change_with_currency_date')
     journal = fields.Many2One('account.journal', 'Journal', required=True,
         states=_STATES, depends=_DEPENDS)
     move = fields.Many2One('account.move', 'Move', readonly=True)
@@ -132,12 +130,9 @@ class Invoice(Workflow, ModelSQL, ModelView):
     payment_term = fields.Many2One('account.invoice.payment_term',
         'Payment Term', required=True, states=_STATES, depends=_DEPENDS)
     lines = fields.One2Many('account.invoice.line', 'invoice', 'Lines',
-        states=_STATES, on_change=[
-            'lines', 'taxes', 'currency', 'party', 'type'
-        ], depends=['state', 'currency_date'])
+        states=_STATES, depends=['state', 'currency_date'])
     taxes = fields.One2Many('account.invoice.tax', 'invoice', 'Tax Lines',
-        states=_STATES, depends=_DEPENDS,
-        on_change=['lines', 'taxes', 'currency', 'party', 'type'])
+        states=_STATES, depends=_DEPENDS)
     comment = fields.Text('Comment', states=_STATES, depends=_DEPENDS)
     origins = fields.Function(fields.Char('Origins'), 'get_origins')
     untaxed_amount = fields.Function(fields.Numeric('Untaxed',
@@ -370,6 +365,7 @@ class Invoice(Workflow, ModelSQL, ModelView):
             result['payment_term.rec_name'] = payment_term.rec_name
         return result
 
+    @fields.depends('type', 'party', 'company')
     def on_change_type(self):
         Journal = Pool().get('account.journal')
         res = {}
@@ -384,6 +380,7 @@ class Invoice(Workflow, ModelSQL, ModelView):
         res.update(self.__get_account_payment_term())
         return res
 
+    @fields.depends('party', 'payment_term', 'type', 'company')
     def on_change_party(self):
         res = {
             'invoice_address': None,
@@ -396,15 +393,18 @@ class Invoice(Workflow, ModelSQL, ModelView):
             res['invoice_address.rec_name'] = invoice_address.rec_name
         return res
 
+    @fields.depends('currency')
     def on_change_with_currency_digits(self, name=None):
         if self.currency:
             return self.currency.digits
         return 2
 
+    @fields.depends('invoice_date')
     def on_change_with_currency_date(self, name=None):
         Date = Pool().get('ir.date')
         return self.invoice_date or Date.today()
 
+    @fields.depends('party')
     def on_change_with_party_lang(self, name=None):
         Config = Pool().get('ir.configuration')
         if self.party:
@@ -423,9 +423,13 @@ class Invoice(Workflow, ModelSQL, ModelView):
             type_names[invoice.id] = type2name[invoice.type]
         return type_names
 
+    @fields.depends('lines', 'taxes', 'currency', 'party', 'type',
+        'accounting_date', 'invoice_date')
     def on_change_lines(self):
         return self._on_change_lines_taxes()
 
+    @fields.depends('lines', 'taxes', 'currency', 'party', 'type',
+        'accounting_date', 'invoice_date')
     def on_change_taxes(self):
         return self._on_change_lines_taxes()
 
@@ -447,11 +451,12 @@ class Invoice(Workflow, ModelSQL, ModelView):
             for line in self.lines:
                 if (line.type or 'line') != 'line':
                     continue
-                res['untaxed_amount'] += line.amount or 0
+                res['untaxed_amount'] += getattr(line, 'amount', None) or 0
                 with Transaction().set_context(**context):
-                    taxes = Tax.compute(line.taxes,
-                        line.unit_price or Decimal('0.0'),
-                        line.quantity or 0.0)
+                    taxes = Tax.compute(getattr(line, 'taxes', []) or [],
+                        getattr(line, 'unit_price', None) or Decimal('0.0'),
+                        getattr(line, 'quantity', None) or 0.0,
+                        date=self.accounting_date or self.invoice_date)
                 for tax in taxes:
                     key, val = self._compute_tax(tax,
                         self.type or 'out_invoice')
@@ -519,7 +524,7 @@ class Invoice(Workflow, ModelSQL, ModelView):
                     if value.get(field):
                         value[field + '.rec_name'] = \
                             Target(value[field]).rec_name
-                res['taxes']['add'].append(value)
+                res['taxes']['add'].append((-1, value))
         if self.currency:
             res['untaxed_amount'] = self.currency.round(res['untaxed_amount'])
             res['tax_amount'] = self.currency.round(res['tax_amount'])
@@ -543,6 +548,7 @@ class Invoice(Workflow, ModelSQL, ModelView):
         type_name = cls.tax_amount._field.sql_type().base
         in_max = cursor.IN_MAX
         tax = InvoiceTax.__table__()
+        to_round = False
         for i in range(0, len(invoices), in_max):
             sub_ids = [i.id for i in invoices[i:i + in_max]]
             red_sql = reduce_ids(tax.invoice, sub_ids)
@@ -554,7 +560,13 @@ class Invoice(Workflow, ModelSQL, ModelView):
                 # SQLite uses float for SUM
                 if not isinstance(sum_, Decimal):
                     sum_ = Decimal(str(sum_))
+                    to_round = True
                 tax_amount[invoice_id] = sum_
+        # Float amount must be rounded to get the right precision
+        if to_round:
+            for invoice in invoices:
+                tax_amount[invoice.id] = invoice.currency.round(
+                    tax_amount[invoice.id])
 
         invoices_move = set()
         invoices_no_move = set()
@@ -570,6 +582,7 @@ class Invoice(Workflow, ModelSQL, ModelView):
         invoice = cls.__table__()
         move = Move.__table__()
         line = MoveLine.__table__()
+        to_round = False
         for i in range(0, len(invoices_move), in_max):
             sub_ids = [i.id for i in invoices_move[i:i + in_max]]
             red_sql = reduce_ids(invoice.id, sub_ids)
@@ -580,8 +593,7 @@ class Invoice(Workflow, ModelSQL, ModelView):
                     Coalesce(Sum(
                             Case((line.second_currency == invoice.currency,
                                     Abs(line.amount_second_currency)
-                                    * Abs(line.debit - line.credit)
-                                    / (line.debit - line.credit)),
+                                    * Sign(line.debit - line.credit)),
                                 else_=line.debit - line.credit)),
                         0).cast(type_name),
                     where=(invoice.account == line.account) & red_sql,
@@ -590,11 +602,16 @@ class Invoice(Workflow, ModelSQL, ModelView):
                 # SQLite uses float for SUM
                 if not isinstance(sum_, Decimal):
                     sum_ = Decimal(str(sum_))
+                    to_round = True
                 total_amount[invoice_id] = sum_
 
         for invoice in invoices_move:
             if invoice.type in ('in_invoice', 'out_credit_note'):
                 total_amount[invoice.id] *= -1
+            # Float amount must be rounded to get the right precision
+            if to_round:
+                total_amount[invoice.id] = invoice.currency.round(
+                    total_amount[invoice.id])
             untaxed_amount[invoice.id] = (
                 total_amount[invoice.id] - tax_amount[invoice.id])
 
@@ -795,7 +812,8 @@ class Invoice(Workflow, ModelSQL, ModelView):
                 continue
             with Transaction().set_context(**context):
                 taxes = Tax.compute(line.taxes, line.unit_price,
-                        line.quantity)
+                    line.quantity,
+                    date=self.accounting_date or self.invoice_date)
             for tax in taxes:
                 key, val = self._compute_tax(tax, self.type)
                 val['invoice'] = self.id
@@ -884,7 +902,7 @@ class Invoice(Workflow, ModelSQL, ModelView):
             res['amount_second_currency'] = abs(res['amount_second_currency'])
             res['second_currency'] = self.currency.id
         else:
-            res['amount_second_currency'] = Decimal('0.0')
+            res['amount_second_currency'] = None
             res['second_currency'] = None
         if amount >= Decimal('0.0'):
             res['debit'] = Decimal('0.0')
@@ -917,7 +935,9 @@ class Invoice(Workflow, ModelSQL, ModelView):
         total_currency = Decimal('0.0')
         for line in move_lines:
             total += line['debit'] - line['credit']
-            total_currency += line['amount_second_currency']
+            if line['amount_second_currency']:
+                total_currency += line['amount_second_currency'].copy_sign(
+                    line['debit'] - line['credit'])
 
         term_lines = self.payment_term.compute(total, self.company.currency,
             self.invoice_date)
@@ -926,7 +946,8 @@ class Invoice(Workflow, ModelSQL, ModelView):
             term_lines = [(Date.today(), total)]
         for date, amount in term_lines:
             val = self._get_move_line(date, amount)
-            remainder_total_currency += val['amount_second_currency']
+            if val['amount_second_currency']:
+                remainder_total_currency += val['amount_second_currency']
             move_lines.append(val)
         if not self.currency.is_zero(remainder_total_currency):
             move_lines[-1]['amount_second_currency'] -= \
@@ -1000,13 +1021,11 @@ class Invoice(Workflow, ModelSQL, ModelView):
 
     @classmethod
     def search_rec_name(cls, name, clause):
-        invoices = cls.search(['OR',
-                ('number',) + tuple(clause[1:]),
-                ('reference',) + tuple(clause[1:]),
-                ], order=[])
-        if invoices:
-            return [('id', 'in', [i.id for i in invoices])]
-        return [('party',) + tuple(clause[1:])]
+        return ['OR',
+            ('number',) + tuple(clause[1:]),
+            ('reference',) + tuple(clause[1:]),
+            ('party',) + tuple(clause[1:]),
+            ]
 
     @classmethod
     def get_origins(cls, invoices, name):
@@ -1030,24 +1049,20 @@ class Invoice(Workflow, ModelSQL, ModelView):
         super(Invoice, cls).delete(invoices)
 
     @classmethod
-    def write(cls, invoices, vals):
-        keys = vals.keys()
-        for key in cls._check_modify_exclude:
-            if key in keys:
-                keys.remove(key)
-        if len(keys):
-            cls.check_modify(invoices)
-        update_tax = [i for i in invoices if i.state == 'draft']
-        super(Invoice, cls).write(invoices, vals)
+    def write(cls, *args):
+        actions = iter(args)
+        all_invoices = []
+        for invoices, values in zip(actions, actions):
+            if set(values) - set(cls._check_modify_exclude):
+                cls.check_modify(invoices)
+            all_invoices += invoices
+        update_tax = [i for i in all_invoices if i.state == 'draft']
+        super(Invoice, cls).write(*args)
         if update_tax:
             cls.update_taxes(update_tax)
 
     @classmethod
     def copy(cls, invoices, default=None):
-        pool = Pool()
-        Line = pool.get('account.invoice.line')
-        Tax = pool.get('account.invoice.tax')
-
         if default is None:
             default = {}
         default = default.copy()
@@ -1058,24 +1073,10 @@ class Invoice(Workflow, ModelSQL, ModelView):
         default['invoice_report_cache'] = None
         default['invoice_report_format'] = None
         default['payment_lines'] = None
-        default['lines'] = None
-        default['taxes'] = None
         default.setdefault('invoice_date', None)
         default.setdefault('accounting_date', None)
         default['lines_to_pay'] = None
-        default.setdefault('origin', None)
-
-        new_invoices = []
-        for invoice in invoices:
-            new_invoice, = super(Invoice, cls).copy([invoice], default=default)
-            Line.copy(invoice.lines, default={
-                    'invoice': new_invoice.id,
-                    })
-            Tax.copy(invoice.taxes, default={
-                    'invoice': new_invoice.id,
-                    })
-            new_invoices.append(new_invoice)
-        return new_invoices
+        return super(Invoice, cls).copy(invoices, default=default)
 
     @classmethod
     def validate(cls, invoices):
@@ -1455,15 +1456,15 @@ class InvoiceLine(ModelSQL, ModelView):
             'required': ~Eval('invoice'),
             },
         depends=['invoice'])
-    party_lang = fields.Function(fields.Char('Party Language',
-        on_change_with=['party']), 'on_change_with_party_lang')
+    party_lang = fields.Function(fields.Char('Party Language'),
+        'on_change_with_party_lang')
     currency = fields.Many2One('currency.currency', 'Currency',
         states={
             'required': ~Eval('invoice'),
             },
         depends=['invoice'])
-    currency_digits = fields.Function(fields.Integer('Currency Digits',
-        on_change_with=['currency']), 'on_change_with_currency_digits')
+    currency_digits = fields.Function(fields.Integer('Currency Digits'),
+        'on_change_with_currency_digits')
     company = fields.Many2One('company.company', 'Company',
         states={
             'required': ~Eval('invoice'),
@@ -1504,20 +1505,15 @@ class InvoiceLine(ModelSQL, ModelView):
                 ('category', '!=', -1)),
             ],
         depends=['product', 'type', 'product_uom_category'])
-    unit_digits = fields.Function(fields.Integer('Unit Digits',
-        on_change_with=['unit']), 'on_change_with_unit_digits')
+    unit_digits = fields.Function(fields.Integer('Unit Digits'),
+        'on_change_with_unit_digits')
     product = fields.Many2One('product.product', 'Product',
         states={
             'invisible': Eval('type') != 'line',
             },
-        on_change=['product', 'unit', 'quantity', 'description',
-            '_parent_invoice.type', '_parent_invoice.party',
-            '_parent_invoice.currency', '_parent_invoice.currency_date',
-            'party', 'currency', 'invoice', 'invoice_type'],
         depends=['type'])
     product_uom_category = fields.Function(
-        fields.Many2One('product.uom.category', 'Product Uom Category',
-            on_change_with=['product']),
+        fields.Many2One('product.uom.category', 'Product Uom Category'),
         'on_change_with_product_uom_category')
     account = fields.Many2One('account.account', 'Account',
         domain=[
@@ -1533,8 +1529,6 @@ class InvoiceLine(ModelSQL, ModelView):
                     ('kind', '=', 'revenue'),
                     ('kind', '=', 'expense')))
             ],
-        on_change=['account', 'product', '_parent_invoice.party',
-            '_parent_invoice.type'],
         states={
             'invisible': Eval('type') != 'line',
             'required': Eval('type') == 'line',
@@ -1552,8 +1546,6 @@ class InvoiceLine(ModelSQL, ModelView):
             states={
                 'invisible': ~Eval('type').in_(['line', 'subtotal']),
                 },
-            on_change_with=['type', 'quantity', 'unit_price',
-                '_parent_invoice.currency', 'currency'],
             depends=['type', 'currency_digits']), 'get_amount')
     description = fields.Text('Description', size=None, required=True)
     note = fields.Text('Note')
@@ -1659,22 +1651,27 @@ class InvoiceLine(ModelSQL, ModelView):
     def default_type():
         return 'line'
 
+    @fields.depends('party')
     def on_change_with_party_lang(self, name=None):
         Config = Pool().get('ir.configuration')
         if self.party and self.party.lang:
             return self.party.lang.code
         return Config.get_language()
 
+    @fields.depends('unit')
     def on_change_with_unit_digits(self, name=None):
         if self.unit:
             return self.unit.digits
         return 2
 
+    @fields.depends('currency')
     def on_change_with_currency_digits(self, name=None):
         if self.currency:
             return self.currency.digits
         return 2
 
+    @fields.depends('type', 'quantity', 'unit_price',
+        '_parent_invoice.currency', 'currency')
     def on_change_with_amount(self):
         if self.type == 'line':
             currency = (self.invoice.currency if self.invoice
@@ -1743,6 +1740,10 @@ class InvoiceLine(ModelSQL, ModelView):
         '''
         return {}
 
+    @fields.depends('product', 'unit', 'quantity', 'description',
+        '_parent_invoice.type', '_parent_invoice.party',
+        '_parent_invoice.currency', '_parent_invoice.currency_date',
+        'party', 'currency', 'invoice', 'invoice_type')
     def on_change_product(self):
         pool = Pool()
         Product = pool.get('product.product')
@@ -1850,10 +1851,13 @@ class InvoiceLine(ModelSQL, ModelView):
         res['amount'] = self.on_change_with_amount()
         return res
 
+    @fields.depends('product')
     def on_change_with_product_uom_category(self, name=None):
         if self.product:
             return self.product.default_uom_category.id
 
+    @fields.depends('account', 'product', '_parent_invoice.party',
+        '_parent_invoice.type')
     def on_change_account(self):
         if self.product:
             return {}
@@ -1915,9 +1919,10 @@ class InvoiceLine(ModelSQL, ModelView):
         super(InvoiceLine, cls).delete(lines)
 
     @classmethod
-    def write(cls, lines, vals):
+    def write(cls, *args):
+        lines = sum(args[0::2], [])
         cls.check_modify(lines)
-        super(InvoiceLine, cls).write(lines, vals)
+        super(InvoiceLine, cls).write(*args)
 
     @classmethod
     def create(cls, vlist):
@@ -2027,7 +2032,7 @@ class InvoiceLine(ModelSQL, ModelView):
             res['second_currency'] = self.invoice.currency.id
         else:
             amount = self.amount
-            res['amount_second_currency'] = Decimal('0.0')
+            res['amount_second_currency'] = None
             res['second_currency'] = None
         if self.invoice.type in ('in_invoice', 'out_credit_note'):
             if amount >= Decimal('0.0'):
@@ -2036,12 +2041,16 @@ class InvoiceLine(ModelSQL, ModelView):
             else:
                 res['debit'] = Decimal('0.0')
                 res['credit'] = - amount
-                res['amount_second_currency'] = - res['amount_second_currency']
+                if res['amount_second_currency']:
+                    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']
+                if res['amount_second_currency']:
+                    res['amount_second_currency'] = \
+                        - res['amount_second_currency']
             else:
                 res['debit'] = - amount
                 res['credit'] = Decimal('0.0')
@@ -2102,7 +2111,6 @@ class InvoiceTax(ModelSQL, ModelView):
         digits=(16, Eval('_parent_invoice', {}).get('currency_digits', 2)))
     amount = fields.Numeric('Amount', required=True,
         digits=(16, Eval('_parent_invoice', {}).get('currency_digits', 2)),
-        on_change_with=['tax', 'base', 'amount', 'manual'],
         depends=['tax', 'base', 'manual'])
     manual = fields.Boolean('Manual')
     base_code = fields.Many2One('account.tax.code', 'Base Code',
@@ -2119,8 +2127,6 @@ class InvoiceTax(ModelSQL, ModelView):
         states={
             'readonly': ~Eval('manual', False),
             },
-        on_change=['tax', '_parent_invoice.party',
-            '_parent_invoice.type'],
         depends=['manual'])
 
     @classmethod
@@ -2182,6 +2188,7 @@ class InvoiceTax(ModelSQL, ModelView):
     def default_tax_sign():
         return Decimal('1')
 
+    @fields.depends('tax', '_parent_invoice.party', '_parent_invoice.type')
     def on_change_tax(self):
         Tax = Pool().get('account.tax')
         changes = {}
@@ -2215,6 +2222,7 @@ class InvoiceTax(ModelSQL, ModelView):
                 changes['account'] = tax.credit_note_account.id
         return changes
 
+    @fields.depends('tax', 'base', 'amount', 'manual')
     def on_change_with_amount(self):
         Tax = Pool().get('account.tax')
         if self.tax and self.manual:
@@ -2249,9 +2257,10 @@ class InvoiceTax(ModelSQL, ModelView):
         super(InvoiceTax, cls).delete(taxes)
 
     @classmethod
-    def write(cls, taxes, vals):
+    def write(cls, *args):
+        taxes = sum(args[0::2], [])
         cls.check_modify(taxes)
-        super(InvoiceTax, cls).write(taxes, vals)
+        super(InvoiceTax, cls).write(*args)
 
     @classmethod
     def create(cls, vlist):
@@ -2314,7 +2323,7 @@ class InvoiceTax(ModelSQL, ModelView):
             res['second_currency'] = self.invoice.currency.id
         else:
             amount = self.amount
-            res['amount_second_currency'] = Decimal('0.0')
+            res['amount_second_currency'] = None
             res['second_currency'] = None
         if self.invoice.type in ('in_invoice', 'out_credit_note'):
             if amount >= Decimal('0.0'):
@@ -2323,12 +2332,16 @@ class InvoiceTax(ModelSQL, ModelView):
             else:
                 res['debit'] = Decimal('0.0')
                 res['credit'] = - amount
-                res['amount_second_currency'] = - res['amount_second_currency']
+                if res['amount_second_currency']:
+                    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']
+                if res['amount_second_currency']:
+                    res['amount_second_currency'] = \
+                        - res['amount_second_currency']
             else:
                 res['debit'] = - amount
                 res['credit'] = Decimal('0.0')
@@ -2450,8 +2463,7 @@ class PayInvoiceStart(ModelView):
     amount = fields.Numeric('Amount', digits=(16, Eval('currency_digits', 2)),
         depends=['currency_digits'], required=True)
     currency = fields.Many2One('currency.currency', 'Currency', required=True)
-    currency_digits = fields.Integer('Currency Digits', readonly=True,
-            on_change_with=['currency'])
+    currency_digits = fields.Integer('Currency Digits', readonly=True)
     description = fields.Char('Description', size=None)
     journal = fields.Many2One('account.journal', 'Journal', required=True,
             domain=[('type', '=', 'cash')])
@@ -2466,6 +2478,7 @@ class PayInvoiceStart(ModelView):
     def default_currency_digits():
         return 2
 
+    @fields.depends('currency')
     def on_change_with_currency_digits(self):
         if self.currency:
             return self.currency.digits
@@ -2480,14 +2493,8 @@ class PayInvoiceAsk(ModelView):
         ('partial', 'Partial Payment'),
         ], 'Type', required=True)
     journal_writeoff = fields.Many2One('account.journal', 'Write-Off Journal',
-        states={
-            'invisible': Eval('type') != 'writeoff',
-            'required': Eval('type') == 'writeoff',
-            }, depends=['type'])
-    account_writeoff = fields.Many2One('account.account', 'Write-Off Account',
         domain=[
-            ('kind', '!=', 'view'),
-            ('company', '=', Eval('context', {}).get('company', -1)),
+            ('type', '=', 'write-off'),
             ],
         states={
             'invisible': Eval('type') != 'writeoff',
@@ -2519,8 +2526,7 @@ class PayInvoiceAsk(ModelView):
             ],
         states={
             'invisible': Eval('type') != 'writeoff',
-            }, on_change=['lines', 'amount', 'currency', 'currency_writeoff',
-            'invoice'],
+            },
         depends=['lines_to_pay', 'type'])
     payment_lines = fields.Many2Many('account.move.line', None, None,
         'Payment Lines', readonly=True,
@@ -2534,6 +2540,8 @@ class PayInvoiceAsk(ModelView):
     def default_type():
         return 'partial'
 
+    @fields.depends('lines', 'amount', 'currency', 'currency_writeoff',
+        'invoice')
     def on_change_lines(self):
         Currency = Pool().get('currency.currency')
 
@@ -2704,8 +2712,7 @@ class PayInvoice(Wizard):
                 if lines:
                     MoveLine.reconcile(lines,
                         journal=self.ask.journal_writeoff,
-                        date=self.start.date,
-                        account=self.ask.account_writeoff)
+                        date=self.start.date)
         else:
             if line:
                 reconcile_lines += [line]
diff --git a/locale/bg_BG.po b/locale/bg_BG.po
index d344a78..3152f25 100644
--- a/locale/bg_BG.po
+++ b/locale/bg_BG.po
@@ -575,10 +575,6 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr "Променено от"
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr "Сметка на отписване"
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
 msgstr "Платена сума"
@@ -1478,8 +1474,8 @@ msgid "Print Invoice"
 msgstr "Отпечатване на фактура"
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
-msgstr "Фактурите ще бъдет изпратени <i>директно</i> на принтера."
+msgid "The invoices will be sent directly to the printer."
+msgstr ""
 
 msgctxt "view:account.invoice.print.warning:"
 msgid "You have selected more than one invoice to print."
diff --git a/locale/ca_ES.po b/locale/ca_ES.po
index 1d13864..d64778a 100644
--- a/locale/ca_ES.po
+++ b/locale/ca_ES.po
@@ -18,7 +18,7 @@ msgstr ""
 
 msgctxt "error:account.invoice.credit:"
 msgid "You can not credit with refund invoice \"%s\" because it has payments."
-msgstr "No podeu pagar amb la factura de devolución \"%s\" perquè té pagaments."
+msgstr "No podeu pagar amb la factura de devolució \"%s\" perquè té pagaments."
 
 msgctxt "error:account.invoice.credit:"
 msgid ""
@@ -31,8 +31,7 @@ msgstr ""
 msgctxt "error:account.invoice.credit:"
 msgid "You can not credit with refund invoice \"%s\" because it is not posted."
 msgstr ""
-"No podeu pagar amb la factura de devolución \"%s\" perquè no està "
-"confirmada."
+"No podeu pagar amb la factura de devolució \"%s\" perquè no està confirmada."
 
 msgctxt "error:account.invoice.line:"
 msgid "Line with \"line\" type must have an account."
@@ -103,11 +102,11 @@ msgstr "La línia \"%(line)s\" del termini de pagament \"%(term)s\" no és corre
 msgctxt "error:account.invoice.payment_term:"
 msgid "Last line of payment term \"%s\" must be of type remainder."
 msgstr ""
-"L'última línia del termini de pagament \"%s\" ha de ser de tipus remanent."
+"L'última línia del termini de pagament \"%s\" ha de ser de tipus romanent."
 
 msgctxt "error:account.invoice.payment_term:"
 msgid "Missing remainder line in payment term \"%s\"."
-msgstr "Falta el remanent de la línea del termini de pagament \"%s\"."
+msgstr "Falta el romanent de la línia del termini de pagament \"%s\"."
 
 msgctxt "error:account.invoice.tax:"
 msgid ""
@@ -133,9 +132,9 @@ msgid ""
 "\"%(invoice_company)s\" using base tax code \"%(base_code)s\" from company "
 "\"%(base_code_company)s\"."
 msgstr ""
-"No podeu crear la factura \"%(invoice)s\" de la empresa "
+"No podeu crear la factura \"%(invoice)s\" de l'empresa "
 "\"%(invoice_company)s\" utilitzant el codi d'impostos base \"%(base_code)s\""
-" de la empresa \"%(base_code_company)s\"."
+" de l'empresa \"%(base_code_company)s\"."
 
 msgctxt "error:account.invoice.tax:"
 msgid ""
@@ -143,9 +142,9 @@ msgid ""
 "\"%(invoice_company)s\" using tax code \"%(tax_code)s\" from company "
 "\"%(tax_code_company)s\"."
 msgstr ""
-"No podeu crear la factura \"%(invoice)s\" de la empresa "
+"No podeu crear la factura \"%(invoice)s\" de l'empresa "
 "\"%(invoice_company)s\" utilitzant el codi d'impostos base \"%(tax_code)s\" "
-"de la empresa \"%(tax_code_company)s\"."
+"de l'empresa \"%(tax_code_company)s\"."
 
 msgctxt "error:account.invoice.tax:"
 msgid ""
@@ -194,7 +193,7 @@ msgid ""
 "Invoice \"%s\" tax bases are different from invoice lines.\n"
 "Re-compute the invoice."
 msgstr ""
-"La base dels impostos de la factura \"%s\" és diferent de les de les línias de la factura.\n"
+"La base dels impostos de la factura \"%s\" és diferent de les de les línies de la factura.\n"
 "Re-calculeu la factura."
 
 msgctxt "error:account.invoice:"
@@ -231,7 +230,7 @@ msgid ""
 "Use the today for cancel move?"
 msgstr ""
 "El període de la factura \"%s\" està tancat.\n"
-"¿Usa l'actual per l'assentament de cancel·lació?"
+"Voleu usar l'actual per l'assentament de cancel·lació?"
 
 msgctxt "error:account.invoice:"
 msgid ""
@@ -239,7 +238,7 @@ msgid ""
 "period/fiscal year \"%(period)s\"."
 msgstr ""
 "No hi ha seqüència de factura per la factura \"%(invoice)s\" al "
-"període/exercicifiscal \"%(period)s\"."
+"període/exercici fiscal \"%(period)s\"."
 
 msgctxt "error:account.invoice:"
 msgid ""
@@ -253,8 +252,8 @@ msgstr ""
 msgctxt "error:account.invoice:"
 msgid "You can not modify invoice \"%s\" because it is posted, paid or cancelled."
 msgstr ""
-"No podeu modificar la factura \"%(invoice)s\" perquè està confirmada, pagada"
-" o cancel·lada."
+"No podeu modificar la factura \"%s\" perquè està confirmada, pagada o "
+"cancel·lada."
 
 msgctxt "error:account.period:"
 msgid "Period \"%(first)s\" and \"%(second)s\" have the same invoice sequence."
@@ -312,7 +311,7 @@ msgstr "Import a pagar avui"
 
 msgctxt "field:account.invoice,cancel_move:"
 msgid "Cancel Move"
-msgstr "Cancel·la assentament"
+msgstr "Assentament cancel·lació"
 
 msgctxt "field:account.invoice,comment:"
 msgid "Comment"
@@ -412,7 +411,7 @@ msgstr "Nom"
 
 msgctxt "field:account.invoice,reconciled:"
 msgid "Reconciled"
-msgstr "Concil·liada"
+msgstr "Conciliada"
 
 msgctxt "field:account.invoice,reference:"
 msgid "Reference"
@@ -444,7 +443,7 @@ msgstr "Tipus"
 
 msgctxt "field:account.invoice,untaxed_amount:"
 msgid "Untaxed"
-msgstr "Base imponible"
+msgstr "Base imposable"
 
 msgctxt "field:account.invoice,write_date:"
 msgid "Write Date"
@@ -638,10 +637,6 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr "Usuari modificació"
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr "Compte del desajust"
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
 msgstr "Import del pagament"
@@ -956,7 +951,7 @@ msgstr "Termini de pagament del proveïdor"
 
 msgctxt "help:account.invoice.credit.start,with_refund:"
 msgid "If true, the current invoice(s) will be paid."
-msgstr "Si està marcada, les factures actuals es pagarán."
+msgstr "Si està marcada, les factures actuals es pagaran."
 
 msgctxt "help:account.invoice.payment_term.line,sequence:"
 msgid "Use to order lines in ascending order"
@@ -1176,7 +1171,7 @@ msgstr "Base"
 
 msgctxt "odt:account.invoice:"
 msgid "Credit Note N°:"
-msgstr "Abonament Nº:"
+msgstr "Abonament Núm.:"
 
 msgctxt "odt:account.invoice:"
 msgid "Date"
@@ -1216,7 +1211,7 @@ msgstr "Correu electrònic:"
 
 msgctxt "odt:account.invoice:"
 msgid "Invoice N°:"
-msgstr "Factura Nº:"
+msgstr "Factura Núm.:"
 
 msgctxt "odt:account.invoice:"
 msgid "Payment Term"
@@ -1244,11 +1239,11 @@ msgstr "Referència"
 
 msgctxt "odt:account.invoice:"
 msgid "Supplier Credit Note N°:"
-msgstr "Abonament de proveïdor Nº:"
+msgstr "Abonament de proveïdor Núm.:"
 
 msgctxt "odt:account.invoice:"
 msgid "Supplier Invoice N°:"
-msgstr "Factura de proveïdor Nº:"
+msgstr "Factura de proveïdor Núm.:"
 
 msgctxt "odt:account.invoice:"
 msgid "Tax"
@@ -1304,11 +1299,11 @@ msgstr "Pagada"
 
 msgctxt "selection:account.invoice,state:"
 msgid "Posted"
-msgstr "Confirmat"
+msgstr "Confirmada"
 
 msgctxt "selection:account.invoice,state:"
 msgid "Validated"
-msgstr "Validat"
+msgstr "Validada"
 
 msgctxt "selection:account.invoice,type:"
 msgid "Credit Note"
@@ -1428,7 +1423,7 @@ msgstr "Fix"
 
 msgctxt "selection:account.invoice.payment_term.line,type:"
 msgid "Percentage on Remainder"
-msgstr "Percentatge sobre remanent"
+msgstr "Percentatge sobre romanent"
 
 msgctxt "selection:account.invoice.payment_term.line,type:"
 msgid "Percentage on Total"
@@ -1436,7 +1431,7 @@ msgstr "Percentatge sobre total"
 
 msgctxt "selection:account.invoice.payment_term.line,type:"
 msgid "Remainder"
-msgstr "Remanent"
+msgstr "Romanent"
 
 msgctxt "selection:account.invoice.payment_term.line,weekday:"
 msgid ""
@@ -1523,8 +1518,8 @@ msgid "Print Invoice"
 msgstr "Imprimeix factura"
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
-msgstr "Les factures s'enviaran <i>directament</i> a la impressora."
+msgid "The invoices will be sent directly to the printer."
+msgstr "Les factures s'enviaran directament a l'impressora."
 
 msgctxt "view:account.invoice.print.warning:"
 msgid "You have selected more than one invoice to print."
@@ -1552,7 +1547,7 @@ msgstr "També coneguda com a pro-forma."
 
 msgctxt "view:account.invoice:"
 msgid "Are you sure to cancel the invoice?"
-msgstr "Esteu segur de cancel·lar aquesta factura?"
+msgstr "Esteu segur de cancel·lar la factura?"
 
 msgctxt "view:account.invoice:"
 msgid "Invoice"
@@ -1588,7 +1583,7 @@ msgstr "_Paga"
 
 msgctxt "view:account.invoice:"
 msgid "_Post"
-msgstr "_Confirma"
+msgstr "Co_nfirma"
 
 msgctxt "view:account.move.line:"
 msgid "Amount Second Currency"
diff --git a/locale/cs_CZ.po b/locale/cs_CZ.po
index 209defa..ce48ab7 100644
--- a/locale/cs_CZ.po
+++ b/locale/cs_CZ.po
@@ -574,10 +574,6 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr ""
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr ""
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
 msgstr ""
@@ -1459,7 +1455,7 @@ msgid "Print Invoice"
 msgstr ""
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
+msgid "The invoices will be sent directly to the printer."
 msgstr ""
 
 msgctxt "view:account.invoice.print.warning:"
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 77a8c49..19cb38b 100644
--- a/locale/de_DE.po
+++ b/locale/de_DE.po
@@ -35,7 +35,7 @@ msgctxt "error:account.invoice.credit:"
 msgid "You can not credit with refund invoice \"%s\" because it is not posted."
 msgstr ""
 "Rechnung \"%s\" kann nicht mit Verrechnung gutgeschrieben werden, da sie "
-"nocht nicht festgeschrieben ist."
+"nicht in Status 'Festgeschrieben' ist."
 
 msgctxt "error:account.invoice.line:"
 msgid "Line with \"line\" type must have an account."
@@ -351,7 +351,7 @@ msgstr "Währungsdatum"
 
 msgctxt "field:account.invoice,currency_digits:"
 msgid "Currency Digits"
-msgstr "Währung (signifikante Stellen)"
+msgstr "Nachkommastellen Währung"
 
 msgctxt "field:account.invoice,description:"
 msgid "Description"
@@ -531,11 +531,11 @@ msgstr "Währung"
 
 msgctxt "field:account.invoice.line,currency_digits:"
 msgid "Currency Digits"
-msgstr "Stellen Währung"
+msgstr "Nachkommastellen Währung"
 
 msgctxt "field:account.invoice.line,description:"
 msgid "Description"
-msgstr "Bezeichnung"
+msgstr "Beschreibung"
 
 msgctxt "field:account.invoice.line,id:"
 msgid "ID"
@@ -603,7 +603,7 @@ msgstr "Einheit"
 
 msgctxt "field:account.invoice.line,unit_digits:"
 msgid "Unit Digits"
-msgstr "Anzahl Stellen"
+msgstr "Nachkommastellen"
 
 msgctxt "field:account.invoice.line,unit_price:"
 msgid "Unit Price"
@@ -649,10 +649,6 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr "Letzte Änderung durch"
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr "Konto Ausbuchung"
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
 msgstr "Betrag"
@@ -671,11 +667,11 @@ msgstr "Währung"
 
 msgctxt "field:account.invoice.pay.ask,currency_digits:"
 msgid "Payment Currency Digits"
-msgstr "Stellen Währung"
+msgstr "Nachkommastellen Währung Zahlung"
 
 msgctxt "field:account.invoice.pay.ask,currency_digits_writeoff:"
 msgid "Write-Off Currency Digits"
-msgstr "Stellen Währung Ausbuchung"
+msgstr "Nachkommastellen Währung Ausbuchung"
 
 msgctxt "field:account.invoice.pay.ask,currency_writeoff:"
 msgid "Write-Off Currency"
@@ -719,7 +715,7 @@ msgstr "Währungen"
 
 msgctxt "field:account.invoice.pay.start,currency_digits:"
 msgid "Currency Digits"
-msgstr "Währung (signifikante Stellen)"
+msgstr "Nachkommastellen Währung"
 
 msgctxt "field:account.invoice.pay.start,date:"
 msgid "Date"
@@ -727,7 +723,7 @@ msgstr "Zeitpunkt"
 
 msgctxt "field:account.invoice.pay.start,description:"
 msgid "Description"
-msgstr "Bezeichnung"
+msgstr "Beschreibung"
 
 msgctxt "field:account.invoice.pay.start,id:"
 msgid "ID"
@@ -759,7 +755,7 @@ msgstr "ID"
 
 msgctxt "field:account.invoice.payment_term,lines:"
 msgid "Lines"
-msgstr "Positionen Zahlungsbedingung"
+msgstr "Positionen"
 
 msgctxt "field:account.invoice.payment_term,name:"
 msgid "Payment Term"
@@ -795,7 +791,7 @@ msgstr "Währung"
 
 msgctxt "field:account.invoice.payment_term.line,currency_digits:"
 msgid "Currency Digits"
-msgstr "Währung (signifikante Stellen)"
+msgstr "Nachkommastellen Währung"
 
 msgctxt "field:account.invoice.payment_term.line,day:"
 msgid "Day of Month"
@@ -1009,7 +1005,7 @@ msgstr "Zahlungsbedingung"
 
 msgctxt "model:account.invoice.payment_term.line,name:"
 msgid "Payment Term Line"
-msgstr "Zahlungsbedingung Position"
+msgstr "Zahlungsbedingungsposition"
 
 msgctxt "model:account.invoice.print.warning,name:"
 msgid "Print Invoice Report Warning"
@@ -1165,7 +1161,7 @@ msgstr "Rechnungsausgang"
 
 msgctxt "model:ir.ui.menu,name:menu_invoices"
 msgid "Invoices"
-msgstr "Rechnungen"
+msgstr "Fakturierung"
 
 msgctxt "model:ir.ui.menu,name:menu_payment_term_form"
 msgid "Payment Terms"
@@ -1273,11 +1269,11 @@ msgstr "Steuern"
 
 msgctxt "odt:account.invoice:"
 msgid "Taxes:"
-msgstr "Steuern:"
+msgstr "Steuern"
 
 msgctxt "odt:account.invoice:"
 msgid "Total (excl. taxes):"
-msgstr "Netto:"
+msgstr "Netto"
 
 msgctxt "odt:account.invoice:"
 msgid "Total:"
@@ -1517,11 +1513,11 @@ msgstr "Rechnung bezahlen"
 
 msgctxt "view:account.invoice.payment_term.line:"
 msgid "Payment Term Line"
-msgstr "Zahlungsbedingung Position"
+msgstr "Zahlungsbedingungsposition"
 
 msgctxt "view:account.invoice.payment_term.line:"
 msgid "Payment Term Lines"
-msgstr "Positionen Zahlungsbedingung"
+msgstr "Zahlungsbedingungspositionen"
 
 msgctxt "view:account.invoice.payment_term:"
 msgid "Payment Term"
@@ -1536,8 +1532,8 @@ msgid "Print Invoice"
 msgstr "Rechnung drucken"
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
-msgstr "Die Rechnungen werden <i>direkt</i> an den Drucker gesendet."
+msgid "The invoices will be sent directly to the printer."
+msgstr "Die Rechnungen werden direkt zum Drucker gesendet."
 
 msgctxt "view:account.invoice.print.warning:"
 msgid "You have selected more than one invoice to print."
@@ -1605,7 +1601,7 @@ msgstr "_Festschreiben"
 
 msgctxt "view:account.move.line:"
 msgid "Amount Second Currency"
-msgstr "Betrag Zweitwährung"
+msgstr "Fremdwährungsbetrag"
 
 msgctxt "view:account.move.line:"
 msgid "Credit"
@@ -1633,7 +1629,7 @@ msgstr "Gutschrift erstellen"
 
 msgctxt "wizard_button:account.invoice.credit,start,end:"
 msgid "Cancel"
-msgstr "Annulliert"
+msgstr "Abbrechen"
 
 msgctxt "wizard_button:account.invoice.pay,ask,end:"
 msgid "Cancel"
@@ -1649,7 +1645,7 @@ msgstr "OK"
 
 msgctxt "wizard_button:account.invoice.pay,start,end:"
 msgid "Cancel"
-msgstr "Annulliert"
+msgstr "Abbrechen"
 
 msgctxt "wizard_button:account.invoice.print,warning,end:"
 msgid "Cancel"
diff --git a/locale/es_AR.po b/locale/es_AR.po
index c3b1ff2..9424b2c 100644
--- a/locale/es_AR.po
+++ b/locale/es_AR.po
@@ -633,10 +633,6 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr "Usuario modificación"
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr "Cuenta de desajuste"
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
 msgstr "Importe de pago"
@@ -1518,8 +1514,8 @@ msgid "Print Invoice"
 msgstr "Imprimir factura"
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
-msgstr "Las facturas serán enviadas <i>directamente</i> a la impresora."
+msgid "The invoices will be sent directly to the printer."
+msgstr "Las facturas serán enviadas directamente a la impresora."
 
 msgctxt "view:account.invoice.print.warning:"
 msgid "You have selected more than one invoice to print."
diff --git a/locale/es_CO.po b/locale/es_CO.po
index 9ee3860..7c55490 100644
--- a/locale/es_CO.po
+++ b/locale/es_CO.po
@@ -19,22 +19,21 @@ msgstr ""
 msgctxt "error:account.invoice.credit:"
 msgid "You can not credit with refund invoice \"%s\" because it has payments."
 msgstr ""
-"Usted no puede abonar con el reembolso de la factura \"%s\" porque ha sido "
-"pagada."
+"Usted no puede abonar con reembolso la factura \"%s\" porque ha sido pagada."
 
 msgctxt "error:account.invoice.credit:"
 msgid ""
 "You can not credit with refund invoice \"%s\" because it is a supplier "
 "invoice/credit note."
 msgstr ""
-"No puede acreditar con un reembolso la factura \"%s\" porque es una nota "
+"No puede abonar con reembolso la factura \"%s\" porque es una nota "
 "credito/factura de proveedor."
 
 msgctxt "error:account.invoice.credit:"
 msgid "You can not credit with refund invoice \"%s\" because it is not posted."
 msgstr ""
 "Usted no puede abonar con el reembolso de la factura \"%s\" porque no ha "
-"esta confirmada."
+"esta contabilizada."
 
 msgctxt "error:account.invoice.line:"
 msgid "Line with \"line\" type must have an account."
@@ -68,15 +67,15 @@ msgid ""
 "because the invoice uses the same account (%(account)s)."
 msgstr ""
 "No puede crear una línea de factura \"%(line)s\" en la factura "
-"\"%(invoice)\" porque la factura usa la misma cuenta %(account)s\"."
+"\"%(invoice)s\" porque la factura usa la misma cuenta (%(account)s)."
 
 msgctxt "error:account.invoice.line:"
 msgid ""
 "You can not modify line \"%(line)s\" from invoice \"%(invoice)s\" that is "
 "posted or paid."
 msgstr ""
-"No puede modificar una línea \"%(line)s\" de la factura \"%(invoice)s\" que "
-"esta confirmada o pagada."
+"No puede modificar la línea \"%(line)s\" de la factura \"%(invoice)s\" que "
+"esta contabilizada o pagada."
 
 msgctxt "error:account.invoice.pay:"
 msgid ""
@@ -125,7 +124,7 @@ msgid ""
 "\"%(account_company)s\"."
 msgstr ""
 "No puede crear la factura \"%(invoice)s\" en la compañia "
-"\"%(invoice_company)\" usando la cuenta \"%(account)s\" desde la compañia "
+"\"%(invoice_company)s\" usando la cuenta \"%(account)s\" desde la compañia "
 "\"%(account_company)s\"."
 
 msgctxt "error:account.invoice.tax:"
@@ -135,8 +134,8 @@ msgid ""
 "\"%(base_code_company)s\"."
 msgstr ""
 "No puede crear la factura \"%(invoice)s\" en la compañia "
-"\"%(invoice_company)\" usando el código de impuesto base \"%(base_code)s\" "
-"desde la compañia diferente \"%(base_code_company)s\"."
+"\"%(invoice_company)s\" usando el código de impuesto base \"%(base_code)s\" "
+"desde la compañia \"%(base_code_company)s\"."
 
 msgctxt "error:account.invoice.tax:"
 msgid ""
@@ -145,7 +144,7 @@ msgid ""
 "\"%(tax_code_company)s\"."
 msgstr ""
 "No puede crear la factura \"%(invoice)s\" en la compañia "
-"\"%(invoice_company)\" usando el código de impuesto \"%(tax_code)s\" desde "
+"\"%(invoice_company)s\" usando el código de impuesto \"%(tax_code)s\" desde "
 "la compañia \"%(tax_code_company)s\"."
 
 msgctxt "error:account.invoice.tax:"
@@ -154,7 +153,7 @@ msgid ""
 "is posted or paid."
 msgstr ""
 "No puede modificar los impuestos \"%(tax)s\" de la factura \"%(invoice)s\" "
-"porque esta abierta o pagada!"
+"porque esta contabilizada o pagada!"
 
 msgctxt "error:account.invoice:"
 msgid "Customer invoice/credit note \"%s\" can not be cancelled once posted."
@@ -175,7 +174,7 @@ msgid ""
 "Invoice \"%s\" has taxes defined but not on invoice lines.\n"
 "Re-compute the invoice."
 msgstr ""
-"Factura \"%s\" tiene impuestos definidos pero no los tienen en las líneas de factura.\n"
+"La factura \"%s\" tiene impuestos definidos pero no las líneas de factura.\n"
 "Reprocese la factura"
 
 msgctxt "error:account.invoice:"
@@ -183,7 +182,7 @@ msgid ""
 "Invoice \"%s\" has taxes on invoice lines that are not in the invoice.\n"
 "Re-compute the invoice."
 msgstr ""
-"Factura \"%s\" tiene impuestos en líneas de factura que no están definidos en la factura.\n"
+"La factura \"%s\" tiene impuestos en líneas de factura que no están definidos en la factura.\n"
 "Reprocese la factura"
 
 msgctxt "error:account.invoice:"
@@ -249,13 +248,13 @@ msgid ""
 msgstr ""
 "No puede crear la factura \"%(invoice)s\" en la compañia "
 "\"%(invoice_company)\" porque la cuenta \"%(account)s\" tiene una compañia "
-"diferente \"%(account_company)s\"."
+"diferente (%(account_company)s.)"
 
 msgctxt "error:account.invoice:"
 msgid "You can not modify invoice \"%s\" because it is posted, paid or cancelled."
 msgstr ""
-"No puede modificar una factura \"%s\" porque esta confirmada, pagada o "
-"cancelada."
+"No puede modificar la factura \"%s\" porque esta contabilizada, pagada o "
+"anulada."
 
 msgctxt "error:account.period:"
 msgid "Period \"%(first)s\" and \"%(second)s\" have the same invoice sequence."
@@ -279,7 +278,7 @@ msgstr ""
 
 msgctxt "field:account.fiscalyear,in_credit_note_sequence:"
 msgid "Supplier Credit Note Sequence"
-msgstr "Secuencia de la Nota Crédito del Proveedor"
+msgstr "Secuencia de Nota Crédito de Proveedor"
 
 msgctxt "field:account.fiscalyear,in_invoice_sequence:"
 msgid "Supplier Invoice Sequence"
@@ -303,15 +302,15 @@ msgstr "Fecha de Contabilización"
 
 msgctxt "field:account.invoice,amount_to_pay:"
 msgid "Amount to Pay"
-msgstr "Cantidad a Pagar"
+msgstr "Valor a Pagar"
 
 msgctxt "field:account.invoice,amount_to_pay_today:"
 msgid "Amount to Pay Today"
-msgstr "Cantidad a Pagar Hoy"
+msgstr "Valor a Pagar Hoy"
 
 msgctxt "field:account.invoice,cancel_move:"
 msgid "Cancel Move"
-msgstr "Cancelar Asiento"
+msgstr "Asiento de Cancelación"
 
 msgctxt "field:account.invoice,comment:"
 msgid "Comment"
@@ -367,7 +366,7 @@ msgstr "Formato de Reporte de Facturación"
 
 msgctxt "field:account.invoice,journal:"
 msgid "Journal"
-msgstr "Libro Diario"
+msgstr "Libro Contable"
 
 msgctxt "field:account.invoice,lines:"
 msgid "Lines"
@@ -443,7 +442,7 @@ msgstr "Tipo"
 
 msgctxt "field:account.invoice,untaxed_amount:"
 msgid "Untaxed"
-msgstr "Sin Impuesto"
+msgstr "Subtotal"
 
 msgctxt "field:account.invoice,write_date:"
 msgid "Write Date"
@@ -499,7 +498,7 @@ msgstr "Cuenta"
 
 msgctxt "field:account.invoice.line,amount:"
 msgid "Amount"
-msgstr "Cantidad"
+msgstr "Valor"
 
 msgctxt "field:account.invoice.line,company:"
 msgid "Company"
@@ -551,7 +550,7 @@ msgstr "Origen"
 
 msgctxt "field:account.invoice.line,party:"
 msgid "Party"
-msgstr "Terceros"
+msgstr "Tercero"
 
 msgctxt "field:account.invoice.line,party_lang:"
 msgid "Party Language"
@@ -637,13 +636,9 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr "Modificado por Usuario"
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr "Cuenta Anulada"
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
-msgstr "Cantidad del Pago"
+msgstr "Valor del Pago"
 
 msgctxt "field:account.invoice.pay.ask,amount_writeoff:"
 msgid "Write-Off Amount"
@@ -663,7 +658,7 @@ msgstr "Decimales de la Moneda de Pago"
 
 msgctxt "field:account.invoice.pay.ask,currency_digits_writeoff:"
 msgid "Write-Off Currency Digits"
-msgstr "Anulado Decimales de Moneda"
+msgstr "Decimales de Moneda Anulado"
 
 msgctxt "field:account.invoice.pay.ask,currency_writeoff:"
 msgid "Write-Off Currency"
@@ -679,11 +674,11 @@ msgstr "Factura"
 
 msgctxt "field:account.invoice.pay.ask,journal_writeoff:"
 msgid "Write-Off Journal"
-msgstr "Libro Diario Anulado"
+msgstr "Libro Contable Anulado"
 
 msgctxt "field:account.invoice.pay.ask,lines:"
 msgid "Lines"
-msgstr "Líneas de Inventario"
+msgstr "Líneas"
 
 msgctxt "field:account.invoice.pay.ask,lines_to_pay:"
 msgid "Lines to Pay"
@@ -699,7 +694,7 @@ msgstr "Tipo"
 
 msgctxt "field:account.invoice.pay.start,amount:"
 msgid "Amount"
-msgstr "Cantidad"
+msgstr "Valor"
 
 msgctxt "field:account.invoice.pay.start,currency:"
 msgid "Currency"
@@ -723,7 +718,7 @@ msgstr "ID"
 
 msgctxt "field:account.invoice.pay.start,journal:"
 msgid "Journal"
-msgstr "Libro Diario"
+msgstr "Libro Contable"
 
 msgctxt "field:account.invoice.payment_term,active:"
 msgid "Active"
@@ -767,7 +762,7 @@ msgstr "Modificado por Usuario"
 
 msgctxt "field:account.invoice.payment_term.line,amount:"
 msgid "Amount"
-msgstr "Cantidad"
+msgstr "Valor"
 
 msgctxt "field:account.invoice.payment_term.line,create_date:"
 msgid "Create Date"
@@ -927,7 +922,7 @@ msgstr "Modificado por Usuario"
 
 msgctxt "field:account.period,in_credit_note_sequence:"
 msgid "Supplier Credit Note Sequence"
-msgstr "Secuencia de la Nota Crédito del Proveedor"
+msgstr "Secuencia de Nota Crédito de Proveedor"
 
 msgctxt "field:account.period,in_invoice_sequence:"
 msgid "Supplier Invoice Sequence"
@@ -999,7 +994,7 @@ msgstr "Línea de Forma de Pago"
 
 msgctxt "model:account.invoice.print.warning,name:"
 msgid "Print Invoice Report Warning"
-msgstr "Imprimir Aviso de Reporte Factura"
+msgstr "Advertencia Imprimir Factura"
 
 msgctxt "model:account.invoice.tax,name:"
 msgid "Invoice Tax"
@@ -1062,7 +1057,7 @@ msgstr "Borrador"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_in_credit_note_domain_posted"
 msgid "Posted"
-msgstr "Confirmado"
+msgstr "Contabilizado"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_in_credit_note_domain_validated"
@@ -1082,7 +1077,7 @@ msgstr "Borrador"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_in_invoice_domain_posted"
 msgid "Posted"
-msgstr "Confirmado"
+msgstr "Contabilizado"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_in_invoice_domain_validated"
@@ -1102,7 +1097,7 @@ msgstr "Borrador"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_out_credit_note_domain_posted"
 msgid "Posted"
-msgstr "Confirmado"
+msgstr "Contabilizado"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_out_credit_note_domain_validated"
@@ -1122,7 +1117,7 @@ msgstr "Borrador"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_out_invoice_domain_posted"
 msgid "Posted"
-msgstr "Confirmado"
+msgstr "Contabilizado"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_out_invoice_domain_validated"
@@ -1147,7 +1142,7 @@ msgstr "Notas Crédito"
 
 msgctxt "model:ir.ui.menu,name:menu_invoice_out_invoice_form"
 msgid "Invoices"
-msgstr "Facturas"
+msgstr "Facturas de Venta"
 
 msgctxt "model:ir.ui.menu,name:menu_invoices"
 msgid "Invoices"
@@ -1167,7 +1162,7 @@ msgstr ":"
 
 msgctxt "odt:account.invoice:"
 msgid "Amount"
-msgstr "Cantidad"
+msgstr "Valor"
 
 msgctxt "odt:account.invoice:"
 msgid "Base"
@@ -1195,7 +1190,7 @@ msgstr "Descripción:"
 
 msgctxt "odt:account.invoice:"
 msgid "Draft Credit Note"
-msgstr "Borrador de Nota Crédito"
+msgstr "Nota Crédito en Borrador"
 
 msgctxt "odt:account.invoice:"
 msgid "Draft Invoice"
@@ -1275,7 +1270,7 @@ msgstr "Precio Unitario"
 
 msgctxt "odt:account.invoice:"
 msgid "VAT Number:"
-msgstr "Número NIT:"
+msgstr "Número Identificación:"
 
 msgctxt "odt:account.invoice:"
 msgid "VAT:"
@@ -1283,7 +1278,7 @@ msgstr "NIT:"
 
 msgctxt "odt:account.invoice:"
 msgid "Validated Supplier Credit Note"
-msgstr "Nota Credito de Proveedor Validad"
+msgstr "Nota Credito de Proveedor Validada"
 
 msgctxt "odt:account.invoice:"
 msgid "Validated Supplier Invoice"
@@ -1291,7 +1286,7 @@ msgstr "Factura de Proveedor Validada"
 
 msgctxt "selection:account.invoice,state:"
 msgid "Canceled"
-msgstr "Cancelado"
+msgstr "Anulada"
 
 msgctxt "selection:account.invoice,state:"
 msgid "Draft"
@@ -1303,7 +1298,7 @@ msgstr "Pagado"
 
 msgctxt "selection:account.invoice,state:"
 msgid "Posted"
-msgstr "Confirmado"
+msgstr "Contabilizado"
 
 msgctxt "selection:account.invoice,state:"
 msgid "Validated"
@@ -1311,7 +1306,7 @@ msgstr "Validado"
 
 msgctxt "selection:account.invoice,type:"
 msgid "Credit Note"
-msgstr "Nota de Crédito"
+msgstr "Nota Crédito"
 
 msgctxt "selection:account.invoice,type:"
 msgid "Invoice"
@@ -1335,7 +1330,7 @@ msgstr "Nota Crédito"
 
 msgctxt "selection:account.invoice.line,invoice_type:"
 msgid "Invoice"
-msgstr "Factura"
+msgstr "Factura de Venta"
 
 msgctxt "selection:account.invoice.line,invoice_type:"
 msgid "Supplier Credit Note"
@@ -1522,8 +1517,8 @@ msgid "Print Invoice"
 msgstr "Imprimir Factura"
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
-msgstr "Las facturas serán enviadas <i>directamente</i> a la impresora."
+msgid "The invoices will be sent directly to the printer."
+msgstr "La factura será enviada directamente a la impresora."
 
 msgctxt "view:account.invoice.print.warning:"
 msgid "You have selected more than one invoice to print."
@@ -1547,7 +1542,7 @@ msgstr "Impuestos"
 
 msgctxt "view:account.invoice:"
 msgid "Also known as Pro Forma"
-msgstr "Tambien conocido como Pro Forma"
+msgstr "Tambien conocido como ProForma"
 
 msgctxt "view:account.invoice:"
 msgid "Are you sure to cancel the invoice?"
@@ -1563,7 +1558,7 @@ msgstr "Facturas"
 
 msgctxt "view:account.invoice:"
 msgid "Other Info"
-msgstr "Información Adicional"
+msgstr "Info Adicional"
 
 msgctxt "view:account.invoice:"
 msgid "Payment"
@@ -1587,11 +1582,11 @@ msgstr "_Pago"
 
 msgctxt "view:account.invoice:"
 msgid "_Post"
-msgstr "Registrar"
+msgstr "_Contabilizar"
 
 msgctxt "view:account.move.line:"
 msgid "Amount Second Currency"
-msgstr "Cantidad en la Segunda Moneda"
+msgstr "Valor en Segunda Moneda"
 
 msgctxt "view:account.move.line:"
 msgid "Credit"
diff --git a/locale/es_ES.po b/locale/es_ES.po
index 5c2d5ca..7099767 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -177,7 +177,7 @@ msgid ""
 "Invoice \"%s\" has taxes on invoice lines that are not in the invoice.\n"
 "Re-compute the invoice."
 msgstr ""
-"Las lineas de la factura \"%s\" tienen impuestos  que no corresponden con la factura.\n"
+"Las líneas de la factura \"%s\" tienen impuestos  que no corresponden con la factura.\n"
 "Recalcule la factura."
 
 msgctxt "error:account.invoice:"
@@ -248,8 +248,8 @@ msgstr ""
 msgctxt "error:account.invoice:"
 msgid "You can not modify invoice \"%s\" because it is posted, paid or cancelled."
 msgstr ""
-"No puede modificar la factura \"%(invoice)s\" porque está confirmada, pagada"
-" o cancelada."
+"No puede modificar la factura \"%s\" porque está confirmada, pagada o "
+"cancelada."
 
 msgctxt "error:account.period:"
 msgid "Period \"%(first)s\" and \"%(second)s\" have the same invoice sequence."
@@ -633,10 +633,6 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr "Usuario modificación"
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr "Cuenta para desajustes"
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
 msgstr "Importe del pago"
@@ -1518,8 +1514,8 @@ msgid "Print Invoice"
 msgstr "Imprimir factura"
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
-msgstr "Las facturas se enviarán <i>directamente</i> a la impresora."
+msgid "The invoices will be sent directly to the printer."
+msgstr "Las facturas se enviarán directamente a la impresora."
 
 msgctxt "view:account.invoice.print.warning:"
 msgid "You have selected more than one invoice to print."
@@ -1583,7 +1579,7 @@ msgstr "_Pagar"
 
 msgctxt "view:account.invoice:"
 msgid "_Post"
-msgstr "_Confirmar"
+msgstr "Co_nfirmar"
 
 msgctxt "view:account.move.line:"
 msgid "Amount Second Currency"
diff --git a/locale/fr_FR.po b/locale/fr_FR.po
index f1d6dbe..cfc36ad 100644
--- a/locale/fr_FR.po
+++ b/locale/fr_FR.po
@@ -192,7 +192,7 @@ msgstr ""
 
 msgctxt "error:account.invoice:"
 msgid "Invoice \"%s\" must be cancelled before deletion."
-msgstr "La facture \"%s\" doit être annulée pour être supprimée."
+msgstr "La facture \"%s\" doit être annulée avant suppression."
 
 msgctxt "error:account.invoice:"
 msgid ""
@@ -641,10 +641,6 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr "Mis à jour par"
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr "Compte de pertes et profits"
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
 msgstr "Montant du paiement"
@@ -1526,8 +1522,8 @@ msgid "Print Invoice"
 msgstr "Imprimer la facture"
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
-msgstr "Les factures seront envoyées  <i>directement </i> à l'imprimente"
+msgid "The invoices will be sent directly to the printer."
+msgstr "Les factures seront envoyées directement à l'imprimante."
 
 msgctxt "view:account.invoice.print.warning:"
 msgid "You have selected more than one invoice to print."
diff --git a/locale/nl_NL.po b/locale/nl_NL.po
index 96ff3be..0fe9c46 100644
--- a/locale/nl_NL.po
+++ b/locale/nl_NL.po
@@ -574,10 +574,6 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr ""
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr ""
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
 msgstr ""
@@ -1494,7 +1490,7 @@ msgid "Print Invoice"
 msgstr ""
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
+msgid "The invoices will be sent directly to the printer."
 msgstr ""
 
 msgctxt "view:account.invoice.print.warning:"
diff --git a/locale/ru_RU.po b/locale/ru_RU.po
index 472ccea..fd8adef 100644
--- a/locale/ru_RU.po
+++ b/locale/ru_RU.po
@@ -632,10 +632,6 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr "Изменено пользователем"
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr "Счет списания"
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
 msgstr "Сумма оплаты"
@@ -1519,8 +1515,8 @@ msgid "Print Invoice"
 msgstr "Распечатать инвойс"
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
-msgstr "Инвойсы будут отправлены <i>напрямую</i> на принтер."
+msgid "The invoices will be sent directly to the printer."
+msgstr ""
 
 msgctxt "view:account.invoice.print.warning:"
 msgid "You have selected more than one invoice to print."
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
index b7a882f..18cba6e 100644
--- a/locale/sl_SI.po
+++ b/locale/sl_SI.po
@@ -56,8 +56,8 @@ msgid ""
 "company \"%(invoice_line_company)s because account \"%(account)s has company"
 " \"%(account_company)s\"."
 msgstr ""
-"Pri računu \"%(invoice)s\" podjetja \"%(invoice_line_company)s\" ni možno "
-"izdelati postavke \"%(line)s\", ker je konto \"%(account)s\" podjetja "
+"Pri računu \"%(invoice)s\" družbe \"%(invoice_line_company)s\" ni možno "
+"izdelati postavke \"%(line)s\", ker je konto \"%(account)s\" od družbe "
 "\"%(account_company)s\"."
 
 msgctxt "error:account.invoice.line:"
@@ -122,9 +122,8 @@ msgid ""
 "\"%(invoice_company)s\" using account \"%(account)s\" from company "
 "\"%(account_company)s\"."
 msgstr ""
-"Računa \"%(invoice)s\" pri podjetju \"%(invoice_company)s\" ni možno "
-"izdelati z uporabo konta \"%(account)s\" iz podjetja "
-"\"%(account_company)s\"."
+"Računa \"%(invoice)s\" pri družbi \"%(invoice_company)s\" ni možno izdelati "
+"z uporabo konta \"%(account)s\" iz družbe \"%(account_company)s\"."
 
 msgctxt "error:account.invoice.tax:"
 msgid ""
@@ -132,8 +131,8 @@ msgid ""
 "\"%(invoice_company)s\" using base tax code \"%(base_code)s\" from company "
 "\"%(base_code_company)s\"."
 msgstr ""
-"Računa \"%(invoice)s\" pri podjetju \"%(invoice_company)s\" ni možno "
-"izdelati z uporabo šifre davčne osnove \"%(base_code)s\" iz podjetja "
+"Računa \"%(invoice)s\" pri družbi \"%(invoice_company)s\" ni možno izdelati "
+"z uporabo šifre davčne osnove \"%(base_code)s\" iz družbe "
 "\"%(base_code_company)s\"."
 
 msgctxt "error:account.invoice.tax:"
@@ -142,9 +141,8 @@ msgid ""
 "\"%(invoice_company)s\" using tax code \"%(tax_code)s\" from company "
 "\"%(tax_code_company)s\"."
 msgstr ""
-"Računa \"%(invoice)s\" pri podjetju \"%(invoice_company)s\" ni možno "
-"izdelati z uporabo davčne šifre \"%(tax_code)s\" iz podjetja "
-"\"%(tax_code_company)s\"."
+"Računa \"%(invoice)s\" pri družbi \"%(invoice_company)s\" ni možno izdelati "
+"z uporabo davčne šifre \"%(tax_code)s\" iz družbe \"%(tax_code_company)s\"."
 
 msgctxt "error:account.invoice.tax:"
 msgid ""
@@ -243,8 +241,8 @@ msgid ""
 "You can not create invoice \"%(invoice)s\" on company \"%(invoice_company)s "
 "because account \"%(account)s has a different company (%(account_company)s.)"
 msgstr ""
-"Računa \"%(invoice)s\" v podjetju \"%(invoice_company)s ni možno izdelati, "
-"ker je podjetje (%(account_company)s) na kontu \"%(account)s drugačno. "
+"Računa \"%(invoice)s\" v družbi \"%(invoice_company)s ni možno izdelati, ker"
+" je družba (%(account_company)s) na kontu \"%(account)s drugačna. "
 
 msgctxt "error:account.invoice:"
 msgid "You can not modify invoice \"%s\" because it is posted, paid or cancelled."
@@ -261,7 +259,7 @@ msgid ""
 "Period \"%(period)s\" must have the same company as its fiscal year "
 "(%(fiscalyear)s)."
 msgstr ""
-"Obdobje \"%(period)s\" mora imeti isto podjetje kot pri poslovnem letu "
+"Obdobje \"%(period)s\" mora imeti isto družbo kot pri poslovnem letu "
 "(%(fiscalyear)s)."
 
 msgctxt "error:account.period:"
@@ -314,7 +312,7 @@ msgstr "Opomba"
 
 msgctxt "field:account.invoice,company:"
 msgid "Company"
-msgstr "Podjetje"
+msgstr "Družba"
 
 msgctxt "field:account.invoice,create_date:"
 msgid "Create Date"
@@ -386,11 +384,11 @@ msgstr "Porekla"
 
 msgctxt "field:account.invoice,party:"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "field:account.invoice,party_lang:"
 msgid "Party Language"
-msgstr "Jezik stranke"
+msgstr "Jezik partnerja"
 
 msgctxt "field:account.invoice,payment_lines:"
 msgid "Payment Lines"
@@ -498,7 +496,7 @@ msgstr "Znesek"
 
 msgctxt "field:account.invoice.line,company:"
 msgid "Company"
-msgstr "Podjetje"
+msgstr "Družba"
 
 msgctxt "field:account.invoice.line,create_date:"
 msgid "Create Date"
@@ -546,11 +544,11 @@ msgstr "Poreklo"
 
 msgctxt "field:account.invoice.line,party:"
 msgid "Party"
-msgstr "Stranka"
+msgstr "Partner"
 
 msgctxt "field:account.invoice.line,party_lang:"
 msgid "Party Language"
-msgstr "Jezik stranke"
+msgstr "Jezik partnerja"
 
 msgctxt "field:account.invoice.line,product:"
 msgid "Product"
@@ -632,10 +630,6 @@ msgctxt "field:account.invoice.line-account.tax,write_uid:"
 msgid "Write User"
 msgstr "Zapisal"
 
-msgctxt "field:account.invoice.pay.ask,account_writeoff:"
-msgid "Write-Off Account"
-msgstr "Konto odpisa"
-
 msgctxt "field:account.invoice.pay.ask,amount:"
 msgid "Payment Amount"
 msgstr "Znesek plačila"
@@ -646,7 +640,7 @@ msgstr "Znesek odpisa"
 
 msgctxt "field:account.invoice.pay.ask,company:"
 msgid "Company"
-msgstr "Podjetje"
+msgstr "Družba"
 
 msgctxt "field:account.invoice.pay.ask,currency:"
 msgid "Payment Currency"
@@ -1052,7 +1046,7 @@ msgstr "Vse"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_in_credit_note_domain_draft"
 msgid "Draft"
-msgstr "Osnutki"
+msgstr "Priprava"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_in_credit_note_domain_posted"
@@ -1072,7 +1066,7 @@ msgstr "Vse"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_in_invoice_domain_draft"
 msgid "Draft"
-msgstr "Osnutki"
+msgstr "Priprava"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_in_invoice_domain_posted"
@@ -1092,7 +1086,7 @@ msgstr "Vse"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_out_credit_note_domain_draft"
 msgid "Draft"
-msgstr "Osnutki"
+msgstr "Priprava"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_out_credit_note_domain_posted"
@@ -1112,7 +1106,7 @@ msgstr "Vse"
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_out_invoice_domain_draft"
 msgid "Draft"
-msgstr "Osnutki"
+msgstr "Priprava"
 
 msgctxt ""
 "model:ir.action.act_window.domain,name:act_invoice_out_invoice_domain_posted"
@@ -1290,7 +1284,7 @@ msgstr "Preklicano"
 
 msgctxt "selection:account.invoice,state:"
 msgid "Draft"
-msgstr "Osnutek"
+msgstr "V pripravi"
 
 msgctxt "selection:account.invoice,state:"
 msgid "Paid"
@@ -1517,8 +1511,8 @@ msgid "Print Invoice"
 msgstr "Izpis računa"
 
 msgctxt "view:account.invoice.print.warning:"
-msgid "The invoices will be sent <i>directly</i> to the printer."
-msgstr "Računi bodo <i>direktno</i> poslani na tiskalnik."
+msgid "The invoices will be sent directly to the printer."
+msgstr "Računi bodo direktno poslani na tiskalnik."
 
 msgctxt "view:account.invoice.print.warning:"
 msgid "You have selected more than one invoice to print."
@@ -1574,7 +1568,7 @@ msgstr "_Preklic"
 
 msgctxt "view:account.invoice:"
 msgid "_Draft"
-msgstr "_Osnutek"
+msgstr "_Priprava"
 
 msgctxt "view:account.invoice:"
 msgid "_Pay"
diff --git a/party.xml b/party.xml
index 2ff440b..46a2f46 100644
--- a/party.xml
+++ b/party.xml
@@ -23,7 +23,7 @@ this repository contains the full copyright notices and license terms. -->
         <record model="ir.action.act_window" id="act_invoice_form2">
             <field name="name">Invoices</field>
             <field name="res_model">account.invoice</field>
-            <field name="domain">[("party", "=", Eval('active_id'))]</field>
+            <field name="domain">[('party', 'in', Eval('active_ids'))]</field>
         </record>
         <record model="ir.action.keyword"
                 id="act_open_invoice_keyword1">
diff --git a/payment_term.py b/payment_term.py
index a25c1c3..685d4f3 100644
--- a/payment_term.py
+++ b/payment_term.py
@@ -99,18 +99,17 @@ class PaymentTermLine(ModelSQL, ModelView):
             ('percent', 'Percentage on Remainder'),
             ('percent_on_total', 'Percentage on Total'),
             ('remainder', 'Remainder'),
-            ], 'Type', required=True,
-            on_change=['type'])
+            ], 'Type', required=True)
     percentage = fields.Numeric('Percentage', digits=(16, 8),
         states={
             'invisible': ~Eval('type').in_(['percent', 'percent_on_total']),
             'required': Eval('type').in_(['percent', 'percent_on_total']),
-            }, on_change=['percentage'], depends=['type'])
+            }, depends=['type'])
     divisor = fields.Numeric('Divisor', digits=(16, 8),
         states={
             'invisible': ~Eval('type').in_(['percent', 'percent_on_total']),
             'required': Eval('type').in_(['percent', 'percent_on_total']),
-            }, on_change=['divisor'], depends=['type'])
+            }, depends=['type'])
     amount = fields.Numeric('Amount', digits=(16, Eval('currency_digits', 2)),
         states={
             'invisible': Eval('type') != 'fixed',
@@ -121,8 +120,8 @@ class PaymentTermLine(ModelSQL, ModelView):
             'invisible': Eval('type') != 'fixed',
             'required': Eval('type') == 'fixed',
             }, depends=['type'])
-    currency_digits = fields.Function(fields.Integer('Currency Digits',
-        on_change_with=['currency']), 'on_change_with_currency_digits')
+    currency_digits = fields.Function(fields.Integer('Currency Digits'),
+        'on_change_with_currency_digits')
     day = fields.Integer('Day of Month')
     month = fields.Selection([
             (None, ''),
@@ -225,6 +224,7 @@ class PaymentTermLine(ModelSQL, ModelView):
     def default_days():
         return 0
 
+    @fields.depends('type')
     def on_change_type(self):
         res = {}
         if self.type != 'fixed':
@@ -235,6 +235,7 @@ class PaymentTermLine(ModelSQL, ModelView):
             res['divisor'] = Decimal('0.0')
         return res
 
+    @fields.depends('percentage')
     def on_change_percentage(self):
         if not self.percentage:
             return {'divisor': 0.0}
@@ -243,6 +244,7 @@ class PaymentTermLine(ModelSQL, ModelView):
                 self.__class__.divisor.digits[1]),
             }
 
+    @fields.depends('divisor')
     def on_change_divisor(self):
         if not self.divisor:
             return {'percentage': 0.0}
@@ -251,6 +253,7 @@ class PaymentTermLine(ModelSQL, ModelView):
                 self.__class__.percentage.digits[1]),
             }
 
+    @fields.depends('currency')
     def on_change_with_currency_digits(self, name=None):
         if self.currency:
             return self.currency.digits
diff --git a/setup.py b/setup.py
index 1c04f14..e236636 100644
--- a/setup.py
+++ b/setup.py
@@ -11,33 +11,51 @@ import ConfigParser
 def read(fname):
     return open(os.path.join(os.path.dirname(__file__), fname)).read()
 
+
+def get_require_version(name):
+    if minor_version % 2:
+        require = '%s >= %s.%s.dev0, < %s.%s'
+    else:
+        require = '%s >= %s.%s, < %s.%s'
+    require %= (name, major_version, minor_version,
+        major_version, minor_version + 1)
+    return require
+
 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)
+version = info.get('version', '0.0.1')
+major_version, minor_version, _ = version.split('.', 2)
 major_version = int(major_version)
 minor_version = int(minor_version)
+name = 'trytond_account_invoice'
+
+download_url = 'http://downloads.tryton.org/%s.%s/' % (
+    major_version, minor_version)
+if minor_version % 2:
+    version = '%s.%s.dev0' % (major_version, minor_version)
+    download_url = (
+        'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % (
+            name[8:], name, version))
 
 requires = ['python-dateutil', 'python-sql']
 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))
-requires.append('trytond >= %s.%s, < %s.%s' %
-        (major_version, minor_version, major_version, minor_version + 1))
+        requires.append(get_require_version('trytond_%s' % dep))
+requires.append(get_require_version('trytond'))
 
-setup(name='trytond_account_invoice',
-    version=info.get('version', '0.0.1'),
+setup(name=name,
+    version=version,
     description='Tryton module for invoicing',
-    long_description=open('README').read(),
+    long_description=read('README'),
     author='Tryton',
+    author_email='issue_tracker at tryton.org',
     url='http://www.tryton.org/',
-    download_url=("http://downloads.tryton.org/" +
-        info.get('version', '0.0.1').rsplit('.', 1)[0] + '/'),
+    download_url=download_url,
+    keywords='tryton account invoice',
     package_dir={'trytond.modules.account_invoice': '.'},
     packages=[
         'trytond.modules.account_invoice',
@@ -66,7 +84,6 @@ setup(name='trytond_account_invoice',
         'Natural Language :: Slovenian',
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
-        'Programming Language :: Python :: 2.6',
         'Programming Language :: Python :: 2.7',
         'Topic :: Office/Business',
         'Topic :: Office/Business :: Financial :: Accounting',
diff --git a/tests/scenario_invoice.rst b/tests/scenario_invoice.rst
index 62d15cf..cfe3bae 100644
--- a/tests/scenario_invoice.rst
+++ b/tests/scenario_invoice.rst
@@ -192,47 +192,50 @@ Create invoice::
     >>> line.description = 'Test'
     >>> line.quantity = 1
     >>> line.unit_price = Decimal(20)
-    >>> invoice.untaxed_amount == Decimal(220)
-    True
-    >>> invoice.tax_amount == Decimal(20)
-    True
-    >>> invoice.total_amount == Decimal(240)
-    True
+    >>> invoice.untaxed_amount
+    Decimal('220.00')
+    >>> invoice.tax_amount
+    Decimal('20.00')
+    >>> invoice.total_amount
+    Decimal('240.00')
     >>> invoice.save()
     >>> Invoice.post([invoice.id], config.context)
     >>> invoice.reload()
     >>> invoice.state
     u'posted'
-    >>> invoice.untaxed_amount == Decimal(220)
-    True
-    >>> invoice.tax_amount == Decimal(20)
-    True
-    >>> invoice.total_amount == Decimal(240)
-    True
+    >>> invoice.untaxed_amount
+    Decimal('220.00')
+    >>> invoice.tax_amount
+    Decimal('20.00')
+    >>> invoice.total_amount
+    Decimal('240.00')
     >>> receivable.reload()
-    >>> (receivable.debit, receivable.credit) == \
-    ... (Decimal(240), Decimal(0))
-    True
+    >>> receivable.debit
+    Decimal('240.00')
+    >>> receivable.credit
+    Decimal('0.00')
     >>> revenue.reload()
-    >>> (revenue.debit, revenue.credit) == \
-    ... (Decimal(0), Decimal(220))
-    True
+    >>> revenue.debit
+    Decimal('0.00')
+    >>> revenue.credit
+    Decimal('220.00')
     >>> account_tax.reload()
-    >>> (account_tax.debit, account_tax.credit) == \
-    ... (Decimal(0), Decimal(20))
-    True
+    >>> account_tax.debit
+    Decimal('0.00')
+    >>> account_tax.credit
+    Decimal('20.00')
     >>> invoice_base_code.reload()
-    >>> invoice_base_code.sum == Decimal(200)
-    True
+    >>> invoice_base_code.sum
+    Decimal('200.00')
     >>> invoice_tax_code.reload()
-    >>> invoice_tax_code.sum == Decimal(20)
-    True
+    >>> invoice_tax_code.sum
+    Decimal('20.00')
     >>> credit_note_base_code.reload()
-    >>> credit_note_base_code.sum == Decimal(0)
-    True
+    >>> credit_note_base_code.sum
+    Decimal('0.00')
     >>> credit_note_tax_code.reload()
-    >>> credit_note_tax_code.sum == Decimal(0)
-    True
+    >>> credit_note_tax_code.sum
+    Decimal('0.00')
 
 Credit invoice with refund::
 
@@ -243,29 +246,32 @@ Credit invoice with refund::
     >>> invoice.state
     u'paid'
     >>> receivable.reload()
-    >>> (receivable.debit, receivable.credit) == \
-    ... (Decimal(240), Decimal(240))
-    True
+    >>> receivable.debit
+    Decimal('240.00')
+    >>> receivable.credit
+    Decimal('240.00')
     >>> revenue.reload()
-    >>> (revenue.debit, revenue.credit) == \
-    ... (Decimal(220), Decimal(220))
-    True
+    >>> revenue.debit
+    Decimal('220.00')
+    >>> revenue.credit
+    Decimal('220.00')
     >>> account_tax.reload()
-    >>> (account_tax.debit, account_tax.credit) == \
-    ... (Decimal(20), Decimal(20))
-    True
+    >>> account_tax.debit
+    Decimal('20.00')
+    >>> account_tax.credit
+    Decimal('20.00')
     >>> invoice_base_code.reload()
-    >>> invoice_base_code.sum == Decimal(200)
-    True
+    >>> invoice_base_code.sum
+    Decimal('200.00')
     >>> invoice_tax_code.reload()
-    >>> invoice_tax_code.sum == Decimal(20)
-    True
+    >>> invoice_tax_code.sum
+    Decimal('20.00')
     >>> credit_note_base_code.reload()
-    >>> credit_note_base_code.sum == Decimal(200)
-    True
+    >>> credit_note_base_code.sum
+    Decimal('200.00')
     >>> credit_note_tax_code.reload()
-    >>> credit_note_tax_code.sum == Decimal(20)
-    True
+    >>> credit_note_tax_code.sum
+    Decimal('20.00')
 
 Create empty invoice::
 
diff --git a/tests/scenario_invoice.rst b/tests/scenario_invoice_alternate_currency.rst
similarity index 73%
copy from tests/scenario_invoice.rst
copy to tests/scenario_invoice_alternate_currency.rst
index 62d15cf..20bc91e 100644
--- a/tests/scenario_invoice.rst
+++ b/tests/scenario_invoice_alternate_currency.rst
@@ -1,8 +1,9 @@
-================
-Invoice Scenario
-================
+===================================
+Invoice Scenario Alternate Currency
+===================================
 
 Imports::
+
     >>> import datetime
     >>> from dateutil.relativedelta import relativedelta
     >>> from decimal import Decimal
@@ -37,6 +38,17 @@ Create company::
     ...         rate=Decimal('1.0'), currency=currency).save()
     ... else:
     ...     currency, = currencies
+    >>> currencies = Currency.find([('code', '=', 'EUR')])
+    >>> if not currencies:
+    ...     eur = Currency(name='Euro', symbol=u'€', code='EUR',
+    ...         rounding=Decimal('0.01'), mon_grouping='[]',
+    ...         mon_decimal_point='.')
+    ...     eur.save()
+    ...     CurrencyRate(date=today + relativedelta(month=1, day=1),
+    ...         rate=Decimal('2.0'), currency=eur).save()
+    ... else:
+    ...     eur, = currencies
+
     >>> Company = Model.get('company.company')
     >>> Party = Model.get('party.party')
     >>> company_config = Wizard('company.company.config')
@@ -175,105 +187,82 @@ Create payment term::
     >>> payment_term.lines.append(payment_term_line)
     >>> payment_term.save()
 
-Create invoice::
+Create invoice with alternate currency::
 
     >>> Invoice = Model.get('account.invoice')
-    >>> InvoiceLine = Model.get('account.invoice.line')
     >>> invoice = Invoice()
     >>> invoice.party = party
     >>> invoice.payment_term = payment_term
-    >>> line = InvoiceLine()
-    >>> invoice.lines.append(line)
+    >>> invoice.currency = eur
+    >>> line = invoice.lines.new()
     >>> line.product = product
     >>> line.quantity = 5
-    >>> line = InvoiceLine()
-    >>> invoice.lines.append(line)
+    >>> line.amount
+    Decimal('400.00')
+    >>> line = invoice.lines.new()
     >>> line.account = revenue
     >>> line.description = 'Test'
     >>> line.quantity = 1
     >>> line.unit_price = Decimal(20)
-    >>> invoice.untaxed_amount == Decimal(220)
-    True
-    >>> invoice.tax_amount == Decimal(20)
-    True
-    >>> invoice.total_amount == Decimal(240)
-    True
-    >>> invoice.save()
-    >>> Invoice.post([invoice.id], config.context)
-    >>> invoice.reload()
+    >>> line.amount
+    Decimal('20.00')
+    >>> invoice.untaxed_amount
+    Decimal('420.00')
+    >>> invoice.tax_amount
+    Decimal('40.00')
+    >>> invoice.total_amount
+    Decimal('460.00')
+    >>> invoice.click('post')
     >>> invoice.state
     u'posted'
-    >>> invoice.untaxed_amount == Decimal(220)
-    True
-    >>> invoice.tax_amount == Decimal(20)
-    True
-    >>> invoice.total_amount == Decimal(240)
-    True
-    >>> receivable.reload()
-    >>> (receivable.debit, receivable.credit) == \
-    ... (Decimal(240), Decimal(0))
-    True
-    >>> revenue.reload()
-    >>> (revenue.debit, revenue.credit) == \
-    ... (Decimal(0), Decimal(220))
-    True
-    >>> account_tax.reload()
-    >>> (account_tax.debit, account_tax.credit) == \
-    ... (Decimal(0), Decimal(20))
-    True
-    >>> invoice_base_code.reload()
-    >>> invoice_base_code.sum == Decimal(200)
-    True
-    >>> invoice_tax_code.reload()
-    >>> invoice_tax_code.sum == Decimal(20)
-    True
-    >>> credit_note_base_code.reload()
-    >>> credit_note_base_code.sum == Decimal(0)
-    True
-    >>> credit_note_tax_code.reload()
-    >>> credit_note_tax_code.sum == Decimal(0)
-    True
+    >>> invoice.untaxed_amount
+    Decimal('420.00')
+    >>> invoice.tax_amount
+    Decimal('40.00')
+    >>> invoice.total_amount
+    Decimal('460.00')
 
-Credit invoice with refund::
+Create negative tax::
 
-    >>> credit = Wizard('account.invoice.credit', [invoice])
-    >>> credit.form.with_refund = True
-    >>> credit.execute('credit')
-    >>> invoice.reload()
-    >>> invoice.state
-    u'paid'
-    >>> receivable.reload()
-    >>> (receivable.debit, receivable.credit) == \
-    ... (Decimal(240), Decimal(240))
-    True
-    >>> revenue.reload()
-    >>> (revenue.debit, revenue.credit) == \
-    ... (Decimal(220), Decimal(220))
-    True
-    >>> account_tax.reload()
-    >>> (account_tax.debit, account_tax.credit) == \
-    ... (Decimal(20), Decimal(20))
-    True
-    >>> invoice_base_code.reload()
-    >>> invoice_base_code.sum == Decimal(200)
-    True
-    >>> invoice_tax_code.reload()
-    >>> invoice_tax_code.sum == Decimal(20)
-    True
-    >>> credit_note_base_code.reload()
-    >>> credit_note_base_code.sum == Decimal(200)
-    True
-    >>> credit_note_tax_code.reload()
-    >>> credit_note_tax_code.sum == Decimal(20)
-    True
+    >>> negative_tax = Tax()
+    >>> negative_tax.name = 'Negative Tax'
+    >>> negative_tax.description = 'Negative Tax'
+    >>> negative_tax.type = 'percentage'
+    >>> negative_tax.rate = Decimal('-.10')
+    >>> negative_tax.invoice_account = account_tax
+    >>> negative_tax.credit_note_account = account_tax
+    >>> negative_tax.invoice_base_code = invoice_base_code
+    >>> negative_tax.invoice_tax_code = invoice_tax_code
+    >>> negative_tax.credit_note_base_code = credit_note_base_code
+    >>> negative_tax.credit_note_tax_code = credit_note_tax_code
+    >>> negative_tax.save()
 
-Create empty invoice::
+Create invoice with alternate currency and negative taxes::
 
     >>> invoice = Invoice()
     >>> invoice.party = party
     >>> invoice.payment_term = payment_term
-    >>> invoice.save()
-    >>> Invoice.post([invoice.id], config.context)
-    >>> invoice.reload()
+    >>> invoice.currency = eur
+    >>> line = invoice.lines.new()
+    >>> line.product = product
+    >>> line.quantity = 5
+    >>> _ = line.taxes.pop(0)
+    >>> line.taxes.append(negative_tax)
+    >>> line.amount
+    Decimal('400.00')
+    >>> invoice.untaxed_amount
+    Decimal('400.00')
+    >>> invoice.tax_amount
+    Decimal('-40.00')
+    >>> invoice.total_amount
+    Decimal('360.00')
+    >>> invoice.click('post')
     >>> invoice.state
-    u'paid'
+    u'posted'
+    >>> invoice.untaxed_amount
+    Decimal('400.00')
+    >>> invoice.tax_amount
+    Decimal('-40.00')
+    >>> invoice.total_amount
+    Decimal('360.00')
+
diff --git a/tests/scenario_invoice_supplier.rst b/tests/scenario_invoice_supplier.rst
index 95ab64f..612614a 100644
--- a/tests/scenario_invoice_supplier.rst
+++ b/tests/scenario_invoice_supplier.rst
@@ -191,47 +191,50 @@ Create invoice::
     >>> line.description = 'Test'
     >>> line.quantity = 1
     >>> line.unit_price = Decimal(10)
-    >>> invoice.untaxed_amount == Decimal(110)
-    True
-    >>> invoice.tax_amount == Decimal(10)
-    True
-    >>> invoice.total_amount == Decimal(120)
-    True
+    >>> invoice.untaxed_amount
+    Decimal('110.00')
+    >>> invoice.tax_amount
+    Decimal('10.00')
+    >>> invoice.total_amount
+    Decimal('120.00')
     >>> invoice.save()
     >>> Invoice.post([invoice.id], config.context)
     >>> invoice.reload()
     >>> invoice.state
     u'posted'
-    >>> invoice.untaxed_amount == Decimal(110)
-    True
-    >>> invoice.tax_amount == Decimal(10)
-    True
-    >>> invoice.total_amount == Decimal(120)
-    True
+    >>> invoice.untaxed_amount
+    Decimal('110.00')
+    >>> invoice.tax_amount
+    Decimal('10.00')
+    >>> invoice.total_amount
+    Decimal('120.00')
     >>> payable.reload()
-    >>> (payable.debit, payable.credit) == \
-    ... (Decimal(0), Decimal(120))
-    True
+    >>> payable.debit
+    Decimal('0.00')
+    >>> payable.credit
+    Decimal('120.00')
     >>> expense.reload()
-    >>> (expense.debit, expense.credit) == \
-    ... (Decimal(110), Decimal(0))
-    True
+    >>> expense.debit
+    Decimal('110.00')
+    >>> expense.credit
+    Decimal('0.00')
     >>> account_tax.reload()
-    >>> (account_tax.debit, account_tax.credit) == \
-    ... (Decimal(10), Decimal(0))
-    True
+    >>> account_tax.debit
+    Decimal('10.00')
+    >>> account_tax.credit
+    Decimal('0.00')
     >>> invoice_base_code.reload()
-    >>> invoice_base_code.sum == Decimal(100)
-    True
+    >>> invoice_base_code.sum
+    Decimal('100.00')
     >>> invoice_tax_code.reload()
-    >>> invoice_tax_code.sum == Decimal(10)
-    True
+    >>> invoice_tax_code.sum
+    Decimal('10.00')
     >>> credit_note_base_code.reload()
-    >>> credit_note_base_code.sum == Decimal(0)
-    True
+    >>> credit_note_base_code.sum
+    Decimal('0.00')
     >>> credit_note_tax_code.reload()
-    >>> credit_note_tax_code.sum == Decimal(0)
-    True
+    >>> credit_note_tax_code.sum
+    Decimal('0.00')
 
 Credit invoice::
 
diff --git a/tests/test_account_invoice.py b/tests/test_account_invoice.py
index 6fdfcbd..2bf0aeb 100644
--- a/tests/test_account_invoice.py
+++ b/tests/test_account_invoice.py
@@ -1,29 +1,17 @@
-#!/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
-import 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 doctest
 import datetime
 from decimal import Decimal
 import trytond.tests.test_tryton
 from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, test_view,\
-        test_depends
+    test_depends, doctest_dropdb
 from trytond.transaction import Transaction
-from trytond.backend.sqlite.database import Database as SQLiteDatabase
 
 
 class AccountInvoiceTestCase(unittest.TestCase):
-    '''
-    Test AccountInvoice module.
-    '''
+    'Test AccountInvoice module'
 
     def setUp(self):
         trytond.tests.test_tryton.install_module('account_invoice')
@@ -31,21 +19,15 @@ class AccountInvoiceTestCase(unittest.TestCase):
         self.currency = POOL.get('currency.currency')
 
     def test0005views(self):
-        '''
-        Test views.
-        '''
+        'Test views'
         test_view('account_invoice')
 
     def test0006depends(self):
-        '''
-        Test depends.
-        '''
+        'Test depends'
         test_depends()
 
     def test0010payment_term(self):
-        '''
-        Test payment_term.
-        '''
+        'Test payment_term'
         with Transaction().start(DB_NAME, USER, context=CONTEXT):
             cu1, = self.currency.create([{
                         'name': 'cu1',
@@ -93,16 +75,6 @@ class AccountInvoiceTestCase(unittest.TestCase):
                     ])
 
 
-def doctest_dropdb(test):
-    database = SQLiteDatabase().connect()
-    cursor = database.cursor(autocommit=True)
-    try:
-        database.drop(cursor, ':memory:')
-        cursor.commit()
-    finally:
-        cursor.close()
-
-
 def suite():
     suite = trytond.tests.test_tryton.suite()
     suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
@@ -113,7 +85,8 @@ def suite():
     suite.addTests(doctest.DocFileSuite('scenario_invoice_supplier.rst',
             setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8',
             optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
+    suite.addTests(doctest.DocFileSuite(
+            'scenario_invoice_alternate_currency.rst',
+            setUp=doctest_dropdb, tearDown=doctest_dropdb, encoding='utf-8',
+            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE))
     return suite
-
-if __name__ == '__main__':
-    unittest.TextTestRunner(verbosity=2).run(suite())
diff --git a/tryton.cfg b/tryton.cfg
index b2775b6..bb8d78e 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.0.2
+version=3.2.0
 depends:
     account
     account_product
diff --git a/trytond_account_invoice.egg-info/PKG-INFO b/trytond_account_invoice.egg-info/PKG-INFO
index b0908fd..1e555bf 100644
--- a/trytond_account_invoice.egg-info/PKG-INFO
+++ b/trytond_account_invoice.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-account-invoice
-Version: 3.0.2
+Version: 3.2.0
 Summary: Tryton module for invoicing
 Home-page: http://www.tryton.org/
 Author: Tryton
-Author-email: UNKNOWN
+Author-email: issue_tracker at tryton.org
 License: GPL-3
-Download-URL: http://downloads.tryton.org/3.0/
+Download-URL: http://downloads.tryton.org/3.2/
 Description: trytond_account_invoice
         =======================
         
@@ -43,6 +43,7 @@ Description: trytond_account_invoice
         
           http://www.tryton.org/
         
+Keywords: tryton account invoice
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Plugins
@@ -62,7 +63,6 @@ Classifier: Natural Language :: Russian
 Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
-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_account_invoice.egg-info/SOURCES.txt b/trytond_account_invoice.egg-info/SOURCES.txt
index fff6fee..7090316 100644
--- a/trytond_account_invoice.egg-info/SOURCES.txt
+++ b/trytond_account_invoice.egg-info/SOURCES.txt
@@ -31,6 +31,7 @@ locale/nl_NL.po
 locale/ru_RU.po
 locale/sl_SI.po
 tests/scenario_invoice.rst
+tests/scenario_invoice_alternate_currency.rst
 tests/scenario_invoice_supplier.rst
 trytond_account_invoice.egg-info/PKG-INFO
 trytond_account_invoice.egg-info/SOURCES.txt
diff --git a/trytond_account_invoice.egg-info/requires.txt b/trytond_account_invoice.egg-info/requires.txt
index d92cff8..f86ec11 100644
--- a/trytond_account_invoice.egg-info/requires.txt
+++ b/trytond_account_invoice.egg-info/requires.txt
@@ -1,9 +1,9 @@
 python-dateutil
 python-sql
-trytond_account >= 3.0, < 3.1
-trytond_account_product >= 3.0, < 3.1
-trytond_company >= 3.0, < 3.1
-trytond_currency >= 3.0, < 3.1
-trytond_party >= 3.0, < 3.1
-trytond_product >= 3.0, < 3.1
-trytond >= 3.0, < 3.1
\ No newline at end of file
+trytond_account >= 3.2, < 3.3
+trytond_account_product >= 3.2, < 3.3
+trytond_company >= 3.2, < 3.3
+trytond_currency >= 3.2, < 3.3
+trytond_party >= 3.2, < 3.3
+trytond_product >= 3.2, < 3.3
+trytond >= 3.2, < 3.3
\ No newline at end of file
diff --git a/view/pay_ask_form.xml b/view/pay_ask_form.xml
index 9fb3b31..44d501d 100644
--- a/view/pay_ask_form.xml
+++ b/view/pay_ask_form.xml
@@ -12,8 +12,6 @@ this repository contains the full copyright notices and license terms. -->
     <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"/>
     <field name="lines" colspan="4"
diff --git a/view/print_warning_form.xml b/view/print_warning_form.xml
index 25e08bf..043ce4c 100644
--- a/view/print_warning_form.xml
+++ b/view/print_warning_form.xml
@@ -7,7 +7,7 @@ this repository contains the full copyright notices and license terms. -->
         <label string="You have selected more than one invoice to print."
             id="selected"
             yalign="0.0" xalign="0.0" xexpand="1"/>
-        <label string="The invoices will be sent <i>directly</i> to the printer."
+        <label string="The invoices will be sent directly to the printer."
             id="printer"
             yalign="0.0" xalign="0.0" xexpand="1"/>
     </group>
-- 
tryton-modules-account-invoice



More information about the tryton-debian-vcs mailing list